edge-currency-accountbased 3.2.1 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- (self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[2784],{50144:function(xt,_,se){"use strict";var T=se(48764).Buffer,a=this&&this.__createBinding||(Object.create?function(b,w,I,S){S===void 0&&(S=I),Object.defineProperty(b,S,{enumerable:!0,get:function(){return w[I]}})}:function(b,w,I,S){S===void 0&&(S=I),b[S]=w[I]}),ce=this&&this.__setModuleDefault||(Object.create?function(b,w){Object.defineProperty(b,"default",{enumerable:!0,value:w})}:function(b,w){b.default=w}),G=this&&this.__importStar||function(b){if(b&&b.__esModule)return b;var w={};if(b!=null)for(var I in b)I!=="default"&&Object.prototype.hasOwnProperty.call(b,I)&&a(w,b,I);return ce(w,b),w};Object.defineProperty(_,"__esModule",{value:!0}),_.recoverTypedSignature_v4=_.recoverTypedSignature=_.signTypedData_v4=_.signTypedData=_.recoverTypedMessage=_.signTypedMessage=_.getEncryptionPublicKey=_.decryptSafely=_.decrypt=_.encryptSafely=_.encrypt=_.recoverTypedSignatureLegacy=_.signTypedDataLegacy=_.typedSignatureHash=_.extractPublicKey=_.recoverPersonalSignature=_.personalSign=_.normalize=_.concatSig=_.TypedDataUtils=_.TYPED_MESSAGE_SCHEMA=void 0;const P=G(se(21964)),V=G(se(68142)),C=G(se(50780)),be=G(se(16885)),Fe={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"]};_.TYPED_MESSAGE_SCHEMA=Fe;const de={encodeData(b,w,I,S=!0){const R=["bytes32"],N=[this.hashType(b,I)];if(S){const Z=(z,q,oe)=>{if(I[q]!==void 0)return["bytes32",oe==null?"0x0000000000000000000000000000000000000000000000000000000000000000":P.keccak(this.encodeData(q,oe,I,S))];if(oe===void 0)throw new Error(`missing value for field ${z} of type ${q}`);if(q==="bytes")return["bytes32",P.keccak(oe)];if(q==="string")return typeof oe=="string"&&(oe=T.from(oe,"utf8")),["bytes32",P.keccak(oe)];if(q.lastIndexOf("]")===q.length-1){const vt=q.slice(0,q.lastIndexOf("[")),Et=oe.map(Me=>Z(z,vt,Me));return["bytes32",P.keccak(V.rawEncode(Et.map(([Me])=>Me),Et.map(([,Me])=>Me)))]}return[q,oe]};for(const z of I[b]){const[q,oe]=Z(z.name,z.type,w[z.name]);R.push(q),N.push(oe)}}else for(const Z of I[b]){let z=w[Z.name];if(z!==void 0)if(Z.type==="bytes")R.push("bytes32"),z=P.keccak(z),N.push(z);else if(Z.type==="string")R.push("bytes32"),typeof z=="string"&&(z=T.from(z,"utf8")),z=P.keccak(z),N.push(z);else if(I[Z.type]!==void 0)R.push("bytes32"),z=P.keccak(this.encodeData(Z.type,z,I,S)),N.push(z);else{if(Z.type.lastIndexOf("]")===Z.type.length-1)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");R.push(Z.type),N.push(z)}}return V.rawEncode(R,N)},encodeType(b,w){let I="",S=this.findTypeDependencies(b,w).filter(R=>R!==b);S=[b].concat(S.sort());for(const R of S){if(!w[R])throw new Error(`No type definition specified: ${R}`);I+=`${R}(${w[R].map(({name:Z,type:z})=>`${z} ${Z}`).join(",")})`}return I},findTypeDependencies(b,w,I=[]){if([b]=b.match(/^\w*/u),I.includes(b)||w[b]===void 0)return I;I.push(b);for(const S of w[b])for(const R of this.findTypeDependencies(S.type,w,I))!I.includes(R)&&I.push(R);return I},hashStruct(b,w,I,S=!0){return P.keccak(this.encodeData(b,w,I,S))},hashType(b,w){return P.keccak(this.encodeType(b,w))},sanitizeData(b){const w={};for(const I in Fe.properties)b[I]&&(w[I]=b[I]);return"types"in w&&(w.types=Object.assign({EIP712Domain:[]},w.types)),w},sign(b,w=!0){const I=this.sanitizeData(b),S=[T.from("1901","hex")];return S.push(this.hashStruct("EIP712Domain",I.domain,I.types,w)),I.primaryType!=="EIP712Domain"&&S.push(this.hashStruct(I.primaryType,I.message,I.types,w)),P.keccak(T.concat(S))}};_.TypedDataUtils=de;function ye(b,w,I){const S=P.fromSigned(w),R=P.fromSigned(I),N=P.bufferToInt(b),Z=Ee(P.toUnsigned(S).toString("hex"),64),z=Ee(P.toUnsigned(R).toString("hex"),64),q=P.stripHexPrefix(P.intToHex(N));return P.addHexPrefix(Z.concat(z,q)).toString("hex")}_.concatSig=ye;function Re(b){if(!!b){if(typeof b=="number"){const w=P.toBuffer(b);b=P.bufferToHex(w)}if(typeof b!="string"){let w="eth-sig-util.normalize() requires hex string or integer input.";throw w+=` received ${typeof b}: ${b}`,new Error(w)}return P.addHexPrefix(b.toLowerCase())}}_.normalize=Re;function _e(b,w){const I=P.toBuffer(w.data),S=P.hashPersonalMessage(I),R=P.ecsign(S,b);return P.bufferToHex(ye(R.v,R.r,R.s))}_.personalSign=_e;function je(b){const w=yt(b),I=P.publicToAddress(w);return P.bufferToHex(I)}_.recoverPersonalSignature=je;function ke(b){return`0x${yt(b).toString("hex")}`}_.extractPublicKey=ke;function rt(b){const w=ut(b);return P.bufferToHex(w)}_.typedSignatureHash=rt;function Te(b,w){const I=ut(w.data),S=P.ecsign(I,b);return P.bufferToHex(ye(S.v,S.r,S.s))}_.signTypedDataLegacy=Te;function st(b){const w=ut(b.data),I=Je(w,b.sig),S=P.publicToAddress(I);return P.bufferToHex(S)}_.recoverTypedSignatureLegacy=st;function Xe(b,w,I){switch(I){case"x25519-xsalsa20-poly1305":{if(typeof w.data!="string")throw new Error('Cannot detect secret message, message params should be of the form {data: "secret message"} ');const S=C.box.keyPair();let R;try{R=be.decodeBase64(b)}catch{throw new Error("Bad public key")}const N=be.decodeUTF8(w.data),Z=C.randomBytes(C.box.nonceLength),z=C.box(N,Z,R,S.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:be.encodeBase64(Z),ephemPublicKey:be.encodeBase64(S.publicKey),ciphertext:be.encodeBase64(z)}}default:throw new Error("Encryption type/version not supported")}}_.encrypt=Xe;function v(b,w,I){const{data:N}=w;if(!N)throw new Error("Cannot encrypt empty msg.data");if(typeof N=="object"&&"toJSON"in N)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const Z={data:N,padding:""},q=T.byteLength(JSON.stringify(Z),"utf-8")%2048;let oe=0;q>0&&(oe=2048-q-16),Z.padding="0".repeat(oe);const vt={data:JSON.stringify(Z)};return Xe(b,vt,I)}_.encryptSafely=v;function H(b,w){switch(b.version){case"x25519-xsalsa20-poly1305":{const I=wt(w),S=C.box.keyPair.fromSecretKey(I).secretKey,R=be.decodeBase64(b.nonce),N=be.decodeBase64(b.ciphertext),Z=be.decodeBase64(b.ephemPublicKey),z=C.box.open(N,R,Z,S);let q;try{q=be.encodeUTF8(z)}catch{throw new Error("Decryption failed.")}if(q)return q;throw new Error("Decryption failed.")}default:throw new Error("Encryption type/version not supported.")}}_.decrypt=H;function F(b,w){return JSON.parse(H(b,w)).data}_.decryptSafely=F;function j(b){const w=wt(b),I=C.box.keyPair.fromSecretKey(w).publicKey;return be.encodeBase64(I)}_.getEncryptionPublicKey=j;function te(b,w,I="V4"){switch(I){case"V1":return Te(b,w);case"V3":return Le(b,w);case"V4":default:return we(b,w)}}_.signTypedMessage=te;function xe(b,w="V4"){switch(w){case"V1":return st(b);case"V3":return Oe(b);case"V4":default:return qe(b)}}_.recoverTypedMessage=xe;function Le(b,w){const I=de.sign(w.data,!1),S=P.ecsign(I,b);return P.bufferToHex(ye(S.v,S.r,S.s))}_.signTypedData=Le;function we(b,w){const I=de.sign(w.data),S=P.ecsign(I,b);return P.bufferToHex(ye(S.v,S.r,S.s))}_.signTypedData_v4=we;function Oe(b){const w=de.sign(b.data,!1),I=Je(w,b.sig),S=P.publicToAddress(I);return P.bufferToHex(S)}_.recoverTypedSignature=Oe;function qe(b){const w=de.sign(b.data),I=Je(w,b.sig),S=P.publicToAddress(I);return P.bufferToHex(S)}_.recoverTypedSignature_v4=qe;function ut(b){const w=new Error("Expect argument to be non-empty array");if(typeof b!="object"||!("length"in b)||!b.length)throw w;const I=b.map(function(N){return N.type==="bytes"?P.toBuffer(N.value):N.value}),S=b.map(function(N){return N.type}),R=b.map(function(N){if(!N.name)throw w;return`${N.type} ${N.name}`});return V.soliditySHA3(["bytes32","bytes32"],[V.soliditySHA3(new Array(b.length).fill("string"),R),V.soliditySHA3(S,I)])}function Je(b,w){const I=P.toBuffer(w),S=P.fromRpcSig(I);return P.ecrecover(b,S.v,S.r,S.s)}function yt(b){const w=P.toBuffer(b.data),I=P.hashPersonalMessage(w);return Je(I,b.sig)}function Ee(b,w){let I=`${b}`;for(;I.length<w;)I=`0${I}`;return I}function wt(b){const w=T.from(b,"hex").toString("base64");return be.decodeBase64(w)}},16885:function(xt,_,se){var T=se(88924).Buffer;(function(a,ce){"use strict";xt.exports?xt.exports=ce():(a.nacl||(a.nacl={}),a.nacl.util=ce())})(this,function(){"use strict";var a={};function ce(G){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(G))throw new TypeError("invalid encoding")}return a.decodeUTF8=function(G){if(typeof G!="string")throw new TypeError("expected string");var P,V=unescape(encodeURIComponent(G)),C=new Uint8Array(V.length);for(P=0;P<V.length;P++)C[P]=V.charCodeAt(P);return C},a.encodeUTF8=function(G){var P,V=[];for(P=0;P<G.length;P++)V.push(String.fromCharCode(G[P]));return decodeURIComponent(escape(V.join("")))},typeof atob>"u"?typeof T.from<"u"?(a.encodeBase64=function(G){return T.from(G).toString("base64")},a.decodeBase64=function(G){return ce(G),new Uint8Array(Array.prototype.slice.call(T.from(G,"base64"),0))}):(a.encodeBase64=function(G){return new T(G).toString("base64")},a.decodeBase64=function(G){return ce(G),new Uint8Array(Array.prototype.slice.call(new T(G,"base64"),0))}):(a.encodeBase64=function(G){var P,V=[],C=G.length;for(P=0;P<C;P++)V.push(String.fromCharCode(G[P]));return btoa(V.join(""))},a.decodeBase64=function(G){ce(G);var P,V=atob(G),C=new Uint8Array(V.length);for(P=0;P<V.length;P++)C[P]=V.charCodeAt(P);return C}),a})},35742:function(xt,_,se){"use strict";se.d(_,{qo:function(){return ue},Gn:function(){return Ae}});var T=se(82090),ce=(m,d=0)=>{let f=~~d,c=0;for(let E=0;E<m.length;E++)c+=m[E];return f+=c%256,f%256},G=se(48764),V=(m,d)=>G.Buffer.from(m,d);function C(m,d){const f=(c,E)=>d(V(c),E)>>>0;return f.signed=(c,E)=>d(V(c),E),f.unsigned=f,f.model=m,f}var be=C("crc1",ce);let Fe=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];typeof Int32Array<"u"&&(Fe=new Int32Array(Fe));var ye=(m,d=0)=>{let f=~~d;for(let c=0;c<m.length;c++)f=Fe[(f^m[c])&255]&255;return f},Re=C("crc-8",ye);let _e=[0,94,188,226,97,63,221,131,194,156,126,32,163,253,31,65,157,195,33,127,252,162,64,30,95,1,227,189,62,96,130,220,35,125,159,193,66,28,254,160,225,191,93,3,128,222,60,98,190,224,2,92,223,129,99,61,124,34,192,158,29,67,161,255,70,24,250,164,39,121,155,197,132,218,56,102,229,187,89,7,219,133,103,57,186,228,6,88,25,71,165,251,120,38,196,154,101,59,217,135,4,90,184,230,167,249,27,69,198,152,122,36,248,166,68,26,153,199,37,123,58,100,134,216,91,5,231,185,140,210,48,110,237,179,81,15,78,16,242,172,47,113,147,205,17,79,173,243,112,46,204,146,211,141,111,49,178,236,14,80,175,241,19,77,206,144,114,44,109,51,209,143,12,82,176,238,50,108,142,208,83,13,239,177,240,174,76,18,145,207,45,115,202,148,118,40,171,245,23,73,8,86,180,234,105,55,213,139,87,9,235,181,54,104,138,212,149,203,41,119,244,170,72,22,233,183,85,11,136,214,52,106,43,117,151,201,74,20,246,168,116,42,200,150,21,75,169,247,182,232,10,84,215,137,107,53];typeof Int32Array<"u"&&(_e=new Int32Array(_e));var ke=(m,d=0)=>{let f=~~d;for(let c=0;c<m.length;c++)f=_e[(f^m[c])&255]&255;return f},rt=C("dallas-1-wire",ke);let Te=[0,213,127,170,254,43,129,84,41,252,86,131,215,2,168,125,82,135,45,248,172,121,211,6,123,174,4,209,133,80,250,47,164,113,219,14,90,143,37,240,141,88,242,39,115,166,12,217,246,35,137,92,8,221,119,162,223,10,160,117,33,244,94,139,157,72,226,55,99,182,28,201,180,97,203,30,74,159,53,224,207,26,176,101,49,228,78,155,230,51,153,76,24,205,103,178,57,236,70,147,199,18,184,109,16,197,111,186,238,59,145,68,107,190,20,193,149,64,234,63,66,151,61,232,188,105,195,22,239,58,144,69,17,196,110,187,198,19,185,108,56,237,71,146,189,104,194,23,67,150,60,233,148,65,235,62,106,191,21,192,75,158,52,225,181,96,202,31,98,183,29,200,156,73,227,54,25,204,102,179,231,50,152,77,48,229,79,154,206,27,177,100,114,167,13,216,140,89,243,38,91,142,36,241,165,112,218,15,32,245,95,138,222,11,161,116,9,220,118,163,247,34,136,93,214,3,169,124,40,253,87,130,255,42,128,85,1,212,126,171,132,81,251,46,122,175,5,208,173,120,210,7,83,134,44,249];typeof Int32Array<"u"&&(Te=new Int32Array(Te));var Xe=(m,d=0)=>{let f=~~d;for(let c=0;c<m.length;c++)f=Te[(f^m[c])&255]&255;return f},v=C("crc-8-dvbs2",Xe);let H=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];typeof Int32Array<"u"&&(H=new Int32Array(H));var j=(m,d=0)=>{let f=~~d;for(let c=0;c<m.length;c++)f=(H[(f^m[c])&255]^f>>8)&65535;return f},te=C("crc-16",j);let xe=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];typeof Int32Array<"u"&&(xe=new Int32Array(xe));var we=(m,d)=>{let f=typeof d<"u"?~~d:65535;for(let c=0;c<m.length;c++)f=(xe[(f>>8^m[c])&255]^f<<8)&65535;return f},Oe=C("ccitt",we);let qe=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];typeof Int32Array<"u"&&(qe=new Int32Array(qe));var Je=(m,d)=>{let f=typeof d<"u"?~~d:65535;for(let c=0;c<m.length;c++)f=(qe[(f^m[c])&255]^f>>8)&65535;return f},yt=C("crc-16-modbus",Je),wt=(m,d)=>{let f=typeof d<"u"?~~d:0;for(let c=0;c<m.length;c++){let E=f>>>8&255;E^=m[c]&255,E^=E>>>4,f=f<<8&65535,f^=E,E=E<<5&65535,f^=E,E=E<<7&65535,f^=E}return f},b=C("xmodem",wt);let w=[0,4489,8978,12955,17956,22445,25910,29887,35912,40385,44890,48851,51820,56293,59774,63735,4225,264,13203,8730,22181,18220,30135,25662,40137,36160,49115,44626,56045,52068,63999,59510,8450,12427,528,5017,26406,30383,17460,21949,44362,48323,36440,40913,60270,64231,51324,55797,12675,8202,4753,792,30631,26158,21685,17724,48587,44098,40665,36688,64495,60006,55549,51572,16900,21389,24854,28831,1056,5545,10034,14011,52812,57285,60766,64727,34920,39393,43898,47859,21125,17164,29079,24606,5281,1320,14259,9786,57037,53060,64991,60502,39145,35168,48123,43634,25350,29327,16404,20893,9506,13483,1584,6073,61262,65223,52316,56789,43370,47331,35448,39921,29575,25102,20629,16668,13731,9258,5809,1848,65487,60998,56541,52564,47595,43106,39673,35696,33800,38273,42778,46739,49708,54181,57662,61623,2112,6601,11090,15067,20068,24557,28022,31999,38025,34048,47003,42514,53933,49956,61887,57398,6337,2376,15315,10842,24293,20332,32247,27774,42250,46211,34328,38801,58158,62119,49212,53685,10562,14539,2640,7129,28518,32495,19572,24061,46475,41986,38553,34576,62383,57894,53437,49460,14787,10314,6865,2904,32743,28270,23797,19836,50700,55173,58654,62615,32808,37281,41786,45747,19012,23501,26966,30943,3168,7657,12146,16123,54925,50948,62879,58390,37033,33056,46011,41522,23237,19276,31191,26718,7393,3432,16371,11898,59150,63111,50204,54677,41258,45219,33336,37809,27462,31439,18516,23005,11618,15595,3696,8185,63375,58886,54429,50452,45483,40994,37561,33584,31687,27214,22741,18780,15843,11370,7921,3960];typeof Int32Array<"u"&&(w=new Int32Array(w));var S=(m,d)=>{let f=typeof d<"u"?~~d:0;for(let c=0;c<m.length;c++)f=(w[(f^m[c])&255]^f>>8)&65535;return f},R=C("kermit",S);let N=[0,8801531,9098509,825846,9692897,1419802,1651692,10452759,10584377,2608578,2839604,11344079,3303384,11807523,12104405,4128302,12930697,4391538,5217156,13227903,5679208,13690003,14450021,5910942,6606768,14844747,15604413,6837830,16197969,7431594,8256604,16494759,840169,9084178,8783076,18463,10434312,1670131,1434117,9678590,11358416,2825259,2590173,10602790,4109873,12122826,11821884,3289031,13213536,5231515,4409965,12912278,5929345,14431610,13675660,5693559,6823513,15618722,14863188,6588335,16513208,8238147,7417269,16212302,1680338,10481449,9664223,1391140,9061683,788936,36926,8838341,12067563,4091408,3340262,11844381,2868234,11372785,10555655,2579964,14478683,5939616,5650518,13661357,5180346,13190977,12967607,4428364,8219746,16457881,16234863,7468436,15633027,6866552,6578062,14816117,1405499,9649856,10463030,1698765,8819930,55329,803287,9047340,11858690,3325945,4072975,12086004,2561507,10574104,11387118,2853909,13647026,5664841,5958079,14460228,4446803,12949160,13176670,5194661,7454091,16249200,16476294,8201341,14834538,6559633,6852199,15647388,3360676,11864927,12161705,4185682,10527045,2551230,2782280,11286707,9619101,1346150,1577872,10379115,73852,8875143,9172337,899466,16124205,7357910,8182816,16421083,6680524,14918455,15678145,6911546,5736468,13747439,14507289,5968354,12873461,4334094,5159928,13170435,4167245,12180150,11879232,3346363,11301036,2767959,2532769,10545498,10360692,1596303,1360505,9604738,913813,9157998,8856728,92259,16439492,8164415,7343561,16138546,6897189,15692510,14936872,6662099,5986813,14488838,13733104,5750795,13156124,5174247,4352529,12855018,2810998,11315341,10498427,2522496,12124823,4148844,3397530,11901793,9135439,862644,110658,8912057,1606574,10407765,9590435,1317464,15706879,6940164,6651890,14889737,8145950,16384229,16161043,7394792,5123014,13133629,12910283,4370992,14535975,5997020,5707818,13718737,2504095,10516836,11329682,2796649,11916158,3383173,4130419,12143240,8893606,129117,876971,9121104,1331783,9576124,10389322,1625009,14908182,6633453,6925851,15721184,7380471,16175372,16402682,8127489,4389423,12891860,13119266,5137369,13704398,5722165,6015427,14517560];typeof Int32Array<"u"&&(N=new Int32Array(N));var z=(m,d)=>{let f=typeof d<"u"?~~d:11994318;for(let c=0;c<m.length;c++)f=(N[(f>>16^m[c])&255]^f<<8)&16777215;return f},q=C("crc-24",z);let oe=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(oe=new Int32Array(oe));var Et=(m,d)=>{let f=d===0?0:~~d^-1;for(let c=0;c<m.length;c++)f=oe[(f^m[c])&255]^f>>>8;return f^-1},Me=C("crc-32",Et);let At=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188];typeof Int32Array<"u"&&(At=new Int32Array(At));var Ze=(m,d)=>{let f=typeof d<"u"?~~d:4294967295;for(let c=0;c<m.length;c++)f=At[(f>>24^m[c])&255]^f<<8;return f},Wt=C("crc-32-mpeg",Ze);let Se=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(Se=new Int32Array(Se));var Ut=(m,d=-1)=>{let f=d===0?0:~~d;for(let c=0;c<m.length;c++)f=Se[(f^m[c])&255]^f>>>8;return f},Mt=C("jam",Ut),Qt={crc1:be,crc8:Re,crc81wire:rt,crc8dvbs2:v,crc16:te,crc16ccitt:Oe,crc16modbus:yt,crc16xmodem:b,crc16kermit:R,crc24:q,crc32:Me,crc32mpeg2:Wt,crcjam:Mt},It=se(17187);const We={mainnet:{name:"mainnet",chainId:1,networkId:1,defaultHardfork:"shanghai",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"The Ethereum main chain",url:"https://ethstats.net/",genesis:{gasLimit:5e3,difficulty:17179869184,nonce:"0x0000000000000042",extraData:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfc64ec04"},{name:"homestead",block:115e4,forkHash:"0x97c2c34c"},{name:"dao",block:192e4,forkHash:"0x91d1f948"},{name:"tangerineWhistle",block:2463e3,forkHash:"0x7a64da13"},{name:"spuriousDragon",block:2675e3,forkHash:"0x3edd5b10"},{name:"byzantium",block:437e4,forkHash:"0xa00bc324"},{name:"constantinople",block:728e4,forkHash:"0x668db0af"},{name:"petersburg",block:728e4,forkHash:"0x668db0af"},{name:"istanbul",block:9069e3,forkHash:"0x879d6e30"},{name:"muirGlacier",block:92e5,forkHash:"0xe029e991"},{name:"berlin",block:12244e3,forkHash:"0x0eb440f6"},{name:"london",block:12965e3,forkHash:"0xb715077d"},{name:"arrowGlacier",block:13773e3,forkHash:"0x20c327fc"},{name:"grayGlacier",block:1505e4,forkHash:"0xf0afd0e3"},{name:"paris",ttd:"58750000000000000000000",block:15537394,forkHash:"0xf0afd0e3"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,timestamp:"1681338455",forkHash:"0xdce96c2d"},{name:"cancun",block:null,forkHash:null}],bootstrapNodes:[{ip:"18.138.108.67",port:30303,id:"d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666",location:"ap-southeast-1-001",comment:"bootnode-aws-ap-southeast-1-001"},{ip:"3.209.45.79",port:30303,id:"22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de",location:"us-east-1-001",comment:"bootnode-aws-us-east-1-001"},{ip:"65.108.70.101",port:30303,id:"2b252ab6a1d0f971d9722cb839a42cb81db019ba44c08754628ab4a823487071b5695317c8ccd085219c3a03af063495b2f1da8d18218da2d6a82981b45e6ffc",location:"eu-west-1-001",comment:"bootnode-hetzner-hel"},{ip:"157.90.35.166",port:30303,id:"4aeb4ab6c14b23e2c4cfdce879c04b0748a20d8e9b59e25ded2a08143e265c6c25936e74cbc8e641e3312ca288673d91f2f93f8e277de3cfa444ecdaaf982052",location:"eu-central-1-001",comment:"bootnode-hetzner-fsn"}],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]},goerli:{name:"goerli",chainId:5,networkId:5,defaultHardfork:"shanghai",consensus:{type:"poa",algorithm:"clique",clique:{period:15,epoch:3e4}},comment:"Cross-client PoA test network",url:"https://github.com/goerli/testnet",genesis:{timestamp:"0x5c51a607",gasLimit:10485760,difficulty:1,nonce:"0x0000000000000000",extraData:"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},hardforks:[{name:"chainstart",block:0,forkHash:"0xa3f5ab08"},{name:"homestead",block:0,forkHash:"0xa3f5ab08"},{name:"tangerineWhistle",block:0,forkHash:"0xa3f5ab08"},{name:"spuriousDragon",block:0,forkHash:"0xa3f5ab08"},{name:"byzantium",block:0,forkHash:"0xa3f5ab08"},{name:"constantinople",block:0,forkHash:"0xa3f5ab08"},{name:"petersburg",block:0,forkHash:"0xa3f5ab08"},{name:"istanbul",block:1561651,forkHash:"0xc25efa5c"},{name:"berlin",block:4460644,forkHash:"0x757a1c47"},{name:"london",block:5062605,forkHash:"0xb8c6299d"},{name:"paris",ttd:"10790000",block:7382819,forkHash:"0xb8c6299d"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,timestamp:"1678832736",forkHash:"0xf9843abf"},{name:"cancun",block:null,forkHash:null}],bootstrapNodes:[{ip:"51.141.78.53",port:30303,id:"011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a",location:"",comment:"Upstream bootnode 1"},{ip:"13.93.54.137",port:30303,id:"176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b",location:"",comment:"Upstream bootnode 2"},{ip:"94.237.54.114",port:30313,id:"46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291",location:"",comment:"Upstream bootnode 3"},{ip:"18.218.250.66",port:30313,id:"b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949",location:"",comment:"Upstream bootnode 4"},{ip:"3.11.147.67",port:30303,id:"a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91",location:"",comment:"Ethereum Foundation bootnode"},{ip:"51.15.116.226",port:30303,id:"a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd",location:"",comment:"Goerli Initiative bootnode"},{ip:"51.15.119.157",port:30303,id:"807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33",location:"",comment:"Goerli Initiative bootnode"},{ip:"51.15.119.157",port:40303,id:"a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd",location:"",comment:"Goerli Initiative bootnode"}],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]},sepolia:{name:"sepolia",chainId:11155111,networkId:11155111,defaultHardfork:"shanghai",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"PoW test network to replace Ropsten",url:"https://github.com/ethereum/go-ethereum/pull/23730",genesis:{timestamp:"0x6159af19",gasLimit:3e7,difficulty:131072,nonce:"0x0000000000000000",extraData:"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfe3366e7"},{name:"homestead",block:0,forkHash:"0xfe3366e7"},{name:"tangerineWhistle",block:0,forkHash:"0xfe3366e7"},{name:"spuriousDragon",block:0,forkHash:"0xfe3366e7"},{name:"byzantium",block:0,forkHash:"0xfe3366e7"},{name:"constantinople",block:0,forkHash:"0xfe3366e7"},{name:"petersburg",block:0,forkHash:"0xfe3366e7"},{name:"istanbul",block:0,forkHash:"0xfe3366e7"},{name:"muirGlacier",block:0,forkHash:"0xfe3366e7"},{name:"berlin",block:0,forkHash:"0xfe3366e7"},{name:"london",block:0,forkHash:"0xfe3366e7"},{name:"paris",ttd:"17000000000000000",block:1450409,forkHash:"0xfe3366e7"},{name:"mergeForkIdTransition",block:1735371,forkHash:"0xb96cbd13"},{name:"shanghai",block:null,timestamp:"1677557088",forkHash:"0xf7f9bc08"},{name:"cancun",block:null,forkHash:null}],bootstrapNodes:[{ip:"18.168.182.86",port:30303,id:"9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066",location:"",comment:"geth"},{ip:"52.14.151.177",port:30303,id:"ec66ddcf1a974950bd4c782789a7e04f8aa7110a72569b6e65fcd51e937e74eed303b1ea734e4d19cfaec9fbff9b6ee65bf31dcb50ba79acce9dd63a6aca61c7",location:"",comment:"besu"},{ip:"165.22.196.173",port:30303,id:"ce970ad2e9daa9e14593de84a8b49da3d54ccfdf83cbc4fe519cb8b36b5918ed4eab087dedd4a62479b8d50756b492d5f762367c8d20329a7854ec01547568a6",location:"",comment:"EF"},{ip:"65.108.95.67",port:30303,id:"075503b13ed736244896efcde2a992ec0b451357d46cb7a8132c0384721742597fc8f0d91bbb40bb52e7d6e66728d36a1fda09176294e4a30cfac55dcce26bc6",location:"",comment:"lodestar"}],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]}};var ue;(function(m){m[m.Mainnet=1]="Mainnet",m[m.Goerli=5]="Goerli",m[m.Sepolia=11155111]="Sepolia"})(ue||(ue={}));const Gt={[ue.Mainnet]:{blockNumber:BigInt(0),stateRoot:(0,T.nr)("0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544")},[ue.Goerli]:{blockNumber:BigInt(0),stateRoot:(0,T.nr)("0x5d6cded585e73c4e322c30c2f782a336316f17dd85a4863b9d838d2d4b8b3008")},[ue.Sepolia]:{blockNumber:BigInt(0),stateRoot:(0,T.nr)("0x5eb6e371a698b8d68f665192350ffcecbbbf322916f4b51bd79bb6887da3f494")}};var k;(function(m){m.Chainstart="chainstart",m.Homestead="homestead",m.Dao="dao",m.TangerineWhistle="tangerineWhistle",m.SpuriousDragon="spuriousDragon",m.Byzantium="byzantium",m.Constantinople="constantinople",m.Petersburg="petersburg",m.Istanbul="istanbul",m.MuirGlacier="muirGlacier",m.Berlin="berlin",m.London="london",m.ArrowGlacier="arrowGlacier",m.GrayGlacier="grayGlacier",m.MergeForkIdTransition="mergeForkIdTransition",m.Paris="paris",m.Shanghai="shanghai",m.Cancun="cancun"})(k||(k={}));var ht;(function(m){m.ProofOfStake="pos",m.ProofOfWork="pow",m.ProofOfAuthority="poa"})(ht||(ht={}));var Ue;(function(m){m.Ethash="ethash",m.Clique="clique",m.Casper="casper"})(Ue||(Ue={}));var he;(function(m){m.PolygonMainnet="polygon-mainnet",m.PolygonMumbai="polygon-mumbai",m.ArbitrumOne="arbitrum-one",m.xDaiChain="x-dai-chain",m.OptimisticKovan="optimistic-kovan",m.OptimisticEthereum="optimistic-ethereum"})(he||(he={}));var K;(function(m){m.Draft="draft",m.Review="review",m.Final="final"})(K||(K={}));const Ge={1153:{comment:"Transient storage opcodes",url:"https://eips.ethereum.org/EIPS/eip-1153",status:K.Review,minimumHardfork:k.Chainstart,requiredEIPs:[],gasPrices:{tstore:{v:100,d:"Base fee of the TSTORE opcode"},tload:{v:100,d:"Base fee of the TLOAD opcode"}}},1559:{comment:"Fee market change for ETH 1.0 chain",url:"https://eips.ethereum.org/EIPS/eip-1559",status:K.Final,minimumHardfork:k.Berlin,requiredEIPs:[2930],gasConfig:{baseFeeMaxChangeDenominator:{v:8,d:"Maximum base fee change denominator"},elasticityMultiplier:{v:2,d:"Maximum block gas target elasticity"},initialBaseFee:{v:1e9,d:"Initial base fee on first EIP1559 block"}}},2315:{comment:"Simple subroutines for the EVM",url:"https://eips.ethereum.org/EIPS/eip-2315",status:K.Draft,minimumHardfork:k.Istanbul,requiredEIPs:[],gasPrices:{beginsub:{v:2,d:"Base fee of the BEGINSUB opcode"},returnsub:{v:5,d:"Base fee of the RETURNSUB opcode"},jumpsub:{v:10,d:"Base fee of the JUMPSUB opcode"}}},2565:{comment:"ModExp gas cost",url:"https://eips.ethereum.org/EIPS/eip-2565",status:K.Final,minimumHardfork:k.Byzantium,requiredEIPs:[],gasPrices:{modexpGquaddivisor:{v:3,d:"Gquaddivisor from modexp precompile for gas calculation"}}},2718:{comment:"Typed Transaction Envelope",url:"https://eips.ethereum.org/EIPS/eip-2718",status:K.Final,minimumHardfork:k.Chainstart,requiredEIPs:[]},2929:{comment:"Gas cost increases for state access opcodes",url:"https://eips.ethereum.org/EIPS/eip-2929",status:K.Final,minimumHardfork:k.Chainstart,requiredEIPs:[],gasPrices:{coldsload:{v:2100,d:"Gas cost of the first read of storage from a given location (per transaction)"},coldaccountaccess:{v:2600,d:"Gas cost of the first read of a given address (per transaction)"},warmstorageread:{v:100,d:"Gas cost of reading storage locations which have already loaded 'cold'"},sstoreCleanGasEIP2200:{v:2900,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreNoopGasEIP2200:{v:100,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:100,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitRefundEIP2200:{v:19900,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanRefundEIP2200:{v:4900,d:"Once per SSTORE operation for resetting to the original non-zero value"},call:{v:0,d:"Base fee of the CALL opcode"},callcode:{v:0,d:"Base fee of the CALLCODE opcode"},delegatecall:{v:0,d:"Base fee of the DELEGATECALL opcode"},staticcall:{v:0,d:"Base fee of the STATICCALL opcode"},balance:{v:0,d:"Base fee of the BALANCE opcode"},extcodesize:{v:0,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:0,d:"Base fee of the EXTCODECOPY opcode"},extcodehash:{v:0,d:"Base fee of the EXTCODEHASH opcode"},sload:{v:0,d:"Base fee of the SLOAD opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"}}},2930:{comment:"Optional access lists",url:"https://eips.ethereum.org/EIPS/eip-2930",status:K.Final,minimumHardfork:k.Istanbul,requiredEIPs:[2718,2929],gasPrices:{accessListStorageKeyCost:{v:1900,d:"Gas cost per storage key in an Access List transaction"},accessListAddressCost:{v:2400,d:"Gas cost per storage key in an Access List transaction"}}},3074:{comment:"AUTH and AUTHCALL opcodes",url:"https://eips.ethereum.org/EIPS/eip-3074",status:K.Review,minimumHardfork:k.London,requiredEIPs:[],gasPrices:{auth:{v:3100,d:"Gas cost of the AUTH opcode"},authcall:{v:0,d:"Gas cost of the AUTHCALL opcode"},authcallValueTransfer:{v:6700,d:"Paid for CALL when the value transfer is non-zero"}}},3198:{comment:"BASEFEE opcode",url:"https://eips.ethereum.org/EIPS/eip-3198",status:K.Final,minimumHardfork:k.London,requiredEIPs:[],gasPrices:{basefee:{v:2,d:"Gas cost of the BASEFEE opcode"}}},3529:{comment:"Reduction in refunds",url:"https://eips.ethereum.org/EIPS/eip-3529",status:K.Final,minimumHardfork:k.Berlin,requiredEIPs:[2929],gasConfig:{maxRefundQuotient:{v:5,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{selfdestructRefund:{v:0,d:"Refunded following a selfdestruct operation"},sstoreClearRefundEIP2200:{v:4800,d:"Once per SSTORE operation for clearing an originally existing storage slot"}}},3540:{comment:"EVM Object Format (EOF) v1",url:"https://eips.ethereum.org/EIPS/eip-3540",status:K.Review,minimumHardfork:k.London,requiredEIPs:[3541]},3541:{comment:"Reject new contracts starting with the 0xEF byte",url:"https://eips.ethereum.org/EIPS/eip-3541",status:K.Final,minimumHardfork:k.Berlin,requiredEIPs:[]},3554:{comment:"Difficulty Bomb Delay to December 1st 2021",url:"https://eips.ethereum.org/EIPS/eip-3554",status:K.Final,minimumHardfork:k.MuirGlacier,requiredEIPs:[],pow:{difficultyBombDelay:{v:95e5,d:"the amount of blocks to delay the difficulty bomb with"}}},3607:{comment:"Reject transactions from senders with deployed code",url:"https://eips.ethereum.org/EIPS/eip-3607",status:K.Final,minimumHardfork:k.Chainstart,requiredEIPs:[]},3651:{comment:"Warm COINBASE",url:"https://eips.ethereum.org/EIPS/eip-3651",status:K.Review,minimumHardfork:k.London,requiredEIPs:[2929]},3670:{comment:"EOF - Code Validation",url:"https://eips.ethereum.org/EIPS/eip-3670",status:"Review",minimumHardfork:k.London,requiredEIPs:[3540],gasConfig:{},gasPrices:{},vm:{},pow:{}},3675:{comment:"Upgrade consensus to Proof-of-Stake",url:"https://eips.ethereum.org/EIPS/eip-3675",status:K.Final,minimumHardfork:k.London,requiredEIPs:[]},3855:{comment:"PUSH0 instruction",url:"https://eips.ethereum.org/EIPS/eip-3855",status:K.Review,minimumHardfork:k.Chainstart,requiredEIPs:[],gasPrices:{push0:{v:2,d:"Base fee of the PUSH0 opcode"}}},3860:{comment:"Limit and meter initcode",url:"https://eips.ethereum.org/EIPS/eip-3860",status:K.Review,minimumHardfork:k.SpuriousDragon,requiredEIPs:[],gasPrices:{initCodeWordCost:{v:2,d:"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},vm:{maxInitCodeSize:{v:49152,d:"Maximum length of initialization code when creating a contract"}}},4345:{comment:"Difficulty Bomb Delay to June 2022",url:"https://eips.ethereum.org/EIPS/eip-4345",status:K.Final,minimumHardfork:k.London,requiredEIPs:[],pow:{difficultyBombDelay:{v:107e5,d:"the amount of blocks to delay the difficulty bomb with"}}},4399:{comment:"Supplant DIFFICULTY opcode with PREVRANDAO",url:"https://eips.ethereum.org/EIPS/eip-4399",status:K.Review,minimumHardfork:k.London,requiredEIPs:[],gasPrices:{prevrandao:{v:2,d:"Base fee of the PREVRANDAO opcode (previously DIFFICULTY)"}}},4788:{comment:"Beacon block root in the EVM",url:"https://eips.ethereum.org/EIPS/eip-4788",status:K.Draft,minimumHardfork:k.Cancun,requiredEIPs:[],gasPrices:{beaconrootCost:{v:4200,d:"Gas cost when calling the beaconroot stateful precompile"}},vm:{historicalRootsLength:{v:98304,d:"The modulo parameter of the beaconroot ring buffer in the beaconroot statefull precompile"}}},4844:{comment:"Shard Blob Transactions",url:"https://eips.ethereum.org/EIPS/eip-4844",status:K.Draft,minimumHardfork:k.Paris,requiredEIPs:[1559,2718,2930,4895],gasConfig:{blobGasPerBlob:{v:131072,d:"The base fee for blob gas per blob"},targetBlobGasPerBlock:{v:393216,d:"The target blob gas consumed per block"},maxblobGasPerBlock:{v:786432,d:"The max blob gas allowable per block"},blobGasPriceUpdateFraction:{v:3338477,d:"The denominator used in the exponential when calculating a blob gas price"}},gasPrices:{simpleGasPerBlob:{v:12e3,d:"The basic gas fee for each blob"},minBlobGasPrice:{v:1,d:"The minimum fee per blob gas"},kzgPointEvaluationGasPrecompilePrice:{v:5e4,d:"The fee associated with the point evaluation precompile"},blobhash:{v:3,d:"Base fee of the BLOBHASH opcode"}},sharding:{blobCommitmentVersionKzg:{v:1,d:"The number indicated a versioned hash is a KZG commitment"},fieldElementsPerBlob:{v:4096,d:"The number of field elements allowed per blob"}}},4895:{comment:"Beacon chain push withdrawals as operations",url:"https://eips.ethereum.org/EIPS/eip-4895",status:K.Review,minimumHardfork:k.Paris,requiredEIPs:[]},5133:{comment:"Delaying Difficulty Bomb to mid-September 2022",url:"https://eips.ethereum.org/EIPS/eip-5133",status:K.Draft,minimumHardfork:k.GrayGlacier,requiredEIPs:[],pow:{difficultyBombDelay:{v:114e5,d:"the amount of blocks to delay the difficulty bomb with"}}},5656:{comment:"MCOPY - Memory copying instruction",url:"https://eips.ethereum.org/EIPS/eip-5656",status:K.Draft,minimumHardfork:k.Shanghai,requiredEIPs:[],gasPrices:{mcopy:{v:3,d:"Base fee of the MCOPY opcode"}}},6780:{comment:"SELFDESTRUCT only in same transaction",url:"https://eips.ethereum.org/EIPS/eip-6780",status:K.Draft,minimumHardfork:k.London,requiredEIPs:[]}};var ne;(function(m){m.Draft="draft",m.Review="review",m.Final="final"})(ne||(ne={}));const Nt={chainstart:{name:"chainstart",comment:"Start of the Ethereum main chain",url:"",status:ne.Final,gasConfig:{minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be"},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations"},maxRefundQuotient:{v:2,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{base:{v:2,d:"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},exp:{v:10,d:"Base fee of the EXP opcode"},expByte:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction"},keccak256:{v:30,d:"Base fee of the SHA3 opcode"},keccak256Word:{v:6,d:"Once per word of the SHA3 operation's data"},sload:{v:50,d:"Base fee of the SLOAD opcode"},sstoreSet:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero"},sstoreReset:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero"},sstoreRefund:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero"},jumpdest:{v:1,d:"Base fee of the JUMPDEST opcode"},log:{v:375,d:"Base fee of the LOG opcode"},logData:{v:8,d:"Per byte in a LOG* operation's data"},logTopic:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},create:{v:32e3,d:"Base fee of the CREATE opcode"},call:{v:40,d:"Base fee of the CALL opcode"},callStipend:{v:2300,d:"Free gas given at beginning of call"},callValueTransfer:{v:9e3,d:"Paid for CALL when the value transfor is non-zero"},callNewAccount:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior"},selfdestructRefund:{v:24e3,d:"Refunded following a selfdestruct operation"},memory:{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"},createData:{v:200,d:""},tx:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions"},txCreation:{v:32e3,d:"The cost of creating a contract via tx"},txDataZero:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},txDataNonZero:{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"},copy:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},ecRecover:{v:3e3,d:""},sha256:{v:60,d:""},sha256Word:{v:12,d:""},ripemd160:{v:600,d:""},ripemd160Word:{v:120,d:""},identity:{v:15,d:""},identityWord:{v:3,d:""},stop:{v:0,d:"Base fee of the STOP opcode"},add:{v:3,d:"Base fee of the ADD opcode"},mul:{v:5,d:"Base fee of the MUL opcode"},sub:{v:3,d:"Base fee of the SUB opcode"},div:{v:5,d:"Base fee of the DIV opcode"},sdiv:{v:5,d:"Base fee of the SDIV opcode"},mod:{v:5,d:"Base fee of the MOD opcode"},smod:{v:5,d:"Base fee of the SMOD opcode"},addmod:{v:8,d:"Base fee of the ADDMOD opcode"},mulmod:{v:8,d:"Base fee of the MULMOD opcode"},signextend:{v:5,d:"Base fee of the SIGNEXTEND opcode"},lt:{v:3,d:"Base fee of the LT opcode"},gt:{v:3,d:"Base fee of the GT opcode"},slt:{v:3,d:"Base fee of the SLT opcode"},sgt:{v:3,d:"Base fee of the SGT opcode"},eq:{v:3,d:"Base fee of the EQ opcode"},iszero:{v:3,d:"Base fee of the ISZERO opcode"},and:{v:3,d:"Base fee of the AND opcode"},or:{v:3,d:"Base fee of the OR opcode"},xor:{v:3,d:"Base fee of the XOR opcode"},not:{v:3,d:"Base fee of the NOT opcode"},byte:{v:3,d:"Base fee of the BYTE opcode"},address:{v:2,d:"Base fee of the ADDRESS opcode"},balance:{v:20,d:"Base fee of the BALANCE opcode"},origin:{v:2,d:"Base fee of the ORIGIN opcode"},caller:{v:2,d:"Base fee of the CALLER opcode"},callvalue:{v:2,d:"Base fee of the CALLVALUE opcode"},calldataload:{v:3,d:"Base fee of the CALLDATALOAD opcode"},calldatasize:{v:2,d:"Base fee of the CALLDATASIZE opcode"},calldatacopy:{v:3,d:"Base fee of the CALLDATACOPY opcode"},codesize:{v:2,d:"Base fee of the CODESIZE opcode"},codecopy:{v:3,d:"Base fee of the CODECOPY opcode"},gasprice:{v:2,d:"Base fee of the GASPRICE opcode"},extcodesize:{v:20,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:20,d:"Base fee of the EXTCODECOPY opcode"},blockhash:{v:20,d:"Base fee of the BLOCKHASH opcode"},coinbase:{v:2,d:"Base fee of the COINBASE opcode"},timestamp:{v:2,d:"Base fee of the TIMESTAMP opcode"},number:{v:2,d:"Base fee of the NUMBER opcode"},difficulty:{v:2,d:"Base fee of the DIFFICULTY opcode"},gaslimit:{v:2,d:"Base fee of the GASLIMIT opcode"},pop:{v:2,d:"Base fee of the POP opcode"},mload:{v:3,d:"Base fee of the MLOAD opcode"},mstore:{v:3,d:"Base fee of the MSTORE opcode"},mstore8:{v:3,d:"Base fee of the MSTORE8 opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"},jump:{v:8,d:"Base fee of the JUMP opcode"},jumpi:{v:10,d:"Base fee of the JUMPI opcode"},pc:{v:2,d:"Base fee of the PC opcode"},msize:{v:2,d:"Base fee of the MSIZE opcode"},gas:{v:2,d:"Base fee of the GAS opcode"},push:{v:3,d:"Base fee of the PUSH opcode"},dup:{v:3,d:"Base fee of the DUP opcode"},swap:{v:3,d:"Base fee of the SWAP opcode"},callcode:{v:40,d:"Base fee of the CALLCODE opcode"},return:{v:0,d:"Base fee of the RETURN opcode"},invalid:{v:0,d:"Base fee of the INVALID opcode"},selfdestruct:{v:0,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{stackLimit:{v:1024,d:"Maximum size of VM stack allowed"},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack"},maxExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis"}},pow:{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"},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},minerReward:{v:BigInt("5000000000000000000"),d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:0,d:"the amount of blocks to delay the difficulty bomb with"}}},homestead:{name:"homestead",comment:"Homestead hardfork with protocol and network changes",url:"https://eips.ethereum.org/EIPS/eip-606",status:ne.Final,gasPrices:{delegatecall:{v:40,d:"Base fee of the DELEGATECALL opcode"}}},dao:{name:"dao",comment:"DAO rescue hardfork",url:"https://eips.ethereum.org/EIPS/eip-779",status:ne.Final},tangerineWhistle:{name:"tangerineWhistle",comment:"Hardfork with gas cost changes for IO-heavy operations",url:"https://eips.ethereum.org/EIPS/eip-608",status:ne.Final,gasPrices:{sload:{v:200,d:"Once per SLOAD operation"},call:{v:700,d:"Once per CALL operation & message call transaction"},extcodesize:{v:700,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:700,d:"Base fee of the EXTCODECOPY opcode"},balance:{v:400,d:"Base fee of the BALANCE opcode"},delegatecall:{v:700,d:"Base fee of the DELEGATECALL opcode"},callcode:{v:700,d:"Base fee of the CALLCODE opcode"},selfdestruct:{v:5e3,d:"Base fee of the SELFDESTRUCT opcode"}}},spuriousDragon:{name:"spuriousDragon",comment:"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit",url:"https://eips.ethereum.org/EIPS/eip-607",status:ne.Final,gasPrices:{expByte:{v:50,d:"Times ceil(log256(exponent)) for the EXP instruction"}},vm:{maxCodeSize:{v:24576,d:"Maximum length of contract code"}}},byzantium:{name:"byzantium",comment:"Hardfork with new precompiles, instructions and other protocol changes",url:"https://eips.ethereum.org/EIPS/eip-609",status:ne.Final,gasPrices:{modexpGquaddivisor:{v:20,d:"Gquaddivisor from modexp precompile for gas calculation"},ecAdd:{v:500,d:"Gas costs for curve addition precompile"},ecMul:{v:4e4,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:1e5,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:8e4,d:"Gas costs regarding curve pairing precompile input length"},revert:{v:0,d:"Base fee of the REVERT opcode"},staticcall:{v:700,d:"Base fee of the STATICCALL opcode"},returndatasize:{v:2,d:"Base fee of the RETURNDATASIZE opcode"},returndatacopy:{v:3,d:"Base fee of the RETURNDATACOPY opcode"}},pow:{minerReward:{v:BigInt("3000000000000000000"),d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:3e6,d:"the amount of blocks to delay the difficulty bomb with"}}},constantinople:{name:"constantinople",comment:"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)",url:"https://eips.ethereum.org/EIPS/eip-1013",status:ne.Final,gasPrices:{netSstoreNoopGas:{v:200,d:"Once per SSTORE operation if the value doesn't change"},netSstoreInitGas:{v:2e4,d:"Once per SSTORE operation from clean zero"},netSstoreCleanGas:{v:5e3,d:"Once per SSTORE operation from clean non-zero"},netSstoreDirtyGas:{v:200,d:"Once per SSTORE operation from dirty"},netSstoreClearRefund:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},netSstoreResetRefund:{v:4800,d:"Once per SSTORE operation for resetting to the original non-zero value"},netSstoreResetClearRefund:{v:19800,d:"Once per SSTORE operation for resetting to the original zero value"},shl:{v:3,d:"Base fee of the SHL opcode"},shr:{v:3,d:"Base fee of the SHR opcode"},sar:{v:3,d:"Base fee of the SAR opcode"},extcodehash:{v:400,d:"Base fee of the EXTCODEHASH opcode"},create2:{v:32e3,d:"Base fee of the CREATE2 opcode"}},pow:{minerReward:{v:BigInt("2000000000000000000"),d:"The amount a miner gets rewarded for mining a block"},difficultyBombDelay:{v:5e6,d:"the amount of blocks to delay the difficulty bomb with"}}},petersburg:{name:"petersburg",comment:"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople",url:"https://eips.ethereum.org/EIPS/eip-1716",status:ne.Final,gasPrices:{netSstoreNoopGas:{v:null,d:"Removed along EIP-1283"},netSstoreInitGas:{v:null,d:"Removed along EIP-1283"},netSstoreCleanGas:{v:null,d:"Removed along EIP-1283"},netSstoreDirtyGas:{v:null,d:"Removed along EIP-1283"},netSstoreClearRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetClearRefund:{v:null,d:"Removed along EIP-1283"}}},istanbul:{name:"istanbul",comment:"HF targeted for December 2019 following the Constantinople/Petersburg HF",url:"https://eips.ethereum.org/EIPS/eip-1679",status:ne.Final,gasConfig:{},gasPrices:{blake2Round:{v:1,d:"Gas cost per round for the Blake2 F precompile"},ecAdd:{v:150,d:"Gas costs for curve addition precompile"},ecMul:{v:6e3,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:45e3,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:34e3,d:"Gas costs regarding curve pairing precompile input length"},txDataNonZero:{v:16,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},sstoreSentryGasEIP2200:{v:2300,d:"Minimum gas required to be present for an SSTORE call, not consumed"},sstoreNoopGasEIP2200:{v:800,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:800,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitGasEIP2200:{v:2e4,d:"Once per SSTORE operation from clean zero to non-zero"},sstoreInitRefundEIP2200:{v:19200,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanGasEIP2200:{v:5e3,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreCleanRefundEIP2200:{v:4200,d:"Once per SSTORE operation for resetting to the original non-zero value"},sstoreClearRefundEIP2200:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},balance:{v:700,d:"Base fee of the BALANCE opcode"},extcodehash:{v:700,d:"Base fee of the EXTCODEHASH opcode"},chainid:{v:2,d:"Base fee of the CHAINID opcode"},selfbalance:{v:5,d:"Base fee of the SELFBALANCE opcode"},sload:{v:800,d:"Base fee of the SLOAD opcode"}}},muirGlacier:{name:"muirGlacier",comment:"HF to delay the difficulty bomb",url:"https://eips.ethereum.org/EIPS/eip-2384",status:ne.Final,pow:{difficultyBombDelay:{v:9e6,d:"the amount of blocks to delay the difficulty bomb with"}}},berlin:{name:"berlin",comment:"HF targeted for July 2020 following the Muir Glacier HF",url:"https://eips.ethereum.org/EIPS/eip-2070",status:ne.Final,eips:[2565,2929,2718,2930]},london:{name:"london",comment:"HF targeted for July 2021 following the Berlin fork",url:"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",status:ne.Final,eips:[1559,3198,3529,3541]},arrowGlacier:{name:"arrowGlacier",comment:"HF to delay the difficulty bomb",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md",status:ne.Final,eips:[4345]},grayGlacier:{name:"grayGlacier",comment:"Delaying the difficulty bomb to Mid September 2022",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md",status:ne.Final,eips:[5133]},paris:{name:"paris",comment:"Hardfork to upgrade the consensus mechanism to Proof-of-Stake",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md",status:ne.Final,consensus:{type:"pos",algorithm:"casper",casper:{}},eips:[3675,4399]},mergeForkIdTransition:{name:"mergeForkIdTransition",comment:"Pre-merge hardfork to fork off non-upgraded clients",url:"https://eips.ethereum.org/EIPS/eip-3675",status:ne.Final,eips:[]},shanghai:{name:"shanghai",comment:"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md",status:ne.Final,eips:[3651,3855,3860,4895]},cancun:{name:"cancun",comment:"Next feature hardfork after the shanghai having proto-danksharding EIP 4844 blobs (still WIP hence not for production use), transient storage opcodes, parent beacon block root availability in EVM and selfdestruct only in same transaction",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md",status:ne.Final,eips:[1153,4844,4788,5656,6780]}};function lt(m){return!m||m==="0x0"?"0x0000000000000000":(0,T.Lo)(m)?"0x"+(0,T.MT)(m).padStart(16,"0"):"0x"+m.padStart(16,"0")}function ot(m,d=!0){var zt,Ie;const{name:f,config:c,difficulty:E,mixHash:L,gasLimit:W,coinbase:fe,baseFeePerGas:U,excessBlobGas:me}=m;let{extraData:ve,timestamp:D,nonce:Ce}=m;const Ye=Number(D),{chainId:it}=c;if(ve===""&&(ve="0x"),(0,T.Lo)(D)||(D=(0,T.I4)(parseInt(D))),Ce.length!==18&&(Ce=lt(Ce)),c.eip155Block!==c.eip158Block)throw new Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");const ge={name:f,chainId:it,networkId:it,genesis:{timestamp:D,gasLimit:W,difficulty:E,nonce:Ce,extraData:ve,mixHash:L,coinbase:fe,baseFeePerGas:U,excessBlobGas:me},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:c.clique!==void 0?{type:"poa",algorithm:"clique",clique:{period:(zt=c.clique.period)!=null?zt:c.clique.blockperiodseconds,epoch:(Ie=c.clique.epoch)!=null?Ie:c.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},at={[k.Homestead]:{name:"homesteadBlock"},[k.Dao]:{name:"daoForkBlock"},[k.TangerineWhistle]:{name:"eip150Block"},[k.SpuriousDragon]:{name:"eip155Block"},[k.Byzantium]:{name:"byzantiumBlock"},[k.Constantinople]:{name:"constantinopleBlock"},[k.Petersburg]:{name:"petersburgBlock"},[k.Istanbul]:{name:"istanbulBlock"},[k.MuirGlacier]:{name:"muirGlacierBlock"},[k.Berlin]:{name:"berlinBlock"},[k.London]:{name:"londonBlock"},[k.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:d},[k.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[k.Cancun]:{name:"cancunTime",postMerge:!0,isTimestamp:!0}},Pt=Object.keys(at).reduce((re,Ne)=>(re[at[Ne].name]=Ne,re),{}),bt=Object.keys(c).filter(re=>Pt[re]!==void 0&&c[re]!==void 0&&c[re]!==null);if(ge.hardforks=bt.map(re=>({name:Pt[re],block:at[Pt[re]].isTimestamp===!0||typeof c[re]!="number"?null:c[re],timestamp:at[Pt[re]].isTimestamp===!0&&typeof c[re]=="number"?c[re]:void 0})).filter(re=>re.block!==null||re.timestamp!==void 0),ge.hardforks.sort(function(re,Ne){var He,le;return((He=re.block)!=null?He:1/0)-((le=Ne.block)!=null?le:1/0)}),ge.hardforks.sort(function(re,Ne){var He,le;return((He=re.timestamp)!=null?He:Ye)-((le=Ne.timestamp)!=null?le:Ye)}),c.terminalTotalDifficulty!==void 0){const re={name:k.Paris,ttd:c.terminalTotalDifficulty,block:null},Ne=ge.hardforks.findIndex(He=>{var le;return((le=at[He.name])==null?void 0:le.postMerge)===!0});Ne!==-1?ge.hardforks.splice(Ne,0,re):ge.hardforks.push(re)}const Tt=ge.hardforks.length>0?ge.hardforks.slice(-1)[0]:void 0;return ge.hardfork=Tt==null?void 0:Tt.name,ge.hardforks.unshift({name:k.Chainstart,block:0}),ge}function kt(m,d,f){try{if(["config","difficulty","gasLimit","alloc"].some(c=>!(c in m)))throw new Error("Invalid format, expected geth genesis fields missing");return d!==void 0&&(m.name=d),ot(m,f)}catch(c){throw new Error(`Error parsing parameters file: ${c.message}`)}}class Ae{constructor(d){var f,c;this._eips=[],this.events=new It.EventEmitter,this._customChains=(f=d.customChains)!=null?f:[],this._chainParams=this.setChain(d.chain),this.DEFAULT_HARDFORK=(c=this._chainParams.defaultHardfork)!=null?c:k.Shanghai,this.HARDFORK_CHANGES=this.hardforks().map(E=>[E.name,Nt[E.name]]),this._hardfork=this.DEFAULT_HARDFORK,d.hardfork!==void 0&&this.setHardfork(d.hardfork),d.eips&&this.setEIPs(d.eips)}static custom(d,f={}){var L;const c=(L=f.baseChain)!=null?L:"mainnet",E={...Ae._getChainParams(c)};if(E.name="custom-chain",typeof d!="string")return new Ae({chain:{...E,...d},...f});if(d===he.PolygonMainnet)return Ae.custom({name:he.PolygonMainnet,chainId:137,networkId:137},f);if(d===he.PolygonMumbai)return Ae.custom({name:he.PolygonMumbai,chainId:80001,networkId:80001},f);if(d===he.ArbitrumOne)return Ae.custom({name:he.ArbitrumOne,chainId:42161,networkId:42161},f);if(d===he.xDaiChain)return Ae.custom({name:he.xDaiChain,chainId:100,networkId:100},f);if(d===he.OptimisticKovan)return Ae.custom({name:he.OptimisticKovan,chainId:69,networkId:69},{hardfork:k.Berlin,...f});if(d===he.OptimisticEthereum)return Ae.custom({name:he.OptimisticEthereum,chainId:10,networkId:10},{hardfork:k.Berlin,...f});throw new Error(`Custom chain ${d} not supported`)}static fromGethGenesis(d,{chain:f,eips:c,genesisHash:E,hardfork:L,mergeForkIdPostMerge:W}){var me;const fe=kt(d,f,W),U=new Ae({chain:(me=fe.name)!=null?me:"custom",customChains:[fe],eips:c,hardfork:L!=null?L:fe.hardfork});return E!==void 0&&U.setForkHashes(E),U}static isSupportedChainId(d){const f=this.getInitializedChains();return Boolean(f.names[d.toString()])}static _getChainParams(d,f){const c=this.getInitializedChains(f);if(typeof d=="number"||typeof d=="bigint"){if(d=d.toString(),c.names[d]){const E=c.names[d];return c[E]}throw new Error(`Chain with ID ${d} not supported`)}if(c[d]!==void 0)return c[d];throw new Error(`Chain with name ${d} not supported`)}setChain(d){if(typeof d=="number"||typeof d=="bigint"||typeof d=="string")this._chainParams=Ae._getChainParams(d,this._customChains);else if(typeof d=="object"){if(this._customChains.length>0)throw new Error("Chain must be a string, number, or bigint when initialized with customChains passed in");const f=["networkId","genesis","hardforks","bootstrapNodes"];for(const c of f)if(!(c in d))throw new Error(`Missing required chain parameter: ${c}`);this._chainParams=d}else throw new Error("Wrong input format");for(const f of this.hardforks())if(f.block===void 0)throw new Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(d){let f=!1;for(const c of this.HARDFORK_CHANGES)c[0]===d&&(this._hardfork!==d&&(this._hardfork=d,this.events.emit("hardforkChanged",d)),f=!0);if(!f)throw new Error(`Hardfork with name ${d} not supported`)}getHardforkBy(d){let{blockNumber:f,timestamp:c,td:E}=d;f=(0,T.Fy)(f,T.qT.BigInt),E=(0,T.Fy)(E,T.qT.BigInt),c=(0,T.Fy)(c,T.qT.BigInt);const L=this.hardforks().filter(D=>D.block!==null||D.ttd!==null&&D.ttd!==void 0||D.timestamp!==void 0),W=L.findIndex(D=>D.ttd!==null&&D.ttd!==void 0);if(L.slice(W+1).findIndex(D=>D.ttd!==null&&D.ttd!==void 0)>=0)throw Error("More than one merge hardforks found with ttd specified");let U=L.findIndex(D=>f!==void 0&&D.block!==null&&BigInt(D.block)>f||c!==void 0&&D.timestamp!==void 0&&D.timestamp>c);if(U===-1)U=L.length;else if(U===0)throw Error("Must have at least one hardfork at block 0");if(c===void 0){const D=L.slice(0,U).reverse().findIndex(Ce=>Ce.block!==null||Ce.ttd!==void 0);U=U-D}if(U=U-1,L[U].block===null&&L[U].timestamp===void 0)(E==null||BigInt(L[U].ttd)>E)&&(U-=1);else if(W>=0&&E!==void 0&&E!==null){if(U>=W&&BigInt(L[W].ttd)>E)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(U<W&&BigInt(L[W].ttd)<=E)throw Error("HF determined by block number is lower than the minimum total difficulty HF")}const me=U;for(;U<L.length-1&&!(L[U].block!==L[U+1].block||L[U].timestamp!==L[U+1].timestamp);U++);if(c!==void 0){if(L.slice(0,me).reduce((Ye,it)=>{var ge;return Math.max(Number((ge=it.timestamp)!=null?ge:"0"),Ye)},0)>c)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");if(L.slice(U+1).reduce((Ye,it)=>{var ge;return Math.min(Number((ge=it.timestamp)!=null?ge:c),Ye)},Number(c))<c)throw Error("Maximum HF determined by block number/ttd is lower than timestamp HF")}return L[U].name}setHardforkBy(d){const f=this.getHardforkBy(d);return this.setHardfork(f),f}_getHardfork(d){const f=this.hardforks();for(const c of f)if(c.name===d)return c;return null}setEIPs(d=[]){for(const f of d){if(!(f in Ge))throw new Error(`${f} not supported`);const c=this.gteHardfork(Ge[f].minimumHardfork);if(!c)throw new Error(`${f} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${c}`);if(Ge[f].requiredEIPs!==void 0){for(const E of Ge[f].requiredEIPs)if(!(d.includes(E)||this.isActivatedEIP(E)))throw new Error(`${f} requires EIP ${E}, but is not included in the EIP list`)}}this._eips=d}param(d,f){let c;for(const E of this._eips)if(c=this.paramByEIP(d,f,E),c!==void 0)return c;return this.paramByHardfork(d,f,this._hardfork)}paramByHardfork(d,f,c){let E=null;for(const L of this.HARDFORK_CHANGES){if("eips"in L[1]){const W=L[1].eips;for(const fe of W){const U=this.paramByEIP(d,f,fe);E=typeof U=="bigint"?U:E}}else L[1][d]!==void 0&&L[1][d][f]!==void 0&&(E=L[1][d][f].v);if(L[0]===c)break}return BigInt(E!=null?E:0)}paramByEIP(d,f,c){if(!(c in Ge))throw new Error(`${c} not supported`);const E=Ge[c];if(!(d in E)||E[d][f]===void 0)return;const L=E[d][f].v;return BigInt(L)}paramByBlock(d,f,c,E,L){const W=this.getHardforkBy({blockNumber:c,td:E,timestamp:L});return this.paramByHardfork(d,f,W)}isActivatedEIP(d){if(this.eips().includes(d))return!0;for(const f of this.HARDFORK_CHANGES){const c=f[1];if(this.gteHardfork(c.name)&&"eips"in c&&c.eips.includes(d))return!0}return!1}hardforkIsActiveOnBlock(d,f){f=(0,T.Fy)(f,T.qT.BigInt),d=d!=null?d:this._hardfork;const c=this.hardforkBlock(d);return typeof c=="bigint"&&c!==BigInt(0)&&f>=c}activeOnBlock(d){return this.hardforkIsActiveOnBlock(null,d)}hardforkGteHardfork(d,f){d=d!=null?d:this._hardfork;const c=this.hardforks();let E=-1,L=-1,W=0;for(const fe of c)fe.name===d&&(E=W),fe.name===f&&(L=W),W+=1;return E>=L&&L!==-1}gteHardfork(d){return this.hardforkGteHardfork(null,d)}hardforkBlock(d){var c;d=d!=null?d:this._hardfork;const f=(c=this._getHardfork(d))==null?void 0:c.block;return f==null?null:BigInt(f)}hardforkTimestamp(d){var c;d=d!=null?d:this._hardfork;const f=(c=this._getHardfork(d))==null?void 0:c.timestamp;return f==null?null:BigInt(f)}eipBlock(d){for(const f of this.HARDFORK_CHANGES){const c=f[1];if("eips"in c&&c.eips.includes(d))return this.hardforkBlock(f[0])}return null}hardforkTTD(d){var c;d=d!=null?d:this._hardfork;const f=(c=this._getHardfork(d))==null?void 0:c.ttd;return f==null?null:BigInt(f)}nextHardforkBlockOrTimestamp(d){var fe,U;d=d!=null?d:this._hardfork;const f=this.hardforks();let c=f.findIndex(me=>me.name===d);if(d===k.Paris&&(c-=1),c<0)return null;let E=(fe=f[c].timestamp)!=null?fe:f[c].block;E=E!=null?Number(E):null;const L=f.slice(c+1).find(me=>{var D;let ve=(D=me.timestamp)!=null?D:me.block;return ve=ve!=null?Number(ve):null,me.name!==k.Paris&&ve!==null&&ve!==void 0&&ve!==E});if(L===void 0)return null;const W=(U=L.timestamp)!=null?U:L.block;return W==null?null:BigInt(W)}_calcForkHash(d,f){let c=new Uint8Array(0),E=0;for(const fe of this.hardforks()){const{block:U,timestamp:me,name:ve}=fe;let D=me!=null?me:U;if(D=D!==null?Number(D):null,typeof D=="number"&&D!==0&&D!==E&&ve!==k.Paris){const Ce=(0,T.nr)("0x"+D.toString(16).padStart(16,"0"));c=(0,T.eV)(c,Ce),E=D}if(fe.name===d)break}const L=(0,T.eV)(f,c);return(0,T.ci)((0,T.sO)(Me(L)>>>0))}forkHash(d,f){d=d!=null?d:this._hardfork;const c=this._getHardfork(d);if(c===null||(c==null?void 0:c.block)===null&&(c==null?void 0:c.timestamp)===void 0&&(c==null?void 0:c.ttd)===void 0){const E="No fork hash calculation possible for future hardfork";throw new Error(E)}if((c==null?void 0:c.forkHash)!==null&&(c==null?void 0:c.forkHash)!==void 0)return c.forkHash;if(!f)throw new Error("genesisHash required for forkHash calculation");return this._calcForkHash(d,f)}hardforkForForkHash(d){const f=this.hardforks().filter(c=>c.forkHash===d);return f.length>=1?f[f.length-1]:null}setForkHashes(d){var f;for(const c of this.hardforks()){const E=(f=c.timestamp)!=null?f:c.block;(c.forkHash===null||c.forkHash===void 0)&&(E!=null||typeof c.ttd<"u")&&(c.forkHash=this.forkHash(c.name,d))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){const d=this.hardfork();let f;for(const c of this.HARDFORK_CHANGES)if("consensus"in c[1]&&(f=c[1].consensus.type),c[0]===d)break;return f!=null?f:this._chainParams.consensus.type}consensusAlgorithm(){const d=this.hardfork();let f;for(const c of this.HARDFORK_CHANGES)if("consensus"in c[1]&&(f=c[1].consensus.algorithm),c[0]===d)break;return f!=null?f:this._chainParams.consensus.algorithm}consensusConfig(){var c;const d=this.hardfork();let f;for(const E of this.HARDFORK_CHANGES){if("consensus"in E[1]){const L=E[1],W=L.consensus.algorithm;f=L.consensus[W]}if(E[0]===d)break}return(c=f!=null?f:this._chainParams.consensus[this.consensusAlgorithm()])!=null?c:{}}copy(){const d=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return d.events=new It.EventEmitter,d}static getInitializedChains(d){const f={};for(const[E,L]of Object.entries(ue))f[L]=E.toLowerCase();const c={...We};if(d)for(const E of d){const{name:L}=E;f[E.chainId.toString()]=L,c[L]=E}return c.names=f,c}}},93996:function(xt,_,se){"use strict";se.d(_,{yH:function(){return Xe}});function T(v){if(Array.isArray(v)){const F=[];let j=0;for(let te=0;te<v.length;te++){const xe=T(v[te]);F.push(xe),j+=xe.length}return ye(G(j,192),...F)}const H=Te(v);return H.length===1&&H[0]<128?H:ye(G(H.length,128),H)}function a(v,H,F){if(F>v.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return v.slice(H,F)}function ce(v){if(v[0]===0)throw new Error("invalid RLP: extra zeros");return Fe(be(v))}function G(v,H){if(v<56)return Uint8Array.from([v+H]);const F=_e(v),j=F.length/2,te=_e(H+55+j);return Uint8Array.from(de(te+F))}function P(v,H=!1){if(typeof v>"u"||v===null||v.length===0)return Uint8Array.from([]);const F=Te(v),j=V(F);if(H)return j;if(j.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return j.data}function V(v){let H,F,j,te,xe;const Le=[],we=v[0];if(we<=127)return{data:v.slice(0,1),remainder:v.slice(1)};if(we<=183){if(H=we-127,we===128?j=Uint8Array.from([]):j=a(v,1,H),H===2&&j[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:j,remainder:v.slice(H)}}else if(we<=191){if(F=we-182,v.length-1<F)throw new Error("invalid RLP: not enough bytes for string length");if(H=ce(a(v,1,F)),H<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return j=a(v,F,H+F),{data:j,remainder:v.slice(H+F)}}else if(we<=247){for(H=we-191,te=a(v,1,H);te.length;)xe=V(te),Le.push(xe.data),te=xe.remainder;return{data:Le,remainder:v.slice(H)}}else{if(F=we-246,H=ce(a(v,1,F)),H<56)throw new Error("invalid RLP: encoded list too short");const Oe=F+H;if(Oe>v.length)throw new Error("invalid RLP: total length is larger than the data");for(te=a(v,F,Oe);te.length;)xe=V(te),Le.push(xe.data),te=xe.remainder;return{data:Le,remainder:v.slice(Oe)}}}const C=Array.from({length:256},(v,H)=>H.toString(16).padStart(2,"0"));function be(v){let H="";for(let F=0;F<v.length;F++)H+=C[v[F]];return H}function Fe(v){const H=Number.parseInt(v,16);if(Number.isNaN(H))throw new Error("Invalid byte sequence");return H}function de(v){if(typeof v!="string")throw new TypeError("hexToBytes: expected string, got "+typeof v);if(v.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const H=new Uint8Array(v.length/2);for(let F=0;F<H.length;F++){const j=F*2;H[F]=Fe(v.slice(j,j+2))}return H}function ye(...v){if(v.length===1)return v[0];const H=v.reduce((j,te)=>j+te.length,0),F=new Uint8Array(H);for(let j=0,te=0;j<v.length;j++){const xe=v[j];F.set(xe,te),te+=xe.length}return F}function Re(v){return new TextEncoder().encode(v)}function _e(v){if(v<0)throw new Error("Invalid integer as argument, must be unsigned!");const H=v.toString(16);return H.length%2?`0${H}`:H}function je(v){return v.length%2?`0${v}`:v}function ke(v){return v.length>=2&&v[0]==="0"&&v[1]==="x"}function rt(v){return typeof v!="string"?v:ke(v)?v.slice(2):v}function Te(v){if(v instanceof Uint8Array)return v;if(typeof v=="string")return ke(v)?de(je(rt(v))):Re(v);if(typeof v=="number"||typeof v=="bigint")return v?de(_e(v)):Uint8Array.from([]);if(v==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof v)}const st={bytesToHex:be,concatBytes:ye,hexToBytes:de,utf8ToBytes:Re},Xe={encode:T,decode:P}},28856:function(xt,_,se){"use strict";se.d(_,{nL:function(){return mt}});var T=se(93996),a=se(82090);function ce(o){if(!Number.isSafeInteger(o)||o<0)throw new Error(`Wrong positive integer: ${o}`)}function G(o){if(typeof o!="boolean")throw new Error(`Expected boolean, not ${o}`)}function P(o,...t){if(!(o instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(o.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${o.length}`)}function V(o){if(typeof o!="function"||typeof o.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ce(o.outputLen),ce(o.blockLen)}function C(o,t=!0){if(o.destroyed)throw new Error("Hash instance has been destroyed");if(t&&o.finished)throw new Error("Hash#digest() has already been called")}function be(o,t){P(o);const s=t.outputLen;if(o.length<s)throw new Error(`digestInto() expects output buffer of length at least ${s}`)}var de={number:ce,bool:G,bytes:P,hash:V,exists:C,output:be};const ye=BigInt(2**32-1),Re=BigInt(32);function _e(o,t=!1){return t?{h:Number(o&ye),l:Number(o>>Re&ye)}:{h:Number(o>>Re&ye)|0,l:Number(o&ye)|0}}function je(o,t=!1){let s=new Uint32Array(o.length),x=new Uint32Array(o.length);for(let h=0;h<o.length;h++){const{h:l,l:p}=_e(o[h],t);[s[h],x[h]]=[l,p]}return[s,x]}const ke=(o,t)=>BigInt(o>>>0)<<Re|BigInt(t>>>0),rt=(o,t,s)=>o>>>s,Te=(o,t,s)=>o<<32-s|t>>>s,st=(o,t,s)=>o>>>s|t<<32-s,Xe=(o,t,s)=>o<<32-s|t>>>s,v=(o,t,s)=>o<<64-s|t>>>s-32,H=(o,t,s)=>o>>>s-32|t<<64-s,F=(o,t)=>t,j=(o,t)=>o,te=(o,t,s)=>o<<s|t>>>32-s,xe=(o,t,s)=>t<<s|o>>>32-s,Le=(o,t,s)=>t<<s-32|o>>>64-s,we=(o,t,s)=>o<<s-32|t>>>64-s;function Oe(o,t,s,x){const h=(t>>>0)+(x>>>0);return{h:o+s+(h/2**32|0)|0,l:h|0}}var w={fromBig:_e,split:je,toBig:ke,shrSH:rt,shrSL:Te,rotrSH:st,rotrSL:Xe,rotrBH:v,rotrBL:H,rotr32H:F,rotr32L:j,rotlSH:te,rotlSL:xe,rotlBH:Le,rotlBL:we,add:Oe,add3L:(o,t,s)=>(o>>>0)+(t>>>0)+(s>>>0),add3H:(o,t,s,x)=>t+s+x+(o/2**32|0)|0,add4L:(o,t,s,x)=>(o>>>0)+(t>>>0)+(s>>>0)+(x>>>0),add4H:(o,t,s,x,h)=>t+s+x+h+(o/2**32|0)|0,add5H:(o,t,s,x,h,l)=>t+s+x+h+l+(o/2**32|0)|0,add5L:(o,t,s,x,h)=>(o>>>0)+(t>>>0)+(s>>>0)+(x>>>0)+(h>>>0)};const I=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const S=o=>o instanceof Uint8Array,R=o=>new Uint8Array(o.buffer,o.byteOffset,o.byteLength),N=o=>new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)),Z=o=>new DataView(o.buffer,o.byteOffset,o.byteLength),z=(o,t)=>o<<32-t|o>>>t;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");const oe=Array.from({length:256},(o,t)=>t.toString(16).padStart(2,"0"));function vt(o){if(!S(o))throw new Error("Uint8Array expected");let t="";for(let s=0;s<o.length;s++)t+=oe[o[s]];return t}function Et(o){if(typeof o!="string")throw new Error("hex string expected, got "+typeof o);const t=o.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const s=new Uint8Array(t/2);for(let x=0;x<s.length;x++){const h=x*2,l=o.slice(h,h+2),p=Number.parseInt(l,16);if(Number.isNaN(p)||p<0)throw new Error("Invalid byte sequence");s[x]=p}return s}const Me=async()=>{};async function At(o,t,s){let x=Date.now();for(let h=0;h<o;h++){s(h);const l=Date.now()-x;l>=0&&l<t||(await Me(),x+=l)}}function Zt(o){if(typeof o!="string")throw new Error(`utf8ToBytes expected string, got ${typeof o}`);return new Uint8Array(new TextEncoder().encode(o))}function Ze(o){if(typeof o=="string"&&(o=Zt(o)),!S(o))throw new Error(`expected Uint8Array, got ${typeof o}`);return o}function Wt(...o){const t=new Uint8Array(o.reduce((x,h)=>x+h.length,0));let s=0;return o.forEach(x=>{if(!S(x))throw new Error("Uint8Array expected");t.set(x,s),s+=x.length}),t}class Se{clone(){return this._cloneInto()}}const Yt=o=>Object.prototype.toString.call(o)==="[object Object]"&&o.constructor===Object;function Ut(o,t){if(t!==void 0&&(typeof t!="object"||!Yt(t)))throw new Error("Options should be object or undefined");return Object.assign(o,t)}function Mt(o){const t=x=>o().update(Ze(x)).digest(),s=o();return t.outputLen=s.outputLen,t.blockLen=s.blockLen,t.create=()=>o(),t}function Qt(o){const t=(x,h)=>o(h).update(Ze(x)).digest(),s=o({});return t.outputLen=s.outputLen,t.blockLen=s.blockLen,t.create=x=>o(x),t}function It(o){const t=(x,h)=>o(h).update(Ze(x)).digest(),s=o({});return t.outputLen=s.outputLen,t.blockLen=s.blockLen,t.create=x=>o(x),t}function We(o=32){if(crypto&&typeof crypto.getRandomValues=="function")return crypto.getRandomValues(new Uint8Array(o));throw new Error("crypto.getRandomValues must be defined")}const[ue,Gt,k]=[[],[],[]],ht=BigInt(0),Ue=BigInt(1),he=BigInt(2),K=BigInt(7),Ge=BigInt(256),ne=BigInt(113);for(let o=0,t=Ue,s=1,x=0;o<24;o++){[s,x]=[x,(2*s+3*x)%5],ue.push(2*(5*x+s)),Gt.push((o+1)*(o+2)/2%64);let h=ht;for(let l=0;l<7;l++)t=(t<<Ue^(t>>K)*ne)%Ge,t&he&&(h^=Ue<<(Ue<<BigInt(l))-Ue);k.push(h)}const[Nt,lt]=w.split(k,!0),ot=(o,t,s)=>s>32?w.rotlBH(o,t,s):w.rotlSH(o,t,s),kt=(o,t,s)=>s>32?w.rotlBL(o,t,s):w.rotlSL(o,t,s);function Ae(o,t=24){const s=new Uint32Array(10);for(let x=24-t;x<24;x++){for(let p=0;p<10;p++)s[p]=o[p]^o[p+10]^o[p+20]^o[p+30]^o[p+40];for(let p=0;p<10;p+=2){const A=(p+8)%10,O=(p+2)%10,M=s[O],$=s[O+1],J=ot(M,$,1)^s[A],Q=kt(M,$,1)^s[A+1];for(let pe=0;pe<50;pe+=10)o[p+pe]^=J,o[p+pe+1]^=Q}let h=o[2],l=o[3];for(let p=0;p<24;p++){const A=Gt[p],O=ot(h,l,A),M=kt(h,l,A),$=ue[p];h=o[$],l=o[$+1],o[$]=O,o[$+1]=M}for(let p=0;p<50;p+=10){for(let A=0;A<10;A++)s[A]=o[p+A];for(let A=0;A<10;A++)o[p+A]^=~s[(A+2)%10]&s[(A+4)%10]}o[0]^=Nt[x],o[1]^=lt[x]}s.fill(0)}class m extends Se{constructor(t,s,x,h=!1,l=24){if(super(),this.blockLen=t,this.suffix=s,this.outputLen=x,this.enableXOF=h,this.rounds=l,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,de.number(x),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=N(this.state)}keccak(){Ae(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){de.exists(this);const{blockLen:s,state:x}=this;t=Ze(t);const h=t.length;for(let l=0;l<h;){const p=Math.min(s-this.pos,h-l);for(let A=0;A<p;A++)x[this.pos++]^=t[l++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:x,blockLen:h}=this;t[x]^=s,(s&128)!==0&&x===h-1&&this.keccak(),t[h-1]^=128,this.keccak()}writeInto(t){de.exists(this,!1),de.bytes(t),this.finish();const s=this.state,{blockLen:x}=this;for(let h=0,l=t.length;h<l;){this.posOut>=x&&this.keccak();const p=Math.min(x-this.posOut,l-h);t.set(s.subarray(this.posOut,this.posOut+p),h),this.posOut+=p,h+=p}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return de.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(de.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:s,suffix:x,outputLen:h,rounds:l,enableXOF:p}=this;return t||(t=new m(s,x,h,p,l)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=l,t.suffix=x,t.outputLen=h,t.enableXOF=p,t.destroyed=this.destroyed,t}}const d=(o,t,s)=>Mt(()=>new m(t,o,s)),f=d(6,144,224/8),c=d(6,136,256/8),E=d(6,104,384/8),L=d(6,72,512/8),W=d(1,144,224/8),fe=d(1,136,256/8),U=d(1,104,384/8),me=d(1,72,512/8),ve=(o,t,s)=>It((x={})=>new m(t,o,x.dkLen===void 0?s:x.dkLen,!0)),D=ve(31,168,128/8),Ce=ve(31,136,256/8),Ye=de.bool,it=de.bytes;function ge(o){if(!(o instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof o}`);return new TextDecoder().decode(o)}function at(o){const t=o.startsWith("0x")?o.substring(2):o;return _hexToBytes(t)}function Pt(o,t){if(o.length!==t.length)return!1;for(let s=0;s<o.length;s++)if(o[s]!==t[s])return!1;return!0}function bt(o){return t=>(de.bytes(t),o(t))}const Tt=(()=>{const o=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,t=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:t&&!o?t("crypto"):void 0,web:o}})(),zt=bt(W),Ie=(()=>{const o=bt(fe);return o.create=fe.create,o})(),re=bt(U),Ne=bt(me);var He=se(35742),le;(function(o){o[o.EIP155ReplayProtection=155]="EIP155ReplayProtection",o[o.EIP1559FeeMarket=1559]="EIP1559FeeMarket",o[o.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",o[o.EIP2930AccessLists=2930]="EIP2930AccessLists"})(le||(le={}));function x0(o){if(o.length===0)return!0;const t=o[0];return!!Array.isArray(t)}function u0(o){return!x0(o)}var Y;(function(o){o[o.Legacy=0]="Legacy",o[o.AccessListEIP2930=1]="AccessListEIP2930",o[o.FeeMarketEIP1559=2]="FeeMarketEIP1559",o[o.BlobEIP4844=3]="BlobEIP4844"})(Y||(Y={}));function Lt(o){return o.type===Y.Legacy}function $t(o){return o.type===Y.AccessListEIP2930}function e0(o){return o.type===Y.FeeMarketEIP1559}function h0(o){return o.type===Y.BlobEIP4844}function t0(o){return Number((0,a.v3)((0,a.O0)(o.type)))===Y.Legacy}function n0(o){return Number((0,a.v3)((0,a.O0)(o.type)))===Y.AccessListEIP2930}function r0(o){return Number((0,a.v3)((0,a.O0)(o.type)))===Y.FeeMarketEIP1559}function s0(o){return Number((0,a.v3)((0,a.O0)(o.type)))===Y.BlobEIP4844}function o0(o,t){const s=o.param("vm","maxInitCodeSize");if(s&&BigInt(t)>s)throw new Error(`the initcode size of this transaction is too large: it is ${t} while the max is ${o.param("vm","maxInitCodeSize")}`)}class De{static getAccessListData(t){let s,x;if(u0(t)){s=t;const h=[];for(let l=0;l<t.length;l++){const p=t[l],A=(0,a.nr)(p.address),O=[];for(let M=0;M<p.storageKeys.length;M++)O.push((0,a.nr)(p.storageKeys[M]));h.push([A,O])}x=h}else{x=t!=null?t:[];const h=[];for(let l=0;l<x.length;l++){const p=x[l],A=(0,a.ci)(p[0]),O=[];for(let $=0;$<p[1].length;$++)O.push((0,a.ci)(p[1][$]));const M={address:A,storageKeys:O};h.push(M)}s=h}return{AccessListJSON:s,accessList:x}}static verifyAccessList(t){for(let s=0;s<t.length;s++){const x=t[s],h=x[0],l=x[1];if(x[2]!==void 0)throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(h.length!==20)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(let p=0;p<l.length;p++)if(l[p].length!==32)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}}static getAccessListJSON(t){const s=[];for(let x=0;x<t.length;x++){const h=t[x],l={address:(0,a.ci)((0,a.V_)(h[0],20)),storageKeys:[]},p=h[1];for(let A=0;A<p.length;A++){const O=p[A];l.storageKeys.push((0,a.ci)((0,a.V_)(O,32)))}s.push(l)}return s}static getDataFeeEIP2930(t,s){const x=s.param("gasPrices","accessListStorageKeyCost"),h=s.param("gasPrices","accessListAddressCost");let l=0;for(let A=0;A<t.length;A++){const M=t[A][1];l+=M.length}return t.length*Number(h)+l*Number(x)}}class Ke{constructor(t,s){var Vt,jt;this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=He.qo.Mainnet;const{nonce:x,gasLimit:h,to:l,value:p,data:A,v:O,r:M,s:$,type:J}=t;this._type=Number((0,a.v3)((0,a.O0)(J))),this.txOptions=s;const Q=(0,a.O0)(l===""?"0x":l),pe=(0,a.O0)(O===""?"0x":O),Pe=(0,a.O0)(M===""?"0x":M),ie=(0,a.O0)($===""?"0x":$);this.nonce=(0,a.v3)((0,a.O0)(x===""?"0x":x)),this.gasLimit=(0,a.v3)((0,a.O0)(h===""?"0x":h)),this.to=Q.length>0?new a.kL(Q):void 0,this.value=(0,a.v3)((0,a.O0)(p===""?"0x":p)),this.data=(0,a.O0)(A===""?"0x":A),this.v=pe.length>0?(0,a.v3)(pe):void 0,this.r=Pe.length>0?(0,a.v3)(Pe):void 0,this.s=ie.length>0?(0,a.v3)(ie):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0);const tt=this.to===void 0||this.to===null,a0=(Vt=s.allowUnlimitedInitCodeSize)!=null?Vt:!1,Ot=(jt=s.common)!=null?jt:this._getCommon();tt&&Ot.isActivatedEIP(3860)&&a0===!1&&o0(Ot,this.data.length)}get type(){return this._type}supports(t){return this.activeCapabilities.includes(t)}getValidationErrors(){const t=[];return this.isSigned()&&!this.verifySignature()&&t.push("Invalid Signature"),this.getBaseFee()>this.gasLimit&&t.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`),t}isValid(){return this.getValidationErrors().length===0}_validateYParity(){const{v:t}=this;if(t!==void 0&&t!==BigInt(0)&&t!==BigInt(1)){const s=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(s)}}_validateHighS(){const{s:t}=this;if(this.common.gteHardfork("homestead")&&t!==void 0&&t>a.Sr){const s=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(s)}}getBaseFee(){const t=this.common.param("gasPrices","tx");let s=this.getDataFee();if(t&&(s+=t),this.common.gteHardfork("homestead")&&this.toCreationAddress()){const x=this.common.param("gasPrices","txCreation");x&&(s+=x)}return s}getDataFee(){const t=this.common.param("gasPrices","txDataZero"),s=this.common.param("gasPrices","txDataNonZero");let x=BigInt(0);for(let h=0;h<this.data.length;h++)this.data[h]===0?x+=t:x+=s;if((this.to===void 0||this.to===null)&&this.common.isActivatedEIP(3860)){const h=BigInt(Math.ceil(this.data.length/32)),l=this.common.param("gasPrices","initCodeWordCost")*h;x+=l}return x}toCreationAddress(){return this.to===void 0||this.to.bytes.length===0}isSigned(){const{v:t,r:s,s:x}=this;return!(t===void 0||s===void 0||x===void 0)}verifySignature(){try{const t=this.getSenderPublicKey();return(0,a._K)(t).length!==0}catch{return!1}}getSenderAddress(){return new a.kL((0,a.fB)(this.getSenderPublicKey()))}sign(t){if(t.length!==32){const O=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(O)}let s=!1;this.type===Y.Legacy&&this.common.gteHardfork("spuriousDragon")&&!this.supports(le.EIP155ReplayProtection)&&(this.activeCapabilities.push(le.EIP155ReplayProtection),s=!0);const x=this.getHashedMessageToSign(),{v:h,r:l,s:p}=(0,a.v4)(x,t),A=this._processSignature(h,l,p);if(s){const O=this.activeCapabilities.indexOf(le.EIP155ReplayProtection);O>-1&&this.activeCapabilities.splice(O,1)}return A}toJSON(){return{type:(0,a.Z4)(BigInt(this.type)),nonce:(0,a.Z4)(this.nonce),gasLimit:(0,a.Z4)(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:(0,a.Z4)(this.value),data:(0,a.ci)(this.data),v:this.v!==void 0?(0,a.Z4)(this.v):void 0,r:this.r!==void 0?(0,a.Z4)(this.r):void 0,s:this.s!==void 0?(0,a.Z4)(this.s):void 0}}_getCommon(t,s){var x;if(s!==void 0){const h=(0,a.v3)((0,a.O0)(s));if(t){if(t.chainId()!==h){const l=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(l)}return t.copy()}else return He.Gn.isSupportedChainId(h)?new He.Gn({chain:h}):He.Gn.custom({name:"custom-chain",networkId:h,chainId:h},{baseChain:this.DEFAULT_CHAIN})}else return(x=t==null?void 0:t.copy())!=null?x:new He.Gn({chain:this.DEFAULT_CHAIN})}_validateCannotExceedMaxInteger(t,s=256,x=!1){for(const[h,l]of Object.entries(t))switch(s){case 64:if(x){if(l!==void 0&&l>=a.np){const p=this._errorMsg(`${h} cannot equal or exceed MAX_UINT64 (2^64-1), given ${l}`);throw new Error(p)}}else if(l!==void 0&&l>a.np){const p=this._errorMsg(`${h} cannot exceed MAX_UINT64 (2^64-1), given ${l}`);throw new Error(p)}break;case 256:if(x){if(l!==void 0&&l>=a.E2){const p=this._errorMsg(`${h} cannot equal or exceed MAX_INTEGER (2^256-1), given ${l}`);throw new Error(p)}}else if(l!==void 0&&l>a.E2){const p=this._errorMsg(`${h} cannot exceed MAX_INTEGER (2^256-1), given ${l}`);throw new Error(p)}break;default:{const p=this._errorMsg("unimplemented bits value");throw new Error(p)}}}static _validateNotArray(t){const s=["nonce","gasPrice","gasLimit","to","value","data","v","r","s","type","baseFee","maxFeePerGas","chainId"];for(const[x,h]of Object.entries(t))if(s.includes(x)&&Array.isArray(h))throw new Error(`${x} cannot be an array`)}_getSharedErrorPostfix(){let t="";try{t=this.isSigned()?(0,a.ci)(this.hash()):"not available (unsigned)"}catch{t="error"}let s="";try{s=this.isSigned().toString()}catch{t="error"}let x="";try{x=this.common.hardfork()}catch{x="error"}let h=`tx type=${this.type} hash=${t} nonce=${this.nonce} value=${this.value} `;return h+=`signed=${s} hf=${x}`,h}}const Ht=(0,a.nr)("0x"+Y.FeeMarketEIP1559.toString(16).padStart(2,"0"));class Qe extends Ke{constructor(t,s={}){var M;super({...t,type:Y.FeeMarketEIP1559},s);const{chainId:x,accessList:h,maxFeePerGas:l,maxPriorityFeePerGas:p}=t;if(this.common=this._getCommon(s.common,x),this.chainId=this.common.chainId(),this.common.isActivatedEIP(1559)===!1)throw new Error("EIP-1559 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const A=De.getAccessListData(h!=null?h:[]);if(this.accessList=A.accessList,this.AccessListJSON=A.AccessListJSON,De.verifyAccessList(this.accessList),this.maxFeePerGas=(0,a.v3)((0,a.O0)(l===""?"0x":l)),this.maxPriorityFeePerGas=(0,a.v3)((0,a.O0)(p===""?"0x":p)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),Ke._validateNotArray(t),this.gasLimit*this.maxFeePerGas>a.E2){const $=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error($)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const $=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error($)}this._validateYParity(),this._validateHighS(),((M=s==null?void 0:s.freeze)!=null?M:!0)&&Object.freeze(this)}static fromTxData(t,s={}){return new Qe(t,s)}static fromSerializedTx(t,s={}){if((0,a.hD)(t.subarray(0,1),Ht)===!1)throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ${Y.FeeMarketEIP1559}, received: ${(0,a.ci)(t.subarray(0,1))}`);const x=T.yH.decode(t.subarray(1));if(!Array.isArray(x))throw new Error("Invalid serialized tx input: must be array");return Qe.fromValuesArray(x,s)}static fromValuesArray(t,s={}){if(t.length!==9&&t.length!==12)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");const[x,h,l,p,A,O,M,$,J,Q,pe,Pe]=t;return this._validateNotArray({chainId:x,v:Q}),(0,a.jY)({nonce:h,maxPriorityFeePerGas:l,maxFeePerGas:p,gasLimit:A,value:M,v:Q,r:pe,s:Pe}),new Qe({chainId:(0,a.v3)(x),nonce:h,maxPriorityFeePerGas:l,maxFeePerGas:p,gasLimit:A,to:O,value:M,data:$,accessList:J!=null?J:[],v:Q!==void 0?(0,a.v3)(Q):void 0,r:pe,s:Pe},s)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let t=super.getDataFee();return t+=BigInt(De.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t}getUpfrontCost(t=BigInt(0)){const s=this.maxPriorityFeePerGas,x=this.maxFeePerGas-t,l=(s<x?s:x)+t;return this.gasLimit*l+this.value}raw(){return[(0,a.XD)(this.chainId),(0,a.XD)(this.nonce),(0,a.XD)(this.maxPriorityFeePerGas),(0,a.XD)(this.maxFeePerGas),(0,a.XD)(this.gasLimit),this.to!==void 0?this.to.bytes:new Uint8Array(0),(0,a.XD)(this.value),this.data,this.accessList,this.v!==void 0?(0,a.XD)(this.v):new Uint8Array(0),this.r!==void 0?(0,a.XD)(this.r):new Uint8Array(0),this.s!==void 0?(0,a.XD)(this.s):new Uint8Array(0)]}serialize(){const t=this.raw();return(0,a.eV)(Ht,T.yH.encode(t))}getMessageToSign(){const t=this.raw().slice(0,9);return(0,a.eV)(Ht,T.yH.encode(t))}getHashedMessageToSign(){return Ie(this.getMessageToSign())}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Ie(this.serialize())),this.cache.hash):Ie(this.serialize())}getMessageToVerifySignature(){return this.getHashedMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const l=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(l)}const t=this.getMessageToVerifySignature(),{v:s,r:x,s:h}=this;this._validateHighS();try{return(0,a.Js)(t,s+BigInt(27),(0,a.XD)(x),(0,a.XD)(h))}catch{const p=this._errorMsg("Invalid Signature");throw new Error(p)}}_processSignature(t,s,x){const h={...this.txOptions,common:this.common};return Qe.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:t-BigInt(27),r:(0,a.v3)(s),s:(0,a.v3)(x)},h)}toJSON(){const t=De.getAccessListJSON(this.accessList);return{...super.toJSON(),chainId:(0,a.Z4)(this.chainId),maxPriorityFeePerGas:(0,a.Z4)(this.maxPriorityFeePerGas),maxFeePerGas:(0,a.Z4)(this.maxFeePerGas),accessList:t}}errorStr(){let t=this._getSharedErrorPostfix();return t+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}const _t=(0,a.nr)("0x"+Y.AccessListEIP2930.toString(16).padStart(2,"0"));class et extends Ke{constructor(t,s={}){var O;super({...t,type:Y.AccessListEIP2930},s);const{chainId:x,accessList:h,gasPrice:l}=t;if(this.common=this._getCommon(s.common,x),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);const p=De.getAccessListData(h!=null?h:[]);if(this.accessList=p.accessList,this.AccessListJSON=p.AccessListJSON,De.verifyAccessList(this.accessList),this.gasPrice=(0,a.v3)((0,a.O0)(l===""?"0x":l)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),Ke._validateNotArray(t),this.gasPrice*this.gasLimit>a.E2){const M=this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(M)}this._validateYParity(),this._validateHighS(),((O=s==null?void 0:s.freeze)!=null?O:!0)&&Object.freeze(this)}static fromTxData(t,s={}){return new et(t,s)}static fromSerializedTx(t,s={}){if((0,a.hD)(t.subarray(0,1),_t)===!1)throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ${Y.AccessListEIP2930}, received: ${(0,a.ci)(t.subarray(0,1))}`);const x=T.yH.decode(Uint8Array.from(t.subarray(1)));if(!Array.isArray(x))throw new Error("Invalid serialized tx input: must be array");return et.fromValuesArray(x,s)}static fromValuesArray(t,s={}){if(t.length!==8&&t.length!==11)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");const[x,h,l,p,A,O,M,$,J,Q,pe]=t;this._validateNotArray({chainId:x,v:J}),(0,a.jY)({nonce:h,gasPrice:l,gasLimit:p,value:O,v:J,r:Q,s:pe});const Pe=[];return new et({chainId:(0,a.v3)(x),nonce:h,gasPrice:l,gasLimit:p,to:A,value:O,data:M,accessList:$!=null?$:Pe,v:J!==void 0?(0,a.v3)(J):void 0,r:Q,s:pe},s)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let t=super.getDataFee();return t+=BigInt(De.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}raw(){return[(0,a.XD)(this.chainId),(0,a.XD)(this.nonce),(0,a.XD)(this.gasPrice),(0,a.XD)(this.gasLimit),this.to!==void 0?this.to.bytes:new Uint8Array(0),(0,a.XD)(this.value),this.data,this.accessList,this.v!==void 0?(0,a.XD)(this.v):new Uint8Array(0),this.r!==void 0?(0,a.XD)(this.r):new Uint8Array(0),this.s!==void 0?(0,a.XD)(this.s):new Uint8Array(0)]}serialize(){const t=this.raw();return(0,a.eV)(_t,T.yH.encode(t))}getMessageToSign(){const t=this.raw().slice(0,8);return(0,a.eV)(_t,T.yH.encode(t))}getHashedMessageToSign(){return Ie(this.getMessageToSign())}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Ie(this.serialize())),this.cache.hash):Ie(this.serialize())}getMessageToVerifySignature(){return this.getHashedMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const l=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(l)}const t=this.getMessageToVerifySignature(),{v:s,r:x,s:h}=this;this._validateHighS();try{return(0,a.Js)(t,s+BigInt(27),(0,a.XD)(x),(0,a.XD)(h))}catch{const p=this._errorMsg("Invalid Signature");throw new Error(p)}}_processSignature(t,s,x){const h={...this.txOptions,common:this.common};return et.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:t-BigInt(27),r:(0,a.v3)(s),s:(0,a.v3)(x)},h)}toJSON(){const t=De.getAccessListJSON(this.accessList);return{...super.toJSON(),chainId:(0,a.Z4)(this.chainId),gasPrice:(0,a.Z4)(this.gasPrice),accessList:t}}errorStr(){var s,x;let t=this._getSharedErrorPostfix();return t+=` gasPrice=${this.gasPrice} accessListCount=${(x=(s=this.accessList)==null?void 0:s.length)!=null?x:0}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}const l0=16777216,b0=16777216,m0=16777216,i0=16777216,T0=16777216,L0=4096,H0=32,Bt=(0,a.nr)("0x"+Y.BlobEIP4844.toString(16).padStart(2,"0")),g0=(o,t,s,x,h)=>{if(!(o.length===t.length&&t.length===s.length))throw new Error("Number of versionedHashes, blobs, and commitments not all equal");if(o.length===0)throw new Error("Invalid transaction with empty blobs");let l;try{l=a.V7.verifyBlobKzgProofBatch(t,s,x)}catch(p){throw new Error(`KZG verification of blobs fail with error=${p}`)}if(!l)throw new Error("KZG proof cannot be verified from blobs/commitments");for(let p=0;p<o.length;p++){const A=(0,a.h$)(s[p],h);if(!(0,a.hD)(A,o[p]))throw new Error(`commitment for blob at index ${p} does not match versionedHash`)}};class Ve extends Ke{constructor(t,s={}){var $,J,Q,pe,Pe;super({...t,type:Y.BlobEIP4844},s);const{chainId:x,accessList:h,maxFeePerGas:l,maxPriorityFeePerGas:p,maxFeePerBlobGas:A}=t;if(this.common=this._getCommon(s.common,x),this.chainId=this.common.chainId(),this.common.isActivatedEIP(1559)===!1)throw new Error("EIP-1559 not enabled on Common");if(this.common.isActivatedEIP(4844)===!1)throw new Error("EIP-4844 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const O=De.getAccessListData(h!=null?h:[]);if(this.accessList=O.accessList,this.AccessListJSON=O.AccessListJSON,De.verifyAccessList(this.accessList),this.maxFeePerGas=(0,a.v3)((0,a.O0)(l===""?"0x":l)),this.maxPriorityFeePerGas=(0,a.v3)((0,a.O0)(p===""?"0x":p)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),Ke._validateNotArray(t),this.gasLimit*this.maxFeePerGas>a.E2){const ie=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(ie)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const ie=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(ie)}this.maxFeePerBlobGas=(0,a.v3)((0,a.O0)((A!=null?A:"")===""?"0x":A)),this.versionedHashes=(($=t.versionedHashes)!=null?$:[]).map(ie=>(0,a.O0)(ie)),this._validateYParity(),this._validateHighS();for(const ie of this.versionedHashes){if(ie.length!==32){const tt=this._errorMsg("versioned hash is invalid length");throw new Error(tt)}if(BigInt(ie[0])!==this.common.paramByEIP("sharding","blobCommitmentVersionKzg",4844)){const tt=this._errorMsg("versioned hash does not start with KZG commitment version");throw new Error(tt)}}if(this.versionedHashes.length>i0){const ie=this._errorMsg(`tx can contain at most ${i0} blobs`);throw new Error(ie)}this.blobs=(J=t.blobs)==null?void 0:J.map(ie=>(0,a.O0)(ie)),this.kzgCommitments=(Q=t.kzgCommitments)==null?void 0:Q.map(ie=>(0,a.O0)(ie)),this.kzgProofs=(pe=t.kzgProofs)==null?void 0:pe.map(ie=>(0,a.O0)(ie)),((Pe=s==null?void 0:s.freeze)!=null?Pe:!0)&&Object.freeze(this)}static fromTxData(t,s){if(t.blobsData!==void 0){if(t.blobs!==void 0)throw new Error("cannot have both raw blobs data and encoded blobs in constructor");if(t.kzgCommitments!==void 0)throw new Error("cannot have both raw blobs data and KZG commitments in constructor");if(t.versionedHashes!==void 0)throw new Error("cannot have both raw blobs data and versioned hashes in constructor");if(t.kzgProofs!==void 0)throw new Error("cannot have both raw blobs data and KZG proofs in constructor");t.blobs=(0,a.KR)(t.blobsData.reduce((x,h)=>x+h)),t.kzgCommitments=(0,a.PS)(t.blobs),t.versionedHashes=(0,a.CW)(t.kzgCommitments),t.kzgProofs=(0,a.y9)(t.blobs,t.kzgCommitments)}return new Ve(t,s)}static minimalFromNetworkWrapper(t,s){return Ve.fromTxData({...t,blobs:void 0,kzgCommitments:void 0,kzgProofs:void 0},s)}static fromSerializedTx(t,s={}){if((0,a.hD)(t.subarray(0,1),Bt)===!1)throw new Error(`Invalid serialized tx input: not an EIP-4844 transaction (wrong tx type, expected: ${Y.BlobEIP4844}, received: ${(0,a.ci)(t.subarray(0,1))}`);const x=T.yH.decode(t.subarray(1));if(!Array.isArray(x))throw new Error("Invalid serialized tx input: must be array");return Ve.fromValuesArray(x,s)}static fromValuesArray(t,s={}){if(t.length!==11&&t.length!==14)throw new Error("Invalid EIP-4844 transaction. Only expecting 11 values (for unsigned tx) or 14 values (for signed tx).");const[x,h,l,p,A,O,M,$,J,Q,pe,Pe,ie,tt]=t;return this._validateNotArray({chainId:x,v:Pe}),(0,a.jY)({nonce:h,maxPriorityFeePerGas:l,maxFeePerGas:p,gasLimit:A,value:M,maxFeePerBlobGas:Q,v:Pe,r:ie,s:tt}),new Ve({chainId:(0,a.v3)(x),nonce:h,maxPriorityFeePerGas:l,maxFeePerGas:p,gasLimit:A,to:O,value:M,data:$,accessList:J!=null?J:[],maxFeePerBlobGas:Q,versionedHashes:pe,v:Pe!==void 0?(0,a.v3)(Pe):void 0,r:ie,s:tt},s)}static fromSerializedBlobTxNetworkWrapper(t,s){var J;if(!s||!s.common)throw new Error("common instance required to validate versioned hashes");if((0,a.hD)(t.subarray(0,1),Bt)===!1)throw new Error(`Invalid serialized tx input: not an EIP-4844 transaction (wrong tx type, expected: ${Y.BlobEIP4844}, received: ${(0,a.ci)(t.subarray(0,1))}`);const x=T.yH.decode(t.subarray(1));if(x.length!==4)throw Error("Expected 4 values in the deserialized network transaction");const[h,l,p,A]=x,O=Ve.fromValuesArray(h,{...s,freeze:!1});if(O.to===void 0)throw Error("BlobEIP4844Transaction can not be send without a valid `to`");const M=Number(s.common.paramByEIP("sharding","blobCommitmentVersionKzg",4844));return g0(O.versionedHashes,l,p,A,M),O.blobs=l,O.kzgCommitments=p,O.kzgProofs=A,((J=s==null?void 0:s.freeze)!=null?J:!0)&&Object.freeze(O),O}getUpfrontCost(t=BigInt(0)){const s=this.maxPriorityFeePerGas,x=this.maxFeePerGas-t,l=(s<x?s:x)+t;return this.gasLimit*l+this.value}raw(){return[(0,a.XD)(this.chainId),(0,a.XD)(this.nonce),(0,a.XD)(this.maxPriorityFeePerGas),(0,a.XD)(this.maxFeePerGas),(0,a.XD)(this.gasLimit),this.to!==void 0?this.to.bytes:new Uint8Array(0),(0,a.XD)(this.value),this.data,this.accessList,(0,a.XD)(this.maxFeePerBlobGas),this.versionedHashes,this.v!==void 0?(0,a.XD)(this.v):new Uint8Array(0),this.r!==void 0?(0,a.XD)(this.r):new Uint8Array(0),this.s!==void 0?(0,a.XD)(this.s):new Uint8Array(0)]}serialize(){const t=this.raw();return(0,a.eV)(Bt,T.yH.encode(t))}serializeNetworkWrapper(){if(this.blobs===void 0||this.kzgCommitments===void 0||this.kzgProofs===void 0)throw new Error("cannot serialize network wrapper without blobs, KZG commitments and KZG proofs provided");const t=this.raw();return(0,a.eV)(Bt,T.yH.encode([t,this.blobs,this.kzgCommitments,this.kzgProofs]))}getMessageToSign(){const t=this.raw().slice(0,11);return(0,a.eV)(Bt,T.yH.encode(t))}getHashedMessageToSign(){return Ie(this.getMessageToSign())}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Ie(this.serialize())),this.cache.hash):Ie(this.serialize())}getMessageToVerifySignature(){return this.getHashedMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const l=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(l)}const t=this.getMessageToVerifySignature(),{v:s,r:x,s:h}=this;this._validateHighS();try{return(0,a.Js)(t,s+BigInt(27),(0,a.XD)(x),(0,a.XD)(h))}catch{const p=this._errorMsg("Invalid Signature");throw new Error(p)}}toJSON(){const t=De.getAccessListJSON(this.accessList);return{...super.toJSON(),chainId:(0,a.Z4)(this.chainId),maxPriorityFeePerGas:(0,a.Z4)(this.maxPriorityFeePerGas),maxFeePerGas:(0,a.Z4)(this.maxFeePerGas),accessList:t,maxFeePerBlobGas:(0,a.Z4)(this.maxFeePerBlobGas),versionedHashes:this.versionedHashes.map(x=>(0,a.ci)(x))}}_processSignature(t,s,x){const h={...this.txOptions,common:this.common};return Ve.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:t-BigInt(27),r:(0,a.v3)(s),s:(0,a.v3)(x),maxFeePerBlobGas:this.maxFeePerBlobGas,versionedHashes:this.versionedHashes,blobs:this.blobs,kzgCommitments:this.kzgCommitments,kzgProofs:this.kzgProofs},h)}errorStr(){let t=this._getSharedErrorPostfix();return t+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}numBlobs(){return this.versionedHashes.length}}function ct(o,t){const s=Number(o),x=Number(t)*2;return s===x+35||s===x+36}class ze extends Ke{constructor(t,s={}){var h;if(super({...t,type:Y.Legacy},s),this.common=this._validateTxV(this.v,s.common),this.gasPrice=(0,a.v3)((0,a.O0)(t.gasPrice===""?"0x":t.gasPrice)),this.gasPrice*this.gasLimit>a.E2){const l=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(l)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),Ke._validateNotArray(t),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?ct(this.v,this.common.chainId())&&this.activeCapabilities.push(le.EIP155ReplayProtection):this.activeCapabilities.push(le.EIP155ReplayProtection)),((h=s==null?void 0:s.freeze)!=null?h:!0)&&Object.freeze(this)}static fromTxData(t,s={}){return new ze(t,s)}static fromSerializedTx(t,s={}){const x=T.yH.decode(t);if(!Array.isArray(x))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(x,s)}static fromValuesArray(t,s={}){if(t.length!==6&&t.length!==9)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");const[x,h,l,p,A,O,M,$,J]=t;return(0,a.jY)({nonce:x,gasPrice:h,gasLimit:l,value:A,v:M,r:$,s:J}),new ze({nonce:x,gasPrice:h,gasLimit:l,to:p,value:A,data:O,v:M,r:$,s:J},s)}raw(){return[(0,a.XD)(this.nonce),(0,a.XD)(this.gasPrice),(0,a.XD)(this.gasLimit),this.to!==void 0?this.to.bytes:new Uint8Array(0),(0,a.XD)(this.value),this.data,this.v!==void 0?(0,a.XD)(this.v):new Uint8Array(0),this.r!==void 0?(0,a.XD)(this.r):new Uint8Array(0),this.s!==void 0?(0,a.XD)(this.s):new Uint8Array(0)]}serialize(){return T.yH.encode(this.raw())}getMessageToSign(){const t=[(0,a.XD)(this.nonce),(0,a.XD)(this.gasPrice),(0,a.XD)(this.gasLimit),this.to!==void 0?this.to.bytes:new Uint8Array(0),(0,a.XD)(this.value),this.data];return this.supports(le.EIP155ReplayProtection)&&(t.push((0,a.XD)(this.common.chainId())),t.push((0,a._K)((0,a.O0)(0))),t.push((0,a._K)((0,a.O0)(0)))),t}getHashedMessageToSign(){const t=this.getMessageToSign();return Ie(T.yH.encode(t))}getDataFee(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:super.getDataFee(),hardfork:this.common.hardfork()}),super.getDataFee())}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Ie(T.yH.encode(this.raw()))),this.cache.hash):Ie(T.yH.encode(this.raw()))}getMessageToVerifySignature(){if(!this.isSigned()){const t=this._errorMsg("This transaction is not signed");throw new Error(t)}return this.getHashedMessageToSign()}getSenderPublicKey(){const t=this.getMessageToVerifySignature(),{v:s,r:x,s:h}=this;this._validateHighS();try{return(0,a.Js)(t,s,(0,a.XD)(x),(0,a.XD)(h),this.supports(le.EIP155ReplayProtection)?this.common.chainId():void 0)}catch{const p=this._errorMsg("Invalid Signature");throw new Error(p)}}_processSignature(t,s,x){this.supports(le.EIP155ReplayProtection)&&(t+=this.common.chainId()*BigInt(2)+BigInt(8));const h={...this.txOptions,common:this.common};return ze.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:t,r:(0,a.v3)(s),s:(0,a.v3)(x)},h)}toJSON(){return{...super.toJSON(),gasPrice:(0,a.Z4)(this.gasPrice)}}_validateTxV(t,s){let x;const h=t!==void 0?Number(t):void 0;if(h!==void 0&&h<37&&h!==27&&h!==28)throw new Error(`Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ${h}`);if(h!==void 0&&h!==0&&(!s||s.gteHardfork("spuriousDragon"))&&h!==27&&h!==28)if(s){if(!ct(BigInt(h),s.chainId()))throw new Error(`Incompatible EIP155-based V ${h} and chain id ${s.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.`)}else{let l;(h-35)%2===0?l=35:l=36,x=BigInt(h-l)/BigInt(2)}return this._getCommon(s,x)}errorStr(){let t=this._getSharedErrorPostfix();return t+=` gasPrice=${this.gasPrice}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}const Kt=o=>{var s;const t=Object.assign({},o);return t.gasLimit=(0,a.Fy)((s=t.gasLimit)!=null?s:t.gas,a.qT.BigInt),t.data=t.data===void 0?t.input:t.data,t.gasPrice=t.gasPrice!==void 0?BigInt(t.gasPrice):void 0,t.value=t.value!==void 0?BigInt(t.value):void 0,t.to=t.to!==null&&t.to!==void 0?(0,a.V_)((0,a.O0)(t.to),20):null,t.v=t.v==="0x0"?"0x":t.v,t.r=t.r==="0x0"?"0x":t.r,t.s=t.s==="0x0"?"0x":t.s,(t.v!=="0x"||t.r!=="0x"||t.s!=="0x")&&(t.v=(0,a.Fy)(t.v,a.qT.BigInt)),t};class mt{constructor(){}static fromTxData(t,s={}){if(!("type"in t)||t.type===void 0)return ze.fromTxData(t,s);if(t0(t))return ze.fromTxData(t,s);if(n0(t))return et.fromTxData(t,s);if(r0(t))return Qe.fromTxData(t,s);if(s0(t))return Ve.fromTxData(t,s);throw new Error(`Tx instantiation with type ${t==null?void 0:t.type} not supported`)}static fromSerializedData(t,s={}){if(t[0]<=127)switch(t[0]){case Y.AccessListEIP2930:return et.fromSerializedTx(t,s);case Y.FeeMarketEIP1559:return Qe.fromSerializedTx(t,s);case Y.BlobEIP4844:return Ve.fromSerializedTx(t,s);default:throw new Error(`TypedTransaction with ID ${t[0]} unknown`)}else return ze.fromSerializedTx(t,s)}static fromBlockBodyData(t,s={}){if(t instanceof Uint8Array)return this.fromSerializedData(t,s);if(Array.isArray(t))return ze.fromValuesArray(t,s);throw new Error("Cannot decode transaction: unknown type input")}static async fromJsonRpcProvider(t,s,x){const h=(0,a.VH)(t),l=await(0,a.Rb)(h,{method:"eth_getTransactionByHash",params:[s]});if(l===null)throw new Error("No data returned from provider");return mt.fromRPC(l,x)}static async fromRPC(t,s={}){return mt.fromTxData(Kt(t),s)}}},82090:function(xt,_,se){"use strict";se.d(_,{kL:function(){return nt},E2:function(){return Ye},np:function(){return Ce},Sr:function(){return at},qT:function(){return gt},Z4:function(){return W},XD:function(){return fe},PS:function(){return rn},y9:function(){return sn},v3:function(){return ue},ci:function(){return We},CW:function(){return on},h$:function(){return S0},eV:function(){return D},Js:function(){return N0},v4:function(){return G0},hD:function(){return S},Rb:function(){return an},KR:function(){return nn},VH:function(){return cn},nr:function(){return k},sO:function(){return Ue},I4:function(){return ht},Lo:function(){return Z},V7:function(){return Ft},fB:function(){return v0},V_:function(){return ne},MT:function(){return z},O0:function(){return m},Fy:function(){return M0},_K:function(){return ot},jY:function(){return L}});var T=se(60533);const a=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ce=e=>e instanceof Uint8Array,G=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),P=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),V=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),C=(e,n)=>e<<32-n|e>>>n;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");const Fe=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function de(e){if(!ce(e))throw new Error("Uint8Array expected");let n="";for(let r=0;r<e.length;r++)n+=Fe[e[r]];return n}function ye(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const n=e.length;if(n%2)throw new Error("padded hex string expected, got unpadded hex of length "+n);const r=new Uint8Array(n/2);for(let i=0;i<r.length;i++){const u=i*2,g=e.slice(u,u+2),y=Number.parseInt(g,16);if(Number.isNaN(y)||y<0)throw new Error("Invalid byte sequence");r[i]=y}return r}const Re=async()=>{};async function _e(e,n,r){let i=Date.now();for(let u=0;u<e;u++){r(u);const g=Date.now()-i;g>=0&&g<n||(await Re(),i+=g)}}function je(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function ke(e){if(typeof e=="string"&&(e=je(e)),!ce(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function rt(...e){const n=new Uint8Array(e.reduce((i,u)=>i+u.length,0));let r=0;return e.forEach(i=>{if(!ce(i))throw new Error("Uint8Array expected");n.set(i,r),r+=i.length}),n}class Te{clone(){return this._cloneInto()}}const st=e=>Object.prototype.toString.call(e)==="[object Object]"&&e.constructor===Object;function Xe(e,n){if(n!==void 0&&(typeof n!="object"||!st(n)))throw new Error("Options should be object or undefined");return Object.assign(e,n)}function v(e){const n=i=>e().update(ke(i)).digest(),r=e();return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=()=>e(),n}function H(e){const n=(i,u)=>e(u).update(ke(i)).digest(),r=e({});return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=i=>e(i),n}function F(e){const n=(i,u)=>e(u).update(ke(i)).digest(),r=e({});return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=i=>e(i),n}function j(e=32){if(crypto&&typeof crypto.getRandomValues=="function")return crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function te(e){return randomBytes(e)}async function xe(e){return randomBytes(e)}function Le(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function we(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function Oe(e,...n){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(n.length>0&&!n.includes(e.length))throw new Error(`Expected Uint8Array of length ${n}, not of length=${e.length}`)}function qe(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Le(e.outputLen),Le(e.blockLen)}function ut(e,n=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(n&&e.finished)throw new Error("Hash#digest() has already been called")}function Je(e,n){Oe(e);const r=n.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var Ee={number:Le,bool:we,bytes:Oe,hash:qe,exists:ut,output:Je};const wt=Ee.bool,b=Ee.bytes;function w(e){if(!(e instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof e}`);return new TextDecoder().decode(e)}function I(e){const n=e.startsWith("0x")?e.substring(2):e;return ye(n)}function S(e,n){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}function R(e){return n=>(Ee.bytes(n),e(n))}const N=(()=>{const e=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,n=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:n&&!e?n("crypto"):void 0,web:e}})();function Z(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e[0]==="0"&&e[1]==="x"}const z=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return Z(e)?e.slice(2):e};function q(e){let n=e;if(typeof n!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof n}`);return n.length%2&&(n=`0${n}`),n}function oe(e){if(typeof e!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof e}`);return utf8ToBytes(e).byteLength}function vt(e,n,r){if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(Array.isArray(n)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof n}'`);return n[r===!0?"some":"every"](i=>e.indexOf(i)>=0)}function Et(e){let n="",r=0;const i=e.length;for(e.substring(0,2)==="0x"&&(r=2);r<i;r+=2){const u=parseInt(e.substr(r,2),16);n+=String.fromCharCode(u)}return n}function Me(e){const n=utf8ToBytes(e);return`0x${q(bytesToHex(n)).replace(/^0+|0+$/g,"")}`}function At(e){let n="";for(let r=0;r<e.length;r++){const u=e.charCodeAt(r).toString(16);n+=u.length<2?`0${u}`:u}return`0x${n}`}function Zt(e,n,r){if(!Array.isArray(e))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof e}`);if(typeof n!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof e}`);const i=[];for(let u=0;u<e.length;u++){let g=e[u][n];if(r===!0&&!g)g="";else if(typeof g!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof g}`);i.push(g)}return i}function Ze(e,n){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof n<"u"&&n>0&&e.length!==2+2*n)}const Wt=function(e){if(!isHexString(e)){const n=`This method only supports 0x-prefixed hex strings but input was: ${e}`;throw new Error(n)}},Se=function(e){if(!(e instanceof Uint8Array)){const n=`This method only supports Uint8Array but input was: ${e}`;throw new Error(n)}},Yt=function(e){if(!Array.isArray(e)){const n=`This method only supports number arrays but input was: ${e}`;throw new Error(n)}},Ut=function(e){if(typeof e!="string"){const n=`This method only supports strings but input was: ${e}`;throw new Error(n)}},Mt=null,Qt=e=>{if(e.slice(0,2)==="0x")throw new Error("hex string is prefixed with 0x, should be unprefixed");return I(q(e))},It=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0")),We=e=>{let n="0x";if(e===void 0||e.length===0)return n;for(const r of e)n+=It[r];return n},ue=e=>{const n=We(e);return BigInt(n==="0x"?0:n)},Gt=e=>{const n=Number(ue(e));if(!Number.isSafeInteger(n))throw new Error("Number exceeds 53 bits");return n},k=e=>{if(typeof e!="string")throw new Error(`hex argument type ${typeof e} must be of type string`);if(!e.startsWith("0x"))throw new Error(`prefixed hex input should start with 0x, got ${e.substring(0,2)}`);e=e.slice(2),e.length%2!==0&&(e=q(e));const n=e.length/2,r=new Uint8Array(n);for(let i=0;i<n;i++){const u=parseInt(e.slice(i*2,(i+1)*2),16);r[i]=u}return r},ht=e=>{if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`},Ue=e=>{const n=ht(e);return k(n)},he=e=>m("0x"+q(e.toString(16))),K=e=>new Uint8Array(e),Ge=(e,n,r)=>r?e.length<n?new Uint8Array([...e,...K(n-e.length)]):e.subarray(0,n):e.length<n?new Uint8Array([...K(n-e.length),...e]):e.subarray(-n),ne=(e,n)=>(Se(e),Ge(e,n,!1)),Nt=(e,n)=>(assertIsBytes(e),Ge(e,n,!0)),lt=e=>{let n=e[0];for(;e.length>0&&n.toString()==="0";)e=e.slice(1),n=e[0];return e},ot=e=>(Se(e),lt(e)),kt=e=>(assertIsArray(e),lt(e)),Ae=e=>(assertIsHexString(e),e=stripHexPrefix(e),"0x"+lt(e)),m=e=>{if(e==null)return new Uint8Array;if(Array.isArray(e)||e instanceof Uint8Array)return Uint8Array.from(e);if(typeof e=="string"){if(!Ze(e))throw new Error(`Cannot convert string to Uint8Array. toBytes only supports 0x-prefixed hex strings and this string was given: ${e}`);return k(e)}if(typeof e=="number")return Ue(e);if(typeof e=="bigint"){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to Uint8Array. Given: ${e}`);let n=e.toString(16);return n.length%2&&(n="0"+n),Qt(n)}if(e.toBytes!==void 0)return e.toBytes();throw new Error("invalid type")},d=e=>BigInt.asIntN(256,ue(e)),f=e=>he(BigInt.asUintN(256,e)),c=e=>typeof e!="string"||isHexPrefixed(e)?e:"0x"+e,E=(e,n=50)=>{const r=e instanceof Uint8Array?We(e):e,i=r.slice(0,2)==="0x"?n+2:n;return r.length<=i?r:r.slice(0,i)+"\u2026"},L=e=>{for(const[n,r]of Object.entries(e))if(r!==void 0&&r.length>0&&r[0]===0)throw new Error(`${n} cannot have leading zeroes, received: ${We(r)}`)},W=e=>"0x"+e.toString(16),fe=e=>ot(he(e)),U=e=>ot(Ue(e)),me=(e,n)=>{const r=ue(e),i=ue(n);return r>i?1:r<i?-1:0},ve=e=>getRandomBytesSync(e),D=(...e)=>{if(e.length===1)return e[0];const n=e.reduce((i,u)=>i+u.length,0),r=new Uint8Array(n);for(let i=0,u=0;i<e.length;i++){const g=e[i];r.set(g,u),u+=g.length}return r},Ce=BigInt("0xffffffffffffffff"),Ye=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),it=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),ge=T.kA.CURVE.n,at=T.kA.CURVE.n/BigInt(2),Pt=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),Tt=k("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"),Ie=k("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"),Ne=k("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"),He=Uint8Array.from([128]),le=16,x0="0000000000000000000000000000000000000003",u0=BigInt(1e9);var Y=se(93996);const Lt=BigInt(2**32-1),$t=BigInt(32);function e0(e,n=!1){return n?{h:Number(e&Lt),l:Number(e>>$t&Lt)}:{h:Number(e>>$t&Lt)|0,l:Number(e&Lt)|0}}function h0(e,n=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let u=0;u<e.length;u++){const{h:g,l:y}=e0(e[u],n);[r[u],i[u]]=[g,y]}return[r,i]}const t0=(e,n)=>BigInt(e>>>0)<<$t|BigInt(n>>>0),n0=(e,n,r)=>e>>>r,r0=(e,n,r)=>e<<32-r|n>>>r,s0=(e,n,r)=>e>>>r|n<<32-r,o0=(e,n,r)=>e<<32-r|n>>>r,De=(e,n,r)=>e<<64-r|n>>>r-32,Ke=(e,n,r)=>e>>>r-32|n<<64-r,Ht=(e,n)=>n,Qe=(e,n)=>e,_t=(e,n,r)=>e<<r|n>>>32-r,et=(e,n,r)=>n<<r|e>>>32-r,l0=(e,n,r)=>n<<r-32|e>>>64-r,b0=(e,n,r)=>e<<r-32|n>>>64-r;function m0(e,n,r,i){const u=(n>>>0)+(i>>>0);return{h:e+r+(u/2**32|0)|0,l:u|0}}var ct={fromBig:e0,split:h0,toBig:t0,shrSH:n0,shrSL:r0,rotrSH:s0,rotrSL:o0,rotrBH:De,rotrBL:Ke,rotr32H:Ht,rotr32L:Qe,rotlSH:_t,rotlSL:et,rotlBH:l0,rotlBL:b0,add:m0,add3L:(e,n,r)=>(e>>>0)+(n>>>0)+(r>>>0),add3H:(e,n,r,i)=>n+r+i+(e/2**32|0)|0,add4L:(e,n,r,i)=>(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),add4H:(e,n,r,i,u)=>n+r+i+u+(e/2**32|0)|0,add5H:(e,n,r,i,u,g)=>n+r+i+u+g+(e/2**32|0)|0,add5L:(e,n,r,i,u)=>(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0)+(u>>>0)};const[ze,Kt,mt]=[[],[],[]],o=BigInt(0),t=BigInt(1),s=BigInt(2),x=BigInt(7),h=BigInt(256),l=BigInt(113);for(let e=0,n=t,r=1,i=0;e<24;e++){[r,i]=[i,(2*r+3*i)%5],ze.push(2*(5*i+r)),Kt.push((e+1)*(e+2)/2%64);let u=o;for(let g=0;g<7;g++)n=(n<<t^(n>>x)*l)%h,n&s&&(u^=t<<(t<<BigInt(g))-t);mt.push(u)}const[p,A]=ct.split(mt,!0),O=(e,n,r)=>r>32?ct.rotlBH(e,n,r):ct.rotlSH(e,n,r),M=(e,n,r)=>r>32?ct.rotlBL(e,n,r):ct.rotlSL(e,n,r);function $(e,n=24){const r=new Uint32Array(10);for(let i=24-n;i<24;i++){for(let y=0;y<10;y++)r[y]=e[y]^e[y+10]^e[y+20]^e[y+30]^e[y+40];for(let y=0;y<10;y+=2){const B=(y+8)%10,X=(y+2)%10,ae=r[X],Be=r[X+1],ee=O(ae,Be,1)^r[B],pt=M(ae,Be,1)^r[B+1];for(let $e=0;$e<50;$e+=10)e[y+$e]^=ee,e[y+$e+1]^=pt}let u=e[2],g=e[3];for(let y=0;y<24;y++){const B=Kt[y],X=O(u,g,B),ae=M(u,g,B),Be=ze[y];u=e[Be],g=e[Be+1],e[Be]=X,e[Be+1]=ae}for(let y=0;y<50;y+=10){for(let B=0;B<10;B++)r[B]=e[y+B];for(let B=0;B<10;B++)e[y+B]^=~r[(B+2)%10]&r[(B+4)%10]}e[0]^=p[i],e[1]^=A[i]}r.fill(0)}class J extends Te{constructor(n,r,i,u=!1,g=24){if(super(),this.blockLen=n,this.suffix=r,this.outputLen=i,this.enableXOF=u,this.rounds=g,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ee.number(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=P(this.state)}keccak(){$(this.state32,this.rounds),this.posOut=0,this.pos=0}update(n){Ee.exists(this);const{blockLen:r,state:i}=this;n=ke(n);const u=n.length;for(let g=0;g<u;){const y=Math.min(r-this.pos,u-g);for(let B=0;B<y;B++)i[this.pos++]^=n[g++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:n,suffix:r,pos:i,blockLen:u}=this;n[i]^=r,(r&128)!==0&&i===u-1&&this.keccak(),n[u-1]^=128,this.keccak()}writeInto(n){Ee.exists(this,!1),Ee.bytes(n),this.finish();const r=this.state,{blockLen:i}=this;for(let u=0,g=n.length;u<g;){this.posOut>=i&&this.keccak();const y=Math.min(i-this.posOut,g-u);n.set(r.subarray(this.posOut,this.posOut+y),u),this.posOut+=y,u+=y}return n}xofInto(n){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(n)}xof(n){return Ee.number(n),this.xofInto(new Uint8Array(n))}digestInto(n){if(Ee.output(n,this),this.finished)throw new Error("digest() was already called");return this.writeInto(n),this.destroy(),n}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(n){const{blockLen:r,suffix:i,outputLen:u,rounds:g,enableXOF:y}=this;return n||(n=new J(r,i,u,y,g)),n.state32.set(this.state32),n.pos=this.pos,n.posOut=this.posOut,n.finished=this.finished,n.rounds=g,n.suffix=i,n.outputLen=u,n.enableXOF=y,n.destroyed=this.destroyed,n}}const Q=(e,n,r)=>v(()=>new J(n,e,r)),pe=Q(6,144,224/8),Pe=Q(6,136,256/8),ie=Q(6,104,384/8),tt=Q(6,72,512/8),a0=Q(1,144,224/8),Ot=Q(1,136,256/8),Vt=Q(1,104,384/8),jt=Q(1,72,512/8),p0=(e,n,r)=>F((i={})=>new J(n,e,i.dkLen===void 0?r:i.dkLen,!0)),dn=p0(31,168,128/8),fn=p0(31,136,256/8),xn=R(a0),Ct=(()=>{const e=R(Ot);return e.create=Ot.create,e})(),un=R(Vt),hn=R(jt),St=BigInt(0);class c0{constructor(n=St,r=St,i=KECCAK256_RLP,u=KECCAK256_NULL){this.nonce=n,this.balance=r,this.storageRoot=i,this.codeHash=u,this._validate()}static fromAccountData(n){const{nonce:r,balance:i,storageRoot:u,codeHash:g}=n;return new c0(r!==void 0?bytesToBigInt(toBytes(r)):void 0,i!==void 0?bytesToBigInt(toBytes(i)):void 0,u!==void 0?toBytes(u):void 0,g!==void 0?toBytes(g):void 0)}static fromRlpSerializedAccount(n){const r=RLP.decode(n);if(!Array.isArray(r))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(r)}static fromValuesArray(n){const[r,i,u,g]=n;return new c0(bytesToBigInt(r),bytesToBigInt(i),u,g)}_validate(){if(this.nonce<St)throw new Error("nonce must be greater than zero");if(this.balance<St)throw new Error("balance must be greater than zero");if(this.storageRoot.length!==32)throw new Error("storageRoot must have a length of 32");if(this.codeHash.length!==32)throw new Error("codeHash must have a length of 32")}raw(){return[bigIntToUnpaddedBytes(this.nonce),bigIntToUnpaddedBytes(this.balance),this.storageRoot,this.codeHash]}serialize(){return RLP.encode(this.raw())}isContract(){return!equalsBytes(this.codeHash,KECCAK256_NULL)}isEmpty(){return this.balance===St&&this.nonce===St&&equalsBytes(this.codeHash,KECCAK256_NULL)}}const y0=function(e){try{Ut(e)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)},_0=function(e,n){assertIsHexString(e);const r=stripHexPrefix(e).toLowerCase();let i="";n!==void 0&&(i=bytesToBigInt(toBytes(n)).toString()+"0x");const u=utf8ToBytes(i+r),g=bytesToHex(keccak256(u)).slice(2);let y="0x";for(let B=0;B<r.length;B++)parseInt(g[B],16)>=8?y+=r[B].toUpperCase():y+=r[B];return y},ln=function(e,n){return y0(e)&&_0(e,n)===e},O0=function(e,n){return Se(e),Se(n),ue(n)===BigInt(0)?Ct(Y.yH.encode([e,Uint8Array.from([])])).subarray(-20):Ct(Y.yH.encode([e,n])).subarray(-20)},C0=function(e,n,r){if(Se(e),Se(n),Se(r),e.length!==20)throw new Error("Expected from to be of length 20");if(n.length!==32)throw new Error("Expected salt to be of length 32");return Ct(D(k("0xff"),e,n,Ct(r))).subarray(-20)},bn=function(e){return secp256k1.utils.isValidPrivateKey(e)},mn=function(e,n=!1){if(assertIsBytes(e),e.length===64)try{return secp256k1.ProjectivePoint.fromHex(concatBytes(Uint8Array.from([4]),e)),!0}catch{return!1}if(!n)return!1;try{return secp256k1.ProjectivePoint.fromHex(e),!0}catch{return!1}},w0=function(e,n=!1){if(Se(e),n&&e.length!==64&&(e=T.kA.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1)),e.length!==64)throw new Error("Expected pubKey to be of length 64");return Ct(e).subarray(-20)},v0=w0,D0=function(e){return Se(e),T.kA.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1)},F0=function(e){return v0(D0(e))},gn=function(e){return assertIsBytes(e),e.length!==64&&(e=secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1)),e},R0=function(){const n=zeros(20);return bytesToHex(n)},pn=function(e){try{assertIsString(e)}catch{return!1}return R0()===e};function U0(e){const[n,r,i,u]=e;return[n,r,i.length===0?KECCAK256_RLP:i,u.length===0?KECCAK256_NULL:u]}const E0=new Uint8Array(0);function yn(e){const[n,r,i,u]=e;return[n,r,equalsBytes(i,KECCAK256_RLP)?E0:i,equalsBytes(u,KECCAK256_NULL)?E0:u]}function wn(e,n=!0){const r=n?U0(e):e;return RLP.encode(r)}class nt{constructor(n){if(n.length!==20)throw new Error("Invalid address length");this.bytes=n}static zero(){return new nt(K(20))}static fromString(n){if(!y0(n))throw new Error("Invalid address");return new nt(m(n))}static fromPublicKey(n){if(!(n instanceof Uint8Array))throw new Error("Public key should be Uint8Array");const r=w0(n);return new nt(r)}static fromPrivateKey(n){if(!(n instanceof Uint8Array))throw new Error("Private key should be Uint8Array");const r=F0(n);return new nt(r)}static generate(n,r){if(typeof r!="bigint")throw new Error("Expected nonce to be a bigint");return new nt(O0(n.bytes,he(r)))}static generate2(n,r,i){if(!(r instanceof Uint8Array))throw new Error("Expected salt to be a Uint8Array");if(!(i instanceof Uint8Array))throw new Error("Expected initCode to be a Uint8Array");return new nt(C0(n.bytes,r,i))}equals(n){return S(this.bytes,n.bytes)}isZero(){return this.equals(nt.zero())}isPrecompileOrSystemAddress(){const n=ue(this.bytes),r=BigInt(0),i=BigInt("0xffff");return n>=r&&n<=i}toString(){return We(this.bytes)}toBytes(){return new Uint8Array(this.bytes)}}var I0;(function(e){e.String="string",e.Bytes="view",e.Number="number"})(I0||(I0={}));var P0;(function(e){e.String="string",e.Bytes="view",e.JSON="json"})(P0||(P0={}));var gt;(function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Uint8Array=2]="Uint8Array",e[e.PrefixedHexString=3]="PrefixedHexString"})(gt||(gt={}));function M0(e,n){if(e===null)return null;if(e===void 0)return;if(typeof e=="string"&&!Ze(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if(typeof e=="number"&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const r=m(e);switch(n){case gt.Uint8Array:return r;case gt.BigInt:return ue(r);case gt.Number:{const i=ue(r);if(i>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(i)}case gt.PrefixedHexString:return We(r);default:throw new Error("unknown outputType")}}class Xt{constructor(n,r,i,u){this.index=n,this.validatorIndex=r,this.address=i,this.amount=u}static fromWithdrawalData(n){const{index:r,validatorIndex:i,address:u,amount:g}=n,y=toType(r,TypeOutput.BigInt),B=toType(i,TypeOutput.BigInt),X=u instanceof Address?u:new Address(toBytes(u)),ae=toType(g,TypeOutput.BigInt);return new Xt(y,B,X,ae)}static fromValuesArray(n){if(n.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${n.length}`);const[r,i,u,g]=n;return Xt.fromWithdrawalData({index:r,validatorIndex:i,address:u,amount:g})}static toBytesArray(n){const{index:r,validatorIndex:i,address:u,amount:g}=n,y=toType(r,TypeOutput.BigInt)===BigInt(0)?new Uint8Array:toType(r,TypeOutput.Uint8Array),B=toType(i,TypeOutput.BigInt)===BigInt(0)?new Uint8Array:toType(i,TypeOutput.Uint8Array),X=u instanceof Address?u.bytes:toType(u,TypeOutput.Uint8Array),ae=toType(g,TypeOutput.BigInt)===BigInt(0)?new Uint8Array:toType(g,TypeOutput.Uint8Array);return[y,B,X,ae]}raw(){return Xt.toBytesArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.bytes,amount:this.amount}}toJSON(){return{index:bigIntToHex(this.index),validatorIndex:bigIntToHex(this.validatorIndex),address:bytesToHex(this.address.bytes),amount:bigIntToHex(this.amount)}}}function G0(e,n,r){const i=T.kA.sign(e,n),u=i.toCompactRawBytes(),g=u.slice(0,32),y=u.slice(32,64),B=r===void 0?BigInt(i.recovery+27):BigInt(i.recovery+35)+BigInt(r)*BigInt(2);return{r:g,s:y,v:B}}function qt(e,n){return e===BigInt(0)||e===BigInt(1)?e:n===void 0?e-BigInt(27):e-(n*BigInt(2)+BigInt(35))}function Jt(e){return e===BigInt(0)||e===BigInt(1)}const N0=function(e,n,r,i,u){const g=D(ne(r,32),ne(i,32)),y=qt(n,u);if(!Jt(y))throw new Error("Invalid signature v value");return T.kA.Signature.fromCompact(g).addRecoveryBit(Number(y)).recoverPublicKey(e).toRawBytes(!1).slice(1)},vn=function(e,n,r,i){const u=qt(e,i);if(!Jt(u))throw new Error("Invalid signature v value");return bytesToHex(concatBytes(setLengthLeft(n,32),setLengthLeft(r,32),toBytes(e)))},En=function(e,n,r,i){const u=qt(e,i);if(!Jt(u))throw new Error("Invalid signature v value");const g=Uint8Array.from([...r]);return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(g[0]|=128),bytesToHex(concatBytes(setLengthLeft(n,32),setLengthLeft(g,32)))},In=function(e){const n=toBytes(e);let r,i,u;if(n.length>=65)r=n.subarray(0,32),i=n.subarray(32,64),u=bytesToBigInt(n.subarray(64));else if(n.length===64)r=n.subarray(0,32),i=n.subarray(32,64),u=BigInt(bytesToInt(n.subarray(32,33))>>7),i[0]&=127;else throw new Error("Invalid signature length");return u<27&&(u=u+BigInt(27)),{v:u,r,s:i}},Pn=function(e,n,r,i=!0,u){if(n.length!==32||r.length!==32||!Jt(qt(e,u)))return!1;const g=bytesToBigInt(n),y=bytesToBigInt(r);return!(g===BigInt(0)||g>=SECP256K1_ORDER||y===BigInt(0)||y>=SECP256K1_ORDER||i&&y>=SECP256K1_ORDER_DIV_2)},Bn=function(e){assertIsBytes(e);const n=utf8ToBytes(`Ethereum Signed Message:
2
- ${e.length}`);return keccak256(concatBytes(n,e))};var Sn=se(17187);async function z0(e,n,r){let i;for await(const u of n)try{u.length<2?u.call(e,r):await new Promise((g,y)=>{u.call(e,r,B=>{B?y(B):g()})})}catch(g){i=g}if(i)throw i}class An extends null{emit(n,...r){var B;let[i,u]=r;const g=this;let y=(B=g._events[n])!=null?B:[];return u===void 0&&typeof i=="function"&&(u=i,i=void 0),(n==="newListener"||n==="removeListener")&&(i={event:i,fn:u},u=void 0),y=Array.isArray(y)?y:[y],z0(g,y.slice(),i).then(u).catch(u),g.listenerCount(n)>0}once(n,r){const i=this;let u;if(typeof r!="function")throw new TypeError("listener must be a function");return r.length>=2?u=function(g,y){i.removeListener(n,u),r(g,y)}:u=function(g){i.removeListener(n,u),r(g,u)},i.on(n,u),i}first(n,r){var u;let i=(u=this._events[n])!=null?u:[];if(typeof r!="function")throw new TypeError("listener must be a function");return Array.isArray(i)||(this._events[n]=i=[i]),i.unshift(r),this}before(n,r,i){return this.beforeOrAfter(n,r,i)}after(n,r,i){return this.beforeOrAfter(n,r,i,"after")}beforeOrAfter(n,r,i,u){var ae;let g=(ae=this._events[n])!=null?ae:[],y,B;const X=u==="after"?1:0;if(typeof i!="function")throw new TypeError("listener must be a function");if(typeof r!="function")throw new TypeError("target must be a function");for(Array.isArray(g)||(this._events[n]=g=[g]),B=g.length,y=g.length;y--;)if(g[y]===r){B=y+X;break}return g.splice(B,0,i),this}on(n,r){return super.on(n,r)}addListener(n,r){return super.addListener(n,r)}prependListener(n,r){return super.prependListener(n,r)}prependOnceListener(n,r){return super.prependOnceListener(n,r)}removeAllListeners(n){return super.removeAllListeners(n)}removeListener(n,r){return super.removeListener(n,r)}eventNames(){return super.eventNames()}listeners(n){return super.listeners(n)}listenerCount(n){return super.listenerCount(n)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(n){return super.setMaxListeners(n)}}function $0(e,n,r,i){if(typeof e.setBigUint64=="function")return e.setBigUint64(n,r,i);const u=BigInt(32),g=BigInt(4294967295),y=Number(r>>u&g),B=Number(r&g),X=i?4:0,ae=i?0:4;e.setUint32(n+X,y,i),e.setUint32(n+ae,B,i)}class K0 extends Te{constructor(n,r,i,u){super(),this.blockLen=n,this.outputLen=r,this.padOffset=i,this.isLE=u,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(n),this.view=V(this.buffer)}update(n){Ee.exists(this);const{view:r,buffer:i,blockLen:u}=this;n=ke(n);const g=n.length;for(let y=0;y<g;){const B=Math.min(u-this.pos,g-y);if(B===u){const X=V(n);for(;u<=g-y;y+=u)this.process(X,y);continue}i.set(n.subarray(y,y+B),this.pos),this.pos+=B,y+=B,this.pos===u&&(this.process(r,0),this.pos=0)}return this.length+=n.length,this.roundClean(),this}digestInto(n){Ee.exists(this),Ee.output(n,this),this.finished=!0;const{buffer:r,view:i,blockLen:u,isLE:g}=this;let{pos:y}=this;r[y++]=128,this.buffer.subarray(y).fill(0),this.padOffset>u-y&&(this.process(i,0),y=0);for(let ee=y;ee<u;ee++)r[ee]=0;$0(i,u-8,BigInt(this.length*8),g),this.process(i,0);const B=V(n),X=this.outputLen;if(X%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const ae=X/4,Be=this.get();if(ae>Be.length)throw new Error("_sha2: outputLen bigger than state");for(let ee=0;ee<ae;ee++)B.setUint32(4*ee,Be[ee],g)}digest(){const{buffer:n,outputLen:r}=this;this.digestInto(n);const i=n.slice(0,r);return this.destroy(),i}_cloneInto(n){n||(n=new this.constructor),n.set(...this.get());const{blockLen:r,buffer:i,length:u,finished:g,destroyed:y,pos:B}=this;return n.length=u,n.pos=B,n.finished=g,n.destroyed=y,u%r&&n.buffer.set(i),n}}const V0=(e,n,r)=>e&n^~e&r,j0=(e,n,r)=>e&n^e&r^n&r,X0=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),dt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ft=new Uint32Array(64);class B0 extends K0{constructor(){super(64,32,8,!1),this.A=dt[0]|0,this.B=dt[1]|0,this.C=dt[2]|0,this.D=dt[3]|0,this.E=dt[4]|0,this.F=dt[5]|0,this.G=dt[6]|0,this.H=dt[7]|0}get(){const{A:n,B:r,C:i,D:u,E:g,F:y,G:B,H:X}=this;return[n,r,i,u,g,y,B,X]}set(n,r,i,u,g,y,B,X){this.A=n|0,this.B=r|0,this.C=i|0,this.D=u|0,this.E=g|0,this.F=y|0,this.G=B|0,this.H=X|0}process(n,r){for(let ee=0;ee<16;ee++,r+=4)ft[ee]=n.getUint32(r,!1);for(let ee=16;ee<64;ee++){const pt=ft[ee-15],$e=ft[ee-2],k0=C(pt,7)^C(pt,18)^pt>>>3,f0=C($e,17)^C($e,19)^$e>>>10;ft[ee]=f0+ft[ee-7]+k0+ft[ee-16]|0}let{A:i,B:u,C:g,D:y,E:B,F:X,G:ae,H:Be}=this;for(let ee=0;ee<64;ee++){const pt=C(B,6)^C(B,11)^C(B,25),$e=Be+pt+V0(B,X,ae)+X0[ee]+ft[ee]|0,f0=(C(i,2)^C(i,13)^C(i,22))+j0(i,u,g)|0;Be=ae,ae=X,X=B,B=y+$e|0,y=g,g=u,u=i,i=$e+f0|0}i=i+this.A|0,u=u+this.B|0,g=g+this.C|0,y=y+this.D|0,B=B+this.E|0,X=X+this.F|0,ae=ae+this.G|0,Be=Be+this.H|0,this.set(i,u,g,y,B,X,ae,Be)}roundClean(){ft.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class q0 extends B0{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const J0=v(()=>new B0),kn=v(()=>new q0),Z0=R(J0);function Dt(){throw Error("kzg library not loaded")}let Ft={loadTrustedSetup:Dt,blobToKzgCommitment:Dt,computeBlobKzgProof:Dt,verifyKzgProof:Dt,verifyBlobKzgProofBatch:Dt};function Tn(e,n){Ft=e,Ft.loadTrustedSetup(n)}const W0=32,d0=4096,Rt=32*d0,Y0=Rt*2-1,Q0=W0*d0;function en(e,n){const r=new Uint8Array(n*Rt).fill(0);return r.set(e),r[e.byteLength]=128,r}function tn(e){const n=new Uint8Array(Q0);for(let r=0;r<d0;r++){const i=new Uint8Array(32);i.set(e.subarray(r*31,(r+1)*31),0),n.set(i,r*32)}return n}const nn=e=>{const n=je(e),r=n.byteLength;if(r===0)throw Error("invalid blob data");if(r>Y0)throw Error("blob data is too large");const i=Math.ceil(r/Rt),u=en(n,i),g=[];for(let y=0;y<i;y++){const B=u.subarray(y*Rt,(y+1)*Rt),X=tn(B);g.push(X)}return g},rn=e=>{const n=[];for(const r of e)n.push(Ft.blobToKzgCommitment(r));return n},sn=(e,n)=>e.map((i,u)=>Ft.computeBlobKzgProof(i,n[u])),S0=(e,n)=>{const r=new Uint8Array(32);return r.set([n],0),r.set(Z0(e).subarray(1),1),r},on=e=>{const n=[];for(const r of e)n.push(S0(r,1));return n};function Hn(e){const n={};for(let r of Object.keys(e.alloc)){let{balance:i,code:u,storage:g,nonce:y}=e.alloc[r];r=addHexPrefix(r),i=isHexPrefixed(i)?i:bigIntToHex(BigInt(i)),u=u!==void 0?addHexPrefix(u):void 0,g=g!==void 0?Object.entries(g):void 0,y=y!==void 0?addHexPrefix(y):void 0,n[r]=[i,u,g,y]}return n}class A0{constructor(n){this._database=n!=null?n:new Map}async get(n){const r=n instanceof Uint8Array?bytesToUnprefixedHex(n):n.toString();return this._database.get(r)}async put(n,r){const i=n instanceof Uint8Array?bytesToUnprefixedHex(n):n.toString();this._database.set(i,r)}async del(n){const r=n instanceof Uint8Array?bytesToUnprefixedHex(n):n.toString();this._database.delete(r)}async batch(n){for(const r of n)r.type==="del"&&await this.del(r.key),r.type==="put"&&await this.put(r.key,r.value)}shallowCopy(){return new A0(this._database)}open(){return Promise.resolve()}}const an=async(e,n)=>{const r=JSON.stringify({method:n.method,params:n.params,jsonrpc:"2.0",id:1});return(await(await fetch(e,{headers:{"content-type":"application/json"},method:"POST",body:r})).json()).result},cn=e=>{if(typeof e=="string")return e;if(typeof e=="object"&&e._getConnection!==void 0)return e._getConnection().url;throw new Error("Must provide valid provider URL or Web3Provider")}}}]);
1
+ (self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[2784],{50144:function(rn,j,Se){"use strict";var F=Se(48764).Buffer,d=this&&this.__createBinding||(Object.create?function(v,S,k,O){O===void 0&&(O=k),Object.defineProperty(v,O,{enumerable:!0,get:function(){return S[k]}})}:function(v,S,k,O){O===void 0&&(O=k),v[O]=S[k]}),Me=this&&this.__setModuleDefault||(Object.create?function(v,S){Object.defineProperty(v,"default",{enumerable:!0,value:S})}:function(v,S){v.default=S}),re=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var S={};if(v!=null)for(var k in v)k!=="default"&&Object.prototype.hasOwnProperty.call(v,k)&&d(S,v,k);return Me(S,v),S};Object.defineProperty(j,"__esModule",{value:!0}),j.recoverTypedSignature_v4=j.recoverTypedSignature=j.signTypedData_v4=j.signTypedData=j.recoverTypedMessage=j.signTypedMessage=j.getEncryptionPublicKey=j.decryptSafely=j.decrypt=j.encryptSafely=j.encrypt=j.recoverTypedSignatureLegacy=j.signTypedDataLegacy=j.typedSignatureHash=j.extractPublicKey=j.recoverPersonalSignature=j.personalSign=j.normalize=j.concatSig=j.TypedDataUtils=j.TYPED_MESSAGE_SCHEMA=void 0;const H=re(Se(21964)),he=re(Se(68142)),de=re(Se(50780)),$e=re(Se(16885)),je={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"]};j.TYPED_MESSAGE_SCHEMA=je;const Ae={encodeData(v,S,k,O=!0){const ae=["bytes32"],se=[this.hashType(v,k)];if(O){const me=(xe,pe,ye)=>{if(k[pe]!==void 0)return["bytes32",ye==null?"0x0000000000000000000000000000000000000000000000000000000000000000":H.keccak(this.encodeData(pe,ye,k,O))];if(ye===void 0)throw new Error(`missing value for field ${xe} of type ${pe}`);if(pe==="bytes")return["bytes32",H.keccak(ye)];if(pe==="string")return typeof ye=="string"&&(ye=F.from(ye,"utf8")),["bytes32",H.keccak(ye)];if(pe.lastIndexOf("]")===pe.length-1){const cn=pe.slice(0,pe.lastIndexOf("[")),Bt=ye.map(dt=>me(xe,cn,dt));return["bytes32",H.keccak(he.rawEncode(Bt.map(([dt])=>dt),Bt.map(([,dt])=>dt)))]}return[pe,ye]};for(const xe of k[v]){const[pe,ye]=me(xe.name,xe.type,S[xe.name]);ae.push(pe),se.push(ye)}}else for(const me of k[v]){let xe=S[me.name];if(xe!==void 0)if(me.type==="bytes")ae.push("bytes32"),xe=H.keccak(xe),se.push(xe);else if(me.type==="string")ae.push("bytes32"),typeof xe=="string"&&(xe=F.from(xe,"utf8")),xe=H.keccak(xe),se.push(xe);else if(k[me.type]!==void 0)ae.push("bytes32"),xe=H.keccak(this.encodeData(me.type,xe,k,O)),se.push(xe);else{if(me.type.lastIndexOf("]")===me.type.length-1)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");ae.push(me.type),se.push(xe)}}return he.rawEncode(ae,se)},encodeType(v,S){let k="",O=this.findTypeDependencies(v,S).filter(ae=>ae!==v);O=[v].concat(O.sort());for(const ae of O){if(!S[ae])throw new Error(`No type definition specified: ${ae}`);k+=`${ae}(${S[ae].map(({name:me,type:xe})=>`${xe} ${me}`).join(",")})`}return k},findTypeDependencies(v,S,k=[]){if([v]=v.match(/^\w*/u),k.includes(v)||S[v]===void 0)return k;k.push(v);for(const O of S[v])for(const ae of this.findTypeDependencies(O.type,S,k))!k.includes(ae)&&k.push(ae);return k},hashStruct(v,S,k,O=!0){return H.keccak(this.encodeData(v,S,k,O))},hashType(v,S){return H.keccak(this.encodeType(v,S))},sanitizeData(v){const S={};for(const k in je.properties)v[k]&&(S[k]=v[k]);return"types"in S&&(S.types=Object.assign({EIP712Domain:[]},S.types)),S},sign(v,S=!0){const k=this.sanitizeData(v),O=[F.from("1901","hex")];return O.push(this.hashStruct("EIP712Domain",k.domain,k.types,S)),k.primaryType!=="EIP712Domain"&&O.push(this.hashStruct(k.primaryType,k.message,k.types,S)),H.keccak(F.concat(O))}};j.TypedDataUtils=Ae;function Ge(v,S,k){const O=H.fromSigned(S),ae=H.fromSigned(k),se=H.bufferToInt(v),me=ln(H.toUnsigned(O).toString("hex"),64),xe=ln(H.toUnsigned(ae).toString("hex"),64),pe=H.stripHexPrefix(H.intToHex(se));return H.addHexPrefix(me.concat(xe,pe)).toString("hex")}j.concatSig=Ge;function pt(v){if(!!v){if(typeof v=="number"){const S=H.toBuffer(v);v=H.bufferToHex(S)}if(typeof v!="string"){let S="eth-sig-util.normalize() requires hex string or integer input.";throw S+=` received ${typeof v}: ${v}`,new Error(S)}return H.addHexPrefix(v.toLowerCase())}}j.normalize=pt;function et(v,S){const k=H.toBuffer(S.data),O=H.hashPersonalMessage(k),ae=H.ecsign(O,v);return H.bufferToHex(Ge(ae.v,ae.r,ae.s))}j.personalSign=et;function vt(v){const S=on(v),k=H.publicToAddress(S);return H.bufferToHex(k)}j.recoverPersonalSignature=vt;function qe(v){return`0x${on(v).toString("hex")}`}j.extractPublicKey=qe;function $t(v){const S=hn(v);return H.bufferToHex(S)}j.typedSignatureHash=$t;function tt(v,S){const k=hn(S.data),O=H.ecsign(k,v);return H.bufferToHex(Ge(O.v,O.r,O.s))}j.signTypedDataLegacy=tt;function sn(v){const S=hn(v.data),k=Lt(S,v.sig),O=H.publicToAddress(k);return H.bufferToHex(O)}j.recoverTypedSignatureLegacy=sn;function _t(v,S,k){switch(k){case"x25519-xsalsa20-poly1305":{if(typeof S.data!="string")throw new Error('Cannot detect secret message, message params should be of the form {data: "secret message"} ');const O=de.box.keyPair();let ae;try{ae=$e.decodeBase64(v)}catch{throw new Error("Bad public key")}const se=$e.decodeUTF8(S.data),me=de.randomBytes(de.box.nonceLength),xe=de.box(se,me,ae,O.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:$e.encodeBase64(me),ephemPublicKey:$e.encodeBase64(O.publicKey),ciphertext:$e.encodeBase64(xe)}}default:throw new Error("Encryption type/version not supported")}}j.encrypt=_t;function P(v,S,k){const{data:se}=S;if(!se)throw new Error("Cannot encrypt empty msg.data");if(typeof se=="object"&&"toJSON"in se)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const me={data:se,padding:""},pe=F.byteLength(JSON.stringify(me),"utf-8")%2048;let ye=0;pe>0&&(ye=2048-pe-16),me.padding="0".repeat(ye);const cn={data:JSON.stringify(me)};return _t(v,cn,k)}j.encryptSafely=P;function q(v,S){switch(v.version){case"x25519-xsalsa20-poly1305":{const k=an(S),O=de.box.keyPair.fromSecretKey(k).secretKey,ae=$e.decodeBase64(v.nonce),se=$e.decodeBase64(v.ciphertext),me=$e.decodeBase64(v.ephemPublicKey),xe=de.box.open(se,ae,me,O);let pe;try{pe=$e.encodeUTF8(xe)}catch{throw new Error("Decryption failed.")}if(pe)return pe;throw new Error("Decryption failed.")}default:throw new Error("Encryption type/version not supported.")}}j.decrypt=q;function ee(v,S){return JSON.parse(q(v,S)).data}j.decryptSafely=ee;function ie(v){const S=an(v),k=de.box.keyPair.fromSecretKey(S).publicKey;return $e.encodeBase64(k)}j.getEncryptionPublicKey=ie;function Ee(v,S,k="V4"){switch(k){case"V1":return tt(v,S);case"V3":return ft(v,S);case"V4":default:return Ze(v,S)}}j.signTypedMessage=Ee;function He(v,S="V4"){switch(S){case"V1":return sn(v);case"V3":return nt(v);case"V4":default:return qt(v)}}j.recoverTypedMessage=He;function ft(v,S){const k=Ae.sign(S.data,!1),O=H.ecsign(k,v);return H.bufferToHex(Ge(O.v,O.r,O.s))}j.signTypedData=ft;function Ze(v,S){const k=Ae.sign(S.data),O=H.ecsign(k,v);return H.bufferToHex(Ge(O.v,O.r,O.s))}j.signTypedData_v4=Ze;function nt(v){const S=Ae.sign(v.data,!1),k=Lt(S,v.sig),O=H.publicToAddress(k);return H.bufferToHex(O)}j.recoverTypedSignature=nt;function qt(v){const S=Ae.sign(v.data),k=Lt(S,v.sig),O=H.publicToAddress(k);return H.bufferToHex(O)}j.recoverTypedSignature_v4=qt;function hn(v){const S=new Error("Expect argument to be non-empty array");if(typeof v!="object"||!("length"in v)||!v.length)throw S;const k=v.map(function(se){return se.type==="bytes"?H.toBuffer(se.value):se.value}),O=v.map(function(se){return se.type}),ae=v.map(function(se){if(!se.name)throw S;return`${se.type} ${se.name}`});return he.soliditySHA3(["bytes32","bytes32"],[he.soliditySHA3(new Array(v.length).fill("string"),ae),he.soliditySHA3(O,k)])}function Lt(v,S){const k=H.toBuffer(S),O=H.fromRpcSig(k);return H.ecrecover(v,O.v,O.r,O.s)}function on(v){const S=H.toBuffer(v.data),k=H.hashPersonalMessage(S);return Lt(k,v.sig)}function ln(v,S){let k=`${v}`;for(;k.length<S;)k=`0${k}`;return k}function an(v){const S=F.from(v,"hex").toString("base64");return $e.decodeBase64(S)}},16885:function(rn,j,Se){var F=Se(88924).Buffer;(function(d,Me){"use strict";rn.exports?rn.exports=Me():(d.nacl||(d.nacl={}),d.nacl.util=Me())})(this,function(){"use strict";var d={};function Me(re){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(re))throw new TypeError("invalid encoding")}return d.decodeUTF8=function(re){if(typeof re!="string")throw new TypeError("expected string");var H,he=unescape(encodeURIComponent(re)),de=new Uint8Array(he.length);for(H=0;H<he.length;H++)de[H]=he.charCodeAt(H);return de},d.encodeUTF8=function(re){var H,he=[];for(H=0;H<re.length;H++)he.push(String.fromCharCode(re[H]));return decodeURIComponent(escape(he.join("")))},typeof atob>"u"?typeof F.from<"u"?(d.encodeBase64=function(re){return F.from(re).toString("base64")},d.decodeBase64=function(re){return Me(re),new Uint8Array(Array.prototype.slice.call(F.from(re,"base64"),0))}):(d.encodeBase64=function(re){return new F(re).toString("base64")},d.decodeBase64=function(re){return Me(re),new Uint8Array(Array.prototype.slice.call(new F(re,"base64"),0))}):(d.encodeBase64=function(re){var H,he=[],de=re.length;for(H=0;H<de;H++)he.push(String.fromCharCode(re[H]));return btoa(he.join(""))},d.decodeBase64=function(re){Me(re);var H,he=atob(re),de=new Uint8Array(he.length);for(H=0;H<he.length;H++)de[H]=he.charCodeAt(H);return de}),d})},35742:function(rn,j,Se){"use strict";Se.d(j,{qo:function(){return xt},Gn:function(){return Oe}});var F=Se(14454),Me=(B,h=0)=>{let l=~~h,u=0;for(let T=0;T<B.length;T++)u+=B[T];return l+=u%256,l%256},re=Se(48764),he=(B,h)=>re.Buffer.from(B,h);function de(B,h){const l=(u,T)=>h(he(u),T)>>>0;return l.signed=(u,T)=>h(he(u),T),l.unsigned=l,l.model=B,l}var $e=de("crc1",Me);let je=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];typeof Int32Array<"u"&&(je=new Int32Array(je));var Ge=(B,h=0)=>{let l=~~h;for(let u=0;u<B.length;u++)l=je[(l^B[u])&255]&255;return l},pt=de("crc-8",Ge);let et=[0,94,188,226,97,63,221,131,194,156,126,32,163,253,31,65,157,195,33,127,252,162,64,30,95,1,227,189,62,96,130,220,35,125,159,193,66,28,254,160,225,191,93,3,128,222,60,98,190,224,2,92,223,129,99,61,124,34,192,158,29,67,161,255,70,24,250,164,39,121,155,197,132,218,56,102,229,187,89,7,219,133,103,57,186,228,6,88,25,71,165,251,120,38,196,154,101,59,217,135,4,90,184,230,167,249,27,69,198,152,122,36,248,166,68,26,153,199,37,123,58,100,134,216,91,5,231,185,140,210,48,110,237,179,81,15,78,16,242,172,47,113,147,205,17,79,173,243,112,46,204,146,211,141,111,49,178,236,14,80,175,241,19,77,206,144,114,44,109,51,209,143,12,82,176,238,50,108,142,208,83,13,239,177,240,174,76,18,145,207,45,115,202,148,118,40,171,245,23,73,8,86,180,234,105,55,213,139,87,9,235,181,54,104,138,212,149,203,41,119,244,170,72,22,233,183,85,11,136,214,52,106,43,117,151,201,74,20,246,168,116,42,200,150,21,75,169,247,182,232,10,84,215,137,107,53];typeof Int32Array<"u"&&(et=new Int32Array(et));var qe=(B,h=0)=>{let l=~~h;for(let u=0;u<B.length;u++)l=et[(l^B[u])&255]&255;return l},$t=de("dallas-1-wire",qe);let tt=[0,213,127,170,254,43,129,84,41,252,86,131,215,2,168,125,82,135,45,248,172,121,211,6,123,174,4,209,133,80,250,47,164,113,219,14,90,143,37,240,141,88,242,39,115,166,12,217,246,35,137,92,8,221,119,162,223,10,160,117,33,244,94,139,157,72,226,55,99,182,28,201,180,97,203,30,74,159,53,224,207,26,176,101,49,228,78,155,230,51,153,76,24,205,103,178,57,236,70,147,199,18,184,109,16,197,111,186,238,59,145,68,107,190,20,193,149,64,234,63,66,151,61,232,188,105,195,22,239,58,144,69,17,196,110,187,198,19,185,108,56,237,71,146,189,104,194,23,67,150,60,233,148,65,235,62,106,191,21,192,75,158,52,225,181,96,202,31,98,183,29,200,156,73,227,54,25,204,102,179,231,50,152,77,48,229,79,154,206,27,177,100,114,167,13,216,140,89,243,38,91,142,36,241,165,112,218,15,32,245,95,138,222,11,161,116,9,220,118,163,247,34,136,93,214,3,169,124,40,253,87,130,255,42,128,85,1,212,126,171,132,81,251,46,122,175,5,208,173,120,210,7,83,134,44,249];typeof Int32Array<"u"&&(tt=new Int32Array(tt));var _t=(B,h=0)=>{let l=~~h;for(let u=0;u<B.length;u++)l=tt[(l^B[u])&255]&255;return l},P=de("crc-8-dvbs2",_t);let q=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];typeof Int32Array<"u"&&(q=new Int32Array(q));var ie=(B,h=0)=>{let l=~~h;for(let u=0;u<B.length;u++)l=(q[(l^B[u])&255]^l>>8)&65535;return l},Ee=de("crc-16",ie);let He=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];typeof Int32Array<"u"&&(He=new Int32Array(He));var Ze=(B,h)=>{let l=typeof h<"u"?~~h:65535;for(let u=0;u<B.length;u++)l=(He[(l>>8^B[u])&255]^l<<8)&65535;return l},nt=de("ccitt",Ze);let qt=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];typeof Int32Array<"u"&&(qt=new Int32Array(qt));var Lt=(B,h)=>{let l=typeof h<"u"?~~h:65535;for(let u=0;u<B.length;u++)l=(qt[(l^B[u])&255]^l>>8)&65535;return l},on=de("crc-16-modbus",Lt),an=(B,h)=>{let l=typeof h<"u"?~~h:0;for(let u=0;u<B.length;u++){let T=l>>>8&255;T^=B[u]&255,T^=T>>>4,l=l<<8&65535,l^=T,T=T<<5&65535,l^=T,T=T<<7&65535,l^=T}return l},v=de("xmodem",an);let S=[0,4489,8978,12955,17956,22445,25910,29887,35912,40385,44890,48851,51820,56293,59774,63735,4225,264,13203,8730,22181,18220,30135,25662,40137,36160,49115,44626,56045,52068,63999,59510,8450,12427,528,5017,26406,30383,17460,21949,44362,48323,36440,40913,60270,64231,51324,55797,12675,8202,4753,792,30631,26158,21685,17724,48587,44098,40665,36688,64495,60006,55549,51572,16900,21389,24854,28831,1056,5545,10034,14011,52812,57285,60766,64727,34920,39393,43898,47859,21125,17164,29079,24606,5281,1320,14259,9786,57037,53060,64991,60502,39145,35168,48123,43634,25350,29327,16404,20893,9506,13483,1584,6073,61262,65223,52316,56789,43370,47331,35448,39921,29575,25102,20629,16668,13731,9258,5809,1848,65487,60998,56541,52564,47595,43106,39673,35696,33800,38273,42778,46739,49708,54181,57662,61623,2112,6601,11090,15067,20068,24557,28022,31999,38025,34048,47003,42514,53933,49956,61887,57398,6337,2376,15315,10842,24293,20332,32247,27774,42250,46211,34328,38801,58158,62119,49212,53685,10562,14539,2640,7129,28518,32495,19572,24061,46475,41986,38553,34576,62383,57894,53437,49460,14787,10314,6865,2904,32743,28270,23797,19836,50700,55173,58654,62615,32808,37281,41786,45747,19012,23501,26966,30943,3168,7657,12146,16123,54925,50948,62879,58390,37033,33056,46011,41522,23237,19276,31191,26718,7393,3432,16371,11898,59150,63111,50204,54677,41258,45219,33336,37809,27462,31439,18516,23005,11618,15595,3696,8185,63375,58886,54429,50452,45483,40994,37561,33584,31687,27214,22741,18780,15843,11370,7921,3960];typeof Int32Array<"u"&&(S=new Int32Array(S));var O=(B,h)=>{let l=typeof h<"u"?~~h:0;for(let u=0;u<B.length;u++)l=(S[(l^B[u])&255]^l>>8)&65535;return l},ae=de("kermit",O);let se=[0,8801531,9098509,825846,9692897,1419802,1651692,10452759,10584377,2608578,2839604,11344079,3303384,11807523,12104405,4128302,12930697,4391538,5217156,13227903,5679208,13690003,14450021,5910942,6606768,14844747,15604413,6837830,16197969,7431594,8256604,16494759,840169,9084178,8783076,18463,10434312,1670131,1434117,9678590,11358416,2825259,2590173,10602790,4109873,12122826,11821884,3289031,13213536,5231515,4409965,12912278,5929345,14431610,13675660,5693559,6823513,15618722,14863188,6588335,16513208,8238147,7417269,16212302,1680338,10481449,9664223,1391140,9061683,788936,36926,8838341,12067563,4091408,3340262,11844381,2868234,11372785,10555655,2579964,14478683,5939616,5650518,13661357,5180346,13190977,12967607,4428364,8219746,16457881,16234863,7468436,15633027,6866552,6578062,14816117,1405499,9649856,10463030,1698765,8819930,55329,803287,9047340,11858690,3325945,4072975,12086004,2561507,10574104,11387118,2853909,13647026,5664841,5958079,14460228,4446803,12949160,13176670,5194661,7454091,16249200,16476294,8201341,14834538,6559633,6852199,15647388,3360676,11864927,12161705,4185682,10527045,2551230,2782280,11286707,9619101,1346150,1577872,10379115,73852,8875143,9172337,899466,16124205,7357910,8182816,16421083,6680524,14918455,15678145,6911546,5736468,13747439,14507289,5968354,12873461,4334094,5159928,13170435,4167245,12180150,11879232,3346363,11301036,2767959,2532769,10545498,10360692,1596303,1360505,9604738,913813,9157998,8856728,92259,16439492,8164415,7343561,16138546,6897189,15692510,14936872,6662099,5986813,14488838,13733104,5750795,13156124,5174247,4352529,12855018,2810998,11315341,10498427,2522496,12124823,4148844,3397530,11901793,9135439,862644,110658,8912057,1606574,10407765,9590435,1317464,15706879,6940164,6651890,14889737,8145950,16384229,16161043,7394792,5123014,13133629,12910283,4370992,14535975,5997020,5707818,13718737,2504095,10516836,11329682,2796649,11916158,3383173,4130419,12143240,8893606,129117,876971,9121104,1331783,9576124,10389322,1625009,14908182,6633453,6925851,15721184,7380471,16175372,16402682,8127489,4389423,12891860,13119266,5137369,13704398,5722165,6015427,14517560];typeof Int32Array<"u"&&(se=new Int32Array(se));var xe=(B,h)=>{let l=typeof h<"u"?~~h:11994318;for(let u=0;u<B.length;u++)l=(se[(l>>16^B[u])&255]^l<<8)&16777215;return l},pe=de("crc-24",xe);let ye=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(ye=new Int32Array(ye));var Bt=(B,h)=>{let l=h===0?0:~~h^-1;for(let u=0;u<B.length;u++)l=ye[(l^B[u])&255]^l>>>8;return l^-1},dt=de("crc-32",Bt);let yt=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188];typeof Int32Array<"u"&&(yt=new Int32Array(yt));var It=(B,h)=>{let l=typeof h<"u"?~~h:4294967295;for(let u=0;u<B.length;u++)l=yt[(l>>24^B[u])&255]^l<<8;return l},Ht=de("crc-32-mpeg",It);let rt=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(rt=new Int32Array(rt));var Ot=(B,h=-1)=>{let l=h===0?0:~~h;for(let u=0;u<B.length;u++)l=rt[(l^B[u])&255]^l>>>8;return l},gn=de("jam",Ot),rr={crc1:$e,crc8:pt,crc81wire:$t,crc8dvbs2:P,crc16:Ee,crc16ccitt:nt,crc16modbus:on,crc16xmodem:v,crc16kermit:ae,crc24:pe,crc32:dt,crc32mpeg2:Ht,crcjam:gn},We=Se(17187);const Vt={mainnet:{name:"mainnet",chainId:1,networkId:1,defaultHardfork:"shanghai",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"The Ethereum main chain",url:"https://ethstats.net/",genesis:{gasLimit:5e3,difficulty:17179869184,nonce:"0x0000000000000042",extraData:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfc64ec04"},{name:"homestead",block:115e4,forkHash:"0x97c2c34c"},{name:"dao",block:192e4,forkHash:"0x91d1f948"},{name:"tangerineWhistle",block:2463e3,forkHash:"0x7a64da13"},{name:"spuriousDragon",block:2675e3,forkHash:"0x3edd5b10"},{name:"byzantium",block:437e4,forkHash:"0xa00bc324"},{name:"constantinople",block:728e4,forkHash:"0x668db0af"},{name:"petersburg",block:728e4,forkHash:"0x668db0af"},{name:"istanbul",block:9069e3,forkHash:"0x879d6e30"},{name:"muirGlacier",block:92e5,forkHash:"0xe029e991"},{name:"berlin",block:12244e3,forkHash:"0x0eb440f6"},{name:"london",block:12965e3,forkHash:"0xb715077d"},{name:"arrowGlacier",block:13773e3,forkHash:"0x20c327fc"},{name:"grayGlacier",block:1505e4,forkHash:"0xf0afd0e3"},{name:"paris",ttd:"58750000000000000000000",block:15537394,forkHash:"0xf0afd0e3"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,timestamp:"1681338455",forkHash:"0xdce96c2d"},{name:"cancun",block:null,forkHash:null}],bootstrapNodes:[{ip:"18.138.108.67",port:30303,id:"d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666",location:"ap-southeast-1-001",comment:"bootnode-aws-ap-southeast-1-001"},{ip:"3.209.45.79",port:30303,id:"22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de",location:"us-east-1-001",comment:"bootnode-aws-us-east-1-001"},{ip:"65.108.70.101",port:30303,id:"2b252ab6a1d0f971d9722cb839a42cb81db019ba44c08754628ab4a823487071b5695317c8ccd085219c3a03af063495b2f1da8d18218da2d6a82981b45e6ffc",location:"eu-west-1-001",comment:"bootnode-hetzner-hel"},{ip:"157.90.35.166",port:30303,id:"4aeb4ab6c14b23e2c4cfdce879c04b0748a20d8e9b59e25ded2a08143e265c6c25936e74cbc8e641e3312ca288673d91f2f93f8e277de3cfa444ecdaaf982052",location:"eu-central-1-001",comment:"bootnode-hetzner-fsn"}],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]},goerli:{name:"goerli",chainId:5,networkId:5,defaultHardfork:"shanghai",consensus:{type:"poa",algorithm:"clique",clique:{period:15,epoch:3e4}},comment:"Cross-client PoA test network",url:"https://github.com/goerli/testnet",genesis:{timestamp:"0x5c51a607",gasLimit:10485760,difficulty:1,nonce:"0x0000000000000000",extraData:"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},hardforks:[{name:"chainstart",block:0,forkHash:"0xa3f5ab08"},{name:"homestead",block:0,forkHash:"0xa3f5ab08"},{name:"tangerineWhistle",block:0,forkHash:"0xa3f5ab08"},{name:"spuriousDragon",block:0,forkHash:"0xa3f5ab08"},{name:"byzantium",block:0,forkHash:"0xa3f5ab08"},{name:"constantinople",block:0,forkHash:"0xa3f5ab08"},{name:"petersburg",block:0,forkHash:"0xa3f5ab08"},{name:"istanbul",block:1561651,forkHash:"0xc25efa5c"},{name:"berlin",block:4460644,forkHash:"0x757a1c47"},{name:"london",block:5062605,forkHash:"0xb8c6299d"},{name:"paris",ttd:"10790000",block:7382819,forkHash:"0xb8c6299d"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,timestamp:"1678832736",forkHash:"0xf9843abf"},{name:"cancun",block:null,forkHash:null}],bootstrapNodes:[{ip:"51.141.78.53",port:30303,id:"011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a",location:"",comment:"Upstream bootnode 1"},{ip:"13.93.54.137",port:30303,id:"176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b",location:"",comment:"Upstream bootnode 2"},{ip:"94.237.54.114",port:30313,id:"46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291",location:"",comment:"Upstream bootnode 3"},{ip:"18.218.250.66",port:30313,id:"b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949",location:"",comment:"Upstream bootnode 4"},{ip:"3.11.147.67",port:30303,id:"a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91",location:"",comment:"Ethereum Foundation bootnode"},{ip:"51.15.116.226",port:30303,id:"a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd",location:"",comment:"Goerli Initiative bootnode"},{ip:"51.15.119.157",port:30303,id:"807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33",location:"",comment:"Goerli Initiative bootnode"},{ip:"51.15.119.157",port:40303,id:"a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd",location:"",comment:"Goerli Initiative bootnode"}],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]},sepolia:{name:"sepolia",chainId:11155111,networkId:11155111,defaultHardfork:"shanghai",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"PoW test network to replace Ropsten",url:"https://github.com/ethereum/go-ethereum/pull/23730",genesis:{timestamp:"0x6159af19",gasLimit:3e7,difficulty:131072,nonce:"0x0000000000000000",extraData:"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfe3366e7"},{name:"homestead",block:0,forkHash:"0xfe3366e7"},{name:"tangerineWhistle",block:0,forkHash:"0xfe3366e7"},{name:"spuriousDragon",block:0,forkHash:"0xfe3366e7"},{name:"byzantium",block:0,forkHash:"0xfe3366e7"},{name:"constantinople",block:0,forkHash:"0xfe3366e7"},{name:"petersburg",block:0,forkHash:"0xfe3366e7"},{name:"istanbul",block:0,forkHash:"0xfe3366e7"},{name:"muirGlacier",block:0,forkHash:"0xfe3366e7"},{name:"berlin",block:0,forkHash:"0xfe3366e7"},{name:"london",block:0,forkHash:"0xfe3366e7"},{name:"paris",ttd:"17000000000000000",block:1450409,forkHash:"0xfe3366e7"},{name:"mergeForkIdTransition",block:1735371,forkHash:"0xb96cbd13"},{name:"shanghai",block:null,timestamp:"1677557088",forkHash:"0xf7f9bc08"},{name:"cancun",block:null,forkHash:null}],bootstrapNodes:[{ip:"18.168.182.86",port:30303,id:"9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066",location:"",comment:"geth"},{ip:"52.14.151.177",port:30303,id:"ec66ddcf1a974950bd4c782789a7e04f8aa7110a72569b6e65fcd51e937e74eed303b1ea734e4d19cfaec9fbff9b6ee65bf31dcb50ba79acce9dd63a6aca61c7",location:"",comment:"besu"},{ip:"165.22.196.173",port:30303,id:"ce970ad2e9daa9e14593de84a8b49da3d54ccfdf83cbc4fe519cb8b36b5918ed4eab087dedd4a62479b8d50756b492d5f762367c8d20329a7854ec01547568a6",location:"",comment:"EF"},{ip:"65.108.95.67",port:30303,id:"075503b13ed736244896efcde2a992ec0b451357d46cb7a8132c0384721742597fc8f0d91bbb40bb52e7d6e66728d36a1fda09176294e4a30cfac55dcce26bc6",location:"",comment:"lodestar"}],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]}};var xt;(function(B){B[B.Mainnet=1]="Mainnet",B[B.Goerli=5]="Goerli",B[B.Sepolia=11155111]="Sepolia"})(xt||(xt={}));const Ln={[xt.Mainnet]:{blockNumber:BigInt(0),stateRoot:(0,F.nr)("0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544")},[xt.Goerli]:{blockNumber:BigInt(0),stateRoot:(0,F.nr)("0x5d6cded585e73c4e322c30c2f782a336316f17dd85a4863b9d838d2d4b8b3008")},[xt.Sepolia]:{blockNumber:BigInt(0),stateRoot:(0,F.nr)("0x5eb6e371a698b8d68f665192350ffcecbbbf322916f4b51bd79bb6887da3f494")}};var z;(function(B){B.Chainstart="chainstart",B.Homestead="homestead",B.Dao="dao",B.TangerineWhistle="tangerineWhistle",B.SpuriousDragon="spuriousDragon",B.Byzantium="byzantium",B.Constantinople="constantinople",B.Petersburg="petersburg",B.Istanbul="istanbul",B.MuirGlacier="muirGlacier",B.Berlin="berlin",B.London="london",B.ArrowGlacier="arrowGlacier",B.GrayGlacier="grayGlacier",B.MergeForkIdTransition="mergeForkIdTransition",B.Paris="paris",B.Shanghai="shanghai",B.Cancun="cancun"})(z||(z={}));var mn;(function(B){B.ProofOfStake="pos",B.ProofOfWork="pow",B.ProofOfAuthority="poa"})(mn||(mn={}));var St;(function(B){B.Ethash="ethash",B.Clique="clique",B.Casper="casper"})(St||(St={}));var Fe;(function(B){B.PolygonMainnet="polygon-mainnet",B.PolygonMumbai="polygon-mumbai",B.ArbitrumOne="arbitrum-one",B.xDaiChain="x-dai-chain",B.OptimisticKovan="optimistic-kovan",B.OptimisticEthereum="optimistic-ethereum"})(Fe||(Fe={}));var ue;(function(B){B.Draft="draft",B.Review="review",B.Final="final"})(ue||(ue={}));const wt={1153:{comment:"Transient storage opcodes",url:"https://eips.ethereum.org/EIPS/eip-1153",status:ue.Review,minimumHardfork:z.Chainstart,requiredEIPs:[],gasPrices:{tstore:{v:100,d:"Base fee of the TSTORE opcode"},tload:{v:100,d:"Base fee of the TLOAD opcode"}}},1559:{comment:"Fee market change for ETH 1.0 chain",url:"https://eips.ethereum.org/EIPS/eip-1559",status:ue.Final,minimumHardfork:z.Berlin,requiredEIPs:[2930],gasConfig:{baseFeeMaxChangeDenominator:{v:8,d:"Maximum base fee change denominator"},elasticityMultiplier:{v:2,d:"Maximum block gas target elasticity"},initialBaseFee:{v:1e9,d:"Initial base fee on first EIP1559 block"}}},2315:{comment:"Simple subroutines for the EVM",url:"https://eips.ethereum.org/EIPS/eip-2315",status:ue.Draft,minimumHardfork:z.Istanbul,requiredEIPs:[],gasPrices:{beginsub:{v:2,d:"Base fee of the BEGINSUB opcode"},returnsub:{v:5,d:"Base fee of the RETURNSUB opcode"},jumpsub:{v:10,d:"Base fee of the JUMPSUB opcode"}}},2565:{comment:"ModExp gas cost",url:"https://eips.ethereum.org/EIPS/eip-2565",status:ue.Final,minimumHardfork:z.Byzantium,requiredEIPs:[],gasPrices:{modexpGquaddivisor:{v:3,d:"Gquaddivisor from modexp precompile for gas calculation"}}},2718:{comment:"Typed Transaction Envelope",url:"https://eips.ethereum.org/EIPS/eip-2718",status:ue.Final,minimumHardfork:z.Chainstart,requiredEIPs:[]},2929:{comment:"Gas cost increases for state access opcodes",url:"https://eips.ethereum.org/EIPS/eip-2929",status:ue.Final,minimumHardfork:z.Chainstart,requiredEIPs:[],gasPrices:{coldsload:{v:2100,d:"Gas cost of the first read of storage from a given location (per transaction)"},coldaccountaccess:{v:2600,d:"Gas cost of the first read of a given address (per transaction)"},warmstorageread:{v:100,d:"Gas cost of reading storage locations which have already loaded 'cold'"},sstoreCleanGasEIP2200:{v:2900,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreNoopGasEIP2200:{v:100,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:100,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitRefundEIP2200:{v:19900,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanRefundEIP2200:{v:4900,d:"Once per SSTORE operation for resetting to the original non-zero value"},call:{v:0,d:"Base fee of the CALL opcode"},callcode:{v:0,d:"Base fee of the CALLCODE opcode"},delegatecall:{v:0,d:"Base fee of the DELEGATECALL opcode"},staticcall:{v:0,d:"Base fee of the STATICCALL opcode"},balance:{v:0,d:"Base fee of the BALANCE opcode"},extcodesize:{v:0,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:0,d:"Base fee of the EXTCODECOPY opcode"},extcodehash:{v:0,d:"Base fee of the EXTCODEHASH opcode"},sload:{v:0,d:"Base fee of the SLOAD opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"}}},2930:{comment:"Optional access lists",url:"https://eips.ethereum.org/EIPS/eip-2930",status:ue.Final,minimumHardfork:z.Istanbul,requiredEIPs:[2718,2929],gasPrices:{accessListStorageKeyCost:{v:1900,d:"Gas cost per storage key in an Access List transaction"},accessListAddressCost:{v:2400,d:"Gas cost per storage key in an Access List transaction"}}},3074:{comment:"AUTH and AUTHCALL opcodes",url:"https://eips.ethereum.org/EIPS/eip-3074",status:ue.Review,minimumHardfork:z.London,requiredEIPs:[],gasPrices:{auth:{v:3100,d:"Gas cost of the AUTH opcode"},authcall:{v:0,d:"Gas cost of the AUTHCALL opcode"},authcallValueTransfer:{v:6700,d:"Paid for CALL when the value transfer is non-zero"}}},3198:{comment:"BASEFEE opcode",url:"https://eips.ethereum.org/EIPS/eip-3198",status:ue.Final,minimumHardfork:z.London,requiredEIPs:[],gasPrices:{basefee:{v:2,d:"Gas cost of the BASEFEE opcode"}}},3529:{comment:"Reduction in refunds",url:"https://eips.ethereum.org/EIPS/eip-3529",status:ue.Final,minimumHardfork:z.Berlin,requiredEIPs:[2929],gasConfig:{maxRefundQuotient:{v:5,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{selfdestructRefund:{v:0,d:"Refunded following a selfdestruct operation"},sstoreClearRefundEIP2200:{v:4800,d:"Once per SSTORE operation for clearing an originally existing storage slot"}}},3540:{comment:"EVM Object Format (EOF) v1",url:"https://eips.ethereum.org/EIPS/eip-3540",status:ue.Review,minimumHardfork:z.London,requiredEIPs:[3541]},3541:{comment:"Reject new contracts starting with the 0xEF byte",url:"https://eips.ethereum.org/EIPS/eip-3541",status:ue.Final,minimumHardfork:z.Berlin,requiredEIPs:[]},3554:{comment:"Difficulty Bomb Delay to December 1st 2021",url:"https://eips.ethereum.org/EIPS/eip-3554",status:ue.Final,minimumHardfork:z.MuirGlacier,requiredEIPs:[],pow:{difficultyBombDelay:{v:95e5,d:"the amount of blocks to delay the difficulty bomb with"}}},3607:{comment:"Reject transactions from senders with deployed code",url:"https://eips.ethereum.org/EIPS/eip-3607",status:ue.Final,minimumHardfork:z.Chainstart,requiredEIPs:[]},3651:{comment:"Warm COINBASE",url:"https://eips.ethereum.org/EIPS/eip-3651",status:ue.Review,minimumHardfork:z.London,requiredEIPs:[2929]},3670:{comment:"EOF - Code Validation",url:"https://eips.ethereum.org/EIPS/eip-3670",status:"Review",minimumHardfork:z.London,requiredEIPs:[3540],gasConfig:{},gasPrices:{},vm:{},pow:{}},3675:{comment:"Upgrade consensus to Proof-of-Stake",url:"https://eips.ethereum.org/EIPS/eip-3675",status:ue.Final,minimumHardfork:z.London,requiredEIPs:[]},3855:{comment:"PUSH0 instruction",url:"https://eips.ethereum.org/EIPS/eip-3855",status:ue.Review,minimumHardfork:z.Chainstart,requiredEIPs:[],gasPrices:{push0:{v:2,d:"Base fee of the PUSH0 opcode"}}},3860:{comment:"Limit and meter initcode",url:"https://eips.ethereum.org/EIPS/eip-3860",status:ue.Review,minimumHardfork:z.SpuriousDragon,requiredEIPs:[],gasPrices:{initCodeWordCost:{v:2,d:"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},vm:{maxInitCodeSize:{v:49152,d:"Maximum length of initialization code when creating a contract"}}},4345:{comment:"Difficulty Bomb Delay to June 2022",url:"https://eips.ethereum.org/EIPS/eip-4345",status:ue.Final,minimumHardfork:z.London,requiredEIPs:[],pow:{difficultyBombDelay:{v:107e5,d:"the amount of blocks to delay the difficulty bomb with"}}},4399:{comment:"Supplant DIFFICULTY opcode with PREVRANDAO",url:"https://eips.ethereum.org/EIPS/eip-4399",status:ue.Review,minimumHardfork:z.London,requiredEIPs:[],gasPrices:{prevrandao:{v:2,d:"Base fee of the PREVRANDAO opcode (previously DIFFICULTY)"}}},4788:{comment:"Beacon block root in the EVM",url:"https://eips.ethereum.org/EIPS/eip-4788",status:ue.Draft,minimumHardfork:z.Cancun,requiredEIPs:[],gasPrices:{beaconrootCost:{v:4200,d:"Gas cost when calling the beaconroot stateful precompile"}},vm:{historicalRootsLength:{v:98304,d:"The modulo parameter of the beaconroot ring buffer in the beaconroot statefull precompile"}}},4844:{comment:"Shard Blob Transactions",url:"https://eips.ethereum.org/EIPS/eip-4844",status:ue.Draft,minimumHardfork:z.Paris,requiredEIPs:[1559,2718,2930,4895],gasConfig:{blobGasPerBlob:{v:131072,d:"The base fee for blob gas per blob"},targetBlobGasPerBlock:{v:393216,d:"The target blob gas consumed per block"},maxblobGasPerBlock:{v:786432,d:"The max blob gas allowable per block"},blobGasPriceUpdateFraction:{v:3338477,d:"The denominator used in the exponential when calculating a blob gas price"}},gasPrices:{simpleGasPerBlob:{v:12e3,d:"The basic gas fee for each blob"},minBlobGasPrice:{v:1,d:"The minimum fee per blob gas"},kzgPointEvaluationGasPrecompilePrice:{v:5e4,d:"The fee associated with the point evaluation precompile"},blobhash:{v:3,d:"Base fee of the BLOBHASH opcode"}},sharding:{blobCommitmentVersionKzg:{v:1,d:"The number indicated a versioned hash is a KZG commitment"},fieldElementsPerBlob:{v:4096,d:"The number of field elements allowed per blob"}}},4895:{comment:"Beacon chain push withdrawals as operations",url:"https://eips.ethereum.org/EIPS/eip-4895",status:ue.Review,minimumHardfork:z.Paris,requiredEIPs:[]},5133:{comment:"Delaying Difficulty Bomb to mid-September 2022",url:"https://eips.ethereum.org/EIPS/eip-5133",status:ue.Draft,minimumHardfork:z.GrayGlacier,requiredEIPs:[],pow:{difficultyBombDelay:{v:114e5,d:"the amount of blocks to delay the difficulty bomb with"}}},5656:{comment:"MCOPY - Memory copying instruction",url:"https://eips.ethereum.org/EIPS/eip-5656",status:ue.Draft,minimumHardfork:z.Shanghai,requiredEIPs:[],gasPrices:{mcopy:{v:3,d:"Base fee of the MCOPY opcode"}}},6780:{comment:"SELFDESTRUCT only in same transaction",url:"https://eips.ethereum.org/EIPS/eip-6780",status:ue.Draft,minimumHardfork:z.London,requiredEIPs:[]}};var Pe;(function(B){B.Draft="draft",B.Review="review",B.Final="final"})(Pe||(Pe={}));const Hn={chainstart:{name:"chainstart",comment:"Start of the Ethereum main chain",url:"",status:Pe.Final,gasConfig:{minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be"},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations"},maxRefundQuotient:{v:2,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{base:{v:2,d:"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},exp:{v:10,d:"Base fee of the EXP opcode"},expByte:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction"},keccak256:{v:30,d:"Base fee of the SHA3 opcode"},keccak256Word:{v:6,d:"Once per word of the SHA3 operation's data"},sload:{v:50,d:"Base fee of the SLOAD opcode"},sstoreSet:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero"},sstoreReset:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero"},sstoreRefund:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero"},jumpdest:{v:1,d:"Base fee of the JUMPDEST opcode"},log:{v:375,d:"Base fee of the LOG opcode"},logData:{v:8,d:"Per byte in a LOG* operation's data"},logTopic:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},create:{v:32e3,d:"Base fee of the CREATE opcode"},call:{v:40,d:"Base fee of the CALL opcode"},callStipend:{v:2300,d:"Free gas given at beginning of call"},callValueTransfer:{v:9e3,d:"Paid for CALL when the value transfor is non-zero"},callNewAccount:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior"},selfdestructRefund:{v:24e3,d:"Refunded following a selfdestruct operation"},memory:{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"},createData:{v:200,d:""},tx:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions"},txCreation:{v:32e3,d:"The cost of creating a contract via tx"},txDataZero:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},txDataNonZero:{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"},copy:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},ecRecover:{v:3e3,d:""},sha256:{v:60,d:""},sha256Word:{v:12,d:""},ripemd160:{v:600,d:""},ripemd160Word:{v:120,d:""},identity:{v:15,d:""},identityWord:{v:3,d:""},stop:{v:0,d:"Base fee of the STOP opcode"},add:{v:3,d:"Base fee of the ADD opcode"},mul:{v:5,d:"Base fee of the MUL opcode"},sub:{v:3,d:"Base fee of the SUB opcode"},div:{v:5,d:"Base fee of the DIV opcode"},sdiv:{v:5,d:"Base fee of the SDIV opcode"},mod:{v:5,d:"Base fee of the MOD opcode"},smod:{v:5,d:"Base fee of the SMOD opcode"},addmod:{v:8,d:"Base fee of the ADDMOD opcode"},mulmod:{v:8,d:"Base fee of the MULMOD opcode"},signextend:{v:5,d:"Base fee of the SIGNEXTEND opcode"},lt:{v:3,d:"Base fee of the LT opcode"},gt:{v:3,d:"Base fee of the GT opcode"},slt:{v:3,d:"Base fee of the SLT opcode"},sgt:{v:3,d:"Base fee of the SGT opcode"},eq:{v:3,d:"Base fee of the EQ opcode"},iszero:{v:3,d:"Base fee of the ISZERO opcode"},and:{v:3,d:"Base fee of the AND opcode"},or:{v:3,d:"Base fee of the OR opcode"},xor:{v:3,d:"Base fee of the XOR opcode"},not:{v:3,d:"Base fee of the NOT opcode"},byte:{v:3,d:"Base fee of the BYTE opcode"},address:{v:2,d:"Base fee of the ADDRESS opcode"},balance:{v:20,d:"Base fee of the BALANCE opcode"},origin:{v:2,d:"Base fee of the ORIGIN opcode"},caller:{v:2,d:"Base fee of the CALLER opcode"},callvalue:{v:2,d:"Base fee of the CALLVALUE opcode"},calldataload:{v:3,d:"Base fee of the CALLDATALOAD opcode"},calldatasize:{v:2,d:"Base fee of the CALLDATASIZE opcode"},calldatacopy:{v:3,d:"Base fee of the CALLDATACOPY opcode"},codesize:{v:2,d:"Base fee of the CODESIZE opcode"},codecopy:{v:3,d:"Base fee of the CODECOPY opcode"},gasprice:{v:2,d:"Base fee of the GASPRICE opcode"},extcodesize:{v:20,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:20,d:"Base fee of the EXTCODECOPY opcode"},blockhash:{v:20,d:"Base fee of the BLOCKHASH opcode"},coinbase:{v:2,d:"Base fee of the COINBASE opcode"},timestamp:{v:2,d:"Base fee of the TIMESTAMP opcode"},number:{v:2,d:"Base fee of the NUMBER opcode"},difficulty:{v:2,d:"Base fee of the DIFFICULTY opcode"},gaslimit:{v:2,d:"Base fee of the GASLIMIT opcode"},pop:{v:2,d:"Base fee of the POP opcode"},mload:{v:3,d:"Base fee of the MLOAD opcode"},mstore:{v:3,d:"Base fee of the MSTORE opcode"},mstore8:{v:3,d:"Base fee of the MSTORE8 opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"},jump:{v:8,d:"Base fee of the JUMP opcode"},jumpi:{v:10,d:"Base fee of the JUMPI opcode"},pc:{v:2,d:"Base fee of the PC opcode"},msize:{v:2,d:"Base fee of the MSIZE opcode"},gas:{v:2,d:"Base fee of the GAS opcode"},push:{v:3,d:"Base fee of the PUSH opcode"},dup:{v:3,d:"Base fee of the DUP opcode"},swap:{v:3,d:"Base fee of the SWAP opcode"},callcode:{v:40,d:"Base fee of the CALLCODE opcode"},return:{v:0,d:"Base fee of the RETURN opcode"},invalid:{v:0,d:"Base fee of the INVALID opcode"},selfdestruct:{v:0,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{stackLimit:{v:1024,d:"Maximum size of VM stack allowed"},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack"},maxExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis"}},pow:{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"},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},minerReward:{v:BigInt("5000000000000000000"),d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:0,d:"the amount of blocks to delay the difficulty bomb with"}}},homestead:{name:"homestead",comment:"Homestead hardfork with protocol and network changes",url:"https://eips.ethereum.org/EIPS/eip-606",status:Pe.Final,gasPrices:{delegatecall:{v:40,d:"Base fee of the DELEGATECALL opcode"}}},dao:{name:"dao",comment:"DAO rescue hardfork",url:"https://eips.ethereum.org/EIPS/eip-779",status:Pe.Final},tangerineWhistle:{name:"tangerineWhistle",comment:"Hardfork with gas cost changes for IO-heavy operations",url:"https://eips.ethereum.org/EIPS/eip-608",status:Pe.Final,gasPrices:{sload:{v:200,d:"Once per SLOAD operation"},call:{v:700,d:"Once per CALL operation & message call transaction"},extcodesize:{v:700,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:700,d:"Base fee of the EXTCODECOPY opcode"},balance:{v:400,d:"Base fee of the BALANCE opcode"},delegatecall:{v:700,d:"Base fee of the DELEGATECALL opcode"},callcode:{v:700,d:"Base fee of the CALLCODE opcode"},selfdestruct:{v:5e3,d:"Base fee of the SELFDESTRUCT opcode"}}},spuriousDragon:{name:"spuriousDragon",comment:"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit",url:"https://eips.ethereum.org/EIPS/eip-607",status:Pe.Final,gasPrices:{expByte:{v:50,d:"Times ceil(log256(exponent)) for the EXP instruction"}},vm:{maxCodeSize:{v:24576,d:"Maximum length of contract code"}}},byzantium:{name:"byzantium",comment:"Hardfork with new precompiles, instructions and other protocol changes",url:"https://eips.ethereum.org/EIPS/eip-609",status:Pe.Final,gasPrices:{modexpGquaddivisor:{v:20,d:"Gquaddivisor from modexp precompile for gas calculation"},ecAdd:{v:500,d:"Gas costs for curve addition precompile"},ecMul:{v:4e4,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:1e5,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:8e4,d:"Gas costs regarding curve pairing precompile input length"},revert:{v:0,d:"Base fee of the REVERT opcode"},staticcall:{v:700,d:"Base fee of the STATICCALL opcode"},returndatasize:{v:2,d:"Base fee of the RETURNDATASIZE opcode"},returndatacopy:{v:3,d:"Base fee of the RETURNDATACOPY opcode"}},pow:{minerReward:{v:BigInt("3000000000000000000"),d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:3e6,d:"the amount of blocks to delay the difficulty bomb with"}}},constantinople:{name:"constantinople",comment:"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)",url:"https://eips.ethereum.org/EIPS/eip-1013",status:Pe.Final,gasPrices:{netSstoreNoopGas:{v:200,d:"Once per SSTORE operation if the value doesn't change"},netSstoreInitGas:{v:2e4,d:"Once per SSTORE operation from clean zero"},netSstoreCleanGas:{v:5e3,d:"Once per SSTORE operation from clean non-zero"},netSstoreDirtyGas:{v:200,d:"Once per SSTORE operation from dirty"},netSstoreClearRefund:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},netSstoreResetRefund:{v:4800,d:"Once per SSTORE operation for resetting to the original non-zero value"},netSstoreResetClearRefund:{v:19800,d:"Once per SSTORE operation for resetting to the original zero value"},shl:{v:3,d:"Base fee of the SHL opcode"},shr:{v:3,d:"Base fee of the SHR opcode"},sar:{v:3,d:"Base fee of the SAR opcode"},extcodehash:{v:400,d:"Base fee of the EXTCODEHASH opcode"},create2:{v:32e3,d:"Base fee of the CREATE2 opcode"}},pow:{minerReward:{v:BigInt("2000000000000000000"),d:"The amount a miner gets rewarded for mining a block"},difficultyBombDelay:{v:5e6,d:"the amount of blocks to delay the difficulty bomb with"}}},petersburg:{name:"petersburg",comment:"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople",url:"https://eips.ethereum.org/EIPS/eip-1716",status:Pe.Final,gasPrices:{netSstoreNoopGas:{v:null,d:"Removed along EIP-1283"},netSstoreInitGas:{v:null,d:"Removed along EIP-1283"},netSstoreCleanGas:{v:null,d:"Removed along EIP-1283"},netSstoreDirtyGas:{v:null,d:"Removed along EIP-1283"},netSstoreClearRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetClearRefund:{v:null,d:"Removed along EIP-1283"}}},istanbul:{name:"istanbul",comment:"HF targeted for December 2019 following the Constantinople/Petersburg HF",url:"https://eips.ethereum.org/EIPS/eip-1679",status:Pe.Final,gasConfig:{},gasPrices:{blake2Round:{v:1,d:"Gas cost per round for the Blake2 F precompile"},ecAdd:{v:150,d:"Gas costs for curve addition precompile"},ecMul:{v:6e3,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:45e3,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:34e3,d:"Gas costs regarding curve pairing precompile input length"},txDataNonZero:{v:16,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},sstoreSentryGasEIP2200:{v:2300,d:"Minimum gas required to be present for an SSTORE call, not consumed"},sstoreNoopGasEIP2200:{v:800,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:800,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitGasEIP2200:{v:2e4,d:"Once per SSTORE operation from clean zero to non-zero"},sstoreInitRefundEIP2200:{v:19200,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanGasEIP2200:{v:5e3,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreCleanRefundEIP2200:{v:4200,d:"Once per SSTORE operation for resetting to the original non-zero value"},sstoreClearRefundEIP2200:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},balance:{v:700,d:"Base fee of the BALANCE opcode"},extcodehash:{v:700,d:"Base fee of the EXTCODEHASH opcode"},chainid:{v:2,d:"Base fee of the CHAINID opcode"},selfbalance:{v:5,d:"Base fee of the SELFBALANCE opcode"},sload:{v:800,d:"Base fee of the SLOAD opcode"}}},muirGlacier:{name:"muirGlacier",comment:"HF to delay the difficulty bomb",url:"https://eips.ethereum.org/EIPS/eip-2384",status:Pe.Final,pow:{difficultyBombDelay:{v:9e6,d:"the amount of blocks to delay the difficulty bomb with"}}},berlin:{name:"berlin",comment:"HF targeted for July 2020 following the Muir Glacier HF",url:"https://eips.ethereum.org/EIPS/eip-2070",status:Pe.Final,eips:[2565,2929,2718,2930]},london:{name:"london",comment:"HF targeted for July 2021 following the Berlin fork",url:"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",status:Pe.Final,eips:[1559,3198,3529,3541]},arrowGlacier:{name:"arrowGlacier",comment:"HF to delay the difficulty bomb",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md",status:Pe.Final,eips:[4345]},grayGlacier:{name:"grayGlacier",comment:"Delaying the difficulty bomb to Mid September 2022",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md",status:Pe.Final,eips:[5133]},paris:{name:"paris",comment:"Hardfork to upgrade the consensus mechanism to Proof-of-Stake",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md",status:Pe.Final,consensus:{type:"pos",algorithm:"casper",casper:{}},eips:[3675,4399]},mergeForkIdTransition:{name:"mergeForkIdTransition",comment:"Pre-merge hardfork to fork off non-upgraded clients",url:"https://eips.ethereum.org/EIPS/eip-3675",status:Pe.Final,eips:[]},shanghai:{name:"shanghai",comment:"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md",status:Pe.Final,eips:[3651,3855,3860,4895]},cancun:{name:"cancun",comment:"Next feature hardfork after the shanghai having proto-danksharding EIP 4844 blobs (still WIP hence not for production use), transient storage opcodes, parent beacon block root availability in EVM and selfdestruct only in same transaction",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md",status:Pe.Final,eips:[1153,4844,4788,5656,6780]}};function Ct(B){return!B||B==="0x0"?"0x0000000000000000":(0,F.Lo)(B)?"0x"+(0,F.MT)(B).padStart(16,"0"):"0x"+B.padStart(16,"0")}function Te(B,h=!0){var On,Ye;const{name:l,config:u,difficulty:T,mixHash:G,gasLimit:J,coinbase:Ue,baseFeePerGas:X,excessBlobGas:Ce}=B;let{extraData:Ve,timestamp:ne,nonce:ut}=B;const Rt=Number(ne),{chainId:Ut}=u;if(Ve===""&&(Ve="0x"),(0,F.Lo)(ne)||(ne=(0,F.I4)(parseInt(ne))),ut.length!==18&&(ut=Ct(ut)),u.eip155Block!==u.eip158Block)throw new Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");const ze={name:l,chainId:Ut,networkId:Ut,genesis:{timestamp:ne,gasLimit:J,difficulty:T,nonce:ut,extraData:Ve,mixHash:G,coinbase:Ue,baseFeePerGas:X,excessBlobGas:Ce},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:u.clique!==void 0?{type:"poa",algorithm:"clique",clique:{period:(On=u.clique.period)!=null?On:u.clique.blockperiodseconds,epoch:(Ye=u.clique.epoch)!=null?Ye:u.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},Kt={[z.Homestead]:{name:"homesteadBlock"},[z.Dao]:{name:"daoForkBlock"},[z.TangerineWhistle]:{name:"eip150Block"},[z.SpuriousDragon]:{name:"eip155Block"},[z.Byzantium]:{name:"byzantiumBlock"},[z.Constantinople]:{name:"constantinopleBlock"},[z.Petersburg]:{name:"petersburgBlock"},[z.Istanbul]:{name:"istanbulBlock"},[z.MuirGlacier]:{name:"muirGlacierBlock"},[z.Berlin]:{name:"berlinBlock"},[z.London]:{name:"londonBlock"},[z.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:h},[z.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[z.Cancun]:{name:"cancunTime",postMerge:!0,isTimestamp:!0}},pn=Object.keys(Kt).reduce((Ie,ht)=>(Ie[Kt[ht].name]=ht,Ie),{}),fn=Object.keys(u).filter(Ie=>pn[Ie]!==void 0&&u[Ie]!==void 0&&u[Ie]!==null);if(ze.hardforks=fn.map(Ie=>({name:pn[Ie],block:Kt[pn[Ie]].isTimestamp===!0||typeof u[Ie]!="number"?null:u[Ie],timestamp:Kt[pn[Ie]].isTimestamp===!0&&typeof u[Ie]=="number"?u[Ie]:void 0})).filter(Ie=>Ie.block!==null||Ie.timestamp!==void 0),ze.hardforks.sort(function(Ie,ht){var Je,Re;return((Je=Ie.block)!=null?Je:1/0)-((Re=ht.block)!=null?Re:1/0)}),ze.hardforks.sort(function(Ie,ht){var Je,Re;return((Je=Ie.timestamp)!=null?Je:Rt)-((Re=ht.timestamp)!=null?Re:Rt)}),u.terminalTotalDifficulty!==void 0){const Ie={name:z.Paris,ttd:u.terminalTotalDifficulty,block:null},ht=ze.hardforks.findIndex(Je=>{var Re;return((Re=Kt[Je.name])==null?void 0:Re.postMerge)===!0});ht!==-1?ze.hardforks.splice(ht,0,Ie):ze.hardforks.push(Ie)}const jt=ze.hardforks.length>0?ze.hardforks.slice(-1)[0]:void 0;return ze.hardfork=jt==null?void 0:jt.name,ze.hardforks.unshift({name:z.Chainstart,block:0}),ze}function le(B,h,l){try{if(["config","difficulty","gasLimit","alloc"].some(u=>!(u in B)))throw new Error("Invalid format, expected geth genesis fields missing");return h!==void 0&&(B.name=h),Te(B,l)}catch(u){throw new Error(`Error parsing parameters file: ${u.message}`)}}class Oe{constructor(h){var l,u;this._eips=[],this.events=new We.EventEmitter,this._customChains=(l=h.customChains)!=null?l:[],this._chainParams=this.setChain(h.chain),this.DEFAULT_HARDFORK=(u=this._chainParams.defaultHardfork)!=null?u:z.Shanghai,this.HARDFORK_CHANGES=this.hardforks().map(T=>[T.name,Hn[T.name]]),this._hardfork=this.DEFAULT_HARDFORK,h.hardfork!==void 0&&this.setHardfork(h.hardfork),h.eips&&this.setEIPs(h.eips)}static custom(h,l={}){var G;const u=(G=l.baseChain)!=null?G:"mainnet",T={...Oe._getChainParams(u)};if(T.name="custom-chain",typeof h!="string")return new Oe({chain:{...T,...h},...l});if(h===Fe.PolygonMainnet)return Oe.custom({name:Fe.PolygonMainnet,chainId:137,networkId:137},l);if(h===Fe.PolygonMumbai)return Oe.custom({name:Fe.PolygonMumbai,chainId:80001,networkId:80001},l);if(h===Fe.ArbitrumOne)return Oe.custom({name:Fe.ArbitrumOne,chainId:42161,networkId:42161},l);if(h===Fe.xDaiChain)return Oe.custom({name:Fe.xDaiChain,chainId:100,networkId:100},l);if(h===Fe.OptimisticKovan)return Oe.custom({name:Fe.OptimisticKovan,chainId:69,networkId:69},{hardfork:z.Berlin,...l});if(h===Fe.OptimisticEthereum)return Oe.custom({name:Fe.OptimisticEthereum,chainId:10,networkId:10},{hardfork:z.Berlin,...l});throw new Error(`Custom chain ${h} not supported`)}static fromGethGenesis(h,{chain:l,eips:u,genesisHash:T,hardfork:G,mergeForkIdPostMerge:J}){var Ce;const Ue=le(h,l,J),X=new Oe({chain:(Ce=Ue.name)!=null?Ce:"custom",customChains:[Ue],eips:u,hardfork:G!=null?G:Ue.hardfork});return T!==void 0&&X.setForkHashes(T),X}static isSupportedChainId(h){const l=this.getInitializedChains();return Boolean(l.names[h.toString()])}static _getChainParams(h,l){const u=this.getInitializedChains(l);if(typeof h=="number"||typeof h=="bigint"){if(h=h.toString(),u.names[h]){const T=u.names[h];return u[T]}throw new Error(`Chain with ID ${h} not supported`)}if(u[h]!==void 0)return u[h];throw new Error(`Chain with name ${h} not supported`)}setChain(h){if(typeof h=="number"||typeof h=="bigint"||typeof h=="string")this._chainParams=Oe._getChainParams(h,this._customChains);else if(typeof h=="object"){if(this._customChains.length>0)throw new Error("Chain must be a string, number, or bigint when initialized with customChains passed in");const l=["networkId","genesis","hardforks","bootstrapNodes"];for(const u of l)if(!(u in h))throw new Error(`Missing required chain parameter: ${u}`);this._chainParams=h}else throw new Error("Wrong input format");for(const l of this.hardforks())if(l.block===void 0)throw new Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(h){let l=!1;for(const u of this.HARDFORK_CHANGES)u[0]===h&&(this._hardfork!==h&&(this._hardfork=h,this.events.emit("hardforkChanged",h)),l=!0);if(!l)throw new Error(`Hardfork with name ${h} not supported`)}getHardforkBy(h){let{blockNumber:l,timestamp:u,td:T}=h;l=(0,F.Fy)(l,F.qT.BigInt),T=(0,F.Fy)(T,F.qT.BigInt),u=(0,F.Fy)(u,F.qT.BigInt);const G=this.hardforks().filter(ne=>ne.block!==null||ne.ttd!==null&&ne.ttd!==void 0||ne.timestamp!==void 0),J=G.findIndex(ne=>ne.ttd!==null&&ne.ttd!==void 0);if(G.slice(J+1).findIndex(ne=>ne.ttd!==null&&ne.ttd!==void 0)>=0)throw Error("More than one merge hardforks found with ttd specified");let X=G.findIndex(ne=>l!==void 0&&ne.block!==null&&BigInt(ne.block)>l||u!==void 0&&ne.timestamp!==void 0&&ne.timestamp>u);if(X===-1)X=G.length;else if(X===0)throw Error("Must have at least one hardfork at block 0");if(u===void 0){const ne=G.slice(0,X).reverse().findIndex(ut=>ut.block!==null||ut.ttd!==void 0);X=X-ne}if(X=X-1,G[X].block===null&&G[X].timestamp===void 0)(T==null||BigInt(G[X].ttd)>T)&&(X-=1);else if(J>=0&&T!==void 0&&T!==null){if(X>=J&&BigInt(G[J].ttd)>T)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(X<J&&BigInt(G[J].ttd)<=T)throw Error("HF determined by block number is lower than the minimum total difficulty HF")}const Ce=X;for(;X<G.length-1&&!(G[X].block!==G[X+1].block||G[X].timestamp!==G[X+1].timestamp);X++);if(u!==void 0){if(G.slice(0,Ce).reduce((Rt,Ut)=>{var ze;return Math.max(Number((ze=Ut.timestamp)!=null?ze:"0"),Rt)},0)>u)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");if(G.slice(X+1).reduce((Rt,Ut)=>{var ze;return Math.min(Number((ze=Ut.timestamp)!=null?ze:u),Rt)},Number(u))<u)throw Error("Maximum HF determined by block number/ttd is lower than timestamp HF")}return G[X].name}setHardforkBy(h){const l=this.getHardforkBy(h);return this.setHardfork(l),l}_getHardfork(h){const l=this.hardforks();for(const u of l)if(u.name===h)return u;return null}setEIPs(h=[]){for(const l of h){if(!(l in wt))throw new Error(`${l} not supported`);const u=this.gteHardfork(wt[l].minimumHardfork);if(!u)throw new Error(`${l} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${u}`);if(wt[l].requiredEIPs!==void 0){for(const T of wt[l].requiredEIPs)if(!(h.includes(T)||this.isActivatedEIP(T)))throw new Error(`${l} requires EIP ${T}, but is not included in the EIP list`)}}this._eips=h}param(h,l){let u;for(const T of this._eips)if(u=this.paramByEIP(h,l,T),u!==void 0)return u;return this.paramByHardfork(h,l,this._hardfork)}paramByHardfork(h,l,u){let T=null;for(const G of this.HARDFORK_CHANGES){if("eips"in G[1]){const J=G[1].eips;for(const Ue of J){const X=this.paramByEIP(h,l,Ue);T=typeof X=="bigint"?X:T}}else G[1][h]!==void 0&&G[1][h][l]!==void 0&&(T=G[1][h][l].v);if(G[0]===u)break}return BigInt(T!=null?T:0)}paramByEIP(h,l,u){if(!(u in wt))throw new Error(`${u} not supported`);const T=wt[u];if(!(h in T)||T[h][l]===void 0)return;const G=T[h][l].v;return BigInt(G)}paramByBlock(h,l,u,T,G){const J=this.getHardforkBy({blockNumber:u,td:T,timestamp:G});return this.paramByHardfork(h,l,J)}isActivatedEIP(h){if(this.eips().includes(h))return!0;for(const l of this.HARDFORK_CHANGES){const u=l[1];if(this.gteHardfork(u.name)&&"eips"in u&&u.eips.includes(h))return!0}return!1}hardforkIsActiveOnBlock(h,l){l=(0,F.Fy)(l,F.qT.BigInt),h=h!=null?h:this._hardfork;const u=this.hardforkBlock(h);return typeof u=="bigint"&&u!==BigInt(0)&&l>=u}activeOnBlock(h){return this.hardforkIsActiveOnBlock(null,h)}hardforkGteHardfork(h,l){h=h!=null?h:this._hardfork;const u=this.hardforks();let T=-1,G=-1,J=0;for(const Ue of u)Ue.name===h&&(T=J),Ue.name===l&&(G=J),J+=1;return T>=G&&G!==-1}gteHardfork(h){return this.hardforkGteHardfork(null,h)}hardforkBlock(h){var u;h=h!=null?h:this._hardfork;const l=(u=this._getHardfork(h))==null?void 0:u.block;return l==null?null:BigInt(l)}hardforkTimestamp(h){var u;h=h!=null?h:this._hardfork;const l=(u=this._getHardfork(h))==null?void 0:u.timestamp;return l==null?null:BigInt(l)}eipBlock(h){for(const l of this.HARDFORK_CHANGES){const u=l[1];if("eips"in u&&u.eips.includes(h))return this.hardforkBlock(l[0])}return null}hardforkTTD(h){var u;h=h!=null?h:this._hardfork;const l=(u=this._getHardfork(h))==null?void 0:u.ttd;return l==null?null:BigInt(l)}nextHardforkBlockOrTimestamp(h){var Ue,X;h=h!=null?h:this._hardfork;const l=this.hardforks();let u=l.findIndex(Ce=>Ce.name===h);if(h===z.Paris&&(u-=1),u<0)return null;let T=(Ue=l[u].timestamp)!=null?Ue:l[u].block;T=T!=null?Number(T):null;const G=l.slice(u+1).find(Ce=>{var ne;let Ve=(ne=Ce.timestamp)!=null?ne:Ce.block;return Ve=Ve!=null?Number(Ve):null,Ce.name!==z.Paris&&Ve!==null&&Ve!==void 0&&Ve!==T});if(G===void 0)return null;const J=(X=G.timestamp)!=null?X:G.block;return J==null?null:BigInt(J)}_calcForkHash(h,l){let u=new Uint8Array(0),T=0;for(const Ue of this.hardforks()){const{block:X,timestamp:Ce,name:Ve}=Ue;let ne=Ce!=null?Ce:X;if(ne=ne!==null?Number(ne):null,typeof ne=="number"&&ne!==0&&ne!==T&&Ve!==z.Paris){const ut=(0,F.nr)("0x"+ne.toString(16).padStart(16,"0"));u=(0,F.eV)(u,ut),T=ne}if(Ue.name===h)break}const G=(0,F.eV)(l,u);return(0,F.ci)((0,F.sO)(dt(G)>>>0))}forkHash(h,l){h=h!=null?h:this._hardfork;const u=this._getHardfork(h);if(u===null||(u==null?void 0:u.block)===null&&(u==null?void 0:u.timestamp)===void 0&&(u==null?void 0:u.ttd)===void 0){const T="No fork hash calculation possible for future hardfork";throw new Error(T)}if((u==null?void 0:u.forkHash)!==null&&(u==null?void 0:u.forkHash)!==void 0)return u.forkHash;if(!l)throw new Error("genesisHash required for forkHash calculation");return this._calcForkHash(h,l)}hardforkForForkHash(h){const l=this.hardforks().filter(u=>u.forkHash===h);return l.length>=1?l[l.length-1]:null}setForkHashes(h){var l;for(const u of this.hardforks()){const T=(l=u.timestamp)!=null?l:u.block;(u.forkHash===null||u.forkHash===void 0)&&(T!=null||typeof u.ttd<"u")&&(u.forkHash=this.forkHash(u.name,h))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){const h=this.hardfork();let l;for(const u of this.HARDFORK_CHANGES)if("consensus"in u[1]&&(l=u[1].consensus.type),u[0]===h)break;return l!=null?l:this._chainParams.consensus.type}consensusAlgorithm(){const h=this.hardfork();let l;for(const u of this.HARDFORK_CHANGES)if("consensus"in u[1]&&(l=u[1].consensus.algorithm),u[0]===h)break;return l!=null?l:this._chainParams.consensus.algorithm}consensusConfig(){var u;const h=this.hardfork();let l;for(const T of this.HARDFORK_CHANGES){if("consensus"in T[1]){const G=T[1],J=G.consensus.algorithm;l=G.consensus[J]}if(T[0]===h)break}return(u=l!=null?l:this._chainParams.consensus[this.consensusAlgorithm()])!=null?u:{}}copy(){const h=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return h.events=new We.EventEmitter,h}static getInitializedChains(h){const l={};for(const[T,G]of Object.entries(xt))l[G]=T.toLowerCase();const u={...Vt};if(h)for(const T of h){const{name:G}=T;l[T.chainId.toString()]=G,u[G]=T}return u.names=l,u}}},93996:function(rn,j,Se){"use strict";Se.d(j,{yH:function(){return _t}});function F(P){if(Array.isArray(P)){const ee=[];let ie=0;for(let Ee=0;Ee<P.length;Ee++){const He=F(P[Ee]);ee.push(He),ie+=He.length}return Ge(re(ie,192),...ee)}const q=tt(P);return q.length===1&&q[0]<128?q:Ge(re(q.length,128),q)}function d(P,q,ee){if(ee>P.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return P.slice(q,ee)}function Me(P){if(P[0]===0)throw new Error("invalid RLP: extra zeros");return je($e(P))}function re(P,q){if(P<56)return Uint8Array.from([P+q]);const ee=et(P),ie=ee.length/2,Ee=et(q+55+ie);return Uint8Array.from(Ae(Ee+ee))}function H(P,q=!1){if(typeof P>"u"||P===null||P.length===0)return Uint8Array.from([]);const ee=tt(P),ie=he(ee);if(q)return ie;if(ie.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return ie.data}function he(P){let q,ee,ie,Ee,He;const ft=[],Ze=P[0];if(Ze<=127)return{data:P.slice(0,1),remainder:P.slice(1)};if(Ze<=183){if(q=Ze-127,Ze===128?ie=Uint8Array.from([]):ie=d(P,1,q),q===2&&ie[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:ie,remainder:P.slice(q)}}else if(Ze<=191){if(ee=Ze-182,P.length-1<ee)throw new Error("invalid RLP: not enough bytes for string length");if(q=Me(d(P,1,ee)),q<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return ie=d(P,ee,q+ee),{data:ie,remainder:P.slice(q+ee)}}else if(Ze<=247){for(q=Ze-191,Ee=d(P,1,q);Ee.length;)He=he(Ee),ft.push(He.data),Ee=He.remainder;return{data:ft,remainder:P.slice(q)}}else{if(ee=Ze-246,q=Me(d(P,1,ee)),q<56)throw new Error("invalid RLP: encoded list too short");const nt=ee+q;if(nt>P.length)throw new Error("invalid RLP: total length is larger than the data");for(Ee=d(P,ee,nt);Ee.length;)He=he(Ee),ft.push(He.data),Ee=He.remainder;return{data:ft,remainder:P.slice(nt)}}}const de=Array.from({length:256},(P,q)=>q.toString(16).padStart(2,"0"));function $e(P){let q="";for(let ee=0;ee<P.length;ee++)q+=de[P[ee]];return q}function je(P){const q=Number.parseInt(P,16);if(Number.isNaN(q))throw new Error("Invalid byte sequence");return q}function Ae(P){if(typeof P!="string")throw new TypeError("hexToBytes: expected string, got "+typeof P);if(P.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const q=new Uint8Array(P.length/2);for(let ee=0;ee<q.length;ee++){const ie=ee*2;q[ee]=je(P.slice(ie,ie+2))}return q}function Ge(...P){if(P.length===1)return P[0];const q=P.reduce((ie,Ee)=>ie+Ee.length,0),ee=new Uint8Array(q);for(let ie=0,Ee=0;ie<P.length;ie++){const He=P[ie];ee.set(He,Ee),Ee+=He.length}return ee}function pt(P){return new TextEncoder().encode(P)}function et(P){if(P<0)throw new Error("Invalid integer as argument, must be unsigned!");const q=P.toString(16);return q.length%2?`0${q}`:q}function vt(P){return P.length%2?`0${P}`:P}function qe(P){return P.length>=2&&P[0]==="0"&&P[1]==="x"}function $t(P){return typeof P!="string"?P:qe(P)?P.slice(2):P}function tt(P){if(P instanceof Uint8Array)return P;if(typeof P=="string")return qe(P)?Ae(vt($t(P))):pt(P);if(typeof P=="number"||typeof P=="bigint")return P?Ae(et(P)):Uint8Array.from([]);if(P==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof P)}const sn={bytesToHex:$e,concatBytes:Ge,hexToBytes:Ae,utf8ToBytes:pt},_t={encode:F,decode:H}},28856:function(rn,j,Se){"use strict";Se.d(j,{nL:function(){return Mt}});var F=Se(93996),d=Se(14454);function Me(f){if(!Number.isSafeInteger(f)||f<0)throw new Error(`Wrong positive integer: ${f}`)}function re(f){if(typeof f!="boolean")throw new Error(`Expected boolean, not ${f}`)}function H(f,...r){if(!(f instanceof Uint8Array))throw new Error("Expected Uint8Array");if(r.length>0&&!r.includes(f.length))throw new Error(`Expected Uint8Array of length ${r}, not of length=${f.length}`)}function he(f){if(typeof f!="function"||typeof f.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Me(f.outputLen),Me(f.blockLen)}function de(f,r=!0){if(f.destroyed)throw new Error("Hash instance has been destroyed");if(r&&f.finished)throw new Error("Hash#digest() has already been called")}function $e(f,r){H(f);const i=r.outputLen;if(f.length<i)throw new Error(`digestInto() expects output buffer of length at least ${i}`)}var Ae={number:Me,bool:re,bytes:H,hash:he,exists:de,output:$e};const Ge=BigInt(2**32-1),pt=BigInt(32);function et(f,r=!1){return r?{h:Number(f&Ge),l:Number(f>>pt&Ge)}:{h:Number(f>>pt&Ge)|0,l:Number(f&Ge)|0}}function vt(f,r=!1){let i=new Uint32Array(f.length),b=new Uint32Array(f.length);for(let m=0;m<f.length;m++){const{h:w,l:E}=et(f[m],r);[i[m],b[m]]=[w,E]}return[i,b]}const qe=(f,r)=>BigInt(f>>>0)<<pt|BigInt(r>>>0),$t=(f,r,i)=>f>>>i,tt=(f,r,i)=>f<<32-i|r>>>i,sn=(f,r,i)=>f>>>i|r<<32-i,_t=(f,r,i)=>f<<32-i|r>>>i,P=(f,r,i)=>f<<64-i|r>>>i-32,q=(f,r,i)=>f>>>i-32|r<<64-i,ee=(f,r)=>r,ie=(f,r)=>f,Ee=(f,r,i)=>f<<i|r>>>32-i,He=(f,r,i)=>r<<i|f>>>32-i,ft=(f,r,i)=>r<<i-32|f>>>64-i,Ze=(f,r,i)=>f<<i-32|r>>>64-i;function nt(f,r,i,b){const m=(r>>>0)+(b>>>0);return{h:f+i+(m/2**32|0)|0,l:m|0}}var S={fromBig:et,split:vt,toBig:qe,shrSH:$t,shrSL:tt,rotrSH:sn,rotrSL:_t,rotrBH:P,rotrBL:q,rotr32H:ee,rotr32L:ie,rotlSH:Ee,rotlSL:He,rotlBH:ft,rotlBL:Ze,add:nt,add3L:(f,r,i)=>(f>>>0)+(r>>>0)+(i>>>0),add3H:(f,r,i,b)=>r+i+b+(f/2**32|0)|0,add4L:(f,r,i,b)=>(f>>>0)+(r>>>0)+(i>>>0)+(b>>>0),add4H:(f,r,i,b,m)=>r+i+b+m+(f/2**32|0)|0,add5H:(f,r,i,b,m,w)=>r+i+b+m+w+(f/2**32|0)|0,add5L:(f,r,i,b,m)=>(f>>>0)+(r>>>0)+(i>>>0)+(b>>>0)+(m>>>0)};const k=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const O=f=>f instanceof Uint8Array,ae=f=>new Uint8Array(f.buffer,f.byteOffset,f.byteLength),se=f=>new Uint32Array(f.buffer,f.byteOffset,Math.floor(f.byteLength/4)),me=f=>new DataView(f.buffer,f.byteOffset,f.byteLength),xe=(f,r)=>f<<32-r|f>>>r;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");const ye=Array.from({length:256},(f,r)=>r.toString(16).padStart(2,"0"));function cn(f){if(!O(f))throw new Error("Uint8Array expected");let r="";for(let i=0;i<f.length;i++)r+=ye[f[i]];return r}function Bt(f){if(typeof f!="string")throw new Error("hex string expected, got "+typeof f);const r=f.length;if(r%2)throw new Error("padded hex string expected, got unpadded hex of length "+r);const i=new Uint8Array(r/2);for(let b=0;b<i.length;b++){const m=b*2,w=f.slice(m,m+2),E=Number.parseInt(w,16);if(Number.isNaN(E)||E<0)throw new Error("Invalid byte sequence");i[b]=E}return i}const dt=async()=>{};async function yt(f,r,i){let b=Date.now();for(let m=0;m<f;m++){i(m);const w=Date.now()-b;w>=0&&w<r||(await dt(),b+=w)}}function _n(f){if(typeof f!="string")throw new Error(`utf8ToBytes expected string, got ${typeof f}`);return new Uint8Array(new TextEncoder().encode(f))}function It(f){if(typeof f=="string"&&(f=_n(f)),!O(f))throw new Error(`expected Uint8Array, got ${typeof f}`);return f}function Ht(...f){const r=new Uint8Array(f.reduce((b,m)=>b+m.length,0));let i=0;return f.forEach(b=>{if(!O(b))throw new Error("Uint8Array expected");r.set(b,i),i+=b.length}),r}class rt{clone(){return this._cloneInto()}}const bn=f=>Object.prototype.toString.call(f)==="[object Object]"&&f.constructor===Object;function Ot(f,r){if(r!==void 0&&(typeof r!="object"||!bn(r)))throw new Error("Options should be object or undefined");return Object.assign(f,r)}function gn(f){const r=b=>f().update(It(b)).digest(),i=f();return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.create=()=>f(),r}function rr(f){const r=(b,m)=>f(m).update(It(b)).digest(),i=f({});return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.create=b=>f(b),r}function We(f){const r=(b,m)=>f(m).update(It(b)).digest(),i=f({});return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.create=b=>f(b),r}function Vt(f=32){if(crypto&&typeof crypto.getRandomValues=="function")return crypto.getRandomValues(new Uint8Array(f));throw new Error("crypto.getRandomValues must be defined")}const[xt,Ln,z]=[[],[],[]],mn=BigInt(0),St=BigInt(1),Fe=BigInt(2),ue=BigInt(7),wt=BigInt(256),Pe=BigInt(113);for(let f=0,r=St,i=1,b=0;f<24;f++){[i,b]=[b,(2*i+3*b)%5],xt.push(2*(5*b+i)),Ln.push((f+1)*(f+2)/2%64);let m=mn;for(let w=0;w<7;w++)r=(r<<St^(r>>ue)*Pe)%wt,r&Fe&&(m^=St<<(St<<BigInt(w))-St);z.push(m)}const[Hn,Ct]=S.split(z,!0),Te=(f,r,i)=>i>32?S.rotlBH(f,r,i):S.rotlSH(f,r,i),le=(f,r,i)=>i>32?S.rotlBL(f,r,i):S.rotlSL(f,r,i);function Oe(f,r=24){const i=new Uint32Array(10);for(let b=24-r;b<24;b++){for(let E=0;E<10;E++)i[E]=f[E]^f[E+10]^f[E+20]^f[E+30]^f[E+40];for(let E=0;E<10;E+=2){const R=(E+8)%10,Z=(E+2)%10,ce=i[Z],fe=i[Z+1],be=Te(ce,fe,1)^i[R],Ne=le(ce,fe,1)^i[R+1];for(let De=0;De<50;De+=10)f[E+De]^=be,f[E+De+1]^=Ne}let m=f[2],w=f[3];for(let E=0;E<24;E++){const R=Ln[E],Z=Te(m,w,R),ce=le(m,w,R),fe=xt[E];m=f[fe],w=f[fe+1],f[fe]=Z,f[fe+1]=ce}for(let E=0;E<50;E+=10){for(let R=0;R<10;R++)i[R]=f[E+R];for(let R=0;R<10;R++)f[E+R]^=~i[(R+2)%10]&i[(R+4)%10]}f[0]^=Hn[b],f[1]^=Ct[b]}i.fill(0)}class B extends rt{constructor(r,i,b,m=!1,w=24){if(super(),this.blockLen=r,this.suffix=i,this.outputLen=b,this.enableXOF=m,this.rounds=w,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ae.number(b),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=se(this.state)}keccak(){Oe(this.state32,this.rounds),this.posOut=0,this.pos=0}update(r){Ae.exists(this);const{blockLen:i,state:b}=this;r=It(r);const m=r.length;for(let w=0;w<m;){const E=Math.min(i-this.pos,m-w);for(let R=0;R<E;R++)b[this.pos++]^=r[w++];this.pos===i&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:r,suffix:i,pos:b,blockLen:m}=this;r[b]^=i,(i&128)!==0&&b===m-1&&this.keccak(),r[m-1]^=128,this.keccak()}writeInto(r){Ae.exists(this,!1),Ae.bytes(r),this.finish();const i=this.state,{blockLen:b}=this;for(let m=0,w=r.length;m<w;){this.posOut>=b&&this.keccak();const E=Math.min(b-this.posOut,w-m);r.set(i.subarray(this.posOut,this.posOut+E),m),this.posOut+=E,m+=E}return r}xofInto(r){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(r)}xof(r){return Ae.number(r),this.xofInto(new Uint8Array(r))}digestInto(r){if(Ae.output(r,this),this.finished)throw new Error("digest() was already called");return this.writeInto(r),this.destroy(),r}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(r){const{blockLen:i,suffix:b,outputLen:m,rounds:w,enableXOF:E}=this;return r||(r=new B(i,b,m,E,w)),r.state32.set(this.state32),r.pos=this.pos,r.posOut=this.posOut,r.finished=this.finished,r.rounds=w,r.suffix=b,r.outputLen=m,r.enableXOF=E,r.destroyed=this.destroyed,r}}const h=(f,r,i)=>gn(()=>new B(r,f,i)),l=h(6,144,224/8),u=h(6,136,256/8),T=h(6,104,384/8),G=h(6,72,512/8),J=h(1,144,224/8),Ue=h(1,136,256/8),X=h(1,104,384/8),Ce=h(1,72,512/8),Ve=(f,r,i)=>We((b={})=>new B(r,f,b.dkLen===void 0?i:b.dkLen,!0)),ne=Ve(31,168,128/8),ut=Ve(31,136,256/8),Rt=Ae.bool,Ut=Ae.bytes;function ze(f){if(!(f instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof f}`);return new TextDecoder().decode(f)}function Kt(f){const r=f.startsWith("0x")?f.substring(2):f;return _hexToBytes(r)}function pn(f,r){if(f.length!==r.length)return!1;for(let i=0;i<f.length;i++)if(f[i]!==r[i])return!1;return!0}function fn(f){return r=>(Ae.bytes(r),f(r))}const jt=(()=>{const f=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,r=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:r&&!f?r("crypto"):void 0,web:f}})(),On=fn(J),Ye=(()=>{const f=fn(Ue);return f.create=Ue.create,f})(),Ie=fn(X),ht=fn(Ce);var Je=Se(35742),Re;(function(f){f[f.EIP155ReplayProtection=155]="EIP155ReplayProtection",f[f.EIP1559FeeMarket=1559]="EIP1559FeeMarket",f[f.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",f[f.EIP2930AccessLists=2930]="EIP2930AccessLists"})(Re||(Re={}));function sr(f){if(f.length===0)return!0;const r=f[0];return!!Array.isArray(r)}function jn(f){return!sr(f)}var ve;(function(f){f[f.Legacy=0]="Legacy",f[f.AccessListEIP2930=1]="AccessListEIP2930",f[f.FeeMarketEIP1559=2]="FeeMarketEIP1559",f[f.BlobEIP4844=3]="BlobEIP4844"})(ve||(ve={}));function Ir(f){return f.type===ve.Legacy}function Sr(f){return f.type===ve.AccessListEIP2930}function Xt(f){return f.type===ve.FeeMarketEIP1559}function lt(f){return f.type===ve.BlobEIP4844}function _e(f){return Number((0,d.v3)((0,d.O0)(f.type)))===ve.Legacy}function At(f){return Number((0,d.v3)((0,d.O0)(f.type)))===ve.AccessListEIP2930}function yn(f){return Number((0,d.v3)((0,d.O0)(f.type)))===ve.FeeMarketEIP1559}function Xn(f){return Number((0,d.v3)((0,d.O0)(f.type)))===ve.BlobEIP4844}function or(f,r){const i=f.param("vm","maxInitCodeSize");if(i&&BigInt(r)>i)throw new Error(`the initcode size of this transaction is too large: it is ${r} while the max is ${f.param("vm","maxInitCodeSize")}`)}class st{static getAccessListData(r){let i,b;if(jn(r)){i=r;const m=[];for(let w=0;w<r.length;w++){const E=r[w],R=(0,d.nr)(E.address),Z=[];for(let ce=0;ce<E.storageKeys.length;ce++)Z.push((0,d.nr)(E.storageKeys[ce]));m.push([R,Z])}b=m}else{b=r!=null?r:[];const m=[];for(let w=0;w<b.length;w++){const E=b[w],R=(0,d.ci)(E[0]),Z=[];for(let fe=0;fe<E[1].length;fe++)Z.push((0,d.ci)(E[1][fe]));const ce={address:R,storageKeys:Z};m.push(ce)}i=m}return{AccessListJSON:i,accessList:b}}static verifyAccessList(r){for(let i=0;i<r.length;i++){const b=r[i],m=b[0],w=b[1];if(b[2]!==void 0)throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(m.length!==20)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(let E=0;E<w.length;E++)if(w[E].length!==32)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}}static getAccessListJSON(r){const i=[];for(let b=0;b<r.length;b++){const m=r[b],w={address:(0,d.ci)((0,d.V_)(m[0],20)),storageKeys:[]},E=m[1];for(let R=0;R<E.length;R++){const Z=E[R];w.storageKeys.push((0,d.ci)((0,d.V_)(Z,32)))}i.push(w)}return i}static getDataFeeEIP2930(r,i){const b=i.param("gasPrices","accessListStorageKeyCost"),m=i.param("gasPrices","accessListAddressCost");let w=0;for(let R=0;R<r.length;R++){const ce=r[R][1];w+=ce.length}return r.length*Number(m)+w*Number(b)}}class Pt{constructor(r,i){var Zn,Dn;this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=Je.qo.Mainnet;const{nonce:b,gasLimit:m,to:w,value:E,data:R,v:Z,r:ce,s:fe,type:be}=r;this._type=Number((0,d.v3)((0,d.O0)(be))),this.txOptions=i;const Ne=(0,d.O0)(w===""?"0x":w),De=(0,d.O0)(Z===""?"0x":Z),Ke=(0,d.O0)(ce===""?"0x":ce),we=(0,d.O0)(fe===""?"0x":fe);this.nonce=(0,d.v3)((0,d.O0)(b===""?"0x":b)),this.gasLimit=(0,d.v3)((0,d.O0)(m===""?"0x":m)),this.to=Ne.length>0?new d.kL(Ne):void 0,this.value=(0,d.v3)((0,d.O0)(E===""?"0x":E)),this.data=(0,d.O0)(R===""?"0x":R),this.v=De.length>0?(0,d.v3)(De):void 0,this.r=Ke.length>0?(0,d.v3)(Ke):void 0,this.s=we.length>0?(0,d.v3)(we):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0);const gt=this.to===void 0||this.to===null,cr=(Zn=i.allowUnlimitedInitCodeSize)!=null?Zn:!1,Bn=(Dn=i.common)!=null?Dn:this._getCommon();gt&&Bn.isActivatedEIP(3860)&&cr===!1&&or(Bn,this.data.length)}get type(){return this._type}supports(r){return this.activeCapabilities.includes(r)}getValidationErrors(){const r=[];return this.isSigned()&&!this.verifySignature()&&r.push("Invalid Signature"),this.getBaseFee()>this.gasLimit&&r.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`),r}isValid(){return this.getValidationErrors().length===0}_validateYParity(){const{v:r}=this;if(r!==void 0&&r!==BigInt(0)&&r!==BigInt(1)){const i=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(i)}}_validateHighS(){const{s:r}=this;if(this.common.gteHardfork("homestead")&&r!==void 0&&r>d.Sr){const i=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(i)}}getBaseFee(){const r=this.common.param("gasPrices","tx");let i=this.getDataFee();if(r&&(i+=r),this.common.gteHardfork("homestead")&&this.toCreationAddress()){const b=this.common.param("gasPrices","txCreation");b&&(i+=b)}return i}getDataFee(){const r=this.common.param("gasPrices","txDataZero"),i=this.common.param("gasPrices","txDataNonZero");let b=BigInt(0);for(let m=0;m<this.data.length;m++)this.data[m]===0?b+=r:b+=i;if((this.to===void 0||this.to===null)&&this.common.isActivatedEIP(3860)){const m=BigInt(Math.ceil(this.data.length/32)),w=this.common.param("gasPrices","initCodeWordCost")*m;b+=w}return b}toCreationAddress(){return this.to===void 0||this.to.bytes.length===0}isSigned(){const{v:r,r:i,s:b}=this;return!(r===void 0||i===void 0||b===void 0)}verifySignature(){try{const r=this.getSenderPublicKey();return(0,d._K)(r).length!==0}catch{return!1}}getSenderAddress(){return new d.kL((0,d.fB)(this.getSenderPublicKey()))}sign(r){if(r.length!==32){const Z=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(Z)}let i=!1;this.type===ve.Legacy&&this.common.gteHardfork("spuriousDragon")&&!this.supports(Re.EIP155ReplayProtection)&&(this.activeCapabilities.push(Re.EIP155ReplayProtection),i=!0);const b=this.getHashedMessageToSign(),{v:m,r:w,s:E}=(0,d.v4)(b,r),R=this._processSignature(m,w,E);if(i){const Z=this.activeCapabilities.indexOf(Re.EIP155ReplayProtection);Z>-1&&this.activeCapabilities.splice(Z,1)}return R}toJSON(){return{type:(0,d.Z4)(BigInt(this.type)),nonce:(0,d.Z4)(this.nonce),gasLimit:(0,d.Z4)(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:(0,d.Z4)(this.value),data:(0,d.ci)(this.data),v:this.v!==void 0?(0,d.Z4)(this.v):void 0,r:this.r!==void 0?(0,d.Z4)(this.r):void 0,s:this.s!==void 0?(0,d.Z4)(this.s):void 0}}_getCommon(r,i){var b;if(i!==void 0){const m=(0,d.v3)((0,d.O0)(i));if(r){if(r.chainId()!==m){const w=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(w)}return r.copy()}else return Je.Gn.isSupportedChainId(m)?new Je.Gn({chain:m}):Je.Gn.custom({name:"custom-chain",networkId:m,chainId:m},{baseChain:this.DEFAULT_CHAIN})}else return(b=r==null?void 0:r.copy())!=null?b:new Je.Gn({chain:this.DEFAULT_CHAIN})}_validateCannotExceedMaxInteger(r,i=256,b=!1){for(const[m,w]of Object.entries(r))switch(i){case 64:if(b){if(w!==void 0&&w>=d.np){const E=this._errorMsg(`${m} cannot equal or exceed MAX_UINT64 (2^64-1), given ${w}`);throw new Error(E)}}else if(w!==void 0&&w>d.np){const E=this._errorMsg(`${m} cannot exceed MAX_UINT64 (2^64-1), given ${w}`);throw new Error(E)}break;case 256:if(b){if(w!==void 0&&w>=d.E2){const E=this._errorMsg(`${m} cannot equal or exceed MAX_INTEGER (2^256-1), given ${w}`);throw new Error(E)}}else if(w!==void 0&&w>d.E2){const E=this._errorMsg(`${m} cannot exceed MAX_INTEGER (2^256-1), given ${w}`);throw new Error(E)}break;default:{const E=this._errorMsg("unimplemented bits value");throw new Error(E)}}}static _validateNotArray(r){const i=["nonce","gasPrice","gasLimit","to","value","data","v","r","s","type","baseFee","maxFeePerGas","chainId"];for(const[b,m]of Object.entries(r))if(i.includes(b)&&Array.isArray(m))throw new Error(`${b} cannot be an array`)}_getSharedErrorPostfix(){let r="";try{r=this.isSigned()?(0,d.ci)(this.hash()):"not available (unsigned)"}catch{r="error"}let i="";try{i=this.isSigned().toString()}catch{r="error"}let b="";try{b=this.common.hardfork()}catch{b="error"}let m=`tx type=${this.type} hash=${r} nonce=${this.nonce} value=${this.value} `;return m+=`signed=${i} hf=${b}`,m}}const Cn=(0,d.nr)("0x"+ve.FeeMarketEIP1559.toString(16).padStart(2,"0"));class Zt extends Pt{constructor(r,i={}){var ce;super({...r,type:ve.FeeMarketEIP1559},i);const{chainId:b,accessList:m,maxFeePerGas:w,maxPriorityFeePerGas:E}=r;if(this.common=this._getCommon(i.common,b),this.chainId=this.common.chainId(),this.common.isActivatedEIP(1559)===!1)throw new Error("EIP-1559 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const R=st.getAccessListData(m!=null?m:[]);if(this.accessList=R.accessList,this.AccessListJSON=R.AccessListJSON,st.verifyAccessList(this.accessList),this.maxFeePerGas=(0,d.v3)((0,d.O0)(w===""?"0x":w)),this.maxPriorityFeePerGas=(0,d.v3)((0,d.O0)(E===""?"0x":E)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),Pt._validateNotArray(r),this.gasLimit*this.maxFeePerGas>d.E2){const fe=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(fe)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const fe=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(fe)}this._validateYParity(),this._validateHighS(),((ce=i==null?void 0:i.freeze)!=null?ce:!0)&&Object.freeze(this)}static fromTxData(r,i={}){return new Zt(r,i)}static fromSerializedTx(r,i={}){if((0,d.hD)(r.subarray(0,1),Cn)===!1)throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ${ve.FeeMarketEIP1559}, received: ${(0,d.ci)(r.subarray(0,1))}`);const b=F.yH.decode(r.subarray(1));if(!Array.isArray(b))throw new Error("Invalid serialized tx input: must be array");return Zt.fromValuesArray(b,i)}static fromValuesArray(r,i={}){if(r.length!==9&&r.length!==12)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");const[b,m,w,E,R,Z,ce,fe,be,Ne,De,Ke]=r;return this._validateNotArray({chainId:b,v:Ne}),(0,d.jY)({nonce:m,maxPriorityFeePerGas:w,maxFeePerGas:E,gasLimit:R,value:ce,v:Ne,r:De,s:Ke}),new Zt({chainId:(0,d.v3)(b),nonce:m,maxPriorityFeePerGas:w,maxFeePerGas:E,gasLimit:R,to:Z,value:ce,data:fe,accessList:be!=null?be:[],v:Ne!==void 0?(0,d.v3)(Ne):void 0,r:De,s:Ke},i)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let r=super.getDataFee();return r+=BigInt(st.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:r,hardfork:this.common.hardfork()}),r}getUpfrontCost(r=BigInt(0)){const i=this.maxPriorityFeePerGas,b=this.maxFeePerGas-r,w=(i<b?i:b)+r;return this.gasLimit*w+this.value}raw(){return[(0,d.XD)(this.chainId),(0,d.XD)(this.nonce),(0,d.XD)(this.maxPriorityFeePerGas),(0,d.XD)(this.maxFeePerGas),(0,d.XD)(this.gasLimit),this.to!==void 0?this.to.bytes:new Uint8Array(0),(0,d.XD)(this.value),this.data,this.accessList,this.v!==void 0?(0,d.XD)(this.v):new Uint8Array(0),this.r!==void 0?(0,d.XD)(this.r):new Uint8Array(0),this.s!==void 0?(0,d.XD)(this.s):new Uint8Array(0)]}serialize(){const r=this.raw();return(0,d.eV)(Cn,F.yH.encode(r))}getMessageToSign(){const r=this.raw().slice(0,9);return(0,d.eV)(Cn,F.yH.encode(r))}getHashedMessageToSign(){return Ye(this.getMessageToSign())}hash(){if(!this.isSigned()){const r=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(r)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Ye(this.serialize())),this.cache.hash):Ye(this.serialize())}getMessageToVerifySignature(){return this.getHashedMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const w=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(w)}const r=this.getMessageToVerifySignature(),{v:i,r:b,s:m}=this;this._validateHighS();try{return(0,d.Js)(r,i+BigInt(27),(0,d.XD)(b),(0,d.XD)(m))}catch{const E=this._errorMsg("Invalid Signature");throw new Error(E)}}_processSignature(r,i,b){const m={...this.txOptions,common:this.common};return Zt.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:r-BigInt(27),r:(0,d.v3)(i),s:(0,d.v3)(b)},m)}toJSON(){const r=st.getAccessListJSON(this.accessList);return{...super.toJSON(),chainId:(0,d.Z4)(this.chainId),maxPriorityFeePerGas:(0,d.Z4)(this.maxPriorityFeePerGas),maxFeePerGas:(0,d.Z4)(this.maxFeePerGas),accessList:r}}errorStr(){let r=this._getSharedErrorPostfix();return r+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,r}_errorMsg(r){return`${r} (${this.errorStr()})`}}const Rn=(0,d.nr)("0x"+ve.AccessListEIP2930.toString(16).padStart(2,"0"));class Dt extends Pt{constructor(r,i={}){var Z;super({...r,type:ve.AccessListEIP2930},i);const{chainId:b,accessList:m,gasPrice:w}=r;if(this.common=this._getCommon(i.common,b),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);const E=st.getAccessListData(m!=null?m:[]);if(this.accessList=E.accessList,this.AccessListJSON=E.AccessListJSON,st.verifyAccessList(this.accessList),this.gasPrice=(0,d.v3)((0,d.O0)(w===""?"0x":w)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),Pt._validateNotArray(r),this.gasPrice*this.gasLimit>d.E2){const ce=this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(ce)}this._validateYParity(),this._validateHighS(),((Z=i==null?void 0:i.freeze)!=null?Z:!0)&&Object.freeze(this)}static fromTxData(r,i={}){return new Dt(r,i)}static fromSerializedTx(r,i={}){if((0,d.hD)(r.subarray(0,1),Rn)===!1)throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ${ve.AccessListEIP2930}, received: ${(0,d.ci)(r.subarray(0,1))}`);const b=F.yH.decode(Uint8Array.from(r.subarray(1)));if(!Array.isArray(b))throw new Error("Invalid serialized tx input: must be array");return Dt.fromValuesArray(b,i)}static fromValuesArray(r,i={}){if(r.length!==8&&r.length!==11)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");const[b,m,w,E,R,Z,ce,fe,be,Ne,De]=r;this._validateNotArray({chainId:b,v:be}),(0,d.jY)({nonce:m,gasPrice:w,gasLimit:E,value:Z,v:be,r:Ne,s:De});const Ke=[];return new Dt({chainId:(0,d.v3)(b),nonce:m,gasPrice:w,gasLimit:E,to:R,value:Z,data:ce,accessList:fe!=null?fe:Ke,v:be!==void 0?(0,d.v3)(be):void 0,r:Ne,s:De},i)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let r=super.getDataFee();return r+=BigInt(st.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:r,hardfork:this.common.hardfork()}),r}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}raw(){return[(0,d.XD)(this.chainId),(0,d.XD)(this.nonce),(0,d.XD)(this.gasPrice),(0,d.XD)(this.gasLimit),this.to!==void 0?this.to.bytes:new Uint8Array(0),(0,d.XD)(this.value),this.data,this.accessList,this.v!==void 0?(0,d.XD)(this.v):new Uint8Array(0),this.r!==void 0?(0,d.XD)(this.r):new Uint8Array(0),this.s!==void 0?(0,d.XD)(this.s):new Uint8Array(0)]}serialize(){const r=this.raw();return(0,d.eV)(Rn,F.yH.encode(r))}getMessageToSign(){const r=this.raw().slice(0,8);return(0,d.eV)(Rn,F.yH.encode(r))}getHashedMessageToSign(){return Ye(this.getMessageToSign())}hash(){if(!this.isSigned()){const r=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(r)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Ye(this.serialize())),this.cache.hash):Ye(this.serialize())}getMessageToVerifySignature(){return this.getHashedMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const w=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(w)}const r=this.getMessageToVerifySignature(),{v:i,r:b,s:m}=this;this._validateHighS();try{return(0,d.Js)(r,i+BigInt(27),(0,d.XD)(b),(0,d.XD)(m))}catch{const E=this._errorMsg("Invalid Signature");throw new Error(E)}}_processSignature(r,i,b){const m={...this.txOptions,common:this.common};return Dt.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:r-BigInt(27),r:(0,d.v3)(i),s:(0,d.v3)(b)},m)}toJSON(){const r=st.getAccessListJSON(this.accessList);return{...super.toJSON(),chainId:(0,d.Z4)(this.chainId),gasPrice:(0,d.Z4)(this.gasPrice),accessList:r}}errorStr(){var i,b;let r=this._getSharedErrorPostfix();return r+=` gasPrice=${this.gasPrice} accessListCount=${(b=(i=this.accessList)==null?void 0:i.length)!=null?b:0}`,r}_errorMsg(r){return`${r} (${this.errorStr()})`}}const Nt=16777216,Ar=16777216,wn=16777216,En=16777216,Pr=16777216,kr=4096,ir=32,vn=(0,d.nr)("0x"+ve.BlobEIP4844.toString(16).padStart(2,"0")),Tr=(f,r,i,b,m)=>{if(!(f.length===r.length&&r.length===i.length))throw new Error("Number of versionedHashes, blobs, and commitments not all equal");if(f.length===0)throw new Error("Invalid transaction with empty blobs");let w;try{w=d.V7.verifyBlobKzgProofBatch(r,i,b)}catch(E){throw new Error(`KZG verification of blobs fail with error=${E}`)}if(!w)throw new Error("KZG proof cannot be verified from blobs/commitments");for(let E=0;E<f.length;E++){const R=(0,d.h$)(i[E],m);if(!(0,d.hD)(R,f[E]))throw new Error(`commitment for blob at index ${E} does not match versionedHash`)}};class bt extends Pt{constructor(r,i={}){var fe,be,Ne,De,Ke;super({...r,type:ve.BlobEIP4844},i);const{chainId:b,accessList:m,maxFeePerGas:w,maxPriorityFeePerGas:E,maxFeePerBlobGas:R}=r;if(this.common=this._getCommon(i.common,b),this.chainId=this.common.chainId(),this.common.isActivatedEIP(1559)===!1)throw new Error("EIP-1559 not enabled on Common");if(this.common.isActivatedEIP(4844)===!1)throw new Error("EIP-4844 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const Z=st.getAccessListData(m!=null?m:[]);if(this.accessList=Z.accessList,this.AccessListJSON=Z.AccessListJSON,st.verifyAccessList(this.accessList),this.maxFeePerGas=(0,d.v3)((0,d.O0)(w===""?"0x":w)),this.maxPriorityFeePerGas=(0,d.v3)((0,d.O0)(E===""?"0x":E)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),Pt._validateNotArray(r),this.gasLimit*this.maxFeePerGas>d.E2){const we=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(we)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const we=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(we)}this.maxFeePerBlobGas=(0,d.v3)((0,d.O0)((R!=null?R:"")===""?"0x":R)),this.versionedHashes=((fe=r.versionedHashes)!=null?fe:[]).map(we=>(0,d.O0)(we)),this._validateYParity(),this._validateHighS();for(const we of this.versionedHashes){if(we.length!==32){const gt=this._errorMsg("versioned hash is invalid length");throw new Error(gt)}if(BigInt(we[0])!==this.common.paramByEIP("sharding","blobCommitmentVersionKzg",4844)){const gt=this._errorMsg("versioned hash does not start with KZG commitment version");throw new Error(gt)}}if(this.versionedHashes.length>En){const we=this._errorMsg(`tx can contain at most ${En} blobs`);throw new Error(we)}this.blobs=(be=r.blobs)==null?void 0:be.map(we=>(0,d.O0)(we)),this.kzgCommitments=(Ne=r.kzgCommitments)==null?void 0:Ne.map(we=>(0,d.O0)(we)),this.kzgProofs=(De=r.kzgProofs)==null?void 0:De.map(we=>(0,d.O0)(we)),((Ke=i==null?void 0:i.freeze)!=null?Ke:!0)&&Object.freeze(this)}static fromTxData(r,i){if(r.blobsData!==void 0){if(r.blobs!==void 0)throw new Error("cannot have both raw blobs data and encoded blobs in constructor");if(r.kzgCommitments!==void 0)throw new Error("cannot have both raw blobs data and KZG commitments in constructor");if(r.versionedHashes!==void 0)throw new Error("cannot have both raw blobs data and versioned hashes in constructor");if(r.kzgProofs!==void 0)throw new Error("cannot have both raw blobs data and KZG proofs in constructor");r.blobs=(0,d.KR)(r.blobsData.reduce((b,m)=>b+m)),r.kzgCommitments=(0,d.PS)(r.blobs),r.versionedHashes=(0,d.CW)(r.kzgCommitments),r.kzgProofs=(0,d.y9)(r.blobs,r.kzgCommitments)}return new bt(r,i)}static minimalFromNetworkWrapper(r,i){return bt.fromTxData({...r,blobs:void 0,kzgCommitments:void 0,kzgProofs:void 0},i)}static fromSerializedTx(r,i={}){if((0,d.hD)(r.subarray(0,1),vn)===!1)throw new Error(`Invalid serialized tx input: not an EIP-4844 transaction (wrong tx type, expected: ${ve.BlobEIP4844}, received: ${(0,d.ci)(r.subarray(0,1))}`);const b=F.yH.decode(r.subarray(1));if(!Array.isArray(b))throw new Error("Invalid serialized tx input: must be array");return bt.fromValuesArray(b,i)}static fromValuesArray(r,i={}){if(r.length!==11&&r.length!==14)throw new Error("Invalid EIP-4844 transaction. Only expecting 11 values (for unsigned tx) or 14 values (for signed tx).");const[b,m,w,E,R,Z,ce,fe,be,Ne,De,Ke,we,gt]=r;return this._validateNotArray({chainId:b,v:Ke}),(0,d.jY)({nonce:m,maxPriorityFeePerGas:w,maxFeePerGas:E,gasLimit:R,value:ce,maxFeePerBlobGas:Ne,v:Ke,r:we,s:gt}),new bt({chainId:(0,d.v3)(b),nonce:m,maxPriorityFeePerGas:w,maxFeePerGas:E,gasLimit:R,to:Z,value:ce,data:fe,accessList:be!=null?be:[],maxFeePerBlobGas:Ne,versionedHashes:De,v:Ke!==void 0?(0,d.v3)(Ke):void 0,r:we,s:gt},i)}static fromSerializedBlobTxNetworkWrapper(r,i){var be;if(!i||!i.common)throw new Error("common instance required to validate versioned hashes");if((0,d.hD)(r.subarray(0,1),vn)===!1)throw new Error(`Invalid serialized tx input: not an EIP-4844 transaction (wrong tx type, expected: ${ve.BlobEIP4844}, received: ${(0,d.ci)(r.subarray(0,1))}`);const b=F.yH.decode(r.subarray(1));if(b.length!==4)throw Error("Expected 4 values in the deserialized network transaction");const[m,w,E,R]=b,Z=bt.fromValuesArray(m,{...i,freeze:!1});if(Z.to===void 0)throw Error("BlobEIP4844Transaction can not be send without a valid `to`");const ce=Number(i.common.paramByEIP("sharding","blobCommitmentVersionKzg",4844));return Tr(Z.versionedHashes,w,E,R,ce),Z.blobs=w,Z.kzgCommitments=E,Z.kzgProofs=R,((be=i==null?void 0:i.freeze)!=null?be:!0)&&Object.freeze(Z),Z}getUpfrontCost(r=BigInt(0)){const i=this.maxPriorityFeePerGas,b=this.maxFeePerGas-r,w=(i<b?i:b)+r;return this.gasLimit*w+this.value}raw(){return[(0,d.XD)(this.chainId),(0,d.XD)(this.nonce),(0,d.XD)(this.maxPriorityFeePerGas),(0,d.XD)(this.maxFeePerGas),(0,d.XD)(this.gasLimit),this.to!==void 0?this.to.bytes:new Uint8Array(0),(0,d.XD)(this.value),this.data,this.accessList,(0,d.XD)(this.maxFeePerBlobGas),this.versionedHashes,this.v!==void 0?(0,d.XD)(this.v):new Uint8Array(0),this.r!==void 0?(0,d.XD)(this.r):new Uint8Array(0),this.s!==void 0?(0,d.XD)(this.s):new Uint8Array(0)]}serialize(){const r=this.raw();return(0,d.eV)(vn,F.yH.encode(r))}serializeNetworkWrapper(){if(this.blobs===void 0||this.kzgCommitments===void 0||this.kzgProofs===void 0)throw new Error("cannot serialize network wrapper without blobs, KZG commitments and KZG proofs provided");const r=this.raw();return(0,d.eV)(vn,F.yH.encode([r,this.blobs,this.kzgCommitments,this.kzgProofs]))}getMessageToSign(){const r=this.raw().slice(0,11);return(0,d.eV)(vn,F.yH.encode(r))}getHashedMessageToSign(){return Ye(this.getMessageToSign())}hash(){if(!this.isSigned()){const r=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(r)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Ye(this.serialize())),this.cache.hash):Ye(this.serialize())}getMessageToVerifySignature(){return this.getHashedMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const w=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(w)}const r=this.getMessageToVerifySignature(),{v:i,r:b,s:m}=this;this._validateHighS();try{return(0,d.Js)(r,i+BigInt(27),(0,d.XD)(b),(0,d.XD)(m))}catch{const E=this._errorMsg("Invalid Signature");throw new Error(E)}}toJSON(){const r=st.getAccessListJSON(this.accessList);return{...super.toJSON(),chainId:(0,d.Z4)(this.chainId),maxPriorityFeePerGas:(0,d.Z4)(this.maxPriorityFeePerGas),maxFeePerGas:(0,d.Z4)(this.maxFeePerGas),accessList:r,maxFeePerBlobGas:(0,d.Z4)(this.maxFeePerBlobGas),versionedHashes:this.versionedHashes.map(b=>(0,d.ci)(b))}}_processSignature(r,i,b){const m={...this.txOptions,common:this.common};return bt.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:r-BigInt(27),r:(0,d.v3)(i),s:(0,d.v3)(b),maxFeePerBlobGas:this.maxFeePerBlobGas,versionedHashes:this.versionedHashes,blobs:this.blobs,kzgCommitments:this.kzgCommitments,kzgProofs:this.kzgProofs},m)}errorStr(){let r=this._getSharedErrorPostfix();return r+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,r}_errorMsg(r){return`${r} (${this.errorStr()})`}numBlobs(){return this.versionedHashes.length}}function Un(f,r){const i=Number(f),b=Number(r)*2;return i===b+35||i===b+36}class kt extends Pt{constructor(r,i={}){var m;if(super({...r,type:ve.Legacy},i),this.common=this._validateTxV(this.v,i.common),this.gasPrice=(0,d.v3)((0,d.O0)(r.gasPrice===""?"0x":r.gasPrice)),this.gasPrice*this.gasLimit>d.E2){const w=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(w)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),Pt._validateNotArray(r),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?Un(this.v,this.common.chainId())&&this.activeCapabilities.push(Re.EIP155ReplayProtection):this.activeCapabilities.push(Re.EIP155ReplayProtection)),((m=i==null?void 0:i.freeze)!=null?m:!0)&&Object.freeze(this)}static fromTxData(r,i={}){return new kt(r,i)}static fromSerializedTx(r,i={}){const b=F.yH.decode(r);if(!Array.isArray(b))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(b,i)}static fromValuesArray(r,i={}){if(r.length!==6&&r.length!==9)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");const[b,m,w,E,R,Z,ce,fe,be]=r;return(0,d.jY)({nonce:b,gasPrice:m,gasLimit:w,value:R,v:ce,r:fe,s:be}),new kt({nonce:b,gasPrice:m,gasLimit:w,to:E,value:R,data:Z,v:ce,r:fe,s:be},i)}raw(){return[(0,d.XD)(this.nonce),(0,d.XD)(this.gasPrice),(0,d.XD)(this.gasLimit),this.to!==void 0?this.to.bytes:new Uint8Array(0),(0,d.XD)(this.value),this.data,this.v!==void 0?(0,d.XD)(this.v):new Uint8Array(0),this.r!==void 0?(0,d.XD)(this.r):new Uint8Array(0),this.s!==void 0?(0,d.XD)(this.s):new Uint8Array(0)]}serialize(){return F.yH.encode(this.raw())}getMessageToSign(){const r=[(0,d.XD)(this.nonce),(0,d.XD)(this.gasPrice),(0,d.XD)(this.gasLimit),this.to!==void 0?this.to.bytes:new Uint8Array(0),(0,d.XD)(this.value),this.data];return this.supports(Re.EIP155ReplayProtection)&&(r.push((0,d.XD)(this.common.chainId())),r.push((0,d._K)((0,d.O0)(0))),r.push((0,d._K)((0,d.O0)(0)))),r}getHashedMessageToSign(){const r=this.getMessageToSign();return Ye(F.yH.encode(r))}getDataFee(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:super.getDataFee(),hardfork:this.common.hardfork()}),super.getDataFee())}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}hash(){if(!this.isSigned()){const r=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(r)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Ye(F.yH.encode(this.raw()))),this.cache.hash):Ye(F.yH.encode(this.raw()))}getMessageToVerifySignature(){if(!this.isSigned()){const r=this._errorMsg("This transaction is not signed");throw new Error(r)}return this.getHashedMessageToSign()}getSenderPublicKey(){const r=this.getMessageToVerifySignature(),{v:i,r:b,s:m}=this;this._validateHighS();try{return(0,d.Js)(r,i,(0,d.XD)(b),(0,d.XD)(m),this.supports(Re.EIP155ReplayProtection)?this.common.chainId():void 0)}catch{const E=this._errorMsg("Invalid Signature");throw new Error(E)}}_processSignature(r,i,b){this.supports(Re.EIP155ReplayProtection)&&(r+=this.common.chainId()*BigInt(2)+BigInt(8));const m={...this.txOptions,common:this.common};return kt.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:r,r:(0,d.v3)(i),s:(0,d.v3)(b)},m)}toJSON(){return{...super.toJSON(),gasPrice:(0,d.Z4)(this.gasPrice)}}_validateTxV(r,i){let b;const m=r!==void 0?Number(r):void 0;if(m!==void 0&&m<37&&m!==27&&m!==28)throw new Error(`Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ${m}`);if(m!==void 0&&m!==0&&(!i||i.gteHardfork("spuriousDragon"))&&m!==27&&m!==28)if(i){if(!Un(BigInt(m),i.chainId()))throw new Error(`Incompatible EIP155-based V ${m} and chain id ${i.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.`)}else{let w;(m-35)%2===0?w=35:w=36,b=BigInt(m-w)/BigInt(2)}return this._getCommon(i,b)}errorStr(){let r=this._getSharedErrorPostfix();return r+=` gasPrice=${this.gasPrice}`,r}_errorMsg(r){return`${r} (${this.errorStr()})`}}const ar=f=>{var i;const r=Object.assign({},f);return r.gasLimit=(0,d.Fy)((i=r.gasLimit)!=null?i:r.gas,d.qT.BigInt),r.data=r.data===void 0?r.input:r.data,r.gasPrice=r.gasPrice!==void 0?BigInt(r.gasPrice):void 0,r.value=r.value!==void 0?BigInt(r.value):void 0,r.to=r.to!==null&&r.to!==void 0?(0,d.V_)((0,d.O0)(r.to),20):null,r.v=r.v==="0x0"?"0x":r.v,r.r=r.r==="0x0"?"0x":r.r,r.s=r.s==="0x0"?"0x":r.s,(r.v!=="0x"||r.r!=="0x"||r.s!=="0x")&&(r.v=(0,d.Fy)(r.v,d.qT.BigInt)),r};class Mt{constructor(){}static fromTxData(r,i={}){if(!("type"in r)||r.type===void 0)return kt.fromTxData(r,i);if(_e(r))return kt.fromTxData(r,i);if(At(r))return Dt.fromTxData(r,i);if(yn(r))return Zt.fromTxData(r,i);if(Xn(r))return bt.fromTxData(r,i);throw new Error(`Tx instantiation with type ${r==null?void 0:r.type} not supported`)}static fromSerializedData(r,i={}){if(r[0]<=127)switch(r[0]){case ve.AccessListEIP2930:return Dt.fromSerializedTx(r,i);case ve.FeeMarketEIP1559:return Zt.fromSerializedTx(r,i);case ve.BlobEIP4844:return bt.fromSerializedTx(r,i);default:throw new Error(`TypedTransaction with ID ${r[0]} unknown`)}else return kt.fromSerializedTx(r,i)}static fromBlockBodyData(r,i={}){if(r instanceof Uint8Array)return this.fromSerializedData(r,i);if(Array.isArray(r))return kt.fromValuesArray(r,i);throw new Error("Cannot decode transaction: unknown type input")}static async fromJsonRpcProvider(r,i,b){const m=(0,d.VH)(r),w=await(0,d.Rb)(m,{method:"eth_getTransactionByHash",params:[i]});if(w===null)throw new Error("No data returned from provider");return Mt.fromRPC(w,b)}static async fromRPC(r,i={}){return Mt.fromTxData(ar(r),i)}}},14454:function(rn,j,Se){"use strict";Se.d(j,{kL:function(){return zt},E2:function(){return Ss},np:function(){return Is},Sr:function(){return As},qT:function(){return xn},Z4:function(){return vs},XD:function(){return Bs},PS:function(){return So},y9:function(){return Ao},v3:function(){return Ft},ci:function(){return In},CW:function(){return Po},h$:function(){return es},eV:function(){return yr},Js:function(){return co},v4:function(){return ao},hD:function(){return Or},Rb:function(){return ko},KR:function(){return Io},VH:function(){return To},nr:function(){return dn},sO:function(){return hr},I4:function(){return Ur},Lo:function(){return Cr},V7:function(){return qn},fB:function(){return Zr},V_:function(){return gr},MT:function(){return ms},O0:function(){return Yn},Fy:function(){return io},_K:function(){return pr},jY:function(){return Es}});var F={};Se.r(F),Se.d(F,{bitGet:function(){return mn},bitLen:function(){return z},bitMask:function(){return Fe},bitSet:function(){return St},bytesToHex:function(){return yt},bytesToNumberBE:function(){return rt},bytesToNumberLE:function(){return bn},concatBytes:function(){return Vt},createHmacDrbg:function(){return Pe},ensureBytes:function(){return We},equalBytes:function(){return xt},hexToBytes:function(){return Ht},hexToNumber:function(){return It},numberToBytesBE:function(){return Ot},numberToBytesLE:function(){return gn},numberToHexUnpadded:function(){return _n},numberToVarBytesBE:function(){return rr},utf8ToBytes:function(){return Ln},validateObject:function(){return Ct}});function d(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Me(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function re(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function H(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");d(e.outputLen),d(e.blockLen)}function he(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function de(e,t){re(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}var je={number:d,bool:Me,bytes:re,hash:H,exists:he,output:de};const Ae=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ge=e=>e instanceof Uint8Array,pt=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),et=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),vt=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),qe=(e,t)=>e<<32-t|e>>>t;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");const tt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function sn(e){if(!Ge(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=tt[e[n]];return t}function _t(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(t/2);for(let s=0;s<n.length;s++){const o=s*2,a=e.slice(o,o+2),c=Number.parseInt(a,16);if(Number.isNaN(c)||c<0)throw new Error("Invalid byte sequence");n[s]=c}return n}const P=async()=>{};async function q(e,t,n){let s=Date.now();for(let o=0;o<e;o++){n(o);const a=Date.now()-s;a>=0&&a<t||(await P(),s+=a)}}function ee(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function ie(e){if(typeof e=="string"&&(e=ee(e)),!Ge(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Ee(...e){const t=new Uint8Array(e.reduce((s,o)=>s+o.length,0));let n=0;return e.forEach(s=>{if(!Ge(s))throw new Error("Uint8Array expected");t.set(s,n),n+=s.length}),t}class He{clone(){return this._cloneInto()}}const ft=e=>Object.prototype.toString.call(e)==="[object Object]"&&e.constructor===Object;function Ze(e,t){if(t!==void 0&&(typeof t!="object"||!ft(t)))throw new Error("Options should be object or undefined");return Object.assign(e,t)}function nt(e){const t=s=>e().update(ie(s)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function qt(e){const t=(s,o)=>e(o).update(ie(s)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=s=>e(s),t}function hn(e){const t=(s,o)=>e(o).update(ie(s)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=s=>e(s),t}function Lt(e=32){if(Ae&&typeof Ae.getRandomValues=="function")return Ae.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function on(e,t,n,s){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,s);const o=BigInt(32),a=BigInt(4294967295),c=Number(n>>o&a),x=Number(n&a),g=s?4:0,p=s?0:4;e.setUint32(t+g,c,s),e.setUint32(t+p,x,s)}class ln extends He{constructor(t,n,s,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=s,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=vt(this.buffer)}update(t){je.exists(this);const{view:n,buffer:s,blockLen:o}=this;t=ie(t);const a=t.length;for(let c=0;c<a;){const x=Math.min(o-this.pos,a-c);if(x===o){const g=vt(t);for(;o<=a-c;c+=o)this.process(g,c);continue}s.set(t.subarray(c,c+x),this.pos),this.pos+=x,c+=x,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){je.exists(this),je.output(t,this),this.finished=!0;const{buffer:n,view:s,blockLen:o,isLE:a}=this;let{pos:c}=this;n[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(s,0),c=0);for(let y=c;y<o;y++)n[y]=0;on(s,o-8,BigInt(this.length*8),a),this.process(s,0);const x=vt(t),g=this.outputLen;if(g%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=g/4,A=this.get();if(p>A.length)throw new Error("_sha2: outputLen bigger than state");for(let y=0;y<p;y++)x.setUint32(4*y,A[y],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const s=t.slice(0,n);return this.destroy(),s}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:s,length:o,finished:a,destroyed:c,pos:x}=this;return t.length=o,t.pos=x,t.finished=a,t.destroyed=c,o%n&&t.buffer.set(s),t}}const an=(e,t,n)=>e&t^~e&n,v=(e,t,n)=>e&t^e&n^t&n,S=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),k=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),O=new Uint32Array(64);class ae extends ln{constructor(){super(64,32,8,!1),this.A=k[0]|0,this.B=k[1]|0,this.C=k[2]|0,this.D=k[3]|0,this.E=k[4]|0,this.F=k[5]|0,this.G=k[6]|0,this.H=k[7]|0}get(){const{A:t,B:n,C:s,D:o,E:a,F:c,G:x,H:g}=this;return[t,n,s,o,a,c,x,g]}set(t,n,s,o,a,c,x,g){this.A=t|0,this.B=n|0,this.C=s|0,this.D=o|0,this.E=a|0,this.F=c|0,this.G=x|0,this.H=g|0}process(t,n){for(let y=0;y<16;y++,n+=4)O[y]=t.getUint32(n,!1);for(let y=16;y<64;y++){const V=O[y-15],U=O[y-2],D=qe(V,7)^qe(V,18)^V>>>3,I=qe(U,17)^qe(U,19)^U>>>10;O[y]=I+O[y-7]+D+O[y-16]|0}let{A:s,B:o,C:a,D:c,E:x,F:g,G:p,H:A}=this;for(let y=0;y<64;y++){const V=qe(x,6)^qe(x,11)^qe(x,25),U=A+V+an(x,g,p)+S[y]+O[y]|0,I=(qe(s,2)^qe(s,13)^qe(s,22))+v(s,o,a)|0;A=p,p=g,g=x,x=c+U|0,c=a,a=o,o=s,s=U+I|0}s=s+this.A|0,o=o+this.B|0,a=a+this.C|0,c=c+this.D|0,x=x+this.E|0,g=g+this.F|0,p=p+this.G|0,A=A+this.H|0,this.set(s,o,a,c,x,g,p,A)}roundClean(){O.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class se extends ae{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const me=nt(()=>new ae),xe=nt(()=>new se);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pe=BigInt(0),ye=BigInt(1),cn=BigInt(2),Bt=e=>e instanceof Uint8Array,dt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function yt(e){if(!Bt(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=dt[e[n]];return t}function _n(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function It(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}function Ht(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(t/2);for(let s=0;s<n.length;s++){const o=s*2,a=e.slice(o,o+2),c=Number.parseInt(a,16);if(Number.isNaN(c)||c<0)throw new Error("Invalid byte sequence");n[s]=c}return n}function rt(e){return It(yt(e))}function bn(e){if(!Bt(e))throw new Error("Uint8Array expected");return It(yt(Uint8Array.from(e).reverse()))}function Ot(e,t){return Ht(e.toString(16).padStart(t*2,"0"))}function gn(e,t){return Ot(e,t).reverse()}function rr(e){return Ht(_n(e))}function We(e,t,n){let s;if(typeof t=="string")try{s=Ht(t)}catch(a){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${a}`)}else if(Bt(t))s=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const o=s.length;if(typeof n=="number"&&o!==n)throw new Error(`${e} expected ${n} bytes, got ${o}`);return s}function Vt(...e){const t=new Uint8Array(e.reduce((s,o)=>s+o.length,0));let n=0;return e.forEach(s=>{if(!Bt(s))throw new Error("Uint8Array expected");t.set(s,n),n+=s.length}),t}function xt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ln(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function z(e){let t;for(t=0;e>pe;e>>=ye,t+=1);return t}function mn(e,t){return e>>BigInt(t)&ye}const St=(e,t,n)=>e|(n?ye:pe)<<BigInt(t),Fe=e=>(cn<<BigInt(e-1))-ye,ue=e=>new Uint8Array(e),wt=e=>Uint8Array.from(e);function Pe(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let s=ue(e),o=ue(e),a=0;const c=()=>{s.fill(1),o.fill(0),a=0},x=(...y)=>n(o,s,...y),g=(y=ue())=>{o=x(wt([0]),y),s=x(),y.length!==0&&(o=x(wt([1]),y),s=x())},p=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let y=0;const V=[];for(;y<t;){s=x();const U=s.slice();V.push(U),y+=s.length}return Vt(...V)};return(y,V)=>{c(),g(y);let U;for(;!(U=V(p()));)g();return c(),U}}const Hn={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ct(e,t,n={}){const s=(o,a,c)=>{const x=Hn[a];if(typeof x!="function")throw new Error(`Invalid validator "${a}", expected function`);const g=e[o];if(!(c&&g===void 0)&&!x(g,e))throw new Error(`Invalid param ${String(o)}=${g} (${typeof g}), expected ${a}`)};for(const[o,a]of Object.entries(t))s(o,a,!1);for(const[o,a]of Object.entries(n))s(o,a,!0);return e}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Te=BigInt(0),le=BigInt(1),Oe=BigInt(2),B=BigInt(3),h=BigInt(4),l=BigInt(5),u=BigInt(8),T=BigInt(9),G=BigInt(16);function J(e,t){const n=e%t;return n>=Te?n:t+n}function Ue(e,t,n){if(n<=Te||t<Te)throw new Error("Expected power/modulo > 0");if(n===le)return Te;let s=le;for(;t>Te;)t&le&&(s=s*e%n),e=e*e%n,t>>=le;return s}function X(e,t,n){let s=e;for(;t-- >Te;)s*=s,s%=n;return s}function Ce(e,t){if(e===Te||t<=Te)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=J(e,t),s=t,o=Te,a=le,c=le,x=Te;for(;n!==Te;){const p=s/n,A=s%n,y=o-c*p,V=a-x*p;s=n,n=A,o=c,a=x,c=y,x=V}if(s!==le)throw new Error("invert: does not exist");return J(o,t)}function Ve(e){const t=(e-le)/Oe;let n,s,o;for(n=e-le,s=0;n%Oe===Te;n/=Oe,s++);for(o=Oe;o<e&&Ue(o,t,e)!==e-le;o++);if(s===1){const c=(e+le)/h;return function(g,p){const A=g.pow(p,c);if(!g.eql(g.sqr(A),p))throw new Error("Cannot find square root");return A}}const a=(n+le)/Oe;return function(x,g){if(x.pow(g,t)===x.neg(x.ONE))throw new Error("Cannot find square root");let p=s,A=x.pow(x.mul(x.ONE,o),n),y=x.pow(g,a),V=x.pow(g,n);for(;!x.eql(V,x.ONE);){if(x.eql(V,x.ZERO))return x.ZERO;let U=1;for(let I=x.sqr(V);U<p&&!x.eql(I,x.ONE);U++)I=x.sqr(I);const D=x.pow(A,le<<BigInt(p-U-1));A=x.sqr(D),y=x.mul(y,D),V=x.mul(V,A),p=U}return y}}function ne(e){if(e%h===B){const t=(e+le)/h;return function(s,o){const a=s.pow(o,t);if(!s.eql(s.sqr(a),o))throw new Error("Cannot find square root");return a}}if(e%u===l){const t=(e-l)/u;return function(s,o){const a=s.mul(o,Oe),c=s.pow(a,t),x=s.mul(o,c),g=s.mul(s.mul(x,Oe),c),p=s.mul(x,s.sub(g,s.ONE));if(!s.eql(s.sqr(p),o))throw new Error("Cannot find square root");return p}}return e%G,Ve(e)}const ut=(e,t)=>(J(e,t)&le)===le,Rt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ut(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Rt.reduce((s,o)=>(s[o]="function",s),t);return Ct(e,n)}function ze(e,t,n){if(n<Te)throw new Error("Expected power > 0");if(n===Te)return e.ONE;if(n===le)return t;let s=e.ONE,o=t;for(;n>Te;)n&le&&(s=e.mul(s,o)),o=e.sqr(o),n>>=le;return s}function Kt(e,t){const n=new Array(t.length),s=t.reduce((a,c,x)=>e.is0(c)?a:(n[x]=a,e.mul(a,c)),e.ONE),o=e.inv(s);return t.reduceRight((a,c,x)=>e.is0(c)?a:(n[x]=e.mul(a,n[x]),e.mul(a,c)),o),n}function pn(e,t,n){return e.mul(t,typeof n=="bigint"?Ce(n,e.ORDER):e.inv(n))}function fn(e){const t=(e.ORDER-le)/Oe;return n=>{const s=e.pow(n,t);return e.eql(s,e.ZERO)||e.eql(s,e.ONE)}}function jt(e,t){const n=t!==void 0?t:e.toString(2).length,s=Math.ceil(n/8);return{nBitLength:n,nByteLength:s}}function On(e,t,n=!1,s={}){if(e<=Te)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:a}=jt(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const c=ne(e),x=Object.freeze({ORDER:e,BITS:o,BYTES:a,MASK:Fe(o),ZERO:Te,ONE:le,create:g=>J(g,e),isValid:g=>{if(typeof g!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof g}`);return Te<=g&&g<e},is0:g=>g===Te,isOdd:g=>(g&le)===le,neg:g=>J(-g,e),eql:(g,p)=>g===p,sqr:g=>J(g*g,e),add:(g,p)=>J(g+p,e),sub:(g,p)=>J(g-p,e),mul:(g,p)=>J(g*p,e),pow:(g,p)=>ze(x,g,p),div:(g,p)=>J(g*Ce(p,e),e),sqrN:g=>g*g,addN:(g,p)=>g+p,subN:(g,p)=>g-p,mulN:(g,p)=>g*p,inv:g=>Ce(g,e),sqrt:s.sqrt||(g=>c(x,g)),invertBatch:g=>Kt(x,g),cmov:(g,p,A)=>A?p:g,toBytes:g=>n?gn(g,a):Ot(g,a),fromBytes:g=>{if(g.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${g.length}`);return n?bn(g):rt(g)}});return Object.freeze(x)}function Ye(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?n:e.neg(n)}function Ie(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n}function ht(e,t,n=!1){e=We("privateHash",e);const s=e.length,o=jt(t).nByteLength+8;if(o<24||s<o||s>1024)throw new Error(`hashToPrivateScalar: expected ${o}-1024 bytes of input, got ${s}`);const a=n?bn(e):rt(e);return J(a,t-le)+le}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Je=BigInt(0),Re=BigInt(1);function sr(e,t){const n=(o,a)=>{const c=a.negate();return o?c:a},s=o=>{const a=Math.ceil(t/o)+1,c=2**(o-1);return{windows:a,windowSize:c}};return{constTimeNegate:n,unsafeLadder(o,a){let c=e.ZERO,x=o;for(;a>Je;)a&Re&&(c=c.add(x)),x=x.double(),a>>=Re;return c},precomputeWindow(o,a){const{windows:c,windowSize:x}=s(a),g=[];let p=o,A=p;for(let y=0;y<c;y++){A=p,g.push(A);for(let V=1;V<x;V++)A=A.add(p),g.push(A);p=A.double()}return g},wNAF(o,a,c){const{windows:x,windowSize:g}=s(o);let p=e.ZERO,A=e.BASE;const y=BigInt(2**o-1),V=2**o,U=BigInt(o);for(let D=0;D<x;D++){const I=D*g;let L=Number(c&y);c>>=U,L>g&&(L-=V,c+=Re);const _=I,N=I+Math.abs(L)-1,$=D%2!==0,Y=L<0;L===0?A=A.add(n($,a[_])):p=p.add(n(Y,a[N]))}return{p,f:A}},wNAFCached(o,a,c,x){const g=o._WINDOW_SIZE||1;let p=a.get(o);return p||(p=this.precomputeWindow(o,g),g!==1&&a.set(o,x(p))),this.wNAF(g,p,c)}}}function jn(e){return Ut(e.Fp),Ct(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...jt(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function ve(e){const t=jn(e);Ct(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:s,a:o}=t;if(n){if(!s.eql(o,s.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:Ir,hexToBytes:Sr}=F,Xt={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Xt;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],s=e.subarray(2,n+2);if(!n||s.length!==n)throw new t("Invalid signature integer: wrong length");if(s[0]&128)throw new t("Invalid signature integer: negative");if(s[0]===0&&!(s[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Ir(s),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Xt,n=typeof e=="string"?Sr(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let s=n.length;if(s<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==s-2)throw new t("Invalid signature: incorrect length");const{d:o,l:a}=Xt._parseInt(n.subarray(2)),{d:c,l:x}=Xt._parseInt(a);if(x.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:c}},hexFromSig(e){const t=p=>Number.parseInt(p[0],16)&8?"00"+p:p,n=p=>{const A=p.toString(16);return A.length&1?`0${A}`:A},s=t(n(e.s)),o=t(n(e.r)),a=s.length/2,c=o.length/2,x=n(a),g=n(c);return`30${n(c+a+4)}02${g}${o}02${x}${s}`}},lt=BigInt(0),_e=BigInt(1),At=BigInt(2),yn=BigInt(3),Xn=BigInt(4);function or(e){const t=ve(e),{Fp:n}=t,s=t.toBytes||((D,I,L)=>{const _=I.toAffine();return Vt(Uint8Array.from([4]),n.toBytes(_.x),n.toBytes(_.y))}),o=t.fromBytes||(D=>{const I=D.subarray(1),L=n.fromBytes(I.subarray(0,n.BYTES)),_=n.fromBytes(I.subarray(n.BYTES,2*n.BYTES));return{x:L,y:_}});function a(D){const{a:I,b:L}=t,_=n.sqr(D),N=n.mul(_,D);return n.add(n.add(N,n.mul(D,I)),L)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function c(D){return typeof D=="bigint"&&lt<D&&D<t.n}function x(D){if(!c(D))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function g(D){const{allowedPrivateKeyLengths:I,nByteLength:L,wrapPrivateKey:_,n:N}=t;if(I&&typeof D!="bigint"){if(D instanceof Uint8Array&&(D=yt(D)),typeof D!="string"||!I.includes(D.length))throw new Error("Invalid key");D=D.padStart(L*2,"0")}let $;try{$=typeof D=="bigint"?D:rt(We("private key",D,L))}catch{throw new Error(`private key must be ${L} bytes, hex or bigint, not ${typeof D}`)}return _&&($=J($,N)),x($),$}const p=new Map;function A(D){if(!(D instanceof y))throw new Error("ProjectivePoint expected")}class y{constructor(I,L,_){if(this.px=I,this.py=L,this.pz=_,I==null||!n.isValid(I))throw new Error("x required");if(L==null||!n.isValid(L))throw new Error("y required");if(_==null||!n.isValid(_))throw new Error("z required")}static fromAffine(I){const{x:L,y:_}=I||{};if(!I||!n.isValid(L)||!n.isValid(_))throw new Error("invalid affine point");if(I instanceof y)throw new Error("projective point not allowed");const N=$=>n.eql($,n.ZERO);return N(L)&&N(_)?y.ZERO:new y(L,_,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(I){const L=n.invertBatch(I.map(_=>_.pz));return I.map((_,N)=>_.toAffine(L[N])).map(y.fromAffine)}static fromHex(I){const L=y.fromAffine(o(We("pointHex",I)));return L.assertValidity(),L}static fromPrivateKey(I){return y.BASE.multiply(g(I))}_setWindowSize(I){this._WINDOW_SIZE=I,p.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:I,y:L}=this.toAffine();if(!n.isValid(I)||!n.isValid(L))throw new Error("bad point: x or y not FE");const _=n.sqr(L),N=a(I);if(!n.eql(_,N))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:I}=this.toAffine();if(n.isOdd)return!n.isOdd(I);throw new Error("Field doesn't support isOdd")}equals(I){A(I);const{px:L,py:_,pz:N}=this,{px:$,py:Y,pz:te}=I,K=n.eql(n.mul(L,te),n.mul($,N)),W=n.eql(n.mul(_,te),n.mul(Y,N));return K&&W}negate(){return new y(this.px,n.neg(this.py),this.pz)}double(){const{a:I,b:L}=t,_=n.mul(L,yn),{px:N,py:$,pz:Y}=this;let te=n.ZERO,K=n.ZERO,W=n.ZERO,Q=n.mul(N,N),Qe=n.mul($,$),Le=n.mul(Y,Y),ge=n.mul(N,$);return ge=n.add(ge,ge),W=n.mul(N,Y),W=n.add(W,W),te=n.mul(I,W),K=n.mul(_,Le),K=n.add(te,K),te=n.sub(Qe,K),K=n.add(Qe,K),K=n.mul(te,K),te=n.mul(ge,te),W=n.mul(_,W),Le=n.mul(I,Le),ge=n.sub(Q,Le),ge=n.mul(I,ge),ge=n.add(ge,W),W=n.add(Q,Q),Q=n.add(W,Q),Q=n.add(Q,Le),Q=n.mul(Q,ge),K=n.add(K,Q),Le=n.mul($,Y),Le=n.add(Le,Le),Q=n.mul(Le,ge),te=n.sub(te,Q),W=n.mul(Le,Qe),W=n.add(W,W),W=n.add(W,W),new y(te,K,W)}add(I){A(I);const{px:L,py:_,pz:N}=this,{px:$,py:Y,pz:te}=I;let K=n.ZERO,W=n.ZERO,Q=n.ZERO;const Qe=t.a,Le=n.mul(t.b,yn);let ge=n.mul(L,$),ot=n.mul(_,Y),it=n.mul(N,te),Qt=n.add(L,_),C=n.add($,Y);Qt=n.mul(Qt,C),C=n.add(ge,ot),Qt=n.sub(Qt,C),C=n.add(L,N);let M=n.add($,te);return C=n.mul(C,M),M=n.add(ge,it),C=n.sub(C,M),M=n.add(_,N),K=n.add(Y,te),M=n.mul(M,K),K=n.add(ot,it),M=n.sub(M,K),Q=n.mul(Qe,C),K=n.mul(Le,it),Q=n.add(K,Q),K=n.sub(ot,Q),Q=n.add(ot,Q),W=n.mul(K,Q),ot=n.add(ge,ge),ot=n.add(ot,ge),it=n.mul(Qe,it),C=n.mul(Le,C),ot=n.add(ot,it),it=n.sub(ge,it),it=n.mul(Qe,it),C=n.add(C,it),ge=n.mul(ot,C),W=n.add(W,ge),ge=n.mul(M,C),K=n.mul(Qt,K),K=n.sub(K,ge),ge=n.mul(Qt,ot),Q=n.mul(M,Q),Q=n.add(Q,ge),new y(K,W,Q)}subtract(I){return this.add(I.negate())}is0(){return this.equals(y.ZERO)}wNAF(I){return U.wNAFCached(this,p,I,L=>{const _=n.invertBatch(L.map(N=>N.pz));return L.map((N,$)=>N.toAffine(_[$])).map(y.fromAffine)})}multiplyUnsafe(I){const L=y.ZERO;if(I===lt)return L;if(x(I),I===_e)return this;const{endo:_}=t;if(!_)return U.unsafeLadder(this,I);let{k1neg:N,k1:$,k2neg:Y,k2:te}=_.splitScalar(I),K=L,W=L,Q=this;for(;$>lt||te>lt;)$&_e&&(K=K.add(Q)),te&_e&&(W=W.add(Q)),Q=Q.double(),$>>=_e,te>>=_e;return N&&(K=K.negate()),Y&&(W=W.negate()),W=new y(n.mul(W.px,_.beta),W.py,W.pz),K.add(W)}multiply(I){x(I);let L=I,_,N;const{endo:$}=t;if($){const{k1neg:Y,k1:te,k2neg:K,k2:W}=$.splitScalar(L);let{p:Q,f:Qe}=this.wNAF(te),{p:Le,f:ge}=this.wNAF(W);Q=U.constTimeNegate(Y,Q),Le=U.constTimeNegate(K,Le),Le=new y(n.mul(Le.px,$.beta),Le.py,Le.pz),_=Q.add(Le),N=Qe.add(ge)}else{const{p:Y,f:te}=this.wNAF(L);_=Y,N=te}return y.normalizeZ([_,N])[0]}multiplyAndAddUnsafe(I,L,_){const N=y.BASE,$=(te,K)=>K===lt||K===_e||!te.equals(N)?te.multiplyUnsafe(K):te.multiply(K),Y=$(this,L).add($(I,_));return Y.is0()?void 0:Y}toAffine(I){const{px:L,py:_,pz:N}=this,$=this.is0();I==null&&(I=$?n.ONE:n.inv(N));const Y=n.mul(L,I),te=n.mul(_,I),K=n.mul(N,I);if($)return{x:n.ZERO,y:n.ZERO};if(!n.eql(K,n.ONE))throw new Error("invZ was invalid");return{x:Y,y:te}}isTorsionFree(){const{h:I,isTorsionFree:L}=t;if(I===_e)return!0;if(L)return L(y,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:I,clearCofactor:L}=t;return I===_e?this:L?L(y,this):this.multiplyUnsafe(t.h)}toRawBytes(I=!0){return this.assertValidity(),s(y,this,I)}toHex(I=!0){return yt(this.toRawBytes(I))}}y.BASE=new y(t.Gx,t.Gy,n.ONE),y.ZERO=new y(n.ZERO,n.ONE,n.ZERO);const V=t.nBitLength,U=sr(y,t.endo?Math.ceil(V/2):V);return{CURVE:t,ProjectivePoint:y,normPrivateKeyToScalar:g,weierstrassEquation:a,isWithinCurveOrder:c}}function st(e){const t=jn(e);return Ct(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Pt(e){const t=st(e),{Fp:n,n:s}=t,o=n.BYTES+1,a=2*n.BYTES+1;function c(C){return lt<C&&C<n.ORDER}function x(C){return J(C,s)}function g(C){return Ce(C,s)}const{ProjectivePoint:p,normPrivateKeyToScalar:A,weierstrassEquation:y,isWithinCurveOrder:V}=or({...t,toBytes(C,M,oe){const ke=M.toAffine(),Be=n.toBytes(ke.x),Xe=Vt;return oe?Xe(Uint8Array.from([M.hasEvenY()?2:3]),Be):Xe(Uint8Array.from([4]),Be,n.toBytes(ke.y))},fromBytes(C){const M=C.length,oe=C[0],ke=C.subarray(1);if(M===o&&(oe===2||oe===3)){const Be=rt(ke);if(!c(Be))throw new Error("Point is not on curve");const Xe=y(Be);let at=n.sqrt(Xe);const ct=(at&_e)===_e;return(oe&1)===1!==ct&&(at=n.neg(at)),{x:Be,y:at}}else if(M===a&&oe===4){const Be=n.fromBytes(ke.subarray(0,n.BYTES)),Xe=n.fromBytes(ke.subarray(n.BYTES,2*n.BYTES));return{x:Be,y:Xe}}else throw new Error(`Point of length ${M} was invalid. Expected ${o} compressed bytes or ${a} uncompressed bytes`)}}),U=C=>yt(Ot(C,t.nByteLength));function D(C){const M=s>>_e;return C>M}function I(C){return D(C)?x(-C):C}const L=(C,M,oe)=>rt(C.slice(M,oe));class _{constructor(M,oe,ke){this.r=M,this.s=oe,this.recovery=ke,this.assertValidity()}static fromCompact(M){const oe=t.nByteLength;return M=We("compactSignature",M,oe*2),new _(L(M,0,oe),L(M,oe,2*oe))}static fromDER(M){const{r:oe,s:ke}=Xt.toSig(We("DER",M));return new _(oe,ke)}assertValidity(){if(!V(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!V(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(M){return new _(this.r,this.s,M)}recoverPublicKey(M){const{r:oe,s:ke,recovery:Be}=this,Xe=W(We("msgHash",M));if(Be==null||![0,1,2,3].includes(Be))throw new Error("recovery id invalid");const at=Be===2||Be===3?oe+t.n:oe;if(at>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const ct=(Be&1)===0?"02":"03",en=p.fromHex(ct+U(at)),tn=g(at),An=x(-Xe*tn),Kn=x(ke*tn),nn=p.BASE.multiplyAndAddUnsafe(en,An,Kn);if(!nn)throw new Error("point at infinify");return nn.assertValidity(),nn}hasHighS(){return D(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,x(-this.s),this.recovery):this}toDERRawBytes(){return Ht(this.toDERHex())}toDERHex(){return Xt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ht(this.toCompactHex())}toCompactHex(){return U(this.r)+U(this.s)}}const N={isValidPrivateKey(C){try{return A(C),!0}catch{return!1}},normPrivateKeyToScalar:A,randomPrivateKey:()=>{const C=t.randomBytes(n.BYTES+8),M=ht(C,s);return Ot(M,t.nByteLength)},precompute(C=8,M=p.BASE){return M._setWindowSize(C),M.multiply(BigInt(3)),M}};function $(C,M=!0){return p.fromPrivateKey(C).toRawBytes(M)}function Y(C){const M=C instanceof Uint8Array,oe=typeof C=="string",ke=(M||oe)&&C.length;return M?ke===o||ke===a:oe?ke===2*o||ke===2*a:C instanceof p}function te(C,M,oe=!0){if(Y(C))throw new Error("first arg must be private key");if(!Y(M))throw new Error("second arg must be public key");return p.fromHex(M).multiply(A(C)).toRawBytes(oe)}const K=t.bits2int||function(C){const M=rt(C),oe=C.length*8-t.nBitLength;return oe>0?M>>BigInt(oe):M},W=t.bits2int_modN||function(C){return x(K(C))},Q=Fe(t.nBitLength);function Qe(C){if(typeof C!="bigint")throw new Error("bigint expected");if(!(lt<=C&&C<Q))throw new Error(`bigint expected < 2^${t.nBitLength}`);return Ot(C,t.nByteLength)}function Le(C,M,oe=ge){if(["recovered","canonical"].some(un=>un in oe))throw new Error("sign() legacy options not supported");const{hash:ke,randomBytes:Be}=t;let{lowS:Xe,prehash:at,extraEntropy:ct}=oe;Xe==null&&(Xe=!0),C=We("msgHash",C),at&&(C=We("prehashed msgHash",ke(C)));const en=W(C),tn=A(M),An=[Qe(tn),Qe(en)];if(ct!=null){const un=ct===!0?Be(n.BYTES):ct;An.push(We("extraEntropy",un,n.BYTES))}const Kn=Vt(...An),nn=en;function Br(un){const Pn=K(un);if(!V(Pn))return;const ns=g(Pn),kn=p.BASE.multiply(Pn).toAffine(),Et=x(kn.x);if(Et===lt)return;const Tn=x(ns*x(nn+Et*tn));if(Tn===lt)return;let rs=(kn.x===Et?0:2)|Number(kn.y&_e),ss=Tn;return Xe&&D(Tn)&&(ss=I(Tn),rs^=1),new _(Et,ss,rs)}return{seed:Kn,k2sig:Br}}const ge={lowS:t.lowS,prehash:!1},ot={lowS:t.lowS,prehash:!1};function it(C,M,oe=ge){const{seed:ke,k2sig:Be}=Le(C,M,oe),Xe=t;return Pe(Xe.hash.outputLen,Xe.nByteLength,Xe.hmac)(ke,Be)}p.BASE._setWindowSize(8);function Qt(C,M,oe,ke=ot){var kn;const Be=C;if(M=We("msgHash",M),oe=We("publicKey",oe),"strict"in ke)throw new Error("options.strict was renamed to lowS");const{lowS:Xe,prehash:at}=ke;let ct,en;try{if(typeof Be=="string"||Be instanceof Uint8Array)try{ct=_.fromDER(Be)}catch(Et){if(!(Et instanceof Xt.Err))throw Et;ct=_.fromCompact(Be)}else if(typeof Be=="object"&&typeof Be.r=="bigint"&&typeof Be.s=="bigint"){const{r:Et,s:Tn}=Be;ct=new _(Et,Tn)}else throw new Error("PARSE");en=p.fromHex(oe)}catch(Et){if(Et.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Xe&&ct.hasHighS())return!1;at&&(M=t.hash(M));const{r:tn,s:An}=ct,Kn=W(M),nn=g(An),Br=x(Kn*nn),un=x(tn*nn),Pn=(kn=p.BASE.multiplyAndAddUnsafe(en,Br,un))==null?void 0:kn.toAffine();return Pn?x(Pn.x)===tn:!1}return{CURVE:t,getPublicKey:$,getSharedSecret:te,sign:it,verify:Qt,ProjectivePoint:p,Signature:_,utils:N}}function Cn(e,t){const n=e.ORDER;let s=lt;for(let D=n-_e;D%At===lt;D/=At)s+=_e;const o=s,a=At<<o-_e-_e,c=a*At,x=(n-_e)/c,g=(x-_e)/At,p=c-_e,A=a,y=e.pow(t,x),V=e.pow(t,(x+_e)/At);let U=(D,I)=>{let L=y,_=e.pow(I,p),N=e.sqr(_);N=e.mul(N,I);let $=e.mul(D,N);$=e.pow($,g),$=e.mul($,_),_=e.mul($,I),N=e.mul($,D);let Y=e.mul(N,_);$=e.pow(Y,A);let te=e.eql($,e.ONE);_=e.mul(N,V),$=e.mul(Y,L),N=e.cmov(_,N,te),Y=e.cmov($,Y,te);for(let K=o;K>_e;K--){let W=K-At;W=At<<W-_e;let Q=e.pow(Y,W);const Qe=e.eql(Q,e.ONE);_=e.mul(N,L),L=e.mul(L,L),Q=e.mul(Y,L),N=e.cmov(_,N,Qe),Y=e.cmov(Q,Y,Qe)}return{isValid:te,value:N}};if(e.ORDER%Xn===yn){const D=(e.ORDER-yn)/Xn,I=e.sqrt(e.neg(t));U=(L,_)=>{let N=e.sqr(_);const $=e.mul(L,_);N=e.mul(N,$);let Y=e.pow(N,D);Y=e.mul(Y,$);const te=e.mul(Y,I),K=e.mul(e.sqr(Y),_),W=e.eql(K,L);let Q=e.cmov(te,Y,W);return{isValid:W,value:Q}}}return U}function Zt(e,t){if(mod.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const n=Cn(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return s=>{let o,a,c,x,g,p,A,y;o=e.sqr(s),o=e.mul(o,t.Z),a=e.sqr(o),a=e.add(a,o),c=e.add(a,e.ONE),c=e.mul(c,t.B),x=e.cmov(t.Z,e.neg(a),!e.eql(a,e.ZERO)),x=e.mul(x,t.A),a=e.sqr(c),p=e.sqr(x),g=e.mul(p,t.A),a=e.add(a,g),a=e.mul(a,c),p=e.mul(p,x),g=e.mul(p,t.B),a=e.add(a,g),A=e.mul(o,c);const{isValid:V,value:U}=n(a,p);y=e.mul(o,s),y=e.mul(y,U),A=e.cmov(A,c,V),y=e.cmov(y,U,V);const D=e.isOdd(s)===e.isOdd(y);return y=e.cmov(e.neg(y),y,D),A=e.div(A,x),{x:A,y}}}function Rn(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return utf8ToBytes(e);throw new Error("DST must be Uint8Array or string")}const Dt=null;function Nt(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const n=Array.from({length:t}).fill(0);for(let s=t-1;s>=0;s--)n[s]=e&255,e>>>=8;return new Uint8Array(n)}function Ar(e,t){const n=new Uint8Array(e.length);for(let s=0;s<e.length;s++)n[s]=e[s]^t[s];return n}function wn(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected")}function En(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function Pr(e,t,n,s){wn(e),wn(t),En(n),t.length>255&&(t=s(concatBytes(utf8ToBytes("H2C-OVERSIZE-DST-"),t)));const{outputLen:o,blockLen:a}=s,c=Math.ceil(n/o);if(c>255)throw new Error("Invalid xmd length");const x=concatBytes(t,Nt(t.length,1)),g=Nt(0,a),p=Nt(n,2),A=new Array(c),y=s(concatBytes(g,e,p,Nt(0,1),x));A[0]=s(concatBytes(y,Nt(1,1),x));for(let U=1;U<=c;U++){const D=[Ar(y,A[U-1]),Nt(U+1,1),x];A[U]=s(concatBytes(...D))}return concatBytes(...A).slice(0,n)}function kr(e,t,n,s,o){if(wn(e),wn(t),En(n),t.length>255){const a=Math.ceil(2*s/8);t=o.create({dkLen:a}).update(utf8ToBytes("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:n}).update(e).update(Nt(n,2)).update(t).update(Nt(t.length,1)).digest()}function ir(e,t,n){validateObject(n,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:s,k:o,m:a,hash:c,expand:x,DST:g}=n;wn(e),En(t);const p=Rn(g),A=s.toString(2).length,y=Math.ceil((A+o)/8),V=t*a*y;let U;if(x==="xmd")U=Pr(e,p,V,c);else if(x==="xof")U=kr(e,p,V,o,c);else if(x==="_internal_pass")U=e;else throw new Error('expand must be "xmd" or "xof"');const D=new Array(t);for(let I=0;I<t;I++){const L=new Array(a);for(let _=0;_<a;_++){const N=y*(_+I*a),$=U.subarray(N,N+y);L[_]=mod(Dt($),s)}D[I]=L}return D}function vn(e,t){const n=t.map(s=>Array.from(s).reverse());return(s,o)=>{const[a,c,x,g]=n.map(p=>p.reduce((A,y)=>e.add(e.mul(A,s),y)));return s=e.div(a,c),o=e.mul(o,e.div(x,g)),{x:s,y:o}}}function Tr(e,t,n){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(s,o){const a=ir(s,2,{...n,DST:n.DST,...o}),c=e.fromAffine(t(a[0])),x=e.fromAffine(t(a[1])),g=c.add(x).clearCofactor();return g.assertValidity(),g},encodeToCurve(s,o){const a=ir(s,1,{...n,DST:n.encodeDST,...o}),c=e.fromAffine(t(a[0])).clearCofactor();return c.assertValidity(),c}}}class bt extends He{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,je.hash(t);const s=ie(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,a=new Uint8Array(o);a.set(s.length>o?t.create().update(s).digest():s);for(let c=0;c<a.length;c++)a[c]^=54;this.iHash.update(a),this.oHash=t.create();for(let c=0;c<a.length;c++)a[c]^=106;this.oHash.update(a),a.fill(0)}update(t){return je.exists(this),this.iHash.update(t),this}digestInto(t){je.exists(this),je.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:s,finished:o,destroyed:a,blockLen:c,outputLen:x}=this;return t=t,t.finished=o,t.destroyed=a,t.blockLen=c,t.outputLen=x,t.oHash=n._cloneInto(t.oHash),t.iHash=s._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Un=(e,t,n)=>new bt(e,t).update(n).digest();Un.create=(e,t)=>new bt(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function kt(e){return{hash:e,hmac:(t,...n)=>Un(e,t,Ee(...n)),randomBytes:Lt}}function ar(e,t){const n=s=>Pt({...e,...kt(s)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Mt=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),f=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),r=BigInt(1),i=BigInt(2),b=(e,t)=>(e+t/i)/t;function m(e){const t=Mt,n=BigInt(3),s=BigInt(6),o=BigInt(11),a=BigInt(22),c=BigInt(23),x=BigInt(44),g=BigInt(88),p=e*e*e%t,A=p*p*e%t,y=X(A,n,t)*A%t,V=X(y,n,t)*A%t,U=X(V,i,t)*p%t,D=X(U,o,t)*U%t,I=X(D,a,t)*D%t,L=X(I,x,t)*I%t,_=X(L,g,t)*L%t,N=X(_,x,t)*I%t,$=X(N,n,t)*A%t,Y=X($,c,t)*D%t,te=X(Y,s,t)*p%t,K=X(te,i,t);if(!w.eql(w.sqr(K),e))throw new Error("Cannot find square root");return K}const w=On(Mt,void 0,void 0,{sqrt:m}),E=ar({a:BigInt(0),b:BigInt(7),Fp:w,n:f,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=f,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),s=-r*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,c=BigInt("0x100000000000000000000000000000000"),x=b(a*e,t),g=b(-s*e,t);let p=J(e-x*n-g*o,t),A=J(-x*s-g*a,t);const y=p>c,V=A>c;if(y&&(p=t-p),V&&(A=t-A),p>c||A>c)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:y,k1:p,k2neg:V,k2:A}}}},me),R=BigInt(0),Z=e=>typeof e=="bigint"&&R<e&&e<Mt,ce=e=>typeof e=="bigint"&&R<e&&e<f,fe={};function be(e,...t){let n=fe[e];if(n===void 0){const s=sha256(Uint8Array.from(e,o=>o.charCodeAt(0)));n=concatBytes(s,s),fe[e]=n}return sha256(concatBytes(n,...t))}const Ne=e=>e.toRawBytes(!0).slice(1),De=e=>numberToBytesBE(e,32),Ke=e=>mod(e,Mt),we=e=>mod(e,f),gt=E.ProjectivePoint,cr=(e,t,n)=>gt.BASE.multiplyAndAddUnsafe(e,t,n);function Bn(e){let t=E.utils.normPrivateKeyToScalar(e),n=gt.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:we(-t),bytes:Ne(n)}}function Zn(e){if(!Z(e))throw new Error("bad x: need 0 < x < p");const t=Ke(e*e),n=Ke(t*e+BigInt(7));let s=m(n);s%i!==R&&(s=Ke(-s));const o=new gt(e,s,r);return o.assertValidity(),o}function Dn(...e){return we(bytesToNumberBE(be("BIP0340/challenge",...e)))}function _o(e){return Bn(e).bytes}function Lo(e,t,n=randomBytes(32)){const s=ensureBytes("message",e),{bytes:o,scalar:a}=Bn(t),c=ensureBytes("auxRand",n,32),x=De(a^bytesToNumberBE(be("BIP0340/aux",c))),g=be("BIP0340/nonce",x,o,s),p=we(bytesToNumberBE(g));if(p===R)throw new Error("sign failed: k is zero");const{bytes:A,scalar:y}=Bn(p),V=Dn(A,o,s),U=new Uint8Array(64);if(U.set(A,0),U.set(De(we(y+V*a)),32),!os(U,s,o))throw new Error("sign: Invalid signature produced");return U}function os(e,t,n){const s=ensureBytes("signature",e,64),o=ensureBytes("message",t),a=ensureBytes("publicKey",n,32);try{const c=Zn(bytesToNumberBE(a)),x=bytesToNumberBE(s.subarray(0,32));if(!Z(x))return!1;const g=bytesToNumberBE(s.subarray(32,64));if(!ce(g))return!1;const p=Dn(De(x),Ne(c),o),A=cr(c,g,we(-p));return!(!A||!A.hasEvenY()||A.toAffine().x!==x)}catch{return!1}}const Ho=null,Oo=null,Co=null,Ro=null,Uo=null,Do=null,No=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fr=e=>e instanceof Uint8Array,Mo=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),is=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),dr=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Tt=(e,t)=>e<<32-t|e>>>t;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");const as=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Fo(e){if(!fr(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=as[e[n]];return t}function cs(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(t/2);for(let s=0;s<n.length;s++){const o=s*2,a=e.slice(o,o+2),c=Number.parseInt(a,16);if(Number.isNaN(c)||c<0)throw new Error("Invalid byte sequence");n[s]=c}return n}const fs=async()=>{};async function zo(e,t,n){let s=Date.now();for(let o=0;o<e;o++){n(o);const a=Date.now()-s;a>=0&&a<t||(await fs(),s+=a)}}function _r(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Nn(e){if(typeof e=="string"&&(e=_r(e)),!fr(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function $o(...e){const t=new Uint8Array(e.reduce((s,o)=>s+o.length,0));let n=0;return e.forEach(s=>{if(!fr(s))throw new Error("Uint8Array expected");t.set(s,n),n+=s.length}),t}class Lr{clone(){return this._cloneInto()}}const ds=e=>Object.prototype.toString.call(e)==="[object Object]"&&e.constructor===Object;function qo(e,t){if(t!==void 0&&(typeof t!="object"||!ds(t)))throw new Error("Options should be object or undefined");return Object.assign(e,t)}function xr(e){const t=s=>e().update(Nn(s)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Vo(e){const t=(s,o)=>e(o).update(Nn(s)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=s=>e(s),t}function xs(e){const t=(s,o)=>e(o).update(Nn(s)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=s=>e(s),t}function Ko(e=32){if(crypto&&typeof crypto.getRandomValues=="function")return crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function jo(e){return randomBytes(e)}async function Xo(e){return randomBytes(e)}function ur(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function us(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function Hr(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function hs(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ur(e.outputLen),ur(e.blockLen)}function ls(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function bs(e,t){Hr(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}var mt={number:ur,bool:us,bytes:Hr,hash:hs,exists:ls,output:bs};const Wo=mt.bool,Yo=mt.bytes;function Jo(e){if(!(e instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof e}`);return new TextDecoder().decode(e)}function gs(e){const t=e.startsWith("0x")?e.substring(2):e;return cs(t)}function Or(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Mn(e){return t=>(mt.bytes(t),e(t))}const Qo=(()=>{const e=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,t=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:t&&!e?t("crypto"):void 0,web:e}})();function Cr(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e[0]==="0"&&e[1]==="x"}const ms=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return Cr(e)?e.slice(2):e};function Wn(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}function e0(e){if(typeof e!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof e}`);return utf8ToBytes(e).byteLength}function t0(e,t,n){if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(Array.isArray(t)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[n===!0?"some":"every"](s=>e.indexOf(s)>=0)}function n0(e){let t="",n=0;const s=e.length;for(e.substring(0,2)==="0x"&&(n=2);n<s;n+=2){const o=parseInt(e.substr(n,2),16);t+=String.fromCharCode(o)}return t}function r0(e){const t=utf8ToBytes(e);return`0x${Wn(bytesToHex(t)).replace(/^0+|0+$/g,"")}`}function s0(e){let t="";for(let n=0;n<e.length;n++){const o=e.charCodeAt(n).toString(16);t+=o.length<2?`0${o}`:o}return`0x${t}`}function o0(e,t,n){if(!Array.isArray(e))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof e}`);if(typeof t!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof e}`);const s=[];for(let o=0;o<e.length;o++){let a=e[o][t];if(n===!0&&!a)a="";else if(typeof a!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof a}`);s.push(a)}return s}function Rr(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t<"u"&&t>0&&e.length!==2+2*t)}const i0=function(e){if(!isHexString(e)){const t=`This method only supports 0x-prefixed hex strings but input was: ${e}`;throw new Error(t)}},Gt=function(e){if(!(e instanceof Uint8Array)){const t=`This method only supports Uint8Array but input was: ${e}`;throw new Error(t)}},a0=function(e){if(!Array.isArray(e)){const t=`This method only supports number arrays but input was: ${e}`;throw new Error(t)}},ps=function(e){if(typeof e!="string"){const t=`This method only supports strings but input was: ${e}`;throw new Error(t)}},c0=null,ys=e=>{if(e.slice(0,2)==="0x")throw new Error("hex string is prefixed with 0x, should be unprefixed");return gs(Wn(e))},ws=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),In=e=>{let t="0x";if(e===void 0||e.length===0)return t;for(const n of e)t+=ws[n];return t},Ft=e=>{const t=In(e);return BigInt(t==="0x"?0:t)},f0=e=>{const t=Number(Ft(e));if(!Number.isSafeInteger(t))throw new Error("Number exceeds 53 bits");return t},dn=e=>{if(typeof e!="string")throw new Error(`hex argument type ${typeof e} must be of type string`);if(!e.startsWith("0x"))throw new Error(`prefixed hex input should start with 0x, got ${e.substring(0,2)}`);e=e.slice(2),e.length%2!==0&&(e=Wn(e));const t=e.length/2,n=new Uint8Array(t);for(let s=0;s<t;s++){const o=parseInt(e.slice(s*2,(s+1)*2),16);n[s]=o}return n},Ur=e=>{if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`},hr=e=>{const t=Ur(e);return dn(t)},lr=e=>Yn("0x"+Wn(e.toString(16))),br=e=>new Uint8Array(e),Dr=(e,t,n)=>n?e.length<t?new Uint8Array([...e,...br(t-e.length)]):e.subarray(0,t):e.length<t?new Uint8Array([...br(t-e.length),...e]):e.subarray(-t),gr=(e,t)=>(Gt(e),Dr(e,t,!1)),d0=(e,t)=>(assertIsBytes(e),Dr(e,t,!0)),mr=e=>{let t=e[0];for(;e.length>0&&t.toString()==="0";)e=e.slice(1),t=e[0];return e},pr=e=>(Gt(e),mr(e)),x0=e=>(assertIsArray(e),mr(e)),u0=e=>(assertIsHexString(e),e=stripHexPrefix(e),"0x"+mr(e)),Yn=e=>{if(e==null)return new Uint8Array;if(Array.isArray(e)||e instanceof Uint8Array)return Uint8Array.from(e);if(typeof e=="string"){if(!Rr(e))throw new Error(`Cannot convert string to Uint8Array. toBytes only supports 0x-prefixed hex strings and this string was given: ${e}`);return dn(e)}if(typeof e=="number")return hr(e);if(typeof e=="bigint"){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to Uint8Array. Given: ${e}`);let t=e.toString(16);return t.length%2&&(t="0"+t),ys(t)}if(e.toBytes!==void 0)return e.toBytes();throw new Error("invalid type")},h0=e=>BigInt.asIntN(256,Ft(e)),l0=e=>lr(BigInt.asUintN(256,e)),b0=e=>typeof e!="string"||isHexPrefixed(e)?e:"0x"+e,g0=(e,t=50)=>{const n=e instanceof Uint8Array?In(e):e,s=n.slice(0,2)==="0x"?t+2:t;return n.length<=s?n:n.slice(0,s)+"\u2026"},Es=e=>{for(const[t,n]of Object.entries(e))if(n!==void 0&&n.length>0&&n[0]===0)throw new Error(`${t} cannot have leading zeroes, received: ${In(n)}`)},vs=e=>"0x"+e.toString(16),Bs=e=>pr(lr(e)),m0=e=>pr(hr(e)),p0=(e,t)=>{const n=Ft(e),s=Ft(t);return n>s?1:n<s?-1:0},y0=e=>getRandomBytesSync(e),yr=(...e)=>{if(e.length===1)return e[0];const t=e.reduce((s,o)=>s+o.length,0),n=new Uint8Array(t);for(let s=0,o=0;s<e.length;s++){const a=e[s];n.set(a,o),o+=a.length}return n},Is=BigInt("0xffffffffffffffff"),Ss=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),w0=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),E0=E.CURVE.n,As=E.CURVE.n/BigInt(2),v0=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),I0=dn("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"),A0=dn("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"),k0=dn("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"),T0=Uint8Array.from([128]),_0=16,L0="0000000000000000000000000000000000000003",H0=BigInt(1e9);var Nr=Se(93996);const Jn=BigInt(2**32-1),wr=BigInt(32);function Mr(e,t=!1){return t?{h:Number(e&Jn),l:Number(e>>wr&Jn)}:{h:Number(e>>wr&Jn)|0,l:Number(e&Jn)|0}}function Ps(e,t=!1){let n=new Uint32Array(e.length),s=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:a,l:c}=Mr(e[o],t);[n[o],s[o]]=[a,c]}return[n,s]}const ks=(e,t)=>BigInt(e>>>0)<<wr|BigInt(t>>>0),Ts=(e,t,n)=>e>>>n,_s=(e,t,n)=>e<<32-n|t>>>n,Ls=(e,t,n)=>e>>>n|t<<32-n,Hs=(e,t,n)=>e<<32-n|t>>>n,Os=(e,t,n)=>e<<64-n|t>>>n-32,Cs=(e,t,n)=>e>>>n-32|t<<64-n,Rs=(e,t)=>t,Us=(e,t)=>e,Ds=(e,t,n)=>e<<n|t>>>32-n,Ns=(e,t,n)=>t<<n|e>>>32-n,Ms=(e,t,n)=>t<<n-32|e>>>64-n,Gs=(e,t,n)=>e<<n-32|t>>>64-n;function Fs(e,t,n,s){const o=(t>>>0)+(s>>>0);return{h:e+n+(o/2**32|0)|0,l:o|0}}var Gn={fromBig:Mr,split:Ps,toBig:ks,shrSH:Ts,shrSL:_s,rotrSH:Ls,rotrSL:Hs,rotrBH:Os,rotrBL:Cs,rotr32H:Rs,rotr32L:Us,rotlSH:Ds,rotlSL:Ns,rotlBH:Ms,rotlBL:Gs,add:Fs,add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,s)=>t+n+s+(e/2**32|0)|0,add4L:(e,t,n,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0),add4H:(e,t,n,s,o)=>t+n+s+o+(e/2**32|0)|0,add5H:(e,t,n,s,o,a)=>t+n+s+o+a+(e/2**32|0)|0,add5L:(e,t,n,s,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0)+(o>>>0)};const[Gr,Fr,zr]=[[],[],[]],zs=BigInt(0),Fn=BigInt(1),$s=BigInt(2),qs=BigInt(7),Vs=BigInt(256),Ks=BigInt(113);for(let e=0,t=Fn,n=1,s=0;e<24;e++){[n,s]=[s,(2*n+3*s)%5],Gr.push(2*(5*s+n)),Fr.push((e+1)*(e+2)/2%64);let o=zs;for(let a=0;a<7;a++)t=(t<<Fn^(t>>qs)*Ks)%Vs,t&$s&&(o^=Fn<<(Fn<<BigInt(a))-Fn);zr.push(o)}const[js,Xs]=Gn.split(zr,!0),$r=(e,t,n)=>n>32?Gn.rotlBH(e,t,n):Gn.rotlSH(e,t,n),qr=(e,t,n)=>n>32?Gn.rotlBL(e,t,n):Gn.rotlSL(e,t,n);function Zs(e,t=24){const n=new Uint32Array(10);for(let s=24-t;s<24;s++){for(let c=0;c<10;c++)n[c]=e[c]^e[c+10]^e[c+20]^e[c+30]^e[c+40];for(let c=0;c<10;c+=2){const x=(c+8)%10,g=(c+2)%10,p=n[g],A=n[g+1],y=$r(p,A,1)^n[x],V=qr(p,A,1)^n[x+1];for(let U=0;U<50;U+=10)e[c+U]^=y,e[c+U+1]^=V}let o=e[2],a=e[3];for(let c=0;c<24;c++){const x=Fr[c],g=$r(o,a,x),p=qr(o,a,x),A=Gr[c];o=e[A],a=e[A+1],e[A]=g,e[A+1]=p}for(let c=0;c<50;c+=10){for(let x=0;x<10;x++)n[x]=e[c+x];for(let x=0;x<10;x++)e[c+x]^=~n[(x+2)%10]&n[(x+4)%10]}e[0]^=js[s],e[1]^=Xs[s]}n.fill(0)}class Qn extends Lr{constructor(t,n,s,o=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=s,this.enableXOF=o,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,mt.number(s),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=is(this.state)}keccak(){Zs(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){mt.exists(this);const{blockLen:n,state:s}=this;t=Nn(t);const o=t.length;for(let a=0;a<o;){const c=Math.min(n-this.pos,o-a);for(let x=0;x<c;x++)s[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:s,blockLen:o}=this;t[s]^=n,(n&128)!==0&&s===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){mt.exists(this,!1),mt.bytes(t),this.finish();const n=this.state,{blockLen:s}=this;for(let o=0,a=t.length;o<a;){this.posOut>=s&&this.keccak();const c=Math.min(s-this.posOut,a-o);t.set(n.subarray(this.posOut,this.posOut+c),o),this.posOut+=c,o+=c}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return mt.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(mt.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:s,outputLen:o,rounds:a,enableXOF:c}=this;return t||(t=new Qn(n,s,o,c,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=s,t.outputLen=o,t.enableXOF=c,t.destroyed=this.destroyed,t}}const Wt=(e,t,n)=>xr(()=>new Qn(t,e,n)),G0=Wt(6,144,224/8),F0=Wt(6,136,256/8),z0=Wt(6,104,384/8),$0=Wt(6,72,512/8),Ws=Wt(1,144,224/8),Vr=Wt(1,136,256/8),Ys=Wt(1,104,384/8),Js=Wt(1,72,512/8),Kr=(e,t,n)=>xs((s={})=>new Qn(t,e,s.dkLen===void 0?n:s.dkLen,!0)),q0=Kr(31,168,128/8),V0=Kr(31,136,256/8),K0=Mn(Ws),zn=(()=>{const e=Mn(Vr);return e.create=Vr.create,e})(),j0=Mn(Ys),X0=Mn(Js),Sn=BigInt(0);class Er{constructor(t=Sn,n=Sn,s=KECCAK256_RLP,o=KECCAK256_NULL){this.nonce=t,this.balance=n,this.storageRoot=s,this.codeHash=o,this._validate()}static fromAccountData(t){const{nonce:n,balance:s,storageRoot:o,codeHash:a}=t;return new Er(n!==void 0?bytesToBigInt(toBytes(n)):void 0,s!==void 0?bytesToBigInt(toBytes(s)):void 0,o!==void 0?toBytes(o):void 0,a!==void 0?toBytes(a):void 0)}static fromRlpSerializedAccount(t){const n=RLP.decode(t);if(!Array.isArray(n))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(n)}static fromValuesArray(t){const[n,s,o,a]=t;return new Er(bytesToBigInt(n),bytesToBigInt(s),o,a)}_validate(){if(this.nonce<Sn)throw new Error("nonce must be greater than zero");if(this.balance<Sn)throw new Error("balance must be greater than zero");if(this.storageRoot.length!==32)throw new Error("storageRoot must have a length of 32");if(this.codeHash.length!==32)throw new Error("codeHash must have a length of 32")}raw(){return[bigIntToUnpaddedBytes(this.nonce),bigIntToUnpaddedBytes(this.balance),this.storageRoot,this.codeHash]}serialize(){return RLP.encode(this.raw())}isContract(){return!equalsBytes(this.codeHash,KECCAK256_NULL)}isEmpty(){return this.balance===Sn&&this.nonce===Sn&&equalsBytes(this.codeHash,KECCAK256_NULL)}}const jr=function(e){try{ps(e)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)},Qs=function(e,t){assertIsHexString(e);const n=stripHexPrefix(e).toLowerCase();let s="";t!==void 0&&(s=bytesToBigInt(toBytes(t)).toString()+"0x");const o=utf8ToBytes(s+n),a=bytesToHex(keccak256(o)).slice(2);let c="0x";for(let x=0;x<n.length;x++)parseInt(a[x],16)>=8?c+=n[x].toUpperCase():c+=n[x];return c},Z0=function(e,t){return jr(e)&&Qs(e,t)===e},eo=function(e,t){return Gt(e),Gt(t),Ft(t)===BigInt(0)?zn(Nr.yH.encode([e,Uint8Array.from([])])).subarray(-20):zn(Nr.yH.encode([e,t])).subarray(-20)},to=function(e,t,n){if(Gt(e),Gt(t),Gt(n),e.length!==20)throw new Error("Expected from to be of length 20");if(t.length!==32)throw new Error("Expected salt to be of length 32");return zn(yr(dn("0xff"),e,t,zn(n))).subarray(-20)},W0=function(e){return secp256k1.utils.isValidPrivateKey(e)},Y0=function(e,t=!1){if(assertIsBytes(e),e.length===64)try{return secp256k1.ProjectivePoint.fromHex(concatBytes(Uint8Array.from([4]),e)),!0}catch{return!1}if(!t)return!1;try{return secp256k1.ProjectivePoint.fromHex(e),!0}catch{return!1}},Xr=function(e,t=!1){if(Gt(e),t&&e.length!==64&&(e=E.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1)),e.length!==64)throw new Error("Expected pubKey to be of length 64");return zn(e).subarray(-20)},Zr=Xr,no=function(e){return Gt(e),E.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1)},ro=function(e){return Zr(no(e))},J0=function(e){return assertIsBytes(e),e.length!==64&&(e=secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1)),e},so=function(){const t=zeros(20);return bytesToHex(t)},Q0=function(e){try{assertIsString(e)}catch{return!1}return so()===e};function oo(e){const[t,n,s,o]=e;return[t,n,s.length===0?KECCAK256_RLP:s,o.length===0?KECCAK256_NULL:o]}const Wr=new Uint8Array(0);function ei(e){const[t,n,s,o]=e;return[t,n,equalsBytes(s,KECCAK256_RLP)?Wr:s,equalsBytes(o,KECCAK256_NULL)?Wr:o]}function ti(e,t=!0){const n=t?oo(e):e;return RLP.encode(n)}class zt{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.bytes=t}static zero(){return new zt(br(20))}static fromString(t){if(!jr(t))throw new Error("Invalid address");return new zt(Yn(t))}static fromPublicKey(t){if(!(t instanceof Uint8Array))throw new Error("Public key should be Uint8Array");const n=Xr(t);return new zt(n)}static fromPrivateKey(t){if(!(t instanceof Uint8Array))throw new Error("Private key should be Uint8Array");const n=ro(t);return new zt(n)}static generate(t,n){if(typeof n!="bigint")throw new Error("Expected nonce to be a bigint");return new zt(eo(t.bytes,lr(n)))}static generate2(t,n,s){if(!(n instanceof Uint8Array))throw new Error("Expected salt to be a Uint8Array");if(!(s instanceof Uint8Array))throw new Error("Expected initCode to be a Uint8Array");return new zt(to(t.bytes,n,s))}equals(t){return Or(this.bytes,t.bytes)}isZero(){return this.equals(zt.zero())}isPrecompileOrSystemAddress(){const t=Ft(this.bytes),n=BigInt(0),s=BigInt("0xffff");return t>=n&&t<=s}toString(){return In(this.bytes)}toBytes(){return new Uint8Array(this.bytes)}}var Yr;(function(e){e.String="string",e.Bytes="view",e.Number="number"})(Yr||(Yr={}));var Jr;(function(e){e.String="string",e.Bytes="view",e.JSON="json"})(Jr||(Jr={}));var xn;(function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Uint8Array=2]="Uint8Array",e[e.PrefixedHexString=3]="PrefixedHexString"})(xn||(xn={}));function io(e,t){if(e===null)return null;if(e===void 0)return;if(typeof e=="string"&&!Rr(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if(typeof e=="number"&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const n=Yn(e);switch(t){case xn.Uint8Array:return n;case xn.BigInt:return Ft(n);case xn.Number:{const s=Ft(n);if(s>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(s)}case xn.PrefixedHexString:return In(n);default:throw new Error("unknown outputType")}}class er{constructor(t,n,s,o){this.index=t,this.validatorIndex=n,this.address=s,this.amount=o}static fromWithdrawalData(t){const{index:n,validatorIndex:s,address:o,amount:a}=t,c=toType(n,TypeOutput.BigInt),x=toType(s,TypeOutput.BigInt),g=o instanceof Address?o:new Address(toBytes(o)),p=toType(a,TypeOutput.BigInt);return new er(c,x,g,p)}static fromValuesArray(t){if(t.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${t.length}`);const[n,s,o,a]=t;return er.fromWithdrawalData({index:n,validatorIndex:s,address:o,amount:a})}static toBytesArray(t){const{index:n,validatorIndex:s,address:o,amount:a}=t,c=toType(n,TypeOutput.BigInt)===BigInt(0)?new Uint8Array:toType(n,TypeOutput.Uint8Array),x=toType(s,TypeOutput.BigInt)===BigInt(0)?new Uint8Array:toType(s,TypeOutput.Uint8Array),g=o instanceof Address?o.bytes:toType(o,TypeOutput.Uint8Array),p=toType(a,TypeOutput.BigInt)===BigInt(0)?new Uint8Array:toType(a,TypeOutput.Uint8Array);return[c,x,g,p]}raw(){return er.toBytesArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.bytes,amount:this.amount}}toJSON(){return{index:bigIntToHex(this.index),validatorIndex:bigIntToHex(this.validatorIndex),address:bytesToHex(this.address.bytes),amount:bigIntToHex(this.amount)}}}function ao(e,t,n){const s=E.sign(e,t),o=s.toCompactRawBytes(),a=o.slice(0,32),c=o.slice(32,64),x=n===void 0?BigInt(s.recovery+27):BigInt(s.recovery+35)+BigInt(n)*BigInt(2);return{r:a,s:c,v:x}}function tr(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function nr(e){return e===BigInt(0)||e===BigInt(1)}const co=function(e,t,n,s,o){const a=yr(gr(n,32),gr(s,32)),c=tr(t,o);if(!nr(c))throw new Error("Invalid signature v value");return E.Signature.fromCompact(a).addRecoveryBit(Number(c)).recoverPublicKey(e).toRawBytes(!1).slice(1)},ni=function(e,t,n,s){const o=tr(e,s);if(!nr(o))throw new Error("Invalid signature v value");return bytesToHex(concatBytes(setLengthLeft(t,32),setLengthLeft(n,32),toBytes(e)))},ri=function(e,t,n,s){const o=tr(e,s);if(!nr(o))throw new Error("Invalid signature v value");const a=Uint8Array.from([...n]);return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(a[0]|=128),bytesToHex(concatBytes(setLengthLeft(t,32),setLengthLeft(a,32)))},si=function(e){const t=toBytes(e);let n,s,o;if(t.length>=65)n=t.subarray(0,32),s=t.subarray(32,64),o=bytesToBigInt(t.subarray(64));else if(t.length===64)n=t.subarray(0,32),s=t.subarray(32,64),o=BigInt(bytesToInt(t.subarray(32,33))>>7),s[0]&=127;else throw new Error("Invalid signature length");return o<27&&(o=o+BigInt(27)),{v:o,r:n,s}},oi=function(e,t,n,s=!0,o){if(t.length!==32||n.length!==32||!nr(tr(e,o)))return!1;const a=bytesToBigInt(t),c=bytesToBigInt(n);return!(a===BigInt(0)||a>=SECP256K1_ORDER||c===BigInt(0)||c>=SECP256K1_ORDER||s&&c>=SECP256K1_ORDER_DIV_2)},ii=function(e){assertIsBytes(e);const t=utf8ToBytes(`Ethereum Signed Message:
2
+ ${e.length}`);return keccak256(concatBytes(t,e))};var ai=Se(17187);async function fo(e,t,n){let s;for await(const o of t)try{o.length<2?o.call(e,n):await new Promise((a,c)=>{o.call(e,n,x=>{x?c(x):a()})})}catch(a){s=a}if(s)throw s}class ci extends null{emit(t,...n){var x;let[s,o]=n;const a=this;let c=(x=a._events[t])!=null?x:[];return o===void 0&&typeof s=="function"&&(o=s,s=void 0),(t==="newListener"||t==="removeListener")&&(s={event:s,fn:o},o=void 0),c=Array.isArray(c)?c:[c],fo(a,c.slice(),s).then(o).catch(o),a.listenerCount(t)>0}once(t,n){const s=this;let o;if(typeof n!="function")throw new TypeError("listener must be a function");return n.length>=2?o=function(a,c){s.removeListener(t,o),n(a,c)}:o=function(a){s.removeListener(t,o),n(a,o)},s.on(t,o),s}first(t,n){var o;let s=(o=this._events[t])!=null?o:[];if(typeof n!="function")throw new TypeError("listener must be a function");return Array.isArray(s)||(this._events[t]=s=[s]),s.unshift(n),this}before(t,n,s){return this.beforeOrAfter(t,n,s)}after(t,n,s){return this.beforeOrAfter(t,n,s,"after")}beforeOrAfter(t,n,s,o){var p;let a=(p=this._events[t])!=null?p:[],c,x;const g=o==="after"?1:0;if(typeof s!="function")throw new TypeError("listener must be a function");if(typeof n!="function")throw new TypeError("target must be a function");for(Array.isArray(a)||(this._events[t]=a=[a]),x=a.length,c=a.length;c--;)if(a[c]===n){x=c+g;break}return a.splice(x,0,s),this}on(t,n){return super.on(t,n)}addListener(t,n){return super.addListener(t,n)}prependListener(t,n){return super.prependListener(t,n)}prependOnceListener(t,n){return super.prependOnceListener(t,n)}removeAllListeners(t){return super.removeAllListeners(t)}removeListener(t,n){return super.removeListener(t,n)}eventNames(){return super.eventNames()}listeners(t){return super.listeners(t)}listenerCount(t){return super.listenerCount(t)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(t){return super.setMaxListeners(t)}}function xo(e,t,n,s){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,s);const o=BigInt(32),a=BigInt(4294967295),c=Number(n>>o&a),x=Number(n&a),g=s?4:0,p=s?0:4;e.setUint32(t+g,c,s),e.setUint32(t+p,x,s)}class uo extends Lr{constructor(t,n,s,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=s,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=dr(this.buffer)}update(t){mt.exists(this);const{view:n,buffer:s,blockLen:o}=this;t=Nn(t);const a=t.length;for(let c=0;c<a;){const x=Math.min(o-this.pos,a-c);if(x===o){const g=dr(t);for(;o<=a-c;c+=o)this.process(g,c);continue}s.set(t.subarray(c,c+x),this.pos),this.pos+=x,c+=x,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){mt.exists(this),mt.output(t,this),this.finished=!0;const{buffer:n,view:s,blockLen:o,isLE:a}=this;let{pos:c}=this;n[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(s,0),c=0);for(let y=c;y<o;y++)n[y]=0;xo(s,o-8,BigInt(this.length*8),a),this.process(s,0);const x=dr(t),g=this.outputLen;if(g%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=g/4,A=this.get();if(p>A.length)throw new Error("_sha2: outputLen bigger than state");for(let y=0;y<p;y++)x.setUint32(4*y,A[y],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const s=t.slice(0,n);return this.destroy(),s}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:s,length:o,finished:a,destroyed:c,pos:x}=this;return t.length=o,t.pos=x,t.finished=a,t.destroyed=c,o%n&&t.buffer.set(s),t}}const ho=(e,t,n)=>e&t^~e&n,lo=(e,t,n)=>e&t^e&n^t&n,bo=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Yt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Jt=new Uint32Array(64);class Qr extends uo{constructor(){super(64,32,8,!1),this.A=Yt[0]|0,this.B=Yt[1]|0,this.C=Yt[2]|0,this.D=Yt[3]|0,this.E=Yt[4]|0,this.F=Yt[5]|0,this.G=Yt[6]|0,this.H=Yt[7]|0}get(){const{A:t,B:n,C:s,D:o,E:a,F:c,G:x,H:g}=this;return[t,n,s,o,a,c,x,g]}set(t,n,s,o,a,c,x,g){this.A=t|0,this.B=n|0,this.C=s|0,this.D=o|0,this.E=a|0,this.F=c|0,this.G=x|0,this.H=g|0}process(t,n){for(let y=0;y<16;y++,n+=4)Jt[y]=t.getUint32(n,!1);for(let y=16;y<64;y++){const V=Jt[y-15],U=Jt[y-2],D=Tt(V,7)^Tt(V,18)^V>>>3,I=Tt(U,17)^Tt(U,19)^U>>>10;Jt[y]=I+Jt[y-7]+D+Jt[y-16]|0}let{A:s,B:o,C:a,D:c,E:x,F:g,G:p,H:A}=this;for(let y=0;y<64;y++){const V=Tt(x,6)^Tt(x,11)^Tt(x,25),U=A+V+ho(x,g,p)+bo[y]+Jt[y]|0,I=(Tt(s,2)^Tt(s,13)^Tt(s,22))+lo(s,o,a)|0;A=p,p=g,g=x,x=c+U|0,c=a,a=o,o=s,s=U+I|0}s=s+this.A|0,o=o+this.B|0,a=a+this.C|0,c=c+this.D|0,x=x+this.E|0,g=g+this.F|0,p=p+this.G|0,A=A+this.H|0,this.set(s,o,a,c,x,g,p,A)}roundClean(){Jt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class go extends Qr{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const mo=xr(()=>new Qr),fi=xr(()=>new go),po=Mn(mo);function $n(){throw Error("kzg library not loaded")}let qn={loadTrustedSetup:$n,blobToKzgCommitment:$n,computeBlobKzgProof:$n,verifyKzgProof:$n,verifyBlobKzgProofBatch:$n};function di(e,t){qn=e,qn.loadTrustedSetup(t)}const yo=32,vr=4096,Vn=32*vr,wo=Vn*2-1,Eo=yo*vr;function vo(e,t){const n=new Uint8Array(t*Vn).fill(0);return n.set(e),n[e.byteLength]=128,n}function Bo(e){const t=new Uint8Array(Eo);for(let n=0;n<vr;n++){const s=new Uint8Array(32);s.set(e.subarray(n*31,(n+1)*31),0),t.set(s,n*32)}return t}const Io=e=>{const t=_r(e),n=t.byteLength;if(n===0)throw Error("invalid blob data");if(n>wo)throw Error("blob data is too large");const s=Math.ceil(n/Vn),o=vo(t,s),a=[];for(let c=0;c<s;c++){const x=o.subarray(c*Vn,(c+1)*Vn),g=Bo(x);a.push(g)}return a},So=e=>{const t=[];for(const n of e)t.push(qn.blobToKzgCommitment(n));return t},Ao=(e,t)=>e.map((s,o)=>qn.computeBlobKzgProof(s,t[o])),es=(e,t)=>{const n=new Uint8Array(32);return n.set([t],0),n.set(po(e).subarray(1),1),n},Po=e=>{const t=[];for(const n of e)t.push(es(n,1));return t};function ui(e){const t={};for(let n of Object.keys(e.alloc)){let{balance:s,code:o,storage:a,nonce:c}=e.alloc[n];n=addHexPrefix(n),s=isHexPrefixed(s)?s:bigIntToHex(BigInt(s)),o=o!==void 0?addHexPrefix(o):void 0,a=a!==void 0?Object.entries(a):void 0,c=c!==void 0?addHexPrefix(c):void 0,t[n]=[s,o,a,c]}return t}class ts{constructor(t){this._database=t!=null?t:new Map}async get(t){const n=t instanceof Uint8Array?bytesToUnprefixedHex(t):t.toString();return this._database.get(n)}async put(t,n){const s=t instanceof Uint8Array?bytesToUnprefixedHex(t):t.toString();this._database.set(s,n)}async del(t){const n=t instanceof Uint8Array?bytesToUnprefixedHex(t):t.toString();this._database.delete(n)}async batch(t){for(const n of t)n.type==="del"&&await this.del(n.key),n.type==="put"&&await this.put(n.key,n.value)}shallowCopy(){return new ts(this._database)}open(){return Promise.resolve()}}const ko=async(e,t)=>{const n=JSON.stringify({method:t.method,params:t.params,jsonrpc:"2.0",id:1});return(await(await fetch(e,{headers:{"content-type":"application/json"},method:"POST",body:n})).json()).result},To=e=>{if(typeof e=="string")return e;if(typeof e=="object"&&e._getConnection!==void 0)return e._getConnection().url;throw new Error("Must provide valid provider URL or Web3Provider")}}}]);