1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,885949,e=>{"use strict";var t=e.i(283817),r=e.i(390720);e.s(["publicKeyToAddress",0,function(e){let a=(0,r.keccak256)(`0x${e.substring(4)}`).substring(26);return(0,t.checksumAddress)(`0x${a}`)}])},619189,691278,523823,e=>{"use strict";e.s(["estimateGas",()=>N],523823),e.s(["defaultParameters",()=>F,"prepareTransactionRequest",()=>G],691278);var t=e.i(848311),r=e.i(315796),a=e.i(212667),i=e.i(943106),n=e.i(79295),o=e.i(710363),s=e.i(27040),c=e.i(666474),l=e.i(289637),u=e.i(500855),d=e.i(454695),f=e.i(206208),m=e.i(807985),p=e.i(478631),y=e.i(558633),g=e.i(179827),h=e.i(838394),b=e.i(460336),w=e.i(883192),v=e.i(646509),P=e.i(460842),T=e.i(52564),x=e.i(514513),E=e.i(544753),k=e.i(92483);let F=["blobVersionedHashes","chainId","fees","gas","nonce","type"],A=new Map,B=new T.LruMap(128);async function G(e,r){let a,n,o=r;o.account??=e.account,o.parameters??=F;let{account:s,chain:c=e.chain,nonceManager:l,parameters:u}=o,d="function"==typeof c?.prepareTransactionRequest?{fn:c.prepareTransactionRequest,runAt:["beforeFillTransaction"]}:Array.isArray(c?.prepareTransactionRequest)?{fn:c.prepareTransactionRequest[0],runAt:c.prepareTransactionRequest[1].runAt}:void 0;async function T(){return a||(void 0!==o.chainId?o.chainId:c?c.id:a=await (0,i.getAction)(e,k.getChainId,"getChainId")({}))}let G=s?(0,t.parseAccount)(s):s,R=o.nonce;if(d?.fn&&d.runAt?.includes("beforeFillTransaction")){o=await d.fn({...o,chain:c},{client:e,phase:"beforeFillTransaction"}),R??=o.nonce;let r=o.account??o.from;G=r?(0,t.parseAccount)(r):void 0}if(u.includes("nonce")&&void 0===R&&G&&l){let t=await T();R=await l.consume({address:G.address,chainId:t,client:e})}let I=(!(u.includes("blobVersionedHashes")||u.includes("sidecars"))||!o.kzg||!
1o.blobs)&&(u.length>0&&"feePayer"in o&&o.feePayer&&(!("feePayerSignature"in o)||!o.feePayerSignature)||!1!==B.get(e.uid)&&["fees","gas"].some(e=>u.includes(e))&&(u.includes("chainId")&&"number"!=typeof o.chainId||u.includes("nonce")&&"number"!=typeof R||u.includes("fees")&&"bigint"!=typeof o.gasPrice&&("bigint"!=typeof o.maxFeePerGas||"bigint"!=typeof o.maxPriorityFeePerGas)||u.includes("gas")&&"bigint"!=typeof o.gas))?await (0,i.getAction)(e,E.fillTransaction,"fillTransaction")({...o,nonce:R}).then(t=>{let{chainId:r,from:a,gas:i,gasPrice:n,nonce:s,maxFeePerBlobGas:c,maxFeePerGas:l,maxPriorityFeePerGas:u,type:d,...f}=t.transaction,m="feeToken"in f?f.feeToken:void 0,p="feePayerSignature"in f&&null!==f.feePayerSignature&&void 0!==f.feePayerSignature,y=null!=m&&(!("feeToken"in o)||p);return B.set(e.uid,!0),{...o,...a?{from:a}:{},...d&&!o.type?{type:d}:{},...void 0!==r?{chainId:r}:{},...void 0!==i?{gas:i}:{},...void 0!==n?{gasPrice:n}:{},...void 0!==s?{nonce:s}:{},...void 0!==c&&"legacy"!==o.type&&"eip2930"!==o.type?{maxFeePerBlobGas:c}:{},...void 0!==l&&"legacy"!==o.type&&"eip2930"!==o.type?{maxFeePerGas:l}:{},...void 0!==u&&"legacy"!==o.type&&"eip2930"!==o.type?{maxPriorityFeePerGas:u}:{},..."nonceKey"in f&&void 0!==f.nonceKey?{nonceKey:f.nonceKey}:{},..."keyAuthorization"in f&&void 0!==f.keyAuthorization&&null!==f.keyAuthorization&&!("keyAuthorization"in o)?{keyAuthorization:f.keyAuthorization}:{},..."feePayerSignature"in f&&void 0!==f.feePayerSignature&&null!==f.feePayerSignature?{feePayerSignature:f.feePayerSignature}:{},...y?{feeToken:m}:{},...t.capabilities?{_capabilities:t.capabilities}:{}}}).catch(t=>{if("TransactionExecutionError"!==t.name)return o;if(t.walk?.(e=>e instanceof h.FeePayerNonceMismatchError)||t.walk?.(e=>"ExecutionRevertedError"===e.name))throw t;return t.walk?.(e=>"MethodNotFoundRpcError"===e.name||"MethodNotSupportedRpcError"===e.name||e.message?.includes("eth_fillTransaction is not available"))&&B.set(e.uid,!1),o}):o;R??=I.nonce;let{blobs:S,gas:q,kzg:C,type:M}=o={...I,...G?{from:G?.address}:{},...void 0!==R?{nonce:R}:{}};async function H(){return n||(n=await (0,i.getAction)(e,p.getBlock,"getBlock")({blockTag:"latest"}))}if(d?.fn&&d.runAt?.includes("beforeFillParameters")&&(o=await d.fn({...o,chain:c},{client:e,phase:"beforeFillParameters"})),u.includes("nonce")&&void 0===R&&G&&!l&&(o.nonce=await (0,i.getAction)(e,y.getTransactionCount,"getTransactionCount")({address:G.address,blockTag:"pending"})),(u.includes("blobVersionedHashes")||u.includes("sidecars"))&&S&&C){let e=(0,b.blobsToCommitments)({blobs:S,kzg:C});if(u.includes("blobVersionedHashes")){let t=(0,v.commitmentsToVersionedHashes)({commitments:e,to:"hex"});o.blobVersionedHashes=t}if(u.includes("sidecars")){let t=(0,w.blobsToProofs)({blobs:S,commitments:e,kzg:C}),r=(0,P.toBlobSidecars)({blobs:S,commitments:e,proofs:t,to:"hex"});o.sidecars=r}}if(u.includes("chainId")&&(o.chainId=await T()),(u.includes("fees")||u.includes("type"))&&void 0===M)try{o.type=(0,x.getTransactionType)(o)}catch{let t=A.get(e.uid);if(void 0===t){let r=await H();t="bigint"==typeof r?.baseFeePerGas,A.set(e.uid,t)}o.type=t?"eip1559":"legacy"}if(u.includes("fees"))if("legacy"!==o.type&&"eip2930"!==o.type){if(void 0===o.maxFeePerGas||void 0===o.maxPriorityFeePerGas){let t=await H(),{maxFeePerGas:r,maxPriorityFeePerGas:a}=await (0,m.internal_estimateFeesPerGas)(e,{block:t,chain:c,request:o});if(void 0===o.maxPriorityFeePerGas&&o.maxFeePerGas&&o.maxFeePerGas<a)throw new g.MaxFeePerGasTooLowError({maxPriorityFeePerGas:a});o.maxPriorityFeePerGas=a,o.maxFeePerGas=r}}else{if(void 0!==o.maxFeePerGas||void 0!==o.maxPriorityFeePerGas)throw new g.Eip1559FeesNotSupportedError;if(void 0===o.gasPrice){let t=await H(),{gasPrice:r}=await (0,m.internal_estimateFeesPerGas)(e,{block:t,chain:c,request:o,type:"legacy"});o.gasPrice=r}}return u.includes("gas")&&void 0===q&&(o.gas=await (0,i.getAction)(e,N,"estimateGas")({...o,account:G,prepare:G?.type==="local"?[]:["blobVersionedHashes"]})),d?.fn&&d.runAt?.includes("afterFillParameters")&&(o=await d.fn({...o,chain:c},{client:e,phase:"afterFillParameters"})),(0,f.assertRequest)(o),delete o.parameters,o}async function N(e,r){let{account:a=e.account,prepare:i=!0}=r,m=a?(0,t.parseAccount)(a):void 0,p=Array.isArray(i)?i:m?.type!=="local"?["blobVersionedHashes"]:void 0;try{let t=await (async()=>r.to?r.to:r.authorizationList&&r.authorizationList.length>0?await (0,o.recoverAuthorizationAddress)({authorization:r.authorizationList[0]}).catch(()=>{throw new n.BaseError("`to` is required. Could not infer from `authorizationList`")}):void 0)(),{accessList:a,authorizationList:c,blobs:y,blobVersionedHashes:g,blockNumber:h,blockTag:b,data:w,gas:v,gasPrice:P,maxFeePerBlobGas:T,maxFeePerGas:x,maxPriorityFeePerGas:E,nonce:k,value:F,stateOverride:A,...B}=i?await G(e,{...r,parameters:p,to:t}):r;if(v&&r.gas!==v)return v;let N=("bigint"==typeof h?(0,s.numberToHex)(h):void 0)||b,R=(0,d.seri
1alizeStateOverride)(A);(0,f.assertRequest)(r);let I=e.chain?.formatters?.transactionRequest?.format,S=(I||u.formatTransactionRequest)({...(0,l.extract)(B,{format:I}),account:m,accessList:a,authorizationList:c,blobs:y,blobVersionedHashes:g,data:w,gasPrice:P,maxFeePerBlobGas:T,maxFeePerGas:x,maxPriorityFeePerGas:E,nonce:k,to:t,value:F},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:R?[S,N??e.experimental_blockTag??"latest",R]:N?[S,N]:[S]}))}catch(t){throw(0,c.getEstimateGasError)(t,{...r,account:m,chain:e.chain})}}async function R(e,n){let{abi:o,address:s,args:c,functionName:l,dataSuffix:u="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,...d}=n,f=(0,r.encodeFunctionData)({abi:o,args:c,functionName:l});try{return await (0,i.getAction)(e,N,"estimateGas")({data:`${f}${u?u.replace("0x",""):""}`,to:s,...d})}catch(r){let e=d.account?(0,t.parseAccount)(d.account):void 0;throw(0,a.getContractError)(r,{abi:o,address:s,args:c,docsPath:"/docs/contract/estimateContractGas",functionName:l,sender:e?.address})}}e.s(["estimateContractGas",0,R],619189)},807985,228804,897056,558633,e=>{"use strict";var t=e.i(179827),r=e.i(943106),a=e.i(492745),i=e.i(478631);async function n(e){return BigInt(await e.request({method:"eth_gasPrice"}))}async function o(e,t){return s(e,t)}async function s(e,o){let{block:s,chain:c=e.chain,request:l}=o||{};try{let t=c?.fees?.maxPriorityFeePerGas??c?.fees?.defaultPriorityFee;if("function"==typeof t){let a=s||await (0,r.getAction)(e,i.getBlock,"getBlock")({}),n=await t({block:a,client:e,request:l});if(null===n)throw Error();return n}if(void 0!==t)return t;let n=await e.request({method:"eth_maxPriorityFeePerGas"});return(0,a.hexToBigInt)(n)}catch{let[a,o]=await Promise.all([s?Promise.resolve(s):(0,r.getAction)(e,i.getBlock,"getBlock")({}),(0,r.getAction)(e,n,"getGasPrice")({})]);if("bigint"!=typeof a.baseFeePerGas)throw new t.Eip1559FeesNotSupportedError;let c=o-a.baseFeePerGas;if(c<0n)return 0n;return c}}async function c(e,t){return l(e,t)}async function l(e,a){let{block:o,chain:c=e.chain,request:l,type:u="eip1559"}=a||{},d=await (async()=>"function"==typeof c?.fees?.baseFeeMultiplier?c.fees.baseFeeMultiplier({block:o,client:e,request:l}):c?.fees?.baseFeeMultiplier??1.2)();if(d<1)throw new t.BaseFeeScalarError;let f=d.toString().split(".")[1]?.length??0,m=10**f,p=e=>e*BigInt(Math.round(d*m))/BigInt(m),y=o||await (0,r.getAction)(e,i.getBlock,"getBlock")({});if("function"==typeof c?.fees?.estimateFeesPerGas){let t=await c.fees.estimateFeesPerGas({block:o,client:e,multiply:p,request:l,type:u});if(null!==t)return t}if("eip1559"===u){if("bigint"!=typeof y.baseFeePerGas)throw new t.Eip1559FeesNotSupportedError;let r="bigint"==typeof l?.maxPriorityFeePerGas?l.maxPriorityFeePerGas:await s(e,{block:y,chain:c,request:l}),a=p(y.baseFeePerGas);return{maxFeePerGas:l?.maxFeePerGas??a+r,maxPriorityFeePerGas:r}}return{gasPrice:l?.gasPrice??p(await (0,r.getAction)(e,n,"getGasPrice")({}))}}e.s(["getGasPrice",0,n],228804),e.s(["estimateMaxPriorityFeePerGas",0,o,"internal_estimateMaxPriorityFeePerGas",0,s],897056),e.s(["estimateFeesPerGas",0,c,"internal_estimateFeesPerGas",0,l],807985);var u=e.i(607202);async function d(e,{address:t,blockHash:r,blockNumber:i,blockTag:n="latest",requireCanonical:o}){let s=(0,u.formatBlockParameter)({blockHash:r,blockNumber:i,blockTag:n,requireCanonical:o}),c=await e.request({method:"eth_getTransactionCount",params:[t,s]},{dedupe:"bigint"==typeof i||void 0!==r});return(0,a.hexToNumber)(c)}e.s(["getTransactionCount",0,d],558633)},544753,92483,e=>{"use strict";var t=e.i(848311),r=e.i(179827),a=e.i(838394),i=e.i(483553),n=e.i(289637),o=e.i(578596),s=e.i(500855),c=e.i(943106),l=e.i(206208),u=e.i(478631),d=e.i(492745);async function f(e){let t=await e.request({method:"eth_chainId"},{dedupe:!0});return(0,d.hexToNumber)(t)}async function m(e,d){let{account:m=e.account,accessList:p,authorizationList:y,chain:g=e.chain,blobVersionedHashes:h,blobs:b,data:w,gas:v,gasPrice:P,maxFeePerBlobGas:T,maxFeePerGas:x,maxPriorityFeePerGas:E,nonce:k,nonceManager:F,to:A,type:B,value:G,...N}=d,R=await (async()=>
1{if(!m||!F||void 0!==k)return k;let r=(0,t.parseAccount)(m),a=g?g.id:await (0,c.getAction)(e,f,"getChainId")({});return await F.consume({address:r.address,chainId:a,client:e})})();(0,l.assertRequest)(d);let I=g?.formatters?.transactionRequest?.format,S=(I||s.formatTransactionRequest)({...(0,n.extract)(N,{format:I}),account:m?(0,t.parseAccount)(m):void 0,accessList:p,authorizationList:y,blobs:b,blobVersionedHashes:h,data:w,gas:v,gasPrice:P,maxFeePerBlobGas:T,maxFeePerGas:x,maxPriorityFeePerGas:E,nonce:R,to:A,type:B,value:G},"fillTransaction");try{let t=await e.request({method:"eth_fillTransaction",params:[S]}),i=(g?.formatters?.transaction?.format||o.formatTransaction)(t.tx);delete i.blockHash,delete i.blockNumber,delete i.r,delete i.s,delete i.transactionIndex,delete i.v,delete i.yParity,i.data=i.input;let n=void 0!==i.feePayerSignature&&null!==i.feePayerSignature;if(n&&void 0!==R&&i.nonce!==R)throw new a.FeePayerNonceMismatchError({filledNonce:i.nonce,requestedNonce:R});if(!n){i.gas&&(i.gas=d.gas??i.gas),i.gasPrice&&(i.gasPrice=d.gasPrice??i.gasPrice),i.maxFeePerBlobGas&&(i.maxFeePerBlobGas=d.maxFeePerBlobGas??i.maxFeePerBlobGas),i.maxFeePerGas&&(i.maxFeePerGas=d.maxFeePerGas??i.maxFeePerGas),i.maxPriorityFeePerGas&&(i.maxPriorityFeePerGas=d.maxPriorityFeePerGas??i.maxPriorityFeePerGas),void 0!==i.nonce&&(i.nonce=d.nonce??i.nonce);let t=await (async()=>{if("function"==typeof g?.fees?.baseFeeMultiplier){let t=await (0,c.getAction)(e,u.getBlock,"getBlock")({});return g.fees.baseFeeMultiplier({block:t,client:e,request:d})}return g?.fees?.baseFeeMultiplier??1.2})();if(t<1)throw new r.BaseFeeScalarError;let a=t.toString().split(".")[1]?.length??0,n=10**a,o=e=>e*BigInt(Math.round(t*n))/BigInt(n);i.maxFeePerGas&&!d.maxFeePerGas&&(i.maxFeePerGas=o(i.maxFeePerGas)),i.gasPrice&&!d.gasPrice&&(i.gasPrice=o(i.gasPrice))}return{raw:t.raw,transaction:{from:S.from,...i},...t.capabilities?{capabilities:t.capabilities}:{}}}catch(t){throw(0,i.getTransactionError)(t,{...d,chain:e.chain})}}e.s(["getChainId",0,f],92483),e.s(["fillTransaction",0,m],544753)},478631,828217,e=>{"use strict";var t=e.i(79295);class r extends t.BaseError{constructor({blockHash:e,blockNumber:t}){let r="Block";e&&(r=`Block at hash "${e}"`),t&&(r=`Block at number "${t}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}e.s(["BlockNotFoundError",0,r],828217);var a=e.i(27040),i=e.i(150268);async function n(e,{blockHash:t,blockNumber:o,blockTag:s=e.experimental_blockTag??"latest",includeTransactions:c}={}){let l=c??!1,u=void 0!==o?(0,a.numberToHex)(o):void 0,d=null;if(!(d=t?await e.request({method:"eth_getBlockByHash",params:[t,l]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[u||s,l]},{dedupe:!!u})))throw new r({blockHash:t,blockNumber:o});return(e.chain?.formatters?.block?.format||i.formatBlock)(d,"getBlock")}e.s(["getBlock",0,n],478631)},909568,e=>{"use strict";let t=new Map,r=new Map;async function a(e,{cacheKey:i,cacheTime:n=1/0}){let o,s,c,l=(s=(o=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:r=>t.set(e,r)}))(i,t),{clear:()=>{s.clear(),c.clear()},promise:s,response:c=o(i,r)}),u=l.response.get();if(u&&n>0&&Date.now()-u.created.getTime()<n)return u.data;let d=l.promise.get();d||(d=e(),l.promise.set(d));try{let e=await d;return l.response.set({created:new Date,data:e}),e}finally{l.promise.clear()}}async function i(e,{cacheTime:t=e.cacheTime}={}){let r;return BigInt(await a(()=>e.request({method:"eth_blockNumber"}),{cacheKey:(r=e.uid,`blockNumber.${r}`),cacheTime:t}))}e.s(["getBlockNumber",0,i],909568)},12103,439499,e=>{"use strict";var t=e.i(838394),r=e.i(27040),a=e.i(578596);async function i(e,{blockHash:n,blockNumber:o,blockTag:s,hash:c,index:l,sender:u,nonce:d}){let f=s||"latest",m=void 0!==o?(0,r.numberToHex)(o):void 0,p=null;if(c?p=await e.request({method:"eth_getTransactionByHash",params:[c]},{dedupe:!0}):n?p=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[n,(0,r.numberToHex)(l)]},{dedupe:!0}):(m||f)&&"number"==typeof l?p=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[m||f,(0,r.numberToHex)(l)]},{dedupe:!!m}):u&&"number"==typeof d&&(p=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[u,(0,r.numberToHex)(d)]},{dedupe:!0})),!p)throw new t.TransactionNotFoundError({blockHash:n,blockNumber:o,blockTag:f,hash:c,index:l});return(e.chain?.formatters?.transaction?.format||a.formatTransaction)(p,"getTransaction")}e.s(["getTransaction",0,i],12103);var n=e.i(470965);async function o(e,{hash:r}){let a=await e.request({method:"eth_getTransactionReceipt",params:[r]},{dedupe:!0});if(!a)throw new t.TransactionReceiptNotFoundError({hash:r});return(e.chain?.formatters?.transactionReceipt?.format||n.formatTransactionReceipt)(a,"getTransactionReceipt")}e.s(["getTransactionReceipt",0,o],439499)},883753,e=>{"use strict";var t=e.i(787478),r=e.i(315796),a=e.i(212667),i=e.i(943106),n=e.i(939773);async function o(e,o){let{abi:s,address:c,args:l,functionName:u,...d}=o,f=(0,r.encodeFunctionData)({abi:s,args:l,functionName:u});try{let{data:r}=await (0,i.getAction)(e,n.call,"call")({...d,data:f,to:c});return(0,t.decodeFunctionResult)({abi:s,args:l,functionName:u,data:r||"0x"})}catch(e){throw(0,a.getContractError)(e,{abi:s,address:c,args:l,docsPath:"/docs/contract/readContract",functionName:u})}}e.s(["readContract",0,o])},252373,e=>{"use strict";var t=e.i(848311),r=e.i(787478),a=e.i(315796),i=e.i(212667),n=e.i(943106),o=e.i(939773);
1async function s(e,s){let{abi:c,address:l,args:u,functionName:d,dataSuffix:f="string"==typeof e.dataSuffix?e.dataSuffix:e.dataSuffix?.value,...m}=s,p=m.account?(0,t.parseAccount)(m.account):e.account,y=(0,a.encodeFunctionData)({abi:c,args:u,functionName:d});try{let{data:t}=await (0,n.getAction)(e,o.call,"call")({batch:!1,data:`${y}${f?f.replace("0x",""):""}`,to:l,...m,account:p}),a=(0,r.decodeFunctionResult)({abi:c,args:u,functionName:d,data:t||"0x"}),i=c.filter(e=>"name"in e&&e.name===s.functionName);return{result:a,request:{abi:i,address:l,args:u,dataSuffix:f,functionName:d,...m,account:p}}}catch(e){throw(0,i.getContractError)(e,{abi:c,address:l,args:u,docsPath:"/docs/contract/simulateContract",functionName:d,sender:p?.address})}}e.s(["simulateContract",0,s])},844513,339021,e=>{"use strict";var t=e.i(828217),r=e.i(838394),a=e.i(943106),i=e.i(473309),n=e.i(254513),o=e.i(293711),s=e.i(810685),c=e.i(478631),l=e.i(12103),u=e.i(439499),d=e.i(492745),f=e.i(974992),m=e.i(909568);function p(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:n,onError:o,poll:c,pollingInterval:l=e.pollingInterval}){let u,y,g;return(void 0!==c?c:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
1onfig.type&&"ipc"!==e.transport.transports[0].config.type))?(y=(0,s.stringify)(["watchBlockNumber",e.uid,t,r,l]),(0,i.observe)(y,{onBlockNumber:n,onError:o},i=>(0,f.poll)(async()=>{try{let t=await (0,a.getAction)(e,m.getBlockNumber,"getBlockNumber")({cacheTime:0});if(void 0!==u){if(t===u)return;if(t-u>1&&r)for(let e=u+1n;e<t;e++)i.onBlockNumber(e,u),u=e}(void 0===u||t>u)&&(i.onBlockNumber(t,u),u=t)}catch(e){i.onError?.(e)}},{emitOnBegin:t,interval:l}))):(g=(0,s.stringify)(["watchBlockNumber",e.uid,t,r]),(0,i.observe)(g,{onBlockNumber:n,onError:o},t=>{let r=!0,a=()=>r=!1;return(async()=>{try{let i=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:n}=await i.subscribe({params:["newHeads"],onData(e){if(!r)return;let a=(0,d.hexToBigInt)(e.result?.number);t.onBlockNumber(a,u),u=a},onError(e){t.onError?.(e)}});a=n,r||a()}catch(e){o?.(e)}})(),()=>a()}))}async function y(e,d){let f,m,y,g,h,{checkReplacement:b=e.chain?.supportsTransactionReplacementDetection??!0,confirmations:w=1,hash:v,onReplaced:P,retryCount:T=6,retryDelay:x=({count:e})=>200*~~(1<<e),timeout:E=18e4}=d,k=(0,s.stringify)(["waitForTransactionReceipt",e.uid,v]),F=d.pollingInterval?d.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval,A=!1,{promise:B,resolve:G,reject:N}=(0,n.withResolvers)(),R=E?setTimeout(()=>{h?.(),g?.(),N(new r.WaitForTransactionReceiptTimeoutError({hash:v}))},E):void 0;return g=(0,i.observe)(k,{onReplaced:P,resolve:G,reject:N},async i=>{if((y=await (0,a.getAction)(e,u.getTransactionReceipt,"getTransactionReceipt")({hash:v}).catch(()=>void 0))&&w<=1){clearTimeout(R),i.resolve(y),g?.();return}h=(0,a.getAction)(e,p,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:F,async onBlockNumber(n){let s=e=>{clearTimeout(R),h?.(),e(),g?.()},d=n;if(!A)try{if(y){if(w>1&&(!y.blockNumber||d-y.blockNumber+1n<w))return;s(()=>i.resolve(y));return}if(b&&!f&&(A=!0,await (0,o.withRetry)(async()=>{(f=await (0,a.getAction)(e,l.getTransaction,"getTransaction")({hash:v})).blockNumber&&(d=f.blockNumber)},{delay:x,retryCount:T}),A=!1),y=await (0,a.getAction)(e,u.getTransactionReceipt,"getTransactionReceipt")({hash:v}),w>1&&(!y.blockNumber||d-y.blockNumber+1n<w))return;s(()=>i.resolve(y))}catch(n){if(n instanceof r.TransactionNotFoundError||n instanceof r.TransactionReceiptNotFoundError){if(!f){A=!1;return}try{m=f,A=!0;let r=await (0,o.withRetry)(()=>(0,a.getAction)(e,c.getBlock,"getBlock")({blockNumber:d,includeTransactions:!0}),{delay:x,retryCount:T,shouldRetry:({error:e})=>e instanceof t.BlockNotFoundError});A=!1;let n=r.transactions.find(({from:e,nonce:t})=>e===m.from&&t===m.nonce);if(!n||(y=await (0,a.getAction)(e,u.getTransactionReceipt,"getTransactionReceipt")({hash:n.hash}),w>1&&(!y.blockNumber||d-y.blockNumber+1n<w)))return;let l="replaced";n.to===m.to&&n.value===m.value&&n.input===m.input?l="repriced":n.from===n.to&&0n===n.value&&(l="cancelled"),s(()=>{i.onReplaced?.({reason:l,replacedTransaction:m,transaction:n,transactionReceipt:y}),i.resolve(y)})}catch(e){s(()=>i.reject(e))}}else s(()=>i.reject(n))}}})}),B}e.s(["watchBlockNumber",0,p],339021),e.s(["waitForTransactionReceipt",0,y],844513)},445919,e=>{"use strict";var t=e.i(593529),r=e.i(111027),a=e.i(259777),i=e.i(315796),n=e.i(182920),o=e.i(181915),s=e.i(883753);function c(e,t){let{decimals:i,token:n}=t,o=l(e,n);if(o)return{address:o.address,decimals:i??o.decimals};if((0,r.isAddress)(n,{strict:!1}))return{address:n,decimals:i??function(e,t){let r=e.tokens,i=e.chain?.id;if(r&&void 0!==i)for(let e of r){let r=u(e,i);if(r&&(0,a.isAddressEqual)(r.address,t))return r.decimals}}(e,n)};throw Error(`Token "${n}" is not a declared ERC-20 token on the client's \`tokens\` array (with an address for the client's chain), and is not a valid address.`)}function l(e,t){let i=e.tokens,n=e.chain?.id;if(!i||void 0===n)return;let o=function(e,t){let r=t.toLowerCase();for(let t of e)if(t.symbol?.toLowerCase()===r)return t}(i,t);if(o)return u(o,n);
1if((0,r.isAddress)(t,{strict:!1}))for(let e of i){let r=u(e,n);if(r&&(0,a.isAddressEqual)(r.address,t))return r}}function u(e,t){let r=e.addresses[t];if(r)return{address:r,currency:e.currency,decimals:e.decimals,name:e.name,popular:e.popular,symbol:e.symbol}}async function d(e,r){let{address:a,decimals:i}=c(e,r);return void 0!==i?{address:a,decimals:i}:{address:a,decimals:await (0,s.readContract)(e,{abi:t.erc20Abi,address:a,functionName:"decimals"})}}e.s(["defineCall",0,function(e){return{...e,data:(0,i.encodeFunctionData)(e),to:e.address}},"findDeclaredToken",0,l,"pickWriteParameters",0,function(e){let{account:t,chain:r,gas:a,maxFeePerGas:i,maxPriorityFeePerGas:n,nonce:o}=e;return{account:t,chain:r,gas:a,maxFeePerGas:i,maxPriorityFeePerGas:n,nonce:o}},"resolveAmountDecimals",0,function(e,t){return"bigint"==typeof e?t:e.decimals??t},"resolveToken",0,c,"resolveTokenWithDecimals",0,d,"toAmount",0,function(e,t){return{amount:e,decimals:t,formatted:(0,n.formatUnits)(e,t)}},"toBaseUnits",0,function(e,t){if("bigint"==typeof e)return e;let r=e.decimals??t;return(0,o.parseUnits)(e.formatted,function(e){if(void 0===e)throw Error("Token decimals are required. Pass `amount.decimals` or select a declared token.");return e}(r))}])},838026,e=>{"use strict";async function t(e,{serializedTransaction:r}){return e.request({method:"eth_sendRawTransaction",params:[r]},{retryCount:0})}e.s(["sendRawTransaction",0,t])},842138,e=>{"use strict";var t=e.i(838394),r=e.i(470965);async function a(e,{serializedTransaction:i,throwOnReceiptRevert:n,timeout:o}){let s=await e.request({method:"eth_sendRawTransactionSync",params:o?[i,o]:[i]},{retryCount:0}),c=(e.chain?.formatters?.transactionReceipt?.format||r.formatTransactionReceipt)(s);if("reverted"===c.status&&n)throw new t.TransactionReceiptRevertedError({receipt:c});return c}e.s(["sendRawTransactionSync",0,a])},179827,e=>{"use strict";var t=e.i(85837),r=e.i(79295);class a extends r.BaseError{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class i extends r.BaseError{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class n extends r.BaseError{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,t.formatGwei)(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}e.s(["BaseFeeScalarError",0,a,"Eip1559FeesNotSupportedError",0,i,"MaxFeePerGasTooLowError",0,n])},672283,351915,e=>{"use strict";var t=e.i(259777),r=e.i(949902),a=e.i(584871),i=e.i(390720),n=e.i(122487),o=e.i(506658),s=e.i(831101),c=e.i(94707),l=e.i(124004),u=e.i(348849);let d="/docs/contract/decodeEventLog";function f(e){let{abi:t,data:r,strict:a,topics:i}=e,f=a??!0,[m,...p]=i;if(!m)throw new o.AbiEventSignatureEmptyTopicsError({docsPath:d});let y=t.find(e=>"event"===e.type&&m===(0,n.toEventSelector)((0,u.formatAbiItem)(e)));if(!(y&&"name"in y)||"event"!==y.type)throw new o.AbiEventSignatureNotFoundError(m,{docsPath:d});let{name:g,inputs:h}=y,b=h?.some(e=>!("name"in e&&e.name)),w=b?[]:{},v=h.map((e,t)=>[e,t]).filter(([e])=>"indexed"in e&&e.indexed),P=[];for(let e=0;e<v.length;e++){let[t,r]=v[e],a=p[e];if(!a){if(f)throw new o.DecodeLogTopicsMismatch({abiItem:y,param:t});P.push([t,r]);continue}w[b?r:t.name||r]=function({param:e,value:t}){return"string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/)?t:((0,l.decodeAbiParameters)([e],t)||[])[0]}({param:t,value:a})}let T=h.filter(e=>!("indexed"in e&&e.indexed)),x=f?T:[...P.map(([e])=>e),...T];if(x.length>0){if(r&&"0x"!==r)try{let e=(0,l.decodeAbiParameters)(x,r);if(e){let t=0;if(!f)for(let[r,a]of P)w[b?a:r.name||a]=e[t++];if(b)for(let r=0;r<h.length;r++)void 0===w[r]&&t<e.length&&(w[r]=e[t++]);else for(let r=0;r<T.length;r++)w[T[r].name]=e[t++]}}catch(e){if(f){if(e instanceof o.AbiDecodingDataSizeTooSmallError||e instanceof s.PositionOutOfBoundsError)throw new o.DecodeLogDataMismatch({abiItem:y,data:r,params:x,size:(0,c.size)(r)});throw e}}else if(f)throw new o.DecodeLogDataMismatch({abiItem:y,data:"0x",params:x,size:0})}return{eventName:g,args:Object.values(w).length>0?w:void 0}}e.s(["decodeEventLog",0,f],351915),e.s(["parseEventLogs",0,function(e){let{abi:o,args:s,logs:c,strict:l=!0}=e,u=(()=>
1{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),d=o.filter(e=>"event"===e.type).map(e=>({abi:e,selector:(0,n.toEventSelector)(e)}));return c.map(e=>{let n,o,c="string"==typeof e.blockNumber?(0,a.formatLog)(e):e,m=d.filter(e=>c.topics[0]===e.selector);if(0===m.length)return null;for(let e of m)try{n=f({...c,abi:[e.abi],strict:!0}),o=e;break}catch{}if(!n&&!l){o=m[0];try{n=f({data:c.data,topics:c.topics,abi:[o.abi],strict:!1})}catch{let e=o.abi.inputs?.some(e=>!("name"in e&&e.name));return{...c,args:e?[]:{},eventName:o.abi.name}}}return n&&o&&(!u||u.includes(n.eventName))&&function(e){let{args:a,inputs:n,matchArgs:o}=e;if(!o)return!0;if(!a)return!1;function s(e,a,n){try{if("address"===e.type)return(0,t.isAddressEqual)(a,n);if("string"===e.type||"bytes"===e.type)return(0,i.keccak256)((0,r.toBytes)(a))===n;return a===n}catch{return!1}}return Array.isArray(a)&&Array.isArray(o)?o.every((e,t)=>{if(null==e)return!0;let r=n[t];return!!r&&(Array.isArray(e)?e:[e]).some(e=>s(r,e,a[t]))}):!("object"!=typeof a||Array.isArray(a)||"object"!=typeof o||Array.isArray(o))&&Object.entries(o).every(([e,t])=>{if(null==t)return!0;let r=n.find(t=>t.name===e);return!!r&&(Array.isArray(t)?t:[t]).some(t=>s(r,t,a[e]))})}({args:n.args,inputs:o.abi.inputs,matchArgs:s})?{...n,...c}:null}).filter(Boolean)}],672283)},148403,e=>{"use strict";var t=e.i(981979),r=e.i(949902),a=e.i(27040),i=e.i(632349),n=e.i(390720);e.s(["hashAuthorization",0,function(e){let{chainId:o,nonce:s,to:c}=e,l=e.contractAddress??e.address,u=(0,n.keccak256)((0,t.concatHex)(["0x05",(0,i.toRlp)([o?(0,a.numberToHex)(o):"0x",l,s?(0,a.numberToHex)(s):"0x"])]));return"bytes"===c?(0,r.hexToBytes)(u):u}])},710363,666474,e=>{"use strict";var t=e.i(7156),r=e.i(148403);async function a(e){let{authorization:a,signature:i}=e;return(0,t.recoverAddress)({hash:(0,r.hashAuthorization)(a),signature:i??a})}e.s(["recoverAuthorizationAddress",0,a],710363);var i=e.i(664037),n=e.i(85837),o=e.i(79295),s=e.i(838394);class c extends o.BaseError{constructor(e,{account:t,docsPath:r,chain:a,data:o,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:f,to:m,value:p}){const y=(0,s.prettyPrint)({from:t?.address,to:m,value:void 0!==p&&`${(0,i.formatEther)(p)} ${a?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:c,gasPrice:void 0!==l&&`${(0,n.formatGwei)(l)} gwei`,maxFeePerGas:void 0!==u&&`${(0,n.formatGwei)(u)} gwei`,maxPriorityFeePerGas:void 0!==d&&`${(0,n.formatGwei)(d)} gwei`,nonce:f});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",y].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}var l=e.i(955046),u=e.i(443736);e.s(["getEstimateGasError",0,function(e,{docsPath:t,...r}){let a;return new c((a=(0,u.getNodeError)(e,r))instanceof l.UnknownNodeError?e:a,{docsPath:t,...r})}],666474)},212667,e=>{"use strict";var t=e.i(506658),r=e.i(79295),a=e.i(207223),i=e.i(825872),n=e.i(499323);e.s(["getContractError",0,function(e,{abi:o,address:s,args:c,docsPath:l,functionName:u,sender:d}){let f=e instanceof a.RawContractError?e:e instanceof r.BaseError?e.walk(e=>"data"in e)||e.walk():{},{code:m,data:p,details:y,message:g,shortMessage:h}=f,b=e instanceof t.AbiDecodingZeroDataError?new a.ContractFunctionZeroDataError({functionName:u,cause:e}):[3,n.InternalRpcError.code].includes(m)&&(p||y||g||h)||m===n.InvalidInputRpcError.code&&"execution reverted"===y&&p?new a.ContractFunctionRevertedError({abi:o,data:"object"==typeof p?p.data:p,functionName:u,message:f instanceof i.RpcRequestError?y:h??g,cause:e}):e;return new a.ContractFunctionExecutionError(b,{abi:o,args:c,contractAddress:s,docsPath:l,functionName:u,sender:d})}])},483553,e=>{"use strict";var t=e.i(955046),r=e.i(838394),a=e.i(443736);e.s(["getTransactionError",0,function(e,{docsPath:i,...n}){let o,s=(o=(0,a.getNodeError)(e,n))instanceof t.UnknownNodeError?e:o;return new r.TransactionExecutionError(s,{docsPath:i,...n})}])},943106,e=>{"use strict";e.s(["getAction",0,function(e,t,r){let a=e[t.name];if("function"==typeof a)return a;let i=e[r];return"function"==typeof i?i:r=>t(e,r)}])},473309,e=>{"use strict";let t=new Map,r=new Map,a=0;e.s(["observe",0,function(e,i,n){let o=++a,s=()=>t.get(e)||[],c=()=>{let a=s();if(!a.some(e=>e.id===o))return;let i=r.get(e);if(1===a.length&&i){let e=i();e instanceof Promise&&e.catch(()=>{})}(()=>{let a=s().filter(e=>e.id!==o);if(0===a.length){t.delete(e),r.delete(e);return}t.set(e,a)})()},l=s();if(t.set(e,[...l,{id:o,fns:i}]),l&&l.length>0)return c;let u={};for(let e in i)u[e]=(...t)=>{let r=s();if(0!==r.length)for(let a of r)a.fns[e]?.(...t)};let d=n(u);return"function"==typeof d&&r.set(e,d),c}])},974992,e=>{"use strict";var t=e.i(145391);e.s(["poll",0,function(e,{emitOnBegin:r,initialWaitTime:a,interval:i}){let n=!0,o=()=>n=!1;return(async()=>{let s;r&&(s=await e({unpoll:o}));let c=await a?.(s)??i;await (0,t.wait)(c);let l=async()=>{n&&(await e({unpoll:o}),await (0,t.wait)(i),l())};l()})(),o}])},60392,e=>{"use strict";var t=e.i(390720),r=e.i(981979),a=e.i(94707),i=e.i(27040);e.s(["hashMessage",0,function(e,n){let o,s;return(0,t.keccak256)((o="string"==typeof e?(0,i.stringToHex)(e):"string"==typeof e.raw?e.raw:(0,i.bytesToHex)(e.raw),s=(0,i.stringToHex)(`\x19Ethereum Signed Message: 2${(0,a.size)(o)}`),(0,r.concat)([s,o])),n)}],60392)},7156,e=>{"use strict";var t=e.i(885949),r=e.i(496702);async function a({hash:e,signature:i}){return(0,t.publicKeyToAddress)(await (0,r.recoverPublicKey)({hash:e,signature:i}))}e.s(["recoverAddress",0,a])},496702,e=>{"use strict";var t=e.i(958988),r=e.i(94707),a=e.i(492745),i=e.i(27040);async function n({hash:s,signature:c}){let l=(0,t.isHex)(s)?s:(0,i.toHex)(s),{secp256k1:u}=await e.A(313886),d=(()=>
2{if("object"==typeof c&&"r"in c&&"s"in c){let{r:e,s:t,v:r,yParity:i}=c,n=o(Number(i??r));return new u.Signature((0,a.hexToBigInt)(e),(0,a.hexToBigInt)(t)).addRecoveryBit(n)}let e=(0,t.isHex)(c)?c:(0,i.toHex)(c);if(65!==(0,r.size)(e))throw Error("invalid signature length");let n=o((0,a.hexToNumber)(`0x${e.slice(130)}`));return u.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(n)})().recoverPublicKey(l.substring(2)).toHex(!1);return`0x${d}`}function o(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw Error("Invalid yParityOrV value")}e.s(["recoverPublicKey",0,n])},280410,e=>{"use strict";var t=e.i(506658),r=e.i(431573),a=e.i(810685),i=e.i(79295);class n extends i.BaseError{constructor({domain:e}){super(`Invalid domain "${(0,a.stringify)(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class o extends i.BaseError{constructor({primaryType:e,types:t}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(t))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class s extends i.BaseError{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}class c extends i.BaseError{constructor({type:e}){const t=e.replace(/^(u?int)/,"$&256");super(`Type "${e}" is not a valid EIP-712 type.`,{metaMessages:[`Use "${t}" instead.`],name:"InvalidTypedDataTypeError"})}}var l=e.i(111027),u=e.i(94707),d=e.i(27040),f=e.i(153569);e.s(["getTypesForEIP712Domain",0,function({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},("number"==typeof e?.chainId||"bigint"==typeof e?.chainId)&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)},"serializeTypedData",0,function(e){let{domain:t,message:r,primaryType:i,types:n}=e,o=(e,t)=>{let r={...t};for(let t of e){let{name:e,type:a}=t;"address"===a&&(r[e]=r[e].toLowerCase())}return r},s=n.EIP712Domain&&t?o(n.EIP712Domain,t):{},c=(()=>{if("EIP712Domain"!==i)return o(n[i],r)})();return(0,a.stringify)({domain:s,message:c,primaryType:i,types:n})},"validateTypedData",0,function(e){let{domain:a,message:i,primaryType:m,types:p}=e,y=(e,a)=>{for(let i of e){let{name:e,type:n}=i,o=a[e],m=n.replace(/(\[[0-9]*\])+$/,"");if("int"===m||"uint"===m)throw new c({type:n});let g=n.match(f.integerRegex);if(g&&("number"==typeof o||"bigint"==typeof o)){let[e,t,r]=g;(0,d.numberToHex)(o,{signed:"int"===t,size:Number.parseInt(r,10)/8})}if("address"===n&&"string"==typeof o&&!(0,l.isAddress)(o))throw new r.InvalidAddressError({address:o});let h=n.match(f.bytesRegex);if(h){let[e,r]=h;if(r&&(0,u.size)(o)!==Number.parseInt(r,10))throw new t.BytesSizeMismatchError({expectedSize:Number.parseInt(r,10),givenSize:(0,u.size)(o)})}let b=p[n];b&&(function(e){if("address"===e||"bool"===e||"string"===e||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new s({type:e})}(n),y(b,o))}};if(p.EIP712Domain&&a){if("object"!=typeof a)throw new n({domain:a});y(p.EIP712Domain,a)}if("EIP712Domain"!==m)if(p[m])y(p[m],i);else throw new o({primaryType:m,types:p})}],280410)},181915,e=>{"use strict";var t=e.i(74963);e.s(["parseUnits",0,function(e,r){return t.from(e,r)}])}]);
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.