1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[11567,50369],{11567:function(t,e,i){i.d(e,{estimateL1Fee:function(){return I}});var n=i(73511),r=i(91728),s=i(35569),o=i(19586),a=i(92876),u=i(38514),h=i(1291);function c(t){if(!t||0===t.length)return[];let e=[];for(let{address:i,storageKeys:n}of t){for(let t=0;t<n.length;t++)if(32!==o.dp(n[t]))throw new l({storageKey:n[t]});i&&u.hu(i,{strict:!1}),e.push([i,n])}return e}class l extends h.G{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${o.dp(t)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccessList.InvalidStorageKeySizeError"})}}var f=i(79866);let p={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new x({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new g({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new d({offset:t});let e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new d({offset:t});let e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){let e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){let i=e??this.position;return this.assertPosition(i+t-1),this.bytes.subarray(i,i+t)},inspectUint8(t){let e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){let e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){let e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){let e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,255&t),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();let i=this.inspectBytes(t);return this.position+=e??t,i},readUint8(){this.assertReadLimit(),this._touch();let t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();let t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();let t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();let t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){let e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};class d extends h.G{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class g extends h.G{constructor({length:t,position:e}){super(`Position \`${e}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class x extends h.G{constructor({count:t,limit:e}){super(`Recursive read limit of \`${e}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function v(t,e={}){let{as:i="Hex"}=e;return function(t,e){let{as:i}=e,n=function t(e){return Array.isArray(e)?function(t){let e=t.reduce((t,e)=>t+e.length,0),i=w(e);return{length:e<=55?1+e:1+i+e,encode(n){for(let{encode:r}of(e<=55?n.pushByte(192+e):(n.pushByte(247+i),1===i?n.pushUint8(e):2===i?n.pushUint16(e):3
1===i?n.pushUint24(e):n.pushUint32(e)),t))r(n)}}}(e.map(e=>t(e))):function(t){let e="string"==typeof t?f.H_(t):t,i=w(e.length);return{length:1===e.length&&e[0]<128?1:e.length<=55?1+e.length:1+i+e.length,encode(t){1===e.length&&e[0]<128||(e.length<=55?t.pushByte(128+e.length):(t.pushByte(183+i),1===i?t.pushUint8(e.length):2===i?t.pushUint16(e.length):3===i?t.pushUint24(e.length):t.pushUint32(e.length))),t.pushBytes(e)}}}(e)}(t),r=function(t,{recursiveReadLimit:e=8192}={}){let i=Object.create(p);return i.bytes=t,i.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),i.positionReadCount=new Map,i.recursiveReadLimit=e,i}(new Uint8Array(n.length));return(n.encode(r),"Hex"===i)?o.xv(r.bytes):r.bytes}(t,{as:i})}function w(t){if(t<256)return 1;if(t<65536)return 2;if(t<16777216)return 3;if(t<4294967296)return 4;throw new h.G("Length is too large.")}let y={wei:0,gwei:9,szabo:12,finney:15,ether:18};function b(t,e="wei"){return function(t,e=0){let i=t.toString(),n=i.startsWith("-");n&&(i=i.slice(1));let[r,s]=[(i=i.padStart(e,"0")).slice(0,i.length-e),i.slice(i.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${r||"0"}${s?`.${s}`:""}`}(t,y.gwei-y[e])}class m extends h.G{constructor({feeCap:t}={}){super(`The fee cap (\`maxFeePerGas\`/\`maxPriorityFeePerGas\`${t?` = ${b(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.FeeCapTooHighError"})}}class P extends h.G{constructor({gasPrice:t}={}){super(`The gas price (\`gasPrice\`${t?` = ${b(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.GasPriceTooHighError"})}}class S extends h.G{constructor({chainId:t}){super(void 0!==t?`Chain ID "${t}
1" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidChainIdError"})}}class U extends h.G{constructor({maxPriorityFeePerGas:t,maxFeePerGas:e}={}){super(`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${b(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${e?` = ${b(e)} gwei`:""}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.TipAboveFeeCapError"})}}function C(t){let{chainId:e,maxPriorityFeePerGas:i,maxFeePerGas:n,to:r}=t;if(e<=0)throw new S({chainId:e});if(r&&u.hu(r,{strict:!1}),n&&BigInt(n)>2n**256n-1n)throw new m({feeCap:n});if(i&&n&&i>n)throw new U({maxFeePerGas:n,maxPriorityFeePerGas:i})}function R(t){let{chainId:e,gasPrice:i,to:n}=t;if(e<=0)throw new S({chainId:e});if(n&&u.hu(n,{strict:!1}),i&&BigInt(i)>2n**256n-1n)throw new P({gasPrice:i})}function G(t){let{authorizationList:e}=t;if(e)for(let t of e){let{address:e,chainId:i}=t;if(e&&u.hu(e,{strict:!1}),0>Number(i))throw new S({chainId:i})}C(t)}function E(t){let{chainId:e,gasPrice:i,to:n}=t;if(n&&u.hu(n,{strict:!1}),void 0!==e&&e<=0)throw new S({chainId:e});if(i&&BigInt(i)>2n**256n-1n)throw new P({gasPrice:i})}async function I(t){let{transaction:e,gasPriceOracleAddress:i}=t,u=(0,n.u)({client:e.client,address:i||"0x420000000000000000000000000000000000000F",chain:e.chain}),{gasPrice:h,...l}=await (0,r.n)({transaction:e}),f=function(t){let{transaction:e}=t,i=function(t){if(void 0!==t.type)return t.type;if(void 0!==t.authorizationList)return"eip7702";if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)return"eip1559";if(void 0!==t.gasPrice)return void 0!==t.accessList?"eip2930":"legacy";throw Error("Invalid transaction type")}(e),n=(()=>{if(t.signature)return"v"in t.signature&&void 0!==t.signature.v?a.DZ({r:o.Gh(t.signature.r),s:o.Gh(t.signature.s),v:Number(t.signature.v)}):{r:o.Gh(t.signature.r),s:o.Gh(t.signature.s),yParity:t.signature.yParity};if(void 0!==e.v||void 0!==e.yParity){if(void 0===e.r||void 0===e.s)throw Error("Invalid signature provided with transaction");return{r:"bigint"==typeof e.r?e.r:o.Gh(e.r),s:"bigint"==typeof e.s?e.s:o.Gh(e.s),yParity:void 0!==e.v&&void 0===e.yParity?a.j9(Number(e.v)):Number(e.yParity)}}})();if("eip1559"===i)return C(e),function(t,e={}){let{chainId:i,gas:n,nonce:r,to:s,value:u,maxFeePerGas:h,maxPriorityFeePerGas:l,accessList:f,data:p,input:d}=t;C(t);let g=c(f),x=a.Kl(e.signature||t),w=[o.xS(i),r?o.xS(r):"0x",l?o.xS(l):"0x",h?o.xS(h):"0x",n?o.xS(n):"0x",s??"0x",u?o.xS(u):"0x",p??d??"0x",g,...x?a.Vb(x):[]];return o.zo("0x02",v(w))}(e,{signature:n});if("legacy"===i)return E(e),function(t,e={}){let{chainId:i=0,gas:n,data:r,input:s,nonce:u,to:h,value:c,gasPrice:l}=t;E(t);let f=[u?o.xS(u):"0x",l?o.xS(l):"0x",n?o.xS(n):"0x",h??"0x",c?o.xS(c):"0x",r??s??"0x"],p=e.signature?{r:e.signature.r,s:e.signature.s,v:a.Kb(e.signature.yParity)}:void 0!==t.r&&void 0!==t.s?{r:t.r,s:t.s,v:t.v}:void 0;if(p){let t=(()=>{if(p.v>=35)return Math.floor((p.v-35)/2)>0?p.v:27+(35===p.v?0:1);if(i>0)return 2*i+35+p.v-27;let t=27+(27===p.v?0:1);if(p.v!==t)throw new a.xY({value:p.v});return t})();f=[...f,o.xS(t),0n===p.r?"0x":o.fi(o.xS(p.r)),0n===p.s?"0x":o.fi(o.xS(p.s))]}else i>0&&(f=[...f,o.xS(i),"0x","0x"]);return v(f)}(e,{signature:n});if("eip2930"===i)return R(e),function(t,e={}){let{chainId:i,gas:n,data:r,input:s,nonce:u,to:h,value:l,accessList:f,gasPrice:p}=t;R(t);let d=c(f),g=a.Kl(e.signature||t),x=[o.xS(i),u?o.xS(u):"0x",p?o.xS(p):"0x",n?o.xS(n):"0x",h??"0x",l?o.xS(l):"0x",r??s??"0x",d,...g?a.Vb(g):[]];return o.zo("0x01",v(x))}(e,{signature:n});if("eip7702"===i)return G(e),function(t,e={}){let{authorizationList:i,chainId:n,gas:r,nonce:s,to:u,value:h,maxFeePerGas:l,maxPriorityFeePerGas:f,accessList:p,data:d,input:g}=t;G(t);let x=c(p),w=function(t){if(!t||0===t.length)return[];let e=[];for(let i of t)e.push(function(t){let{address:e,chainId:i,nonce:n}=t,r=a.Kl(t);return[i?o.xS(i):"0x",e,n?o.xS(n):"0x",...r?a.Vb(r):[]]}(i));return e}(i),y=a.Kl(e.signature||t),b=[o.xS(n),s?o.xS(s):"0x",f?o.xS(f):"0x",l?o.xS(l):"0x",r?o.xS(r):"0x",u??"0x",h?o.xS(h):"0x",d??g??"0x",x,w,...y?a.Vb(y):[]];return o.zo("0x04",v(b))}(e,{signature:n});throw Error("Invalid transaction type")}({transaction:l});return(0,s.readContract)({contract:u,method:"function getL1Fee(bytes memory _data) view returns (uint256)",params:[f]})}}
1,50369:function(t,e,i){i.d(e,{encode:function(){return r}});let n=new WeakMap;async function r(t){if(n.has(t))return n.get(t);let e=(async()=>{let[e,n,{concatHex:r}]=await Promise.all([s(t),o(t),i.e(8291).then(i.bind(i,8291))]);return n?r([e,n]):e})();return n.set(t,e),e}async function s(t){return void 0===t.data?"0x":"function"==typeof t.data?await t.data()||"0x":t.data}async function o(t){if(t.extraCallData){if("function"==typeof t.extraCallData){let e=await t.extraCallData();if(!e)return;if(!e.startsWith("0x"))throw Error("Invalid extra calldata - must be a hex string");if("0x"===e)return;return e}if(!t.extraCallData.startsWith("0x"))throw Error("Invalid extra calldata - must be a hex string");return t.extraCallData}}},91728:function(t,e,i){i.d(e,{n:function(){return c}});var n=i(33422),r=i(24623),s=i(46061),o=i(34849),a=i(5189),u=i(50369),h=i(89800);async function c(t){if(await (0,o.T)(t.transaction.chain)){let{getZkGasFees:e}=await i.e(19986).then(i.bind(i,19986)),{gas:n,maxFeePerGas:r,maxPriorityFeePerGas:o}=await e({transaction:t.transaction,from:"string"==typeof t.from?(0,s.Kn)(t.from):void 0!==t.from?(0,s.Kn)(t.from.address):void 0});t.transaction={...t.transaction,gas:n,maxFeePerGas:r,maxPriorityFeePerGas:o}}let e=(0,r.getRpcClient)(t.transaction),c=t.transaction.chain.id,l=t.from,[f,p,d,g,x,v,w,y,b]=await Promise.all([(0,u.encode)(t.transaction),(async()=>{let n=await (0,a.q)(t.transaction.nonce);return void 0!==n?n:l?await i.e(8325).then(i.bind(i,8325)).then(({eth_getTransactionCount:t})=>t(e,{address:"string"==typeof l?(0,s.Kn)(l):(0,s.Kn)(l.address),blockTag:"pending"})):void 0})(),(0,h.Q)({...t,from:t.from}),(0,n.w)(t.transaction),(0,a.q)(t.transaction.to),(0,a.q)(t.transaction.accessList),(0,a.q)(t.transaction.value),(0,a.q)(t.transaction.authorizationList),(0,a.q)(t.transaction.type)]),m=await (0,a.q)(t.transaction.extraGas);return m&&(d+=m),{to:x,chainId:c,data:f,gas:d,nonce:p,accessList:v,value:w,authorizationList:y,type:b,...g}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.