@dcl/explorer-website 2.6.1-25865517797.commit-b7a7cba → 2.7.0
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.
- package/assets/{ConstantsUtil-ByjAYmvC.js → ConstantsUtil-BYRHWuZV.js} +1 -1
- package/assets/{ExchangeController-Bp8ztJrX.js → ExchangeController-N42lbf3C.js} +1 -1
- package/assets/{HelpersUtil-Dp4e1zvd.js → HelpersUtil-DFmhrbIH.js} +1 -1
- package/assets/{NetworkUtil-DqGcuBfF.js → NetworkUtil-DM5H1DOt.js} +1 -1
- package/assets/{SwapController-DUCq2f7d.js → SwapController-SgAc8zJM.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-9eitOT0j.js → W3MFrameProviderSingleton-dGwr0u32.js} +3 -3
- package/assets/{basic-C7tUDecp.js → basic-CDUVa7W3.js} +1 -1
- package/assets/{biconomy-plHCR2Qq.js → biconomy-Dj37CYYZ.js} +1 -1
- package/assets/{browser-VYI7gorG.js → browser-h4rN6CV4.js} +1 -1
- package/assets/browser-ponyfill-LG9Rjmfj.js +1 -0
- package/assets/{ccip-Bldffu31.js → ccip-Cv_5kGJ0.js} +1 -1
- package/assets/{ccip-CrAifiNa.js → ccip-TlIoUAte.js} +1 -1
- package/assets/{chains-DTVDhUwv.js → chains-CsuV2rnE.js} +1 -1
- package/assets/{common-BEf2T7Hi.js → common-C9wbti_7.js} +1 -1
- package/assets/{controller-B8Iy-6V9.js → controller-DpEeOSLx.js} +2 -2
- package/assets/{core-XFvzSI58.js → core-BGvtiIgG.js} +4 -4
- package/assets/{custom-cPmISGcH.js → custom-BbQhcg55.js} +1 -1
- package/assets/{data-capture-DnvAEYWK.js → data-capture-C5UoNnMk.js} +1 -1
- package/assets/decimals-DA8L6Gte.js +1 -0
- package/assets/{decimals-8g2-fBFa.js → decimals-mBEEumco.js} +1 -1
- package/assets/{detectExtension-yvI5WWZb.js → detectExtension-oDT7CrDk.js} +1 -1
- package/assets/{email-C8DRQjTT.js → email-CUatRSQC.js} +1 -1
- package/assets/{embedded-wallet-BxgtT1uV.js → embedded-wallet-DZAeJhJN.js} +1 -1
- package/assets/{engine-BERe87yT.js → engine-AXDB-0h6.js} +1 -1
- package/assets/{estimate-l1-fee-BTeKvFv5.js → estimate-l1-fee-Bxwscz8f.js} +1 -1
- package/assets/eth_estimateGas-DFXalA2X.js +1 -0
- package/assets/{eth_getStorageAt-SbVMAQY-.js → eth_getStorageAt-Dr4zmiJF.js} +1 -1
- package/assets/{eth_getTransactionCount-qv0oO1Md.js → eth_getTransactionCount-cZacEETx.js} +1 -1
- package/assets/{ethereum-BP59xYBe.js → ethereum-CIBzGnJl.js} +1 -1
- package/assets/{extractIPFS-BOFlZk7U.js → extractIPFS-Czsz8-sO.js} +1 -1
- package/assets/{features-DVWd8_kC.js → features-fx-atM_l.js} +1 -1
- package/assets/{fetchTokenMetadata-BaJXN6RH.js → fetchTokenMetadata-uG4nb_Kh.js} +2 -2
- package/assets/{fortmatic-DARkeYTE.js → fortmatic-boxtmFta.js} +1 -1
- package/assets/get-ecosystem-wallet-info-BI2Fd0Vd.js +1 -0
- package/assets/{getBalance-D6wpo61w.js → getBalance-CC2S0qtL.js} +2 -2
- package/assets/{getInstalledModules-Dkj379ys.js → getInstalledModules-53n5UYt2.js} +1 -1
- package/assets/{getNFT-HMkoXD7L.js → getNFT-C3FPakLN.js} +2 -2
- package/assets/{getNFT-Drn4rxrk.js → getNFT-CnaK4j2q.js} +1 -1
- package/assets/{hashTypedData-CMDSWYgs.js → hashTypedData-C4JiqOxU.js} +1 -1
- package/assets/{hashTypedData-B5shS-rs.js → hashTypedData-D1Ievn97.js} +1 -1
- package/assets/{in-app-wallet-calls-l9-2W_Em.js → in-app-wallet-calls-khLeeKNu.js} +1 -1
- package/assets/{index-BIPd_vR5.js → index-0P32tQWj.js} +1 -1
- package/assets/{index-DIlwNfpB.js → index-1quVm3wk.js} +1 -1
- package/assets/{index-DbAu4Peg.js → index-B2PoGJRP.js} +3 -3
- package/assets/{index-BaGjqMte.js → index-B5w_jZpc.js} +2 -2
- package/assets/{index-CE5G6IEJ.js → index-B6j-Tckn.js} +1 -1
- package/assets/{index-CjiwjbqL.js → index-BCiKer83.js} +1 -1
- package/assets/{index-C8NSq3HK.js → index-BCqrDgyR.js} +1 -1
- package/assets/{index-BXAxcybX.js → index-BE5nQY53.js} +1 -1
- package/assets/{index-C51HwlD0.js → index-BF9Yx_yV.js} +1 -1
- package/assets/{index-CWGeCZBJ.js → index-BJCYEGPg.js} +1 -1
- package/assets/{index-Cy1X3n_C.js → index-BT0xQ-Xd.js} +1 -1
- package/assets/{index-0ShVRzxt.js → index-BVi4iI8y.js} +1 -1
- package/assets/{index-BDgZ3gDE.js → index-BVvMg9ZB.js} +1 -1
- package/assets/{index-DFE6t65x.js → index-BpxeqYFx.js} +1 -1
- package/assets/{index-B5ECjSS9.js → index-Bv6LvzLS.js} +1 -1
- package/assets/{index-i4VBSYqA.js → index-BvCGPTHO.js} +1 -1
- package/assets/index-Bzi38pjx.css +1 -0
- package/assets/{index-CH0zI801.js → index-C5oPclal.js} +1 -1
- package/assets/{index-D2ZBQG8w.js → index-C6-AvlPm.js} +1 -1
- package/assets/{index-CWnFK_-0.js → index-C9EMW8qD.js} +1 -1
- package/assets/{index-C-uqursN.js → index-C9vcJp9T.js} +1 -1
- package/assets/{index-DK-ZMNLh.js → index-CO3lXLzl.js} +1 -1
- package/assets/{index-DS2Lm9tG.js → index-CYBDya_s.js} +1 -1
- package/assets/{index-okvlQSs2.js → index-Coj3uG35.js} +1 -1
- package/assets/{index-Cu4ZjLNb.js → index-CqbvjyBi.js} +5 -5
- package/assets/{index-wds8TuUm.js → index-CwfOYq8B.js} +1 -1
- package/assets/{index-aoxVkzFE.js → index-Cz0JdeQb.js} +1 -1
- package/assets/{index-C5ciuua_.js → index-D-YuFp2i.js} +1 -1
- package/assets/{index-I68folnJ.js → index-D4NLrlUn.js} +1 -1
- package/assets/{index-B7Jt3b4d.js → index-D8PaxcsI.js} +1 -1
- package/assets/{index-r_1z0VI_.js → index-D9ey6cqT.js} +1 -1
- package/assets/{index-B-vyBZw9.js → index-DRYOQXZX.js} +1 -1
- package/assets/{index-DOnRCLNP.js → index-DT1PkdGa.js} +2 -2
- package/assets/{index-DWRq2SN_.js → index-DXCSroqX.js} +1 -1
- package/assets/{index-mZa0UiRt.js → index-DXs78xw9.js} +1 -1
- package/assets/{index-kXKMGszW.js → index-DZ0punK7.js} +1 -1
- package/assets/{index-B9U0GcYk.js → index-D_m5AL3D.js} +1 -1
- package/assets/{index-BxdNwV86.js → index-Dc148hav.js} +1 -1
- package/assets/{index-DP1DuCnR.js → index-DgDxBH9m.js} +1 -1
- package/assets/{index-DfWsAOhN.js → index-Dm7tCcMc.js} +3 -3
- package/assets/{index-D0LvjNIX.js → index-DmIGOG39.js} +1 -1
- package/assets/{index-JfVynEph.js → index-DmK5ktNw.js} +1 -1
- package/assets/{index-Cp7mdTuR.js → index-Eyans5--.js} +1 -1
- package/assets/{index-DPxCDCvr.js → index-KK8ZylE4.js} +1 -1
- package/assets/{index-DvJmANzU.js → index-TUD0QlWP.js} +1 -1
- package/assets/{index-TBthDmkl.js → index-ak5cSl-l.js} +1 -1
- package/assets/{index-8M7OkBFm.js → index-bVr8-SEv.js} +1 -1
- package/assets/{index-BlykZ8Gp.js → index-prLj8b2x.js} +1 -1
- package/assets/{index-BKL7nv1p.js → index-vajj2FBo.js} +1 -1
- package/assets/{index.es-YpI01v2I.js → index.es-C85F8NOj.js} +1 -1
- package/assets/{index.es-CkxUaFYS.js → index.es-DYgSAVrd.js} +1 -1
- package/assets/{index.es-cEGj7JU0.js → index.es-XXBqJXMm.js} +4 -4
- package/assets/{localBatchGatewayRequest-CNIOIq-Z.js → localBatchGatewayRequest-DbQn1s0J.js} +1 -1
- package/assets/{networks-DJ72puSk.js → networks-DMqekeph.js} +1 -1
- package/assets/{onramp--l5ZLxWE.js → onramp-qvbxoSMm.js} +1 -1
- package/assets/{openzeppelin-CqtRqxtF.js → openzeppelin-B6Und3LJ.js} +1 -1
- package/assets/{ownerOf-cWkgEtd8.js → ownerOf-CUoSe2c5.js} +1 -1
- package/assets/{parseEventLogs-D1xiFnCH.js → parseEventLogs-BxtEI7tW.js} +3 -3
- package/assets/{parseNft-DH5KlHPI.js → parseNft-DB_pGzOu.js} +2 -2
- package/assets/{parseSignature-HAlgOHnm.js → parseSignature-Csyua1uA.js} +3 -3
- package/assets/{parseSignature-BYhcrVdX.js → parseSignature-O0fAqZoB.js} +1 -1
- package/assets/{pay-with-exchange-CiXPJJ6-.js → pay-with-exchange-1MlV9x6H.js} +1 -1
- package/assets/{qr-overlay-CmFgwJBd.js → qr-overlay-DA6htUdY.js} +3 -3
- package/assets/{receive-t2TxUItI.js → receive-JnpfZY7d.js} +1 -1
- package/assets/{resolveImplementation-iG9WRRnW.js → resolveImplementation-B8d2Q-Ro.js} +1 -1
- package/assets/{rpc-sIdV4wiJ.js → rpc-DkFFCBh9.js} +1 -1
- package/assets/{secp256k1-Rk5k9i7o.js → secp256k1-BCPsQ5nJ.js} +1 -1
- package/assets/{secp256k1-Co_Jve4c.js → secp256k1-BZmrY8e3.js} +1 -1
- package/assets/{secp256k1-Bg2aUJRs.js → secp256k1-TIizaas9.js} +1 -1
- package/assets/{send-ByB5fOtm.js → send-DsnDja5n.js} +1 -1
- package/assets/{send-batch-transaction-D79MC_wr.js → send-batch-transaction-jNcvidMH.js} +1 -1
- package/assets/{send-eip712-transaction-CB6qLgks.js → send-eip712-transaction-DDJVOUpU.js} +2 -2
- package/assets/{send-gasless-transaction-Dt1qtUR8.js → send-gasless-transaction-DXjarWmh.js} +2 -2
- package/assets/{session-proposal-CY0k9Jnm.js → session-proposal-xJguSOgr.js} +1 -1
- package/assets/{session-request-B_2glC9e.js → session-request-BhD4eDPG.js} +2 -2
- package/assets/{sha256-Dy8KQE_5.js → sha256-CbjS9vFa.js} +1 -1
- package/assets/{signing-gNn6SJWz.js → signing-tKzVzr3v.js} +5 -5
- package/assets/{socials-Dx84-PrV.js → socials-CER945jA.js} +1 -1
- package/assets/{swaps-CK9Sfcew.js → swaps-Dy4hNTFm.js} +1 -1
- package/assets/{thirdweb-Bx5V_C1s.js → thirdweb-CNCkvOQU.js} +3 -3
- package/assets/{totalSupply-O-VFDoRO.js → totalSupply-BQvZy7Uc.js} +1 -1
- package/assets/{transactionReceipt-BqEjx5q-.js → transactionReceipt-DA1xo-2g.js} +1 -1
- package/assets/{transactions-BLOC2qYE.js → transactions-CwEfhngY.js} +1 -1
- package/assets/{utils-h8VUSGPW.js → utils-BUWGRgBa.js} +1 -1
- package/assets/{verifyHash-CNJ6t8Wp.js → verifyHash-CX9Livyx.js} +1 -1
- package/assets/{w3m-modal-nzPxg0Fr.js → w3m-modal-B1spewtI.js} +1 -1
- package/assets/{w3m-modal-CCQuGDus.js → w3m-modal-B6M729n4.js} +1 -1
- package/assets/{wait-for-tx-receipt-5pSBMNe2.js → wait-for-tx-receipt-BLruoSfj.js} +1 -1
- package/assets/{wallets-Bz03-Btm.js → wallets-vCTTbbau.js} +6 -6
- package/assets/{web-connector-CAOe_uvv.js → web-connector-h9SB5qXs.js} +3 -3
- package/assets/{writeContract-CCar3Ocq.js → writeContract-C9KDDivM.js} +1 -1
- package/assets/{zora-sepolia-D6mjhB5j.js → zora-sepolia-pCyxGzqm.js} +1 -1
- package/assets/{zoraTestnet-WLSFziQl.js → zoraTestnet-ChmlUfs6.js} +1 -1
- package/index.html +4 -4
- package/package.json +3 -3
- package/assets/browser-ponyfill-BmgQyNz0.js +0 -1
- package/assets/decimals-DR6jraOc.js +0 -1
- package/assets/eth_estimateGas-DKKwG-Ue.js +0 -1
- package/assets/get-ecosystem-wallet-info-Cvjz8DFX.js +0 -1
- package/assets/index-829Uxa3Y.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{P as G,aP as N,N as V,aT as se,bE as ct,a$ as ut,bF as ft,bG as dt,bH as lt,Y as ht,aO as yt,am as j,b5 as S,ab as pt,aj as mt,ac as bt,b2 as gt,S as xt,bI as we,bJ as je,bK as ke,K as wt,bL as Pe,bM as ve,bN as Ie,L as Pt,bO as Ue,bP as v,bQ as ie,bR as w,bS as vt,bT as g,bU as m,bV as b,bW as h,bX as _e,bY as Fe,bZ as He,b_ as It,b$ as Ee,c0 as oe,c1 as Q,c2 as x,c3 as Et,c4 as At,c5 as $t,c6 as zt,c7 as Bt,c8 as C,c9 as Me,ca as St,cb as O,cc as H,cd as Lt,ce as Tt,aQ as Z,b8 as Ct,aI as J,az as ae,b9 as D,b7 as Ge,aq as Ot,aK as Rt,aX as Ae,cf as Nt,ay as Vt,aA as jt,C as kt,x as Ut}from"./parseEventLogs-D1xiFnCH.js";import{an as $e,F as ce,x as _t,B as De,ai as Ft,a9 as Ht,ae as l,_ as We,ao as M,av as Mt,a6 as ze,a8 as Gt,ab as Dt,ac as Wt,aw as Ye,a0 as Be,a7 as Yt}from"./NetworkUtil-DqGcuBfF.js";import{s as qt}from"./secp256k1-Bg2aUJRs.js";import{s as Kt}from"./sha256-D33fGSQc.js";function An(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function r(n){return s=>{const i=typeof s=="function"?s(n):s,o={...n,...i};return Object.assign(o,{extend:r(o)})}}return Object.assign(t,{extend:r(t)})}function $n(){return{}}function Qt(e){if(!e||e.length===0)return[];const t=[];for(const r of e){const{chainId:n,nonce:s,...i}=r,o=r.address;t.push([n?$e(n):"0x",o,s?$e(s):"0x",...k({},i)])}return t}function Zt(e){const{authorizationList:t}=e;if(t)for(const r of t){const{chainId:n}=r,s=r.address;if(!N(s))throw new V({address:s});if(n<0)throw new G({chainId:n})}ue(e)}function Jt(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new ct;for(const r of t){const n=Ft(r),s=Ht(ut(r,0,1));if(n!==32)throw new ft({hash:r,size:n});if(s!==dt)throw new lt({hash:r,version:s})}}ue(e)}function ue(e){const{chainId:t,maxPriorityFeePerGas:r,maxFeePerGas:n,to:s}=e;if(t<=0)throw new G({chainId:t});if(s&&!N(s))throw new V({address:s});if(n&&n>se)throw new ce({maxFeePerGas:n});if(r&&n&&r>n)throw new _t({maxFeePerGas:n,maxPriorityFeePerGas:r})}function Xt(e){const{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:s,to:i}=e;if(t<=0)throw new G({chainId:t});if(i&&!N(i))throw new V({address:i});if(r||s)throw new De("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>se)throw new ce({maxFeePerGas:n})}function er(e){const{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:s,to:i}=e;if(i&&!N(i))throw new V({address:i});if(typeof t<"u"&&t<=0)throw new G({chainId:t});if(r||s)throw new De("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>se)throw new ce({maxFeePerGas:n})}function W(e){if(!e||e.length===0)return[];const t=[];for(let r=0;r<e.length;r++){const{address:n,storageKeys:s}=e[r];for(let i=0;i<s.length;i++)if(s[i].length-2!==64)throw new ht({storageKey:s[i]});if(!N(n,{strict:!1}))throw new V({address:n});t.push([n,s])}return t}function zn(e,t){const r=yt(e);return r==="eip1559"?nr(e,t):r==="eip2930"?sr(e,t):r==="eip4844"?rr(e,t):r==="eip7702"?tr(e,t):ir(e,t)}function tr(e,t){const{authorizationList:r,chainId:n,gas:s,nonce:i,to:o,value:c,maxFeePerGas:u,maxPriorityFeePerGas:a,accessList:f,data:d}=e;Zt(e);const y=W(f),p=Qt(r);return j(["0x04",S([l(n),i?l(i):"0x",a?l(a):"0x",u?l(u):"0x",s?l(s):"0x",o??"0x",c?l(c):"0x",d??"0x",y,p,...k(e,t)])])}function rr(e,t){const{chainId:r,gas:n,nonce:s,to:i,value:o,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:a,accessList:f,data:d}=e;Jt(e);let y=e.blobVersionedHashes,p=e.sidecars;if(e.blobs&&(typeof y>"u"||typeof p>"u")){const E=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(T=>We(T)),F=e.kzg,L=pt({blobs:E,kzg:F});if(typeof y>"u"&&(y=mt({commitments:L})),typeof p>"u"){const T=bt({blobs:E,commitments:L,kzg:F});p=gt({blobs:E,commitments:L,proofs:T})}}const P=W(f),I=[l(r),s?l(s):"0x",a?l(a):"0x",u?l(u):"0x",n?l(n):"0x",i??"0x",o?l(o):"0x",d??"0x",P,c?l(c):"0x",y??[],...k(e,t)],U=[],_=[],xe=[];if(p)for(let E=0;E<p.length;E++){const{blob:F,commitment:L,proof:T}=p[E];U.push(F),_.push(L),xe.push(T)}return j(["0x03",p?S([I,U,_,xe]):S(I)])}function nr(e,t){const{chainId:r,gas:n,nonce:s,to:i,value:o,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:a,data:f}=e;ue(e);const d=W(a),y=[l(r),s?l(s):"0x",u?l(u):"0x",c?l(c):"0x",n?l(n):"0x",i??"0x",o?l(o):"0x",f??"0x",d,...k(e,t)];return j(["0x02",S(y)])}function sr(e,t){const{chainId:r,gas:n,data:s,nonce:i,to:o,value:c,accessList:u,gasPrice:a}=e;Xt(e);const f=W(u),d=[l(r),i?l(i):"0x",a?l(a):"0x",n?l(n):"0x",o??"0x",c?l(c):"0x",s??"0x",f,...k(e,t)];return j(["0x01",S(d)])}function ir(e,t){const{chainId:r=0,gas:n,data:s,nonce:i,to:o,value:c,gasPrice:u}=e;er(e);let a=[i?l(i):"0x",u?l(u):"0x",n?l(n):"0x",o??"0x",c?l(c):"0x",s??"0x"];if(t){const f=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+t.v-27n);const p=27n+(t.v===27n?0n:1n);if(t.v!==p)throw new xt({v:t.v});return p})(),d=M(t.r),y=M(t.s);a=[...a,l(f),d==="0x00"?"0x":d,y==="0x00"?"0x":y]}else r>0&&(a=[...a,l(r),"0x","0x"]);return S(a)}function k(e,t){const r=t??e,{v:n,yParity:s}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof s>"u")return[];const i=M(r.r),o=M(r.s);return[typeof s=="number"?s?l(1):"0x":n===0n?"0x":n===1n?l(1):n===27n?"0x":l(1),i==="0x00"?"0x":i,o==="0x00"?"0x":o]}function Se(e){let t;if(typeof e=="string")t=we(e);else{const r=je(e),n=e.length;for(let s=0;s<n;s++){const i=e[s];if(!ke(i)){t=we(i,r);break}}}if(!t)throw new wt({signature:e});return t}function Le(e){const t=[];if(typeof e=="string"){const r=Pe(e),n=r.length;for(let s=0;s<n;s++)t.push(ve(r[s],{modifiers:Ie}))}else{const r=je(e),n=e.length;for(let s=0;s<n;s++){const i=e[s];if(ke(i))continue;const o=Pe(i),c=o.length;for(let u=0;u<c;u++)t.push(ve(o[u],{modifiers:Ie,structs:r}))}}if(t.length===0)throw new Pt({params:e});return t}class or extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const ar={checksum:new or(8192)},q=ar.checksum;function fe(e,t={}){const{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=Mt(Ue(e));return r==="Bytes"?n:v(n)}function Bn(e,t={}){const{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=Kt(Ue(e));return r==="Bytes"?n:v(n)}function Sn(e){return ie(e)&&w(e)===32}function qe(e,t={}){const{compressed:r}=t,{prefix:n,x:s,y:i}=e;if(r===!1||typeof s=="bigint"&&typeof i=="bigint"){if(n!==4)throw new Te({prefix:n,cause:new dr});return}if(r===!0||typeof s=="bigint"&&typeof i>"u"){if(n!==3&&n!==2)throw new Te({prefix:n,cause:new fr});return}throw new ur({publicKey:e})}function Ln(e){const t=(()=>{if(ie(e))return Ke(e);if(vt(e))return cr(e);const{prefix:r,x:n,y:s}=e;return typeof n=="bigint"&&typeof s=="bigint"?{prefix:r??4,x:n,y:s}:{prefix:r,x:n}})();return qe(t),t}function cr(e){return Ke(v(e))}function Ke(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new lr({publicKey:e});if(e.length===130){const n=BigInt(b(e,0,32)),s=BigInt(b(e,32,64));return{prefix:4,x:n,y:s}}if(e.length===132){const n=Number(b(e,0,1)),s=BigInt(b(e,1,33)),i=BigInt(b(e,33,65));return{prefix:n,x:s,y:i}}const t=Number(b(e,0,1)),r=BigInt(b(e,1,33));return{prefix:t,x:r}}function Tn(e,t={}){return He(Qe(e,t))}function Qe(e,t={}){qe(e);const{prefix:r,x:n,y:s}=e,{includePrefix:i=!0}=t;return g(i?m(r,{size:1}):"0x",m(n,{size:32}),typeof s=="bigint"?m(s,{size:32}):"0x")}class ur extends h{constructor({publicKey:t}){super(`Value \`${Fe(t)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class Te extends h{constructor({prefix:t,cause:r}){super(`Prefix "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class fr extends h{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class dr extends h{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let lr=class extends h{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${w(_e(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const hr=/^0x[a-fA-F0-9]{40}$/;function A(e,t={}){const{strict:r=!0}=t;if(!hr.test(e))throw new Ce({address:e,cause:new pr});if(r){if(e.toLowerCase()===e)return;if(de(e)!==e)throw new Ce({address:e,cause:new mr})}}function de(e){if(q.has(e))return q.get(e);A(e,{strict:!1});const t=e.substring(2).toLowerCase(),r=fe(It(t),{as:"Bytes"}),n=t.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&n[i]&&(n[i]=n[i].toUpperCase()),(r[i>>1]&15)>=8&&n[i+1]&&(n[i+1]=n[i+1].toUpperCase());const s=`0x${n.join("")}`;return q.set(e,s),s}function yr(e,t={}){const{checksum:r=!1}=t;return A(e),r?de(e):e}function On(e,t={}){const r=fe(`0x${Qe(e).slice(4)}`).substring(26);return yr(`0x${r}`,t)}function Rn(e,t){return A(e,{strict:!1}),A(t,{strict:!1}),e.toLowerCase()===t.toLowerCase()}function X(e,t={}){const{strict:r=!0}=t??{};try{return A(e,{strict:r}),!0}catch{return!1}}class Ce extends h{constructor({address:t,cause:r}){super(`Address "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class pr extends h{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class mr extends h{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const br={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 wr({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new xr({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Oe({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Oe({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function gr(e,{recursiveReadLimit:t=8192}={}){const r=Object.create(br);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}class Oe extends h{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class xr extends h{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class wr extends h{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}const Pr=/^(.*)\[([0-9]*)\]$/,vr=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ze=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Re=2n**256n-1n;function le(e,t={}){const{recovered:r}=t;if(typeof e.r>"u")throw new K({signature:e});if(typeof e.s>"u")throw new K({signature:e});if(r&&typeof e.yParity>"u")throw new K({signature:e});if(e.r<0n||e.r>Re)throw new Lr({value:e.r});if(e.s<0n||e.s>Re)throw new Tr({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Y({value:e.yParity})}function Ir(e){return Je(v(e))}function Je(e){if(e.length!==130&&e.length!==132)throw new Sr({signature:e});const t=BigInt(b(e,0,32)),r=BigInt(b(e,32,64)),n=(()=>{const s=+`0x${e.slice(130)}`;if(!Number.isNaN(s))try{return he(s)}catch{throw new Y({value:s})}})();return typeof n>"u"?{r:t,s:r}:{r:t,s:r,yParity:n}}function Er(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return Xe(e)}function Xe(e){const t=typeof e=="string"?Je(e):e instanceof Uint8Array?Ir(e):typeof e.r=="string"?$r(e):e.v?Ar(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return le(t),t}function Ar(e){return{r:e.r,s:e.s,yParity:he(e.v)}}function $r(e){const t=(()=>{const r=e.v?Number(e.v):void 0;let n=e.yParity?Number(e.yParity):void 0;if(typeof r=="number"&&typeof n!="number"&&(n=he(r)),typeof n!="number")throw new Y({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function Nn(e){const[t,r,n]=e;return Xe({r:r==="0x"?0n:BigInt(r),s:n==="0x"?0n:BigInt(n),yParity:t==="0x"?0:Number(t)})}function Vn(e){le(e);const t=e.r,r=e.s;return g(m(t,{size:32}),m(r,{size:32}),typeof e.yParity=="number"?m(Br(e.yParity),{size:1}):"0x")}function zr(e){const{r:t,s:r,yParity:n}=e;return{r:m(t,{size:32}),s:m(r,{size:32}),yParity:n===0?"0x0":"0x1"}}function jn(e){const{r:t,s:r,yParity:n}=e;return[n?"0x01":"0x",t===0n?"0x":Ee(m(t)),r===0n?"0x":Ee(m(r))]}function he(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new Cr({value:e})}function Br(e){if(e===0)return 27;if(e===1)return 28;throw new Y({value:e})}class Sr extends h{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${w(_e(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class K extends h{constructor({signature:t}){super(`Signature \`${Fe(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class Lr extends h{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class Tr extends h{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class Y extends h{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class Cr extends h{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function ee(e){let t=!0,r="",n=0,s="",i=!1;for(let o=0;o<e.length;o++){const c=e[o];if(["(",")",","].includes(c)&&(t=!0),c==="("&&n++,c===")"&&n--,!!t){if(n===0){if(c===" "&&["event","function","error",""].includes(s))s="";else if(s+=c,c===")"){i=!0;break}continue}if(c===" "){e[o-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}s+=c,r+=c}}if(!i)throw new h("Unable to normalize signature.");return s}function te(e,t){const r=typeof e,n=t.type;switch(n){case"address":return X(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((s,i)=>te(Object.values(e)[i],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(s=>te(s,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function et(e,t,r){for(const n in e){const s=e[n],i=t[n];if(s.type==="tuple"&&i.type==="tuple"&&"components"in s&&"components"in i)return et(s.components,i.components,r[n]);const o=[s.type,i.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?X(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?X(r[n],{strict:!1}):!1)return o}}function kn(e,t={}){const{prepare:r=!0}=t,n=Array.isArray(e)||typeof e=="string"?Se(e):e;return{...n,...r?{hash:z(n)}:{}}}function ye(e,t,r){const{args:n=[],prepare:s=!0}=r??{},i=ie(t,{strict:!1}),o=e.filter(a=>i?a.type==="function"||a.type==="error"?Or(a)===b(t,0,4):a.type==="event"?z(a)===t:!1:"name"in a&&a.name===t);if(o.length===0)throw new Ne({name:t});if(o.length===1)return{...o[0],...s?{hash:z(o[0])}:{}};let c;for(const a of o){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return{...a,...s?{hash:z(a)}:{}};continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((d,y)=>{const p="inputs"in a&&a.inputs[y];return p?te(d,p):!1})){if(c&&"inputs"in c&&c.inputs){const d=et(a.inputs,c.inputs,n);if(d)throw new Nr({abiItem:a,type:d[0]},{abiItem:c,type:d[1]})}c=a}}const u=(()=>{if(c)return c;const[a,...f]=o;return{...a,overloads:f}})();if(!u)throw new Ne({name:t});return{...u,...s?{hash:z(u)}:{}}}function Or(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,n]=e;return ye(r,n)}return e[0]})();return b(z(t),0,4)}function Rr(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,s]=e;return ye(n,s)}return e[0]})(),r=typeof t=="string"?t:Q(t);return ee(r)}function z(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,n]=e;return ye(r,n)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:fe(oe(Rr(t)))}class Nr extends h{constructor(t,r){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${ee(Q(t.abiItem))}\`, and`,`\`${r.type}\` in \`${ee(Q(r.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class Ne extends h{constructor({name:t,data:r,type:n="item"}){const s=t?` with name "${t}"`:r?` with data "${r}"`:"";super(`ABI ${n}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function B(e,t,r){const{checksumAddress:n,staticPosition:s}=r,i=be(t.type);if(i){const[o,c]=i;return jr(e,{...t,type:c},{checksumAddress:n,length:o,staticPosition:s})}if(t.type==="tuple")return Fr(e,t,{checksumAddress:n,staticPosition:s});if(t.type==="address")return Vr(e,{checksum:n});if(t.type==="bool")return kr(e);if(t.type.startsWith("bytes"))return Ur(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return _r(e,t);if(t.type==="string")return Hr(e,{staticPosition:s});throw new ge(t.type)}const Ve=32,re=32;function Vr(e,t={}){const{checksum:r=!1}=t,n=e.readBytes(32);return[(i=>r?de(i):i)(v(Et(n,-20))),32]}function jr(e,t,r){const{checksumAddress:n,length:s,staticPosition:i}=r;if(!s){const u=x(e.readBytes(re)),a=i+u,f=a+Ve;e.setPosition(a);const d=x(e.readBytes(Ve)),y=R(t);let p=0;const P=[];for(let I=0;I<d;++I){e.setPosition(f+(y?I*32:p));const[U,_]=B(e,t,{checksumAddress:n,staticPosition:f});p+=_,P.push(U)}return e.setPosition(i+32),[P,32]}if(R(t)){const u=x(e.readBytes(re)),a=i+u,f=[];for(let d=0;d<s;++d){e.setPosition(a+d*32);const[y]=B(e,t,{checksumAddress:n,staticPosition:a});f.push(y)}return e.setPosition(i+32),[f,32]}let o=0;const c=[];for(let u=0;u<s;++u){const[a,f]=B(e,t,{checksumAddress:n,staticPosition:i+o});o+=f,c.push(a)}return[c,o]}function kr(e){return[At(e.readBytes(32),{size:32}),32]}function Ur(e,t,{staticPosition:r}){const[n,s]=t.type.split("bytes");if(!s){const o=x(e.readBytes(32));e.setPosition(r+o);const c=x(e.readBytes(32));if(c===0)return e.setPosition(r+32),["0x",32];const u=e.readBytes(c);return e.setPosition(r+32),[v(u),32]}return[v(e.readBytes(Number.parseInt(s,10),32)),32]}function _r(e,t){const r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[n>48?$t(s,{signed:r}):x(s,{signed:r}),32]}function Fr(e,t,r){const{checksumAddress:n,staticPosition:s}=r,i=t.components.length===0||t.components.some(({name:u})=>!u),o=i?[]:{};let c=0;if(R(t)){const u=x(e.readBytes(re)),a=s+u;for(let f=0;f<t.components.length;++f){const d=t.components[f];e.setPosition(a+c);const[y,p]=B(e,d,{checksumAddress:n,staticPosition:a});c+=p,o[i?f:d?.name]=y}return e.setPosition(s+32),[o,32]}for(let u=0;u<t.components.length;++u){const a=t.components[u],[f,d]=B(e,a,{checksumAddress:n,staticPosition:s});o[i?u:a?.name]=f,c+=d}return[o,c]}function Hr(e,{staticPosition:t}){const r=x(e.readBytes(32)),n=t+r;e.setPosition(n);const s=x(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const i=e.readBytes(s,32),o=zt(Bt(i));return e.setPosition(t+32),[o,32]}function Mr({checksumAddress:e,parameters:t,values:r}){const n=[];for(let s=0;s<t.length;s++)n.push(pe({checksumAddress:e,parameter:t[s],value:r[s]}));return n}function pe({checksumAddress:e=!1,parameter:t,value:r}){const n=t,s=be(n.type);if(s){const[i,o]=s;return Dr(r,{checksumAddress:e,length:i,parameter:{...n,type:o}})}if(n.type==="tuple")return Qr(r,{checksumAddress:e,parameter:n});if(n.type==="address")return Gr(r,{checksum:e});if(n.type==="bool")return Yr(r);if(n.type.startsWith("uint")||n.type.startsWith("int")){const i=n.type.startsWith("int"),[,,o="256"]=Ze.exec(n.type)??[];return qr(r,{signed:i,size:Number(o)})}if(n.type.startsWith("bytes"))return Wr(r,{type:n.type});if(n.type==="string")return Kr(r);throw new ge(n.type)}function me(e){let t=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:c}=e[i];o?t+=32:t+=w(c)}const r=[],n=[];let s=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:c}=e[i];o?(r.push(m(t+s,{size:32})),n.push(c),s+=w(c)):r.push(c)}return g(...r,...n)}function Gr(e,t){const{checksum:r=!1}=t;return A(e,{strict:r}),{dynamic:!1,encoded:C(e.toLowerCase())}}function Dr(e,t){const{checksumAddress:r,length:n,parameter:s}=t,i=n===null;if(!Array.isArray(e))throw new rn(e);if(!i&&e.length!==n)throw new tn({expectedLength:n,givenLength:e.length,type:`${s.type}[${n}]`});let o=!1;const c=[];for(let u=0;u<e.length;u++){const a=pe({checksumAddress:r,parameter:s,value:e[u]});a.dynamic&&(o=!0),c.push(a)}if(i||o){const u=me(c);if(i){const a=m(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?g(a,u):a}}if(o)return{dynamic:!0,encoded:u}}return{dynamic:!1,encoded:g(...c.map(({encoded:u})=>u))}}function Wr(e,{type:t}){const[,r]=t.split("bytes"),n=w(e);if(!r){let s=e;return n%32!==0&&(s=O(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:g(C(m(n,{size:32})),s)}}if(n!==Number.parseInt(r,10))throw new rt({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:O(e)}}function Yr(e){if(typeof e!="boolean")throw new h(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:C(Me(e))}}function qr(e,{signed:t,size:r}){if(typeof r=="number"){const n=2n**(BigInt(r)-(t?1n:0n))-1n,s=t?-n-1n:0n;if(e>n||e<s)throw new St({max:n.toString(),min:s.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:m(e,{size:32,signed:t})}}function Kr(e){const t=oe(e),r=Math.ceil(w(t)/32),n=[];for(let s=0;s<r;s++)n.push(O(b(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:g(O(m(w(t),{size:32})),...n)}}function Qr(e,t){const{checksumAddress:r,parameter:n}=t;let s=!1;const i=[];for(let o=0;o<n.components.length;o++){const c=n.components[o],u=Array.isArray(e)?o:c.name,a=pe({checksumAddress:r,parameter:c,value:e[u]});i.push(a),a.dynamic&&(s=!0)}return{dynamic:s,encoded:s?me(i):g(...i.map(({encoded:o})=>o))}}function be(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function R(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(R);const r=be(e.type);return!!(r&&R({...e,type:r[1]}))}function Zr(e,t,r={}){const{as:n="Array",checksumAddress:s=!1}=r,i=typeof t=="string"?He(t):t,o=gr(i);if(H(i)===0&&e.length>0)throw new en;if(H(i)&&H(i)<32)throw new Xr({data:typeof t=="string"?t:v(t),parameters:e,size:H(i)});let c=0;const u=n==="Array"?[]:{};for(let a=0;a<e.length;++a){const f=e[a];o.setPosition(c);const[d,y]=B(o,f,{checksumAddress:s,staticPosition:0});c+=y,n==="Array"?u.push(d):u[f.name??a]=d}return u}function Jr(e,t,r){const{checksumAddress:n=!1}={};if(e.length!==t.length)throw new nt({expectedLength:e.length,givenLength:t.length});const s=Mr({checksumAddress:n,parameters:e,values:t}),i=me(s);return i.length===0?"0x":i}function ne(e,t){if(e.length!==t.length)throw new nt({expectedLength:e.length,givenLength:t.length});const r=[];for(let n=0;n<e.length;n++){const s=e[n],i=t[n];r.push(ne.encode(s,i))}return g(...r)}(function(e){function t(r,n,s=!1){if(r==="address"){const u=n;return A(u),C(u.toLowerCase(),s?32:0)}if(r==="string")return oe(n);if(r==="bytes")return n;if(r==="bool")return C(Me(n),s?32:1);const i=r.match(Ze);if(i){const[u,a,f="256"]=i,d=Number.parseInt(f,10)/8;return m(n,{size:s?32:d,signed:a==="int"})}const o=r.match(vr);if(o){const[u,a]=o;if(Number.parseInt(a,10)!==(n.length-2)/2)throw new rt({expectedSize:Number.parseInt(a,10),value:n});return O(n,s?32:0)}const c=r.match(Pr);if(c&&Array.isArray(n)){const[u,a]=c,f=[];for(let d=0;d<n.length;d++)f.push(t(a,n[d],!0));return f.length===0?"0x":g(...f)}throw new ge(r)}e.encode=t})(ne||(ne={}));function tt(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Le(e):e}class Xr extends h{constructor({data:t,parameters:r,size:n}){super(`Data size of ${n} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Lt(r)})`,`Data: ${t} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class en extends h{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class tn extends h{constructor({expectedLength:t,givenLength:r,type:n}){super(`Array length mismatch for type \`${n}\`. Expected: \`${t}\`. Given: \`${r}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class rt extends h{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${w(r)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class nt extends h{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${r}`].join(`
|
|
1
|
+
import{P as G,aP as N,N as V,aT as se,bE as ct,a$ as ut,bF as ft,bG as dt,bH as lt,Y as ht,aO as yt,am as j,b5 as S,ab as pt,aj as mt,ac as bt,b2 as gt,S as xt,bI as we,bJ as je,bK as ke,K as wt,bL as Pe,bM as ve,bN as Ie,L as Pt,bO as Ue,bP as v,bQ as ie,bR as w,bS as vt,bT as g,bU as m,bV as b,bW as h,bX as _e,bY as Fe,bZ as He,b_ as It,b$ as Ee,c0 as oe,c1 as Q,c2 as x,c3 as Et,c4 as At,c5 as $t,c6 as zt,c7 as Bt,c8 as C,c9 as Me,ca as St,cb as O,cc as H,cd as Lt,ce as Tt,aQ as Z,b8 as Ct,aI as J,az as ae,b9 as D,b7 as Ge,aq as Ot,aK as Rt,aX as Ae,cf as Nt,ay as Vt,aA as jt,C as kt,x as Ut}from"./parseEventLogs-BxtEI7tW.js";import{an as $e,F as ce,x as _t,B as De,ai as Ft,a9 as Ht,ae as l,_ as We,ao as M,av as Mt,a6 as ze,a8 as Gt,ab as Dt,ac as Wt,aw as Ye,a0 as Be,a7 as Yt}from"./NetworkUtil-DM5H1DOt.js";import{s as qt}from"./secp256k1-TIizaas9.js";import{s as Kt}from"./sha256-D33fGSQc.js";function An(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function r(n){return s=>{const i=typeof s=="function"?s(n):s,o={...n,...i};return Object.assign(o,{extend:r(o)})}}return Object.assign(t,{extend:r(t)})}function $n(){return{}}function Qt(e){if(!e||e.length===0)return[];const t=[];for(const r of e){const{chainId:n,nonce:s,...i}=r,o=r.address;t.push([n?$e(n):"0x",o,s?$e(s):"0x",...k({},i)])}return t}function Zt(e){const{authorizationList:t}=e;if(t)for(const r of t){const{chainId:n}=r,s=r.address;if(!N(s))throw new V({address:s});if(n<0)throw new G({chainId:n})}ue(e)}function Jt(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new ct;for(const r of t){const n=Ft(r),s=Ht(ut(r,0,1));if(n!==32)throw new ft({hash:r,size:n});if(s!==dt)throw new lt({hash:r,version:s})}}ue(e)}function ue(e){const{chainId:t,maxPriorityFeePerGas:r,maxFeePerGas:n,to:s}=e;if(t<=0)throw new G({chainId:t});if(s&&!N(s))throw new V({address:s});if(n&&n>se)throw new ce({maxFeePerGas:n});if(r&&n&&r>n)throw new _t({maxFeePerGas:n,maxPriorityFeePerGas:r})}function Xt(e){const{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:s,to:i}=e;if(t<=0)throw new G({chainId:t});if(i&&!N(i))throw new V({address:i});if(r||s)throw new De("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>se)throw new ce({maxFeePerGas:n})}function er(e){const{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:s,to:i}=e;if(i&&!N(i))throw new V({address:i});if(typeof t<"u"&&t<=0)throw new G({chainId:t});if(r||s)throw new De("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>se)throw new ce({maxFeePerGas:n})}function W(e){if(!e||e.length===0)return[];const t=[];for(let r=0;r<e.length;r++){const{address:n,storageKeys:s}=e[r];for(let i=0;i<s.length;i++)if(s[i].length-2!==64)throw new ht({storageKey:s[i]});if(!N(n,{strict:!1}))throw new V({address:n});t.push([n,s])}return t}function zn(e,t){const r=yt(e);return r==="eip1559"?nr(e,t):r==="eip2930"?sr(e,t):r==="eip4844"?rr(e,t):r==="eip7702"?tr(e,t):ir(e,t)}function tr(e,t){const{authorizationList:r,chainId:n,gas:s,nonce:i,to:o,value:c,maxFeePerGas:u,maxPriorityFeePerGas:a,accessList:f,data:d}=e;Zt(e);const y=W(f),p=Qt(r);return j(["0x04",S([l(n),i?l(i):"0x",a?l(a):"0x",u?l(u):"0x",s?l(s):"0x",o??"0x",c?l(c):"0x",d??"0x",y,p,...k(e,t)])])}function rr(e,t){const{chainId:r,gas:n,nonce:s,to:i,value:o,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:a,accessList:f,data:d}=e;Jt(e);let y=e.blobVersionedHashes,p=e.sidecars;if(e.blobs&&(typeof y>"u"||typeof p>"u")){const E=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(T=>We(T)),F=e.kzg,L=pt({blobs:E,kzg:F});if(typeof y>"u"&&(y=mt({commitments:L})),typeof p>"u"){const T=bt({blobs:E,commitments:L,kzg:F});p=gt({blobs:E,commitments:L,proofs:T})}}const P=W(f),I=[l(r),s?l(s):"0x",a?l(a):"0x",u?l(u):"0x",n?l(n):"0x",i??"0x",o?l(o):"0x",d??"0x",P,c?l(c):"0x",y??[],...k(e,t)],U=[],_=[],xe=[];if(p)for(let E=0;E<p.length;E++){const{blob:F,commitment:L,proof:T}=p[E];U.push(F),_.push(L),xe.push(T)}return j(["0x03",p?S([I,U,_,xe]):S(I)])}function nr(e,t){const{chainId:r,gas:n,nonce:s,to:i,value:o,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:a,data:f}=e;ue(e);const d=W(a),y=[l(r),s?l(s):"0x",u?l(u):"0x",c?l(c):"0x",n?l(n):"0x",i??"0x",o?l(o):"0x",f??"0x",d,...k(e,t)];return j(["0x02",S(y)])}function sr(e,t){const{chainId:r,gas:n,data:s,nonce:i,to:o,value:c,accessList:u,gasPrice:a}=e;Xt(e);const f=W(u),d=[l(r),i?l(i):"0x",a?l(a):"0x",n?l(n):"0x",o??"0x",c?l(c):"0x",s??"0x",f,...k(e,t)];return j(["0x01",S(d)])}function ir(e,t){const{chainId:r=0,gas:n,data:s,nonce:i,to:o,value:c,gasPrice:u}=e;er(e);let a=[i?l(i):"0x",u?l(u):"0x",n?l(n):"0x",o??"0x",c?l(c):"0x",s??"0x"];if(t){const f=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+t.v-27n);const p=27n+(t.v===27n?0n:1n);if(t.v!==p)throw new xt({v:t.v});return p})(),d=M(t.r),y=M(t.s);a=[...a,l(f),d==="0x00"?"0x":d,y==="0x00"?"0x":y]}else r>0&&(a=[...a,l(r),"0x","0x"]);return S(a)}function k(e,t){const r=t??e,{v:n,yParity:s}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof s>"u")return[];const i=M(r.r),o=M(r.s);return[typeof s=="number"?s?l(1):"0x":n===0n?"0x":n===1n?l(1):n===27n?"0x":l(1),i==="0x00"?"0x":i,o==="0x00"?"0x":o]}function Se(e){let t;if(typeof e=="string")t=we(e);else{const r=je(e),n=e.length;for(let s=0;s<n;s++){const i=e[s];if(!ke(i)){t=we(i,r);break}}}if(!t)throw new wt({signature:e});return t}function Le(e){const t=[];if(typeof e=="string"){const r=Pe(e),n=r.length;for(let s=0;s<n;s++)t.push(ve(r[s],{modifiers:Ie}))}else{const r=je(e),n=e.length;for(let s=0;s<n;s++){const i=e[s];if(ke(i))continue;const o=Pe(i),c=o.length;for(let u=0;u<c;u++)t.push(ve(o[u],{modifiers:Ie,structs:r}))}}if(t.length===0)throw new Pt({params:e});return t}class or extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const ar={checksum:new or(8192)},q=ar.checksum;function fe(e,t={}){const{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=Mt(Ue(e));return r==="Bytes"?n:v(n)}function Bn(e,t={}){const{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=Kt(Ue(e));return r==="Bytes"?n:v(n)}function Sn(e){return ie(e)&&w(e)===32}function qe(e,t={}){const{compressed:r}=t,{prefix:n,x:s,y:i}=e;if(r===!1||typeof s=="bigint"&&typeof i=="bigint"){if(n!==4)throw new Te({prefix:n,cause:new dr});return}if(r===!0||typeof s=="bigint"&&typeof i>"u"){if(n!==3&&n!==2)throw new Te({prefix:n,cause:new fr});return}throw new ur({publicKey:e})}function Ln(e){const t=(()=>{if(ie(e))return Ke(e);if(vt(e))return cr(e);const{prefix:r,x:n,y:s}=e;return typeof n=="bigint"&&typeof s=="bigint"?{prefix:r??4,x:n,y:s}:{prefix:r,x:n}})();return qe(t),t}function cr(e){return Ke(v(e))}function Ke(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new lr({publicKey:e});if(e.length===130){const n=BigInt(b(e,0,32)),s=BigInt(b(e,32,64));return{prefix:4,x:n,y:s}}if(e.length===132){const n=Number(b(e,0,1)),s=BigInt(b(e,1,33)),i=BigInt(b(e,33,65));return{prefix:n,x:s,y:i}}const t=Number(b(e,0,1)),r=BigInt(b(e,1,33));return{prefix:t,x:r}}function Tn(e,t={}){return He(Qe(e,t))}function Qe(e,t={}){qe(e);const{prefix:r,x:n,y:s}=e,{includePrefix:i=!0}=t;return g(i?m(r,{size:1}):"0x",m(n,{size:32}),typeof s=="bigint"?m(s,{size:32}):"0x")}class ur extends h{constructor({publicKey:t}){super(`Value \`${Fe(t)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class Te extends h{constructor({prefix:t,cause:r}){super(`Prefix "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class fr extends h{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class dr extends h{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let lr=class extends h{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${w(_e(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const hr=/^0x[a-fA-F0-9]{40}$/;function A(e,t={}){const{strict:r=!0}=t;if(!hr.test(e))throw new Ce({address:e,cause:new pr});if(r){if(e.toLowerCase()===e)return;if(de(e)!==e)throw new Ce({address:e,cause:new mr})}}function de(e){if(q.has(e))return q.get(e);A(e,{strict:!1});const t=e.substring(2).toLowerCase(),r=fe(It(t),{as:"Bytes"}),n=t.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&n[i]&&(n[i]=n[i].toUpperCase()),(r[i>>1]&15)>=8&&n[i+1]&&(n[i+1]=n[i+1].toUpperCase());const s=`0x${n.join("")}`;return q.set(e,s),s}function yr(e,t={}){const{checksum:r=!1}=t;return A(e),r?de(e):e}function On(e,t={}){const r=fe(`0x${Qe(e).slice(4)}`).substring(26);return yr(`0x${r}`,t)}function Rn(e,t){return A(e,{strict:!1}),A(t,{strict:!1}),e.toLowerCase()===t.toLowerCase()}function X(e,t={}){const{strict:r=!0}=t??{};try{return A(e,{strict:r}),!0}catch{return!1}}class Ce extends h{constructor({address:t,cause:r}){super(`Address "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class pr extends h{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class mr extends h{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const br={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 wr({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new xr({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Oe({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Oe({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function gr(e,{recursiveReadLimit:t=8192}={}){const r=Object.create(br);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}class Oe extends h{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class xr extends h{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class wr extends h{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}const Pr=/^(.*)\[([0-9]*)\]$/,vr=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ze=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Re=2n**256n-1n;function le(e,t={}){const{recovered:r}=t;if(typeof e.r>"u")throw new K({signature:e});if(typeof e.s>"u")throw new K({signature:e});if(r&&typeof e.yParity>"u")throw new K({signature:e});if(e.r<0n||e.r>Re)throw new Lr({value:e.r});if(e.s<0n||e.s>Re)throw new Tr({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Y({value:e.yParity})}function Ir(e){return Je(v(e))}function Je(e){if(e.length!==130&&e.length!==132)throw new Sr({signature:e});const t=BigInt(b(e,0,32)),r=BigInt(b(e,32,64)),n=(()=>{const s=+`0x${e.slice(130)}`;if(!Number.isNaN(s))try{return he(s)}catch{throw new Y({value:s})}})();return typeof n>"u"?{r:t,s:r}:{r:t,s:r,yParity:n}}function Er(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return Xe(e)}function Xe(e){const t=typeof e=="string"?Je(e):e instanceof Uint8Array?Ir(e):typeof e.r=="string"?$r(e):e.v?Ar(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return le(t),t}function Ar(e){return{r:e.r,s:e.s,yParity:he(e.v)}}function $r(e){const t=(()=>{const r=e.v?Number(e.v):void 0;let n=e.yParity?Number(e.yParity):void 0;if(typeof r=="number"&&typeof n!="number"&&(n=he(r)),typeof n!="number")throw new Y({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function Nn(e){const[t,r,n]=e;return Xe({r:r==="0x"?0n:BigInt(r),s:n==="0x"?0n:BigInt(n),yParity:t==="0x"?0:Number(t)})}function Vn(e){le(e);const t=e.r,r=e.s;return g(m(t,{size:32}),m(r,{size:32}),typeof e.yParity=="number"?m(Br(e.yParity),{size:1}):"0x")}function zr(e){const{r:t,s:r,yParity:n}=e;return{r:m(t,{size:32}),s:m(r,{size:32}),yParity:n===0?"0x0":"0x1"}}function jn(e){const{r:t,s:r,yParity:n}=e;return[n?"0x01":"0x",t===0n?"0x":Ee(m(t)),r===0n?"0x":Ee(m(r))]}function he(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new Cr({value:e})}function Br(e){if(e===0)return 27;if(e===1)return 28;throw new Y({value:e})}class Sr extends h{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${w(_e(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class K extends h{constructor({signature:t}){super(`Signature \`${Fe(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class Lr extends h{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class Tr extends h{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class Y extends h{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class Cr extends h{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function ee(e){let t=!0,r="",n=0,s="",i=!1;for(let o=0;o<e.length;o++){const c=e[o];if(["(",")",","].includes(c)&&(t=!0),c==="("&&n++,c===")"&&n--,!!t){if(n===0){if(c===" "&&["event","function","error",""].includes(s))s="";else if(s+=c,c===")"){i=!0;break}continue}if(c===" "){e[o-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}s+=c,r+=c}}if(!i)throw new h("Unable to normalize signature.");return s}function te(e,t){const r=typeof e,n=t.type;switch(n){case"address":return X(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((s,i)=>te(Object.values(e)[i],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(s=>te(s,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function et(e,t,r){for(const n in e){const s=e[n],i=t[n];if(s.type==="tuple"&&i.type==="tuple"&&"components"in s&&"components"in i)return et(s.components,i.components,r[n]);const o=[s.type,i.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?X(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?X(r[n],{strict:!1}):!1)return o}}function kn(e,t={}){const{prepare:r=!0}=t,n=Array.isArray(e)||typeof e=="string"?Se(e):e;return{...n,...r?{hash:z(n)}:{}}}function ye(e,t,r){const{args:n=[],prepare:s=!0}=r??{},i=ie(t,{strict:!1}),o=e.filter(a=>i?a.type==="function"||a.type==="error"?Or(a)===b(t,0,4):a.type==="event"?z(a)===t:!1:"name"in a&&a.name===t);if(o.length===0)throw new Ne({name:t});if(o.length===1)return{...o[0],...s?{hash:z(o[0])}:{}};let c;for(const a of o){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return{...a,...s?{hash:z(a)}:{}};continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((d,y)=>{const p="inputs"in a&&a.inputs[y];return p?te(d,p):!1})){if(c&&"inputs"in c&&c.inputs){const d=et(a.inputs,c.inputs,n);if(d)throw new Nr({abiItem:a,type:d[0]},{abiItem:c,type:d[1]})}c=a}}const u=(()=>{if(c)return c;const[a,...f]=o;return{...a,overloads:f}})();if(!u)throw new Ne({name:t});return{...u,...s?{hash:z(u)}:{}}}function Or(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,n]=e;return ye(r,n)}return e[0]})();return b(z(t),0,4)}function Rr(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,s]=e;return ye(n,s)}return e[0]})(),r=typeof t=="string"?t:Q(t);return ee(r)}function z(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,n]=e;return ye(r,n)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:fe(oe(Rr(t)))}class Nr extends h{constructor(t,r){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${ee(Q(t.abiItem))}\`, and`,`\`${r.type}\` in \`${ee(Q(r.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class Ne extends h{constructor({name:t,data:r,type:n="item"}){const s=t?` with name "${t}"`:r?` with data "${r}"`:"";super(`ABI ${n}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function B(e,t,r){const{checksumAddress:n,staticPosition:s}=r,i=be(t.type);if(i){const[o,c]=i;return jr(e,{...t,type:c},{checksumAddress:n,length:o,staticPosition:s})}if(t.type==="tuple")return Fr(e,t,{checksumAddress:n,staticPosition:s});if(t.type==="address")return Vr(e,{checksum:n});if(t.type==="bool")return kr(e);if(t.type.startsWith("bytes"))return Ur(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return _r(e,t);if(t.type==="string")return Hr(e,{staticPosition:s});throw new ge(t.type)}const Ve=32,re=32;function Vr(e,t={}){const{checksum:r=!1}=t,n=e.readBytes(32);return[(i=>r?de(i):i)(v(Et(n,-20))),32]}function jr(e,t,r){const{checksumAddress:n,length:s,staticPosition:i}=r;if(!s){const u=x(e.readBytes(re)),a=i+u,f=a+Ve;e.setPosition(a);const d=x(e.readBytes(Ve)),y=R(t);let p=0;const P=[];for(let I=0;I<d;++I){e.setPosition(f+(y?I*32:p));const[U,_]=B(e,t,{checksumAddress:n,staticPosition:f});p+=_,P.push(U)}return e.setPosition(i+32),[P,32]}if(R(t)){const u=x(e.readBytes(re)),a=i+u,f=[];for(let d=0;d<s;++d){e.setPosition(a+d*32);const[y]=B(e,t,{checksumAddress:n,staticPosition:a});f.push(y)}return e.setPosition(i+32),[f,32]}let o=0;const c=[];for(let u=0;u<s;++u){const[a,f]=B(e,t,{checksumAddress:n,staticPosition:i+o});o+=f,c.push(a)}return[c,o]}function kr(e){return[At(e.readBytes(32),{size:32}),32]}function Ur(e,t,{staticPosition:r}){const[n,s]=t.type.split("bytes");if(!s){const o=x(e.readBytes(32));e.setPosition(r+o);const c=x(e.readBytes(32));if(c===0)return e.setPosition(r+32),["0x",32];const u=e.readBytes(c);return e.setPosition(r+32),[v(u),32]}return[v(e.readBytes(Number.parseInt(s,10),32)),32]}function _r(e,t){const r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[n>48?$t(s,{signed:r}):x(s,{signed:r}),32]}function Fr(e,t,r){const{checksumAddress:n,staticPosition:s}=r,i=t.components.length===0||t.components.some(({name:u})=>!u),o=i?[]:{};let c=0;if(R(t)){const u=x(e.readBytes(re)),a=s+u;for(let f=0;f<t.components.length;++f){const d=t.components[f];e.setPosition(a+c);const[y,p]=B(e,d,{checksumAddress:n,staticPosition:a});c+=p,o[i?f:d?.name]=y}return e.setPosition(s+32),[o,32]}for(let u=0;u<t.components.length;++u){const a=t.components[u],[f,d]=B(e,a,{checksumAddress:n,staticPosition:s});o[i?u:a?.name]=f,c+=d}return[o,c]}function Hr(e,{staticPosition:t}){const r=x(e.readBytes(32)),n=t+r;e.setPosition(n);const s=x(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const i=e.readBytes(s,32),o=zt(Bt(i));return e.setPosition(t+32),[o,32]}function Mr({checksumAddress:e,parameters:t,values:r}){const n=[];for(let s=0;s<t.length;s++)n.push(pe({checksumAddress:e,parameter:t[s],value:r[s]}));return n}function pe({checksumAddress:e=!1,parameter:t,value:r}){const n=t,s=be(n.type);if(s){const[i,o]=s;return Dr(r,{checksumAddress:e,length:i,parameter:{...n,type:o}})}if(n.type==="tuple")return Qr(r,{checksumAddress:e,parameter:n});if(n.type==="address")return Gr(r,{checksum:e});if(n.type==="bool")return Yr(r);if(n.type.startsWith("uint")||n.type.startsWith("int")){const i=n.type.startsWith("int"),[,,o="256"]=Ze.exec(n.type)??[];return qr(r,{signed:i,size:Number(o)})}if(n.type.startsWith("bytes"))return Wr(r,{type:n.type});if(n.type==="string")return Kr(r);throw new ge(n.type)}function me(e){let t=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:c}=e[i];o?t+=32:t+=w(c)}const r=[],n=[];let s=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:c}=e[i];o?(r.push(m(t+s,{size:32})),n.push(c),s+=w(c)):r.push(c)}return g(...r,...n)}function Gr(e,t){const{checksum:r=!1}=t;return A(e,{strict:r}),{dynamic:!1,encoded:C(e.toLowerCase())}}function Dr(e,t){const{checksumAddress:r,length:n,parameter:s}=t,i=n===null;if(!Array.isArray(e))throw new rn(e);if(!i&&e.length!==n)throw new tn({expectedLength:n,givenLength:e.length,type:`${s.type}[${n}]`});let o=!1;const c=[];for(let u=0;u<e.length;u++){const a=pe({checksumAddress:r,parameter:s,value:e[u]});a.dynamic&&(o=!0),c.push(a)}if(i||o){const u=me(c);if(i){const a=m(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?g(a,u):a}}if(o)return{dynamic:!0,encoded:u}}return{dynamic:!1,encoded:g(...c.map(({encoded:u})=>u))}}function Wr(e,{type:t}){const[,r]=t.split("bytes"),n=w(e);if(!r){let s=e;return n%32!==0&&(s=O(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:g(C(m(n,{size:32})),s)}}if(n!==Number.parseInt(r,10))throw new rt({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:O(e)}}function Yr(e){if(typeof e!="boolean")throw new h(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:C(Me(e))}}function qr(e,{signed:t,size:r}){if(typeof r=="number"){const n=2n**(BigInt(r)-(t?1n:0n))-1n,s=t?-n-1n:0n;if(e>n||e<s)throw new St({max:n.toString(),min:s.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:m(e,{size:32,signed:t})}}function Kr(e){const t=oe(e),r=Math.ceil(w(t)/32),n=[];for(let s=0;s<r;s++)n.push(O(b(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:g(O(m(w(t),{size:32})),...n)}}function Qr(e,t){const{checksumAddress:r,parameter:n}=t;let s=!1;const i=[];for(let o=0;o<n.components.length;o++){const c=n.components[o],u=Array.isArray(e)?o:c.name,a=pe({checksumAddress:r,parameter:c,value:e[u]});i.push(a),a.dynamic&&(s=!0)}return{dynamic:s,encoded:s?me(i):g(...i.map(({encoded:o})=>o))}}function be(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function R(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(R);const r=be(e.type);return!!(r&&R({...e,type:r[1]}))}function Zr(e,t,r={}){const{as:n="Array",checksumAddress:s=!1}=r,i=typeof t=="string"?He(t):t,o=gr(i);if(H(i)===0&&e.length>0)throw new en;if(H(i)&&H(i)<32)throw new Xr({data:typeof t=="string"?t:v(t),parameters:e,size:H(i)});let c=0;const u=n==="Array"?[]:{};for(let a=0;a<e.length;++a){const f=e[a];o.setPosition(c);const[d,y]=B(o,f,{checksumAddress:s,staticPosition:0});c+=y,n==="Array"?u.push(d):u[f.name??a]=d}return u}function Jr(e,t,r){const{checksumAddress:n=!1}={};if(e.length!==t.length)throw new nt({expectedLength:e.length,givenLength:t.length});const s=Mr({checksumAddress:n,parameters:e,values:t}),i=me(s);return i.length===0?"0x":i}function ne(e,t){if(e.length!==t.length)throw new nt({expectedLength:e.length,givenLength:t.length});const r=[];for(let n=0;n<e.length;n++){const s=e[n],i=t[n];r.push(ne.encode(s,i))}return g(...r)}(function(e){function t(r,n,s=!1){if(r==="address"){const u=n;return A(u),C(u.toLowerCase(),s?32:0)}if(r==="string")return oe(n);if(r==="bytes")return n;if(r==="bool")return C(Me(n),s?32:1);const i=r.match(Ze);if(i){const[u,a,f="256"]=i,d=Number.parseInt(f,10)/8;return m(n,{size:s?32:d,signed:a==="int"})}const o=r.match(vr);if(o){const[u,a]=o;if(Number.parseInt(a,10)!==(n.length-2)/2)throw new rt({expectedSize:Number.parseInt(a,10),value:n});return O(n,s?32:0)}const c=r.match(Pr);if(c&&Array.isArray(n)){const[u,a]=c,f=[];for(let d=0;d<n.length;d++)f.push(t(a,n[d],!0));return f.length===0?"0x":g(...f)}throw new ge(r)}e.encode=t})(ne||(ne={}));function tt(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Le(e):e}class Xr extends h{constructor({data:t,parameters:r,size:n}){super(`Data size of ${n} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Lt(r)})`,`Data: ${t} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class en extends h{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class tn extends h{constructor({expectedLength:t,givenLength:r,type:n}){super(`Array length mismatch for type \`${n}\`. Expected: \`${t}\`. Given: \`${r}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class rt extends h{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${w(r)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class nt extends h{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${r}`].join(`
|
|
2
2
|
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class rn extends h{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class ge extends h{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function nn(e,t={}){return typeof e.chainId=="string"?st(e):{...e,...t.signature}}function st(e){const{address:t,chainId:r,nonce:n}=e,s=Er(e);return{address:t,chainId:Number(r),nonce:BigInt(n),...s}}function Un(e){return e.map(st)}function sn(e){const{address:t,chainId:r,nonce:n,...s}=e;return{address:t,chainId:m(r),nonce:m(n),...zr(s)}}function _n(e){return e.map(sn)}async function on(e,{address:t,blockNumber:r,blockTag:n="latest"}){const s=r!==void 0?l(r):void 0,i=await e.request({method:"eth_getCode",params:[t,s||n]},{dedupe:!!s});if(i!=="0x")return i}const it="0x6492649264926492649264926492649264926492649264926492649264926492";function an(e){if(b(e,-32)!==it)throw new fn(e)}function cn(e){const{data:t,signature:r,to:n}=e;return g(Jr(tt("address, bytes, bytes"),[n,t,r]),it)}function un(e){try{return an(e),!0}catch{return!1}}let fn=class extends h{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}};const dn="0x8010801080108010801080108010801080108010801080108010801080108010",ln=tt("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function ot(e){if(typeof e=="string"){if(b(e,-32)!==dn)throw new pn(e)}else le(e.authorization)}function hn(e){ot(e);const t=Tt(b(e,-64,-32)),r=b(e,-t-64,-64),n=b(e,0,-t-64),[s,i,o]=Zr(ln,r);return{authorization:nn({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:n,...o&&o!=="0x"?{data:o,to:i}:{}}}function yn(e){try{return ot(e),!0}catch{return!1}}class pn extends h{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}async function mn({address:e,authorization:t,signature:r}){return Z(J(e),await Ct({authorization:t,signature:r}))}function bn({r:e,s:t,to:r="hex",v:n,yParity:s}){const i=(()=>{if(s===0||s===1)return s;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),o=`0x${new qt.Signature(ze(e),ze(t)).toCompactHex()}${i===0?"1b":"1c"}`;return r==="hex"?o:Gt(o)}async function at(e,t){const{abi:r,address:n,args:s,functionName:i,...o}=t,c=ae({abi:r,args:s,functionName:i});try{const{data:u}=await D(e,Ge,"call")({...o,data:c,to:n});return Ot({abi:r,args:s,functionName:i,data:u||"0x"})}catch(u){throw Rt(u,{abi:r,address:n,args:s,docsPath:"/docs/contract/readContract",functionName:i})}}async function Hn(e,t){const{address:r,chain:n=e.chain,hash:s,erc6492VerifierAddress:i=t.universalSignatureVerifierAddress??n?.contracts?.erc6492Verifier?.address,multicallAddress:o=t.multicallAddress??n?.contracts?.multicall3?.address,mode:c="auto"}=t;if(n?.verifyHash)return await n.verifyHash(e,t);const u=(()=>{const a=t.signature;return Dt(a)?a:typeof a=="object"&&"r"in a&&"s"in a?bn(a):We(a)})();try{if(c==="eoa")try{if(Z(J(r),await Ae({hash:s,signature:u})))return!0}catch{}return yn(u)?await gn(e,{...t,multicallAddress:o,signature:u}):await xn(e,{...t,verifierAddress:i,signature:u})}catch(a){if(c!=="eoa")try{if(Z(J(r),await Ae({hash:s,signature:u})))return!0}catch{}if(a instanceof $)return!1;throw a}}async function gn(e,t){const{address:r,blockNumber:n,blockTag:s,hash:i,multicallAddress:o}=t,{authorization:c,data:u,signature:a,to:f}=hn(t.signature);if(await on(e,{address:r,blockNumber:n,blockTag:s})===j(["0xef0100",c.address]))return await wn(e,{address:r,blockNumber:n,blockTag:s,hash:i,signature:a});const y={address:c.address,chainId:Number(c.chainId),nonce:Number(c.nonce),r:l(c.r,{size:32}),s:l(c.s,{size:32}),yParity:c.yParity};if(!await mn({address:r,authorization:y}))throw new $;const P=await D(e,at,"readContract")({...o?{address:o}:{code:Nt},authorizationList:[y],abi:Wt,blockNumber:n,blockTag:"pending",functionName:"aggregate3",args:[[...u?[{allowFailure:!0,target:f??r,callData:u}]:[],{allowFailure:!0,target:r,callData:ae({abi:Ye,functionName:"isValidSignature",args:[i,a]})}]]});if(P[P.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new $}async function xn(e,t){const{address:r,factory:n,factoryData:s,hash:i,signature:o,verifierAddress:c,...u}=t,a=await(async()=>!n&&!s||un(o)?o:cn({data:s,signature:o,to:n}))(),f=c?{to:c,data:ae({abi:Be,functionName:"isValidSig",args:[r,i,a]}),...u}:{data:Vt({abi:Be,args:[r,i,a],bytecode:jt}),...u},{data:d}=await D(e,Ge,"call")(f).catch(y=>{throw y instanceof kt?new $:y});if(Yt(d??"0x0"))return!0;throw new $}async function wn(e,t){const{address:r,blockNumber:n,blockTag:s,hash:i,signature:o}=t;if((await D(e,at,"readContract")({address:r,abi:Ye,args:[i,o],blockNumber:n,blockTag:s,functionName:"isValidSignature"}).catch(u=>{throw u instanceof Ut?new $:u})).startsWith("0x1626ba7e"))return!0;throw new $}class $ extends Error{}export{le as A,$r as B,Vn as C,zr as D,de as E,fe as F,A as G,Er as H,Un as I,Br as J,_n as K,Sn as L,Xe as M,Ne as N,jn as O,X as P,Nn as Q,Ke as R,ue as a,Xt as b,er as c,An as d,$n as e,Le as f,bn as g,zn as h,on as i,Jr as j,kn as k,ye as l,Or as m,gr as n,Qe as o,Se as p,Rn as q,at as r,W as s,k as t,Tn as u,Hn as v,On as w,Ln as x,Bn as y,Je as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as v,i as f,b as a}from"./lit-element-Cn7T8F1W.js";import{n as d,r as w}from"./class-map-mFRv1nW8.js";import{o as M}from"./if-defined-DsPifBxM.js";import{w as pe,s as me,a as he,p as ve,M as g,S as ee,R as l,r as E,A as j,e as te,c as ie,C as m,b as H,d as fe,f as k,E as q,O as T,g as V,h as F,i as $,j as D,T as ge,k as be,l as ye,m as xe}from"./core-
|
|
1
|
+
import{a as v,i as f,b as a}from"./lit-element-Cn7T8F1W.js";import{n as d,r as w}from"./class-map-mFRv1nW8.js";import{o as M}from"./if-defined-DsPifBxM.js";import{w as pe,s as me,a as he,p as ve,M as g,S as ee,R as l,r as E,A as j,e as te,c as ie,C as m,b as H,d as fe,f as k,E as q,O as T,g as V,h as F,i as $,j as D,T as ge,k as be,l as ye,m as xe}from"./core-BGvtiIgG.js";import{c as u,U as Ce}from"./index-C9vcJp9T.js";import"./index-CqbvjyBi.js";import"./index-DRYOQXZX.js";import"./index-CYBDya_s.js";import"./index.es-XXBqJXMm.js";import"./index-nibyPLVP.js";import"./index-CJdot1dH.js";import"./index.es-DYgSAVrd.js";import"./browser-ponyfill-LG9Rjmfj.js";import"./NetworkUtil-DM5H1DOt.js";import"./sha2-D3ryOfi3.js";import"./W3MFrameProviderSingleton-dGwr0u32.js";import"./async-directive-DJs0ey8-.js";const p=ve({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),ke={state:p,subscribe(n){return he(p,()=>n(p))},subscribeKey(n,e){return me(p,n,e)},showTooltip({message:n,triggerRect:e,variant:t}){p.open=!0,p.message=n,p.triggerRect=e,p.variant=t},hide(){p.open=!1,p.message="",p.triggerRect={width:0,height:0,top:0,left:0}}},A=pe(ke),oe={isUnsupportedChainView(){return l.state.view==="UnsupportedChain"||l.state.view==="SwitchNetwork"&&l.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){g.shake();return}if(await ee.isSIWXCloseDisabled()){g.shake();return}g.close()}},Se=v`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
border-radius: clamp(0px, var(--wui-border-radius-l), 44px);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as b,b as d,a as ne}from"./lit-element-Cn7T8F1W.js";import{n as l,r as u}from"./class-map-mFRv1nW8.js";import{o as k}from"./if-defined-DsPifBxM.js";import{d as g,r as j,e as se,v as D,i as le}from"./index-
|
|
1
|
+
import{i as b,b as d,a as ne}from"./lit-element-Cn7T8F1W.js";import{n as l,r as u}from"./class-map-mFRv1nW8.js";import{o as k}from"./if-defined-DsPifBxM.js";import{d as g,r as j,e as se,v as D,i as le}from"./index-B2PoGJRP.js";import{c as m,U as te}from"./index-CwfOYq8B.js";import{M as x,Z as ie,R as c,k as ce,A as z,C as f,q as L,L as de,E as U,O as R,o as F,S as A,z as T,T as ue,_ as pe}from"./W3MFrameProviderSingleton-dGwr0u32.js";import{P as _}from"./index-DXs78xw9.js";import"./index-BvCGPTHO.js";import{H as q}from"./HelpersUtil-DFmhrbIH.js";import{C as V}from"./ConstantsUtil-BYRHWuZV.js";import"./index-D_m5AL3D.js";import"./index-D-YuFp2i.js";import"./index-Bv6LvzLS.js";import"./index-D8PaxcsI.js";import{S as he}from"./SwapController-SgAc8zJM.js";import"./index-DgDxBH9m.js";import"./index-CqbvjyBi.js";import"./index-DRYOQXZX.js";import"./index-CYBDya_s.js";import"./index-nibyPLVP.js";import"./index-D9ey6cqT.js";import"./sha2-D3ryOfi3.js";import"./hmac-BMnSt9Ou.js";import"./NetworkUtil-DM5H1DOt.js";import"./index.es-DYgSAVrd.js";import"./browser-ponyfill-LG9Rjmfj.js";import"./index-BF9Yx_yV.js";import"./index-BCiKer83.js";import"./index-0P32tQWj.js";import"./index-B6j-Tckn.js";import"./index-ak5cSl-l.js";import"./MathUtil-BGCe3rZ3.js";import"./index-TUD0QlWP.js";import"./index-Cz0JdeQb.js";const oe={isUnsupportedChainView(){return c.state.view==="UnsupportedChain"||c.state.view==="SwitchNetwork"&&c.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){x.shake();return}if(await ie.isSIWXCloseDisabled()){x.shake();return}(c.state.view==="DataCapture"||c.state.view==="DataCaptureOtpConfirm")&&ce.disconnect(),x.close()}},me=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
border-radius: clamp(0px, ${({borderRadius:e})=>e[8]}, 44px);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as B}from"./transactionReceipt-
|
|
1
|
+
import{f as B}from"./transactionReceipt-DA1xo-2g.js";import{h as g,m as N}from"./signing-tKzVzr3v.js";import{s as A}from"./sleep-mAKpSMLY.js";async function I(t){const e=await t({method:"eth_blockNumber"});return g(e)}async function E(t,e){const n=await t({method:"eth_getTransactionReceipt",params:[e.hash]});if(!n)throw new Error("Transaction receipt not found.");return B(n)}const x=5e3,y=1e3,k=500,D=2,T=10;function M(t){for(;t.length<T;)t.unshift(y);return t.reduce((n,i)=>n+i,0)/t.length}function R(t,e,n,i){let l=[],c=[],a=!1,o,r;const b=N({chain:e,client:t});async function p(){if(!a)return;try{const s=await I(b);if(!o||s>o){let m=[];if(o)for(let f=o+1n;f<=s;f++)m.push(BigInt(f));else m=[s];o=s;const w=Date.now();if(r){const f=(w-r)/m.length;c.push(f),c=c.slice(-T)}r=w;for(const f of m)for(const L of l)L(f)}}catch(s){i?i(s):console.error(`[watchBlockNumber]: Failed to poll for latest block number: ${s}`)}const h=M(c),u=Math.max(k,Math.min(x,Math.max(k,h)));await A(u/(n??D)),p()}return function(u,s){return l.push(u),a||(o=s,a=!0,p()),function(){l=l.filter(w=>w!==u),l.length===0&&(o=void 0,r=void 0,a=!1)}}}const _=new Map;function O(t){const{client:e,chain:n,onNewBlockNumber:i,overPollRatio:l,latestBlockNumber:c,onError:a}=t,o=n.id;let r=_.get(o);return r||(r=R(e,n,l,a),_.set(o,r)),r(i,c)}const P=100,d=new Map;function S(t){const{transactionHash:e,chain:n,client:i}=t,c=`${n.id}:tx_${e}`,a=t.maxBlocksWaitTime??P;if(d.has(c))return d.get(c);const o=new Promise((r,b)=>{e||b(new Error("Transaction has no transactionHash to wait for, did you execute it?"));const p=N({chain:n,client:i});let h=-1;const u=O({chain:n,client:i,onNewBlockNumber:async()=>{if(h++,h>=a){u(),b(new Error(`Transaction receipt for ${e} not found after ${a} blocks`));return}try{const s=await E(p,{hash:e});u(),r(s)}catch{}}})}).finally(()=>{d.delete(c)});return d.set(c,o),o}export{I as a,O as b,E as e,S as w};
|