@dcl/governance-site 2.5.0 → 2.5.1
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-689989f0.js → ConstantsUtil-c3a75781.js} +1 -1
- package/assets/{ExchangeController-88f78111.js → ExchangeController-de6066de.js} +1 -1
- package/assets/{HelpersUtil-40f31189.js → HelpersUtil-47bce835.js} +1 -1
- package/assets/{NetworkUtil-2fb81493.js → NetworkUtil-cfdab321.js} +1 -1
- package/assets/{ReownAuthentication-e5d1d4cc.js → ReownAuthentication-c1098727.js} +1 -1
- package/assets/{SwapController-f47e6f17.js → SwapController-6f3f28da.js} +1 -1
- package/assets/{UserAvatar-0c19fd64.js → UserAvatar-4217a7be.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-33e9645e.js → W3MFrameProviderSingleton-316899f0.js} +2 -2
- package/assets/{basic-509eb412.js → basic-d9c0f288.js} +1 -1
- package/assets/{biconomy-6fa3eb98.js → biconomy-bc04f7cc.js} +1 -1
- package/assets/{ccip-040f274b.js → ccip-d88eddf3.js} +1 -1
- package/assets/{ccip-6d1e4a15.js → ccip-e509a2bd.js} +1 -1
- package/assets/{chains-bae55e5f.js → chains-12910e1f.js} +1 -1
- package/assets/{common-f2e88a7e.js → common-583dfda9.js} +1 -1
- package/assets/{compat-b432550d.js → compat-000e5801.js} +1 -1
- package/assets/{controller-83cf739b.js → controller-5a843a75.js} +1 -1
- package/assets/{core-71a03396.js → core-1a166f08.js} +3 -3
- package/assets/{custom-7ae31f11.js → custom-3c5e7814.js} +1 -1
- package/assets/{data-capture-f1f485c2.js → data-capture-a27f6e5c.js} +1 -1
- package/assets/decimals-50f9fee1.js +1 -0
- package/assets/{decimals-9d5fec14.js → decimals-bddbc743.js} +1 -1
- package/assets/{email-be31d86e.js → email-0c5024d9.js} +1 -1
- package/assets/{embedded-wallet-41341ab4.js → embedded-wallet-d5992bd8.js} +1 -1
- package/assets/{engine-8d2b111b.js → engine-9b39863f.js} +1 -1
- package/assets/{estimate-l1-fee-8acb8860.js → estimate-l1-fee-69110584.js} +1 -1
- package/assets/eth_estimateGas-945ce595.js +1 -0
- package/assets/{eth_getStorageAt-2d8a4700.js → eth_getStorageAt-125a2bc1.js} +1 -1
- package/assets/{eth_getTransactionCount-273004ec.js → eth_getTransactionCount-6240f912.js} +1 -1
- package/assets/{ethereum-667be7dc.js → ethereum-0d579241.js} +1 -1
- package/assets/{execute-6c88dd5f.js → execute-264a98ed.js} +1 -1
- package/assets/{extractIPFS-640303a3.js → extractIPFS-d48a2b7b.js} +1 -1
- package/assets/features-7c8dc530.js +1 -0
- package/assets/{fetchTokenMetadata-1e138f21.js → fetchTokenMetadata-f32fb87e.js} +1 -1
- package/assets/{fortmatic-d34f42c3.js → fortmatic-5f1bb82e.js} +1 -1
- package/assets/{get-bytecode-8cb4e224.js → get-bytecode-7a8c6215.js} +1 -1
- package/assets/{get-ecosystem-wallet-info-ec712acc.js → get-ecosystem-wallet-info-0a9d1fa7.js} +1 -1
- package/assets/{getBalance-0308f38f.js → getBalance-e2e6d859.js} +1 -1
- package/assets/{getInstalledModules-17fa1a09.js → getInstalledModules-4e23fa8a.js} +1 -1
- package/assets/{getNFT-06eb1406.js → getNFT-5486b2f7.js} +1 -1
- package/assets/{getNFT-30795fe1.js → getNFT-74f5ae81.js} +1 -1
- package/assets/{hashBytecode-a29db705.js → hashBytecode-7a0e56f5.js} +1 -1
- package/assets/{hashTypedData-23a00dc9.js → hashTypedData-03b693eb.js} +1 -1
- package/assets/{hashTypedData-ba8e399b.js → hashTypedData-cc1589a7.js} +1 -1
- package/assets/{in-app-9acc158b.js → in-app-1d212717.js} +1 -1
- package/assets/{in-app-wallet-calls-48ca2694.js → in-app-wallet-calls-7fdb5823.js} +1 -1
- package/assets/{index-89cbc69d.js → index-06d7a58c.js} +1 -1
- package/assets/{index-355751ab.js → index-10c73e9d.js} +245 -245
- package/assets/{index-9ecf773e.js → index-19891b89.js} +1 -1
- package/assets/{index-2ebd7a81.js → index-206ffe7d.js} +1 -1
- package/assets/{index-f4401a12.js → index-20b33848.js} +1 -1
- package/assets/{index-6e64d31e.js → index-23dd6251.js} +2 -2
- package/assets/{index-2124b7cd.js → index-2cab452e.js} +1 -1
- package/assets/{index-9c2f8893.js → index-2f82abe0.js} +1 -1
- package/assets/{index-a5c29e80.js → index-30a8f53e.js} +1 -1
- package/assets/{index-4bc8eee8.js → index-31022e63.js} +1 -1
- package/assets/{index-a5876580.js → index-32a45902.js} +1 -1
- package/assets/{index-b7605561.js → index-3b678484.js} +1 -1
- package/assets/{index-3cdab001.js → index-3bc5c9df.js} +1 -1
- package/assets/{index-d7ed4af8.js → index-3d19d06c.js} +1 -1
- package/assets/{index-1368749b.js → index-401eba13.js} +1 -1
- package/assets/{index-f4841b7d.js → index-5071722a.js} +1 -1
- package/assets/{index-e7f3149f.css → index-59db4a58.css} +4 -4
- package/assets/{index-e6ba4bbe.js → index-5d7b6c51.js} +1 -1
- package/assets/{index-78689969.js → index-5ece9033.js} +1 -1
- package/assets/{index-33bd3c33.js → index-610c7efb.js} +1 -1
- package/assets/{index-a91bb597.js → index-69a0492a.js} +1 -1
- package/assets/{index-76dbec48.js → index-6d8da0b7.js} +1 -1
- package/assets/{index-863b5c53.js → index-6ec6d7c7.js} +1 -1
- package/assets/{index-ec8cf158.js → index-780a2232.js} +1 -1
- package/assets/{index-b40ed19e.js → index-7ad05b06.js} +1 -1
- package/assets/{index-e332724b.js → index-7f01a27a.js} +1 -1
- package/assets/{index-69ac8519.js → index-877ffe4a.js} +1 -1
- package/assets/{index-e6d2ed90.js → index-8aeaab91.js} +1 -1
- package/assets/{index-66d53073.js → index-8cbb4ff7.js} +2 -2
- package/assets/{index-e2d1a06e.js → index-8d81098b.js} +1 -1
- package/assets/{index-3ad96675.js → index-8fa35f13.js} +1 -1
- package/assets/{index-5f847edd.js → index-93724bad.js} +2 -2
- package/assets/index-9bee2cc7.js +77 -0
- package/assets/{index-2e071cd2.js → index-9d37fa54.js} +1 -1
- package/assets/{index-57dbcd5d.js → index-a151f6d7.js} +1 -1
- package/assets/{index-54323fc3.js → index-a22875e4.js} +2 -2
- package/assets/{index-d7bf28d3.js → index-a69ba1cc.js} +1 -1
- package/assets/{index-6c8c5091.js → index-a6a44c61.js} +1 -1
- package/assets/{index-b41b719c.js → index-aae2726c.js} +1 -1
- package/assets/{index-8bdd54b7.js → index-ad63abcf.js} +1 -1
- package/assets/{index-375e28ad.js → index-b3691f6b.js} +1 -1
- package/assets/{index-276c1c99.js → index-b3889ac8.js} +1 -1
- package/assets/{index-2537319c.js → index-bb13bbcd.js} +1 -1
- package/assets/{index-05f3c18a.js → index-bcedc0e6.js} +1 -1
- package/assets/{index-9e3730d4.js → index-c49dee70.js} +1 -1
- package/assets/{index-c7839713.js → index-cafc0996.js} +1 -1
- package/assets/{index-1c9749d2.js → index-d22cfc35.js} +1 -1
- package/assets/{index-9c119afb.js → index-d2f37bee.js} +1 -1
- package/assets/{index-ffdeacb2.js → index-d44b19e2.js} +1 -1
- package/assets/{index-8b5a06dd.js → index-d77a63d3.js} +1 -1
- package/assets/{index-ab687c6f.js → index-e332040b.js} +1 -1
- package/assets/{index-5b4e7208.js → index-e583ff4e.js} +1 -1
- package/assets/{index-5947dd15.js → index-e9ab8876.js} +1 -1
- package/assets/{index-3c50ab3b.js → index-f49c89c1.js} +1 -1
- package/assets/{index-3d2bada3.js → index-fe892b11.js} +1 -1
- package/assets/{index.es-2aacf970.js → index.es-0f7943d8.js} +1 -1
- package/assets/{index.es-ce0aa5fd.js → index.es-30a0ec70.js} +3 -3
- package/assets/{index.es-ac60fff2.js → index.es-4520fb10.js} +1 -1
- package/assets/{index.web-1837e57d.js → index.web-e2526e19.js} +1 -1
- package/assets/{localBatchGatewayRequest-b2e2be89.js → localBatchGatewayRequest-ff5d42f6.js} +1 -1
- package/assets/{native-8dd45a06.js → native-3e8a86bb.js} +1 -1
- package/assets/{networks-2b49f856.js → networks-fc1b1902.js} +1 -1
- package/assets/{onramp-7ba26b97.js → onramp-cf41485f.js} +1 -1
- package/assets/{openzeppelin-56d83a0f.js → openzeppelin-e72c7daa.js} +1 -1
- package/assets/{ownerOf-558180d2.js → ownerOf-c09a8f45.js} +1 -1
- package/assets/parseNft-147a451f.js +1 -0
- package/assets/{parseSignature-16c7c561.js → parseSignature-6b0b4698.js} +2 -2
- package/assets/{parseSignature-7a759338.js → parseSignature-b975d9a6.js} +1 -1
- package/assets/{passkeys-fd92f407.js → passkeys-bb25d43e.js} +1 -1
- package/assets/{pay-with-exchange-542b5282.js → pay-with-exchange-cd96ece6.js} +1 -1
- package/assets/{prepare-contract-call-ac31a985.js → prepare-contract-call-4be4cc68.js} +1 -1
- package/assets/{qr-overlay-548b2074.js → qr-overlay-fd67e1ca.js} +1 -1
- package/assets/{receive-9119a0fc.js → receive-9ddd4e2d.js} +1 -1
- package/assets/{redirect-state-202ec690.js → redirect-state-301cb22c.js} +1 -1
- package/assets/{resolveImplementation-ffd32467.js → resolveImplementation-6b55308f.js} +1 -1
- package/assets/{rpc-4fa5fbde.js → rpc-83ca4b71.js} +1 -1
- package/assets/{secp256k1-61174a68.js → secp256k1-44255658.js} +1 -1
- package/assets/{secp256k1-587b447b.js → secp256k1-4ab38443.js} +1 -1
- package/assets/{secp256k1-2e39eaab.js → secp256k1-ac683ebc.js} +1 -1
- package/assets/{send-5e9549ca.js → send-7e34f1e6.js} +1 -1
- package/assets/{send-batch-transaction-16b5b747.js → send-batch-transaction-429c82ee.js} +1 -1
- package/assets/{send-eip712-transaction-67b51817.js → send-eip712-transaction-20a9b9ed.js} +1 -1
- package/assets/send-gasless-transaction-0435da18.js +1 -0
- package/assets/{send-transaction-5984dc09.js → send-transaction-c3053b90.js} +1 -1
- package/assets/{session-proposal-548687be.js → session-proposal-d1473b74.js} +1 -1
- package/assets/{session-request-543a34de.js → session-request-f0a8f695.js} +1 -1
- package/assets/{sha256-865a5e2e.js → sha256-937f482f.js} +1 -1
- package/assets/{signing-67cb53a5.js → signing-6d6682ec.js} +2 -2
- package/assets/{socials-1c5f45aa.js → socials-d1713bee.js} +1 -1
- package/assets/{swaps-a0b58cae.js → swaps-8bad12fe.js} +1 -1
- package/assets/{thirdweb-d54893e0.js → thirdweb-73096eef.js} +2 -2
- package/assets/{to-serializable-transaction-2ea802ff.js → to-serializable-transaction-9e540f8c.js} +2 -2
- package/assets/{totalSupply-f714505e.js → totalSupply-7e83596b.js} +1 -1
- package/assets/{transaction-e500e7c4.js → transaction-ea614a5a.js} +1 -1
- package/assets/{transactionReceipt-c6fe2381.js → transactionReceipt-1e425ab1.js} +1 -1
- package/assets/{transactions-9a79e8f9.js → transactions-a47e2cb5.js} +1 -1
- package/assets/{tslib.es6-b444c8f1.js → tslib.es6-24024d67.js} +1 -1
- package/assets/{utils-74c631d9.js → utils-dddc86ba.js} +1 -1
- package/assets/{verifyHash-34edded7.js → verifyHash-b21b75c2.js} +1 -1
- package/assets/{w3m-modal-0795c078.js → w3m-modal-e914d462.js} +1 -1
- package/assets/{w3m-modal-906aa735.js → w3m-modal-ff2f112d.js} +1 -1
- package/assets/{wait-for-tx-receipt-dbf6b521.js → wait-for-tx-receipt-50389b4e.js} +1 -1
- package/assets/{wallets-331c410d.js → wallets-4e23dd0f.js} +4 -4
- package/assets/{web-connector-3a1204fd.js → web-connector-351693f5.js} +2 -2
- package/assets/{writeContract-f6b81199.js → writeContract-03e44e49.js} +2 -2
- package/assets/{zora-sepolia-eaf59a0b.js → zora-sepolia-72e60034.js} +1 -1
- package/assets/{zoraTestnet-55836178.js → zoraTestnet-1485f0af.js} +1 -1
- package/index.html +4 -4
- package/package.json +3 -3
- package/assets/decimals-37678a25.js +0 -1
- package/assets/eth_estimateGas-79dc1763.js +0 -1
- package/assets/features-0025dc16.js +0 -1
- package/assets/index-7ee82e4f.js +0 -77
- package/assets/parseNft-93d99682.js +0 -1
- package/assets/send-gasless-transaction-8bdf3649.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as Lr}from"./index-
|
|
1
|
+
import{w as Lr}from"./index-e583ff4e.js";import{e as xr,v as Cr,b as H,i as me,w as Fe,f as Ur,x as Or}from"./index-10c73e9d.js";var Te={exports:{}},Ae={},Ne={};Ne.byteLength=kr;Ne.toByteArray=jr;Ne.fromByteArray=Hr;var ie=[],te=[],Dr=typeof Uint8Array<"u"?Uint8Array:Array,Le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Ee=0,Pr=Le.length;Ee<Pr;++Ee)ie[Ee]=Le[Ee],te[Le.charCodeAt(Ee)]=Ee;te["-".charCodeAt(0)]=62;te["_".charCodeAt(0)]=63;function Br(R){var h=R.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=R.indexOf("=");S===-1&&(S=h);var w=S===h?0:4-S%4;return[S,w]}function kr(R){var h=Br(R),S=h[0],w=h[1];return(S+w)*3/4-w}function qr(R,h,S){return(h+S)*3/4-S}function jr(R){var h,S=Br(R),w=S[0],I=S[1],g=new Dr(qr(R,w,I)),c=0,i=I>0?w-4:w,l;for(l=0;l<i;l+=4)h=te[R.charCodeAt(l)]<<18|te[R.charCodeAt(l+1)]<<12|te[R.charCodeAt(l+2)]<<6|te[R.charCodeAt(l+3)],g[c++]=h>>16&255,g[c++]=h>>8&255,g[c++]=h&255;return I===2&&(h=te[R.charCodeAt(l)]<<2|te[R.charCodeAt(l+1)]>>4,g[c++]=h&255),I===1&&(h=te[R.charCodeAt(l)]<<10|te[R.charCodeAt(l+1)]<<4|te[R.charCodeAt(l+2)]>>2,g[c++]=h>>8&255,g[c++]=h&255),g}function Wr(R){return ie[R>>18&63]+ie[R>>12&63]+ie[R>>6&63]+ie[R&63]}function $r(R,h,S){for(var w,I=[],g=h;g<S;g+=3)w=(R[g]<<16&16711680)+(R[g+1]<<8&65280)+(R[g+2]&255),I.push(Wr(w));return I.join("")}function Hr(R){for(var h,S=R.length,w=S%3,I=[],g=16383,c=0,i=S-w;c<i;c+=g)I.push($r(R,c,c+g>i?i:c+g));return w===1?(h=R[S-1],I.push(ie[h>>2]+ie[h<<4&63]+"==")):w===2&&(h=(R[S-2]<<8)+R[S-1],I.push(ie[h>>10]+ie[h>>4&63]+ie[h<<2&63]+"=")),I.join("")}var er={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */er.read=function(R,h,S,w,I){var g,c,i=I*8-w-1,l=(1<<i)-1,v=l>>1,_=-7,d=S?I-1:0,b=S?-1:1,T=R[h+d];for(d+=b,g=T&(1<<-_)-1,T>>=-_,_+=i;_>0;g=g*256+R[h+d],d+=b,_-=8);for(c=g&(1<<-_)-1,g>>=-_,_+=w;_>0;c=c*256+R[h+d],d+=b,_-=8);if(g===0)g=1-v;else{if(g===l)return c?NaN:(T?-1:1)*(1/0);c=c+Math.pow(2,w),g=g-v}return(T?-1:1)*c*Math.pow(2,g-w)};er.write=function(R,h,S,w,I,g){var c,i,l,v=g*8-I-1,_=(1<<v)-1,d=_>>1,b=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=w?0:g-1,B=w?1:-1,N=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(i=isNaN(h)?1:0,c=_):(c=Math.floor(Math.log(h)/Math.LN2),h*(l=Math.pow(2,-c))<1&&(c--,l*=2),c+d>=1?h+=b/l:h+=b*Math.pow(2,1-d),h*l>=2&&(c++,l/=2),c+d>=_?(i=0,c=_):c+d>=1?(i=(h*l-1)*Math.pow(2,I),c=c+d):(i=h*Math.pow(2,d-1)*Math.pow(2,I),c=0));I>=8;R[S+T]=i&255,T+=B,i/=256,I-=8);for(c=c<<I|i,v+=I;v>0;R[S+T]=c&255,T+=B,c/=256,v-=8);R[S+T-B]|=N*128};/*!
|
|
2
2
|
* The buffer module from node.js, for the browser.
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as L}from"./index-
|
|
1
|
+
import{b as L}from"./index-10c73e9d.js";const w="rpc.thirdweb.com",A="social.thirdweb.com",R="embedded-wallet.thirdweb.com",x="pay.thirdweb.com",$="storage.thirdweb.com",v="bundler.thirdweb.com",C="c.thirdweb.com",N="insight.thirdweb.com",O="engine.thirdweb.com",M="bridge.thirdweb.com";let T={analytics:C,bridge:M,bundler:v,engineCloud:O,inAppWallet:R,insight:N,pay:x,rpc:w,social:A,storage:$};const H=e=>{T={analytics:e.analytics??C,bridge:e.bridge??M,bundler:e.bundler??v,engineCloud:e.engineCloud??O,inAppWallet:e.inAppWallet??R,insight:e.insight??N,pay:e.pay??x,rpc:e.rpc??w,social:e.social??A,storage:e.storage??$}},l=()=>T,V=e=>{const t=T[e];return t.startsWith("localhost")?`http://${t}`:`https://${t}`};let P=null;const X=e=>{P=e},k=()=>P,We=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_RPC_URL:w,getServiceKey:k,getThirdwebBaseUrl:V,getThirdwebDomains:l,setServiceKey:X,setThirdwebDomains:H},Symbol.toStringTag,{value:"Module"})),G="5.121.1";class Q extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const I=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Y(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?"mobile":typeof navigator<"u"?"browser":"node"}function q(e){for(let t=0,n=I.length;t<n;t++){const[r,s]=I[t];if(s.exec(e))return r}return null}function U(e){return e.split(".").length===3}const J=typeof L<"u"&&{}&&!1,Ie=typeof L<"u"&&{}&&!1,Z=6e4;function ee(e,t){async function n(r,s){const{requestTimeoutMs:c=Z,useAuthToken:o,...y}=s||{};let i=y.headers?new Headers(y.headers):typeof r=="object"?r.headers:void 0;const f=typeof r=="string"?r:r.url;if(_(f)){i||(i=new Headers);const p=o&&e.secretKey&&U(e.secretKey)?e.secretKey:void 0,S=e.secretKey&&!U(e.secretKey)?e.secretKey:void 0,m=e.clientId;p&&se(f)?(i.set("authorization",`Bearer ${p}`),e.teamId&&i.set("x-team-id",e.teamId),m&&i.set("x-client-id",m)):p&&!ne(f)&&!re(f)?(i.set("authorization",`Bearer ${p}`),e.teamId&&i.set("x-team-id",e.teamId)):(S&&i.set("x-secret-key",S),m&&i.set("x-client-id",m)),t&&(i.set("x-ecosystem-id",t.id),t.partnerId&&i.set("x-ecosystem-partner-id",t.partnerId));for(const[K,z]of B())i.set(K,z);const W=k();W&&i.set("x-service-api-key",W)}let u,g;return c&&(u=new AbortController,g=setTimeout(()=>{u==null||u.abort("timeout")},c)),fetch(r,{...y,headers:i,signal:u==null?void 0:u.signal}).finally(()=>{g&&clearTimeout(g)})}return n}const te=[".thirdweb.com",".ipfscdn.io",".thirdweb.dev",".thirdweb-dev.com",".thirdwebstorage-dev.com"],a=new Q(4096);function _(e){if(a.has(e))return a.get(e);try{const{hostname:t}=new URL(e);try{if(J&&t==="localhost")return a.set(e,!0),!0}catch{}const n=te.some(r=>t.endsWith(r));return a.set(e,n),n}catch{return a.set(e,!1),!1}}function ne(e){try{const{hostname:t}=new URL(e);return t.startsWith("pay.")}catch{return!1}}function re(e){try{const{hostname:t}=new URL(e);return t.startsWith("in-app-wallet.")||t.startsWith("embedded-wallet.")}catch{return!1}}function se(e){try{const{hostname:t}=new URL(e);return t.endsWith(".bundler.thirdweb.com")||t.endsWith(".bundler.thirdweb-dev.com")}catch{return!1}}const ie="unified-sdk";let h;function B(){if(h)return h;let e=null;typeof navigator<"u"&&(e=q(navigator.userAgent));let t;return typeof globalThis<"u"&&"Application"in globalThis&&(t=globalThis.Application.applicationId),h=Object.entries({"x-sdk-name":ie,"x-sdk-os":e?ce(e):"unknown","x-sdk-platform":Y(),"x-sdk-version":G,...t?{"x-bundle-id":t}:{}}),h}function ce(e){const t=e.toLowerCase();if(t.startsWith("win"))return"win";switch(e){case"Mac OS":return"mac";case"iOS":return"ios";case"Android OS":return"android";default:return t.replace(/\s/gi,"_")}}const Ue=Object.freeze(Object.defineProperty({__proto__:null,IS_THIRDWEB_URL_CACHE:a,getClientFetch:ee,getPlatformHeaders:B,isThirdwebUrl:_},Symbol.toStringTag,{value:"Module"})),oe=new Map,ue=new Map;function ae(e){const t=(s,c)=>({clear:()=>c.delete(s),get:()=>c.get(s),set:o=>c.set(s,o)}),n=t(e,oe),r=t(e,ue);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function F(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=ae(t),s=r.response.get();if(s&&n>0&&Date.now()-s.created.getTime()<n)return s.data;let c=r.promise.get();c||(c=e(),r.promise.set(c));try{const o=await c;return r.response.set({created:new Date,data:o}),o}finally{r.promise.clear()}}const d=new Map;function de(e){const t=l().rpc;if(typeof e=="number")return{id:e,rpc:`https://${e}.${t}`};if(he(e))return j(e);if(me(e))return D(e);let n=e.rpc;n||(n=`https://${e.id}.${t}`);const r={...e,rpc:n};return d.set(e.id,r),r}function le(e){for(const t of e)d.set(t.id,t)}function fe(e){if(d.has(e))return d.get(e);const t=l().rpc;return{id:e,rpc:`https://${e}.${t}`}}function pe(e){return d.get(e)}function me(e){return"rpc"in e&&Array.isArray(e.rpc)&&"slug"in e}function D(e){var n;const t=l().rpc;return{blockExplorers:(n=e==null?void 0:e.explorers)==null?void 0:n.map(r=>({apiUrl:r.url,name:r.name,url:r.url})),faucets:e.faucets?[...e.faucets]:void 0,icon:e.icon,id:e.chainId,name:e.name,nativeCurrency:{decimals:e.nativeCurrency.decimals,name:e.nativeCurrency.name,symbol:e.nativeCurrency.symbol},rpc:e.rpc[0]??`https://${e.chainId}.${t}`,testnet:e.testnet?!0:void 0}}function he(e){return"rpcUrls"in e&&!("rpc"in e)}function j(e){const t=l().rpc;return{blockExplorers:e!=null&&e.blockExplorers?Object.values(e==null?void 0:e.blockExplorers).map(n=>({apiUrl:n.apiUrl,name:n.name,url:n.url})):[],id:e.id,name:e.name,nativeCurrency:{decimals:e.nativeCurrency.decimals,name:e.nativeCurrency.name,symbol:e.nativeCurrency.symbol},rpc:e.rpcUrls.default.http[0]??`https://${e.id}.${t}`,testnet:e.testnet?!0:void 0}}function we(e){const t=l().rpc;if(typeof e.chain=="number")return`https://${e.chain}.${t}/${e.client.clientId}`;const{rpc:n}=e.chain;if(_(n)){const r=new URL(e.chain.rpc.replace(w,t));return(r.pathname==="/"||r.pathname.startsWith("/$"))&&(r.pathname=`/${e.client.clientId}`),r.toString()}return n}async function be(e){var t;return(t=e.nativeCurrency)!=null&&t.symbol?e.nativeCurrency.symbol:b(e).then(n=>n.nativeCurrency.symbol).catch(()=>"ETH")}async function ye(e){var t;return(t=e.nativeCurrency)!=null&&t.decimals?e.nativeCurrency.decimals:b(e).then(n=>n.nativeCurrency.decimals).catch(()=>18)}async function ge(e){var t;return(t=e.nativeCurrency)!=null&&t.name?e.nativeCurrency.name:b(e).then(n=>n.nativeCurrency.name).catch(()=>"ETH")}function b(e){const t=e.id;return F(async()=>{try{const n=await fetch(`https://api.thirdweb.com/v1/chains/${t}`);if(!n.ok)throw new Error(`Failed to fetch chain data for chainId ${t}. ${n.status} ${n.statusText}`);const r=await n.json();if(r.error)throw new Error(`Failed to fetch chain data for chainId ${t}`);if(!r.data)throw new Error(`Failed to fetch chain data for chainId ${t}`);const s=r.data;return E(e,s)}catch{return E(e)}},{cacheKey:`chain:${t}`,cacheTime:5*60*1e3})}async function Te(){return F(async()=>{const e=await fetch("https://api.thirdweb.com/v1/chains/services?service=insight");if(!e.ok)throw new Error(`Failed to fetch services. ${e.status} ${e.statusText}`);const t=await e.json();return Object.keys(t.data).map(n=>Number(n))},{cacheKey:"chain:insight-enabled",cacheTime:24*60*60*1e3})}function _e(e){var t;return{blockExplorers:(t=e.explorers)==null?void 0:t.map(n=>({apiUrl:n.url,name:n.name,url:n.url})),faucets:e.faucets?[...e.faucets]:void 0,icon:e.icon,id:e.chainId,name:e.name,nativeCurrency:e.nativeCurrency,rpc:e.rpc[0]||"",testnet:e.testnet===!0?!0:void 0}}function E(e,t){var r;const n=e.nativeCurrency?{...t==null?void 0:t.nativeCurrency,...e.nativeCurrency}:t==null?void 0:t.nativeCurrency;return{...t,chain:(t==null?void 0:t.chain)||e.name||"",chainId:e.id||(t==null?void 0:t.chainId)||-1,explorers:((r=e.blockExplorers)==null?void 0:r.map(s=>({name:s.name,standard:"EIP3091",url:s.url})))||(t==null?void 0:t.explorers),icon:e.icon||(t==null?void 0:t.icon),name:e.name||(t==null?void 0:t.name)||"",nativeCurrency:{decimals:(n==null?void 0:n.decimals)||18,name:(n==null?void 0:n.name)||"",symbol:(n==null?void 0:n.symbol)||""},rpc:e.rpc?[e.rpc]:(t==null?void 0:t.rpc)||[""],shortName:(t==null?void 0:t.shortName)||e.name||"",slug:(t==null?void 0:t.slug)||e.name||"",stackType:(t==null?void 0:t.stackType)||"",testnet:e.testnet||(t==null?void 0:t.testnet)||!1}}const Ee=Object.freeze(Object.defineProperty({__proto__:null,CUSTOM_CHAIN_MAP:d,cacheChains:le,convertApiChainToChain:_e,convertLegacyChain:D,convertViemChain:j,defineChain:de,getCachedChain:fe,getCachedChainIfExists:pe,getChainDecimals:ye,getChainMetadata:b,getChainNativeCurrencyName:ge,getChainSymbol:be,getInsightEnabledChainIds:Te,getRpcUrlForChain:we},Symbol.toStringTag,{value:"Module"}));export{Ie as I,Q as L,fe as a,we as b,V as c,de as d,ee as e,l as f,Te as g,pe as h,_ as i,J as j,U as k,b as l,q as m,be as n,ye as o,ge as p,le as q,We as r,Ue as s,Ee as u,F as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ag as D,q as _,r as k,ah as ae,ai as xt,s as wt,aj as Pt,ak as vt,al as It,am as Et,an as At,k as j,ao as T,ap as $t,aq as zt,ar as Bt,as as St,at as Lt,au as ze,av as De,aw as We,ax as Tt,ay as Be,az as Se,aA as Ct,aB as Le,aC as Rt,aD as ce,aE as x,aF as Ot,aG as ue,aH as w,aI as y,aJ as Ut,aK as W,aL as Vt,aM as b,aN as g,aO as m,aP as fe,aQ as Ye,aR as Nt,aS as Te,aT as _t,aU as I,aV as kt,aW as jt,aX as Ft,aY as Ht,aZ as V,a_ as N,a$ as qe,b0 as Mt,b1 as de,b2 as M,b3 as Gt,b4 as X,ac as Dt,b5 as Wt,i as ee,b6 as Yt,a0 as te,ad as le,a8 as Y,c as Ke,ae as qt,b7 as Kt,b8 as Ce,b9 as Zt,ba as Jt,bb as Qt,bc as Xt,bd as en}from"./writeContract-f6b81199.js";import{t as Re,a0 as he,a1 as tn,B as Ze,h as nn,a2 as rn,n as l,f as Je,a3 as G,Y as Oe,a4 as sn,b as on,$ as an,a5 as Qe,a6 as Ue,a7 as cn}from"./createBatchScheduler-7c9ada66.js";import{s as ye}from"./secp256k1-61174a68.js";function Wr(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return s=>{const i=typeof s=="function"?s(r):s,o={...r,...i};return Object.assign(o,{extend:n(o)})}}return Object.assign(t,{extend:n(t)})}function Yr(){return{}}function un(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:r,nonce:s,...i}=n,o=n.address;t.push([r?Re(r):"0x",o,s?Re(s):"0x",...F({},i)])}return t}function fn(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:r}=n,s=n.address;if(!_(s))throw new k({address:s});if(r<0)throw new D({chainId:r})}pe(e)}function dn(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new xt;for(const n of t){const r=nn(n),s=rn(wt(n,0,1));if(r!==32)throw new Pt({hash:n,size:r});if(s!==vt)throw new It({hash:n,version:s})}}pe(e)}function pe(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new D({chainId:t});if(s&&!_(s))throw new k({address:s});if(r&&r>ae)throw new he({maxFeePerGas:r});if(n&&r&&n>r)throw new tn({maxFeePerGas:r,maxPriorityFeePerGas:n})}function ln(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i}=e;if(t<=0)throw new D({chainId:t});if(i&&!_(i))throw new k({address:i});if(n||s)throw new Ze("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>ae)throw new he({maxFeePerGas:r})}function hn(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i}=e;if(i&&!_(i))throw new k({address:i});if(typeof t<"u"&&t<=0)throw new D({chainId:t});if(n||s)throw new Ze("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>ae)throw new he({maxFeePerGas:r})}function q(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:s}=e[n];for(let i=0;i<s.length;i++)if(s[i].length-2!==64)throw new Et({storageKey:s[i]});if(!_(r,{strict:!1}))throw new k({address:r});t.push([r,s])}return t}function qr(e,t){const n=At(e);return n==="eip1559"?mn(e,t):n==="eip2930"?bn(e,t):n==="eip4844"?pn(e,t):n==="eip7702"?yn(e,t):gn(e,t)}function yn(e,t){const{authorizationList:n,chainId:r,gas:s,nonce:i,to:o,value:c,maxFeePerGas:u,maxPriorityFeePerGas:a,accessList:f,data:d}=e;fn(e);const p=q(f),h=un(n);return j(["0x04",T([l(r),i?l(i):"0x",a?l(a):"0x",u?l(u):"0x",s?l(s):"0x",o??"0x",c?l(c):"0x",d??"0x",p,h,...F(e,t)])])}function pn(e,t){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:a,accessList:f,data:d}=e;dn(e);let p=e.blobVersionedHashes,h=e.sidecars;if(e.blobs&&(typeof p>"u"||typeof h>"u")){const $=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(U=>Je(U)),H=e.kzg,O=$t({blobs:$,kzg:H});if(typeof p>"u"&&(p=zt({commitments:O})),typeof h>"u"){const U=Bt({blobs:$,commitments:O,kzg:H});h=St({blobs:$,commitments:O,proofs:U})}}const P=q(f),E=[l(n),s?l(s):"0x",a?l(a):"0x",u?l(u):"0x",r?l(r):"0x",i??"0x",o?l(o):"0x",d??"0x",P,c?l(c):"0x",p??[],...F(e,t)],A=[],v=[],R=[];if(h)for(let $=0;$<h.length;$++){const{blob:H,commitment:O,proof:U}=h[$];A.push(H),v.push(O),R.push(U)}return j(["0x03",h?T([E,A,v,R]):T(E)])}function mn(e,t){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:a,data:f}=e;pe(e);const d=q(a),p=[l(n),s?l(s):"0x",u?l(u):"0x",c?l(c):"0x",r?l(r):"0x",i??"0x",o?l(o):"0x",f??"0x",d,...F(e,t)];return j(["0x02",T(p)])}function bn(e,t){const{chainId:n,gas:r,data:s,nonce:i,to:o,value:c,accessList:u,gasPrice:a}=e;ln(e);const f=q(u),d=[l(n),i?l(i):"0x",a?l(a):"0x",r?l(r):"0x",o??"0x",c?l(c):"0x",s??"0x",f,...F(e,t)];return j(["0x01",T(d)])}function gn(e,t){const{chainId:n=0,gas:r,data:s,nonce:i,to:o,value:c,gasPrice:u}=e;hn(e);let a=[i?l(i):"0x",u?l(u):"0x",r?l(r):"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(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const h=27n+(t.v===27n?0n:1n);if(t.v!==h)throw new Lt({v:t.v});return h})(),d=G(t.r),p=G(t.s);a=[...a,l(f),d==="0x00"?"0x":d,p==="0x00"?"0x":p]}else n>0&&(a=[...a,l(n),"0x","0x"]);return T(a)}function F(e,t){const n=t??e,{v:r,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof s>"u")return[];const i=G(n.r),o=G(n.s);return[(()=>typeof s=="number"?s?l(1):"0x":r===0n?"0x":r===1n?l(1):r===27n?"0x":l(1))(),i==="0x00"?"0x":i,o==="0x00"?"0x":o]}function Ve(e){let t;if(typeof e=="string")t=ze(e);else{const n=De(e),r=e.length;for(let s=0;s<r;s++){const i=e[s];if(!We(i)){t=ze(i,n);break}}}if(!t)throw new Tt({signature:e});return t}function Ne(e){const t=[];if(typeof e=="string"){const n=Be(e),r=n.length;for(let s=0;s<r;s++)t.push(Se(n[s],{modifiers:Le}))}else{const n=De(e),r=e.length;for(let s=0;s<r;s++){const i=e[s];if(We(i))continue;const o=Be(i),c=o.length;for(let u=0;u<c;u++)t.push(Se(o[u],{modifiers:Le,structs:n}))}}if(t.length===0)throw new Ct({params:e});return t}function K(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Rt(ce(e));return n==="Bytes"?r:x(r)}function Kr(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Ot(ce(e));return n==="Bytes"?r:x(r)}function Zr(e){return ue(e)&&w(e)===32}const xn={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 Pn({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new wn({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new _e({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 _e({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 n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+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 n=this.inspectBytes(e);return this.position+=t??e,n},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 me(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(xn);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class _e extends y{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class wn extends y{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class Pn extends y{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function Jr(e){return vn(e,"Hex")}function vn(e,t){const n=t??(typeof e=="string"?"Hex":"Bytes"),r=(()=>{if(typeof e=="string"){if(e.length>3&&e.length%2!==0)throw new Ut(e);return W(e)}return e})(),s=me(r,{recursiveReadLimit:Number.POSITIVE_INFINITY});return Xe(s,n)}function Xe(e,t="Hex"){if(e.bytes.length===0)return t==="Hex"?x(e.bytes):e.bytes;const n=e.readByte();if(n<128&&e.decrementPosition(1),n<192){const s=ke(e,n,128),i=e.readBytes(s);return t==="Hex"?x(i):i}const r=ke(e,n,192);return In(e,r,t)}function ke(e,t,n){if(n===128&&t<128)return 1;if(t<=n+55)return t-n;if(t===n+55+1)return e.readUint8();if(t===n+55+2)return e.readUint16();if(t===n+55+3)return e.readUint24();if(t===n+55+4)return e.readUint32();throw new y("Invalid RLP prefix")}function In(e,t,n){const r=e.position,s=[];for(;e.position-r<t;)s.push(Xe(e,n));return s}function En(e,t){const{as:n}=t,r=et(e),s=me(new Uint8Array(r.length));return r.encode(s),n==="Hex"?x(s.bytes):s.bytes}function An(e,t={}){const{as:n="Hex"}=t;return En(e,{as:n})}function et(e){return Array.isArray(e)?$n(e.map(t=>et(t))):zn(e)}function $n(e){const t=e.reduce((s,i)=>s+i.length,0),n=tt(t);return{length:(()=>t<=55?1+t:1+n+t)(),encode(s){t<=55?s.pushByte(192+t):(s.pushByte(192+55+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:i}of e)i(s)}}}function zn(e){const t=typeof e=="string"?W(e):e,n=tt(t.length);return{length:(()=>t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length)(),encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(128+55+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function tt(e){if(e<=255)return 1;if(e<=65535)return 2;if(e<=16777215)return 3;if(e<=4294967295)return 4;throw new y("Length is too large.")}class Bn extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const Sn={checksum:new Bn(8192)},J=Sn.checksum;function nt(e,t={}){const{compressed:n}=t,{prefix:r,x:s,y:i}=e;if(n===!1||typeof s=="bigint"&&typeof i=="bigint"){if(r!==4)throw new je({prefix:r,cause:new Un});return}if(n===!0||typeof s=="bigint"&&typeof i>"u"){if(r!==3&&r!==2)throw new je({prefix:r,cause:new On});return}throw new Rn({publicKey:e})}function Ln(e){const t=(()=>{if(ue(e))return rt(e);if(Vt(e))return Tn(e);const{prefix:n,x:r,y:s}=e;return typeof r=="bigint"&&typeof s=="bigint"?{prefix:n??4,x:r,y:s}:{prefix:n,x:r}})();return nt(t),t}function Tn(e){return rt(x(e))}function rt(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new Vn({publicKey:e});if(e.length===130){const r=BigInt(b(e,0,32)),s=BigInt(b(e,32,64));return{prefix:4,x:r,y:s}}if(e.length===132){const r=Number(b(e,0,1)),s=BigInt(b(e,1,33)),i=BigInt(b(e,33,65));return{prefix:r,x:s,y:i}}const t=Number(b(e,0,1)),n=BigInt(b(e,1,33));return{prefix:t,x:n}}function Cn(e,t={}){return W(st(e,t))}function st(e,t={}){nt(e);const{prefix:n,x:r,y:s}=e,{includePrefix:i=!0}=t;return g(i?m(n,{size:1}):"0x",m(r,{size:32}),typeof s=="bigint"?m(s,{size:32}):"0x")}class Rn extends y{constructor({publicKey:t}){super(`Value \`${Ye(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 je extends y{constructor({prefix:t,cause:n}){super(`Prefix "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class On extends y{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 Un extends y{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let Vn=class extends y{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(fe(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const Nn=/^0x[a-fA-F0-9]{40}$/;function z(e,t={}){const{strict:n=!0}=t;if(!Nn.test(e))throw new Fe({address:e,cause:new Fn});if(n){if(e.toLowerCase()===e)return;if(be(e)!==e)throw new Fe({address:e,cause:new Hn})}}function be(e){if(J.has(e))return J.get(e);z(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=K(Nt(t),{as:"Bytes"}),r=t.split("");for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&r[i]&&(r[i]=r[i].toUpperCase()),(n[i>>1]&15)>=8&&r[i+1]&&(r[i+1]=r[i+1].toUpperCase());const s=`0x${r.join("")}`;return J.set(e,s),s}function _n(e,t={}){const{checksum:n=!1}=t;return z(e),n?be(e):e}function kn(e,t={}){const n=K(`0x${st(e).slice(4)}`).substring(26);return _n(`0x${n}`,t)}function jn(e,t){return z(e,{strict:!1}),z(t,{strict:!1}),e.toLowerCase()===t.toLowerCase()}function ne(e,t={}){const{strict:n=!0}=t??{};try{return z(e,{strict:n}),!0}catch{return!1}}class Fe extends y{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class Fn extends y{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 Hn extends y{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function it(e){return kn(Mn(e))}function Mn(e){const{payload:t,signature:n}=e,{r,s,yParity:i}=n,c=new ye.Signature(BigInt(r),BigInt(s)).addRecoveryBit(i).recoverPublicKey(fe(t).substring(2));return Ln(c)}function Xr(e){const{hash:t,payload:n}=e;return e.address?jn(e.address,it({payload:n,signature:e.signature})):ye.verify(e.signature,ce(n),Cn(e.publicKey),...t?[{prehash:!0,lowS:!0}]:[])}const Gn=/^(.*)\[([0-9]*)\]$/,Dn=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,ot=/^(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)?$/,He=2n**256n-1n;function ge(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new Q({signature:e});if(typeof e.s>"u")throw new Q({signature:e});if(n&&typeof e.yParity>"u")throw new Q({signature:e});if(e.r<0n||e.r>He)throw new Xn({value:e.r});if(e.s<0n||e.s>He)throw new er({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Z({value:e.yParity})}function Wn(e){return at(x(e))}function at(e){if(e.length!==130&&e.length!==132)throw new Qn({signature:e});const t=BigInt(b(e,0,32)),n=BigInt(b(e,32,64)),r=(()=>{const s=+`0x${e.slice(130)}`;if(!Number.isNaN(s))try{return we(s)}catch{throw new Z({value:s})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function ct(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return xe(e)}function xe(e){const t=(()=>typeof e=="string"?at(e):e instanceof Uint8Array?Wn(e):typeof e.r=="string"?qn(e):e.v?Yn(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}})();return ge(t),t}function Yn(e){return{r:e.r,s:e.s,yParity:we(e.v)}}function qn(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=we(n)),typeof r!="number")throw new Z({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function es(e){const[t,n,r]=e;return xe({r:n==="0x"?0n:BigInt(n),s:r==="0x"?0n:BigInt(r),yParity:t==="0x"?0:Number(t)})}function ts(e){ge(e);const t=e.r,n=e.s;return g(m(t,{size:32}),m(n,{size:32}),typeof e.yParity=="number"?m(Jn(e.yParity),{size:1}):"0x")}function Kn(e){const{r:t,s:n,yParity:r}=e;return{r:m(t,{size:32}),s:m(n,{size:32}),yParity:r===0?"0x0":"0x1"}}function Zn(e){const{r:t,s:n,yParity:r}=e;return[r?"0x01":"0x",t===0n?"0x":Te(m(t)),n===0n?"0x":Te(m(n))]}function we(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 tr({value:e})}function Jn(e){if(e===0)return 27;if(e===1)return 28;throw new Z({value:e})}class Qn extends y{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${w(fe(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Q extends y{constructor({signature:t}){super(`Signature \`${Ye(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class Xn extends y{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 er extends y{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 Z extends y{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 tr extends y{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 L(e,t,n){const{checksumAddress:r,staticPosition:s}=n,i=Ie(t.type);if(i){const[o,c]=i;return rr(e,{...t,type:c},{checksumAddress:r,length:o,staticPosition:s})}if(t.type==="tuple")return ar(e,t,{checksumAddress:r,staticPosition:s});if(t.type==="address")return nr(e,{checksum:r});if(t.type==="bool")return sr(e);if(t.type.startsWith("bytes"))return ir(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return or(e,t);if(t.type==="string")return cr(e,{staticPosition:s});throw new Ee(t.type)}const Me=32,re=32;function nr(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(i=>n?be(i):i)(x(_t(r,-20))),32]}function rr(e,t,n){const{checksumAddress:r,length:s,staticPosition:i}=n;if(s===null){const u=I(e.readBytes(re)),a=i+u,f=a+Me;e.setPosition(a);const d=I(e.readBytes(Me)),p=C(t);let h=0;const P=[];for(let E=0;E<d;++E){e.setPosition(f+(p?E*32:h));const[A,v]=L(e,t,{checksumAddress:r,staticPosition:f});h+=v,P.push(A),v===0&&(e.assertReadLimit(),e._touch())}return e.setPosition(i+32),[P,32]}if(C(t)){const u=I(e.readBytes(re)),a=i+u,f=[];for(let d=0;d<s;++d){e.setPosition(a+d*32);const[p]=L(e,t,{checksumAddress:r,staticPosition:a});f.push(p)}return e.setPosition(i+32),[f,32]}let o=0;const c=[];for(let u=0;u<s;++u){const[a,f]=L(e,t,{checksumAddress:r,staticPosition:i+o});o+=f,c.push(a),f===0&&(e.assertReadLimit(),e._touch())}return[c,o]}function sr(e){return[kt(e.readBytes(32),{size:32}),32]}function ir(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const o=I(e.readBytes(32));e.setPosition(n+o);const c=I(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const u=e.readBytes(c);return e.setPosition(n+32),[x(u),32]}return[x(e.readBytes(Number.parseInt(s,10),32)),32]}function or(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[r>48?jt(s,{signed:n}):I(s,{signed:n}),32]}function ar(e,t,n){const{checksumAddress:r,staticPosition:s}=n,i=t.components.length===0||t.components.some(({name:u})=>!u),o=i?[]:{};let c=0;if(C(t)){const u=I(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[p,h]=L(e,d,{checksumAddress:r,staticPosition:a});c+=h,o[i?f:d==null?void 0:d.name]=p}return e.setPosition(s+32),[o,32]}for(let u=0;u<t.components.length;++u){const a=t.components[u],[f,d]=L(e,a,{checksumAddress:r,staticPosition:s});o[i?u:a==null?void 0:a.name]=f,c+=d}return[o,c]}function cr(e,{staticPosition:t}){const n=I(e.readBytes(32)),r=t+n;e.setPosition(r);const s=I(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const i=e.readBytes(s,32),o=Ft(Ht(i));return e.setPosition(t+32),[o,32]}function ur({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(Pe({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function Pe({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=Ie(r.type);if(s){const[i,o]=s;return dr(n,{checksumAddress:e,length:i,parameter:{...r,type:o}})}if(r.type==="tuple")return mr(n,{checksumAddress:e,parameter:r});if(r.type==="address")return fr(n,{checksum:e});if(r.type==="bool")return hr(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const i=r.type.startsWith("int"),[,,o="256"]=ot.exec(r.type)??[];return yr(n,{signed:i,size:Number(o)})}if(r.type.startsWith("bytes"))return lr(n,{type:r.type});if(r.type==="string")return pr(n);throw new Ee(r.type)}function ve(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 n=[],r=[];let s=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:c}=e[i];o?(n.push(m(t+s,{size:32})),r.push(c),s+=w(c)):n.push(c)}return g(...n,...r)}function fr(e,t){const{checksum:n=!1}=t;return z(e,{strict:n}),{dynamic:!1,encoded:V(e.toLowerCase())}}function dr(e,t){const{checksumAddress:n,length:r,parameter:s}=t,i=r===null;if(!Array.isArray(e))throw new Pr(e);if(!i&&e.length!==r)throw new wr({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let o=e.length===0&&C(s);const c=[];for(let u=0;u<e.length;u++){const a=Pe({checksumAddress:n,parameter:s,value:e[u]});a.dynamic&&(o=!0),c.push(a)}if(i||o){const u=ve(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 lr(e,{type:t}){const[,n]=t.split("bytes"),r=w(e);if(!n){let s=e;return r%32!==0&&(s=N(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:g(V(m(r,{size:32})),s)}}if(r!==Number.parseInt(n,10))throw new dt({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:N(e)}}function hr(e){if(typeof e!="boolean")throw new y(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:V(qe(e))}}function yr(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new Mt({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:m(e,{size:32,signed:t})}}function pr(e){const t=de(e),n=Math.ceil(w(t)/32),r=[];for(let s=0;s<n;s++)r.push(N(b(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:g(N(m(w(t),{size:32})),...r)}}function mr(e,t){const{checksumAddress:n,parameter:r}=t;let s=!1;const i=[];for(let o=0;o<r.components.length;o++){const c=r.components[o],u=Array.isArray(e)?o:c.name,a=Pe({checksumAddress:n,parameter:c,value:e[u]});i.push(a),a.dynamic&&(s=!0)}return{dynamic:s,encoded:s?ve(i):g(...i.map(({encoded:o})=>o))}}function Ie(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function C(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(C);const n=Ie(e.type);return!!(n&&C({...e,type:n[1]}))}function br(e,t,n={}){const{as:r="Array",checksumAddress:s=!1}=n,i=typeof t=="string"?W(t):t,o=me(i);if(M(i)===0&&e.length>0)throw new xr;if(M(i)&&M(i)<32)throw new gr({data:typeof t=="string"?t:x(t),parameters:e,size:M(i)});let c=0;const u=r==="Array"?[]:{};for(let a=0;a<e.length;++a){const f=e[a];c<i.length&&o.setPosition(c);const[d,p]=L(o,f,{checksumAddress:s,staticPosition:0});c+=p,r==="Array"?u.push(d):u[f.name??a]=d}return u}function ut(e,t,n){const{checksumAddress:r=!1}=n??{};if(e.length!==t.length)throw new lt({expectedLength:e.length,givenLength:t.length});const s=ur({checksumAddress:r,parameters:e,values:t}),i=ve(s);return i.length===0?"0x":i}function se(e,t){if(e.length!==t.length)throw new lt({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r];n.push(se.encode(s,i))}return g(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const u=r;return z(u),V(u.toLowerCase(),s?32:0)}if(n==="string")return de(r);if(n==="bytes")return r;if(n==="bool")return V(qe(r),s?32:1);const i=n.match(ot);if(i){const[u,a,f="256"]=i,d=Number.parseInt(f,10)/8;return m(r,{size:s?32:d,signed:a==="int"})}const o=n.match(Dn);if(o){const[u,a]=o;if(Number.parseInt(a,10)!==(r.length-2)/2)throw new dt({expectedSize:Number.parseInt(a,10),value:r});return N(r,s?32:0)}const c=n.match(Gn);if(c&&Array.isArray(r)){const[u,a]=c,f=[];for(let d=0;d<r.length;d++)f.push(t(a,r[d],!0));return f.length===0?"0x":g(...f)}throw new Ee(n)}e.encode=t})(se||(se={}));function ft(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Ne(e):e}class gr extends y{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Gt(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class xr extends y{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class wr extends y{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class dt extends y{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${w(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class lt extends y{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
1
|
+
import{ag as D,q as _,r as k,ah as ae,ai as xt,s as wt,aj as Pt,ak as vt,al as It,am as Et,an as At,k as j,ao as T,ap as $t,aq as zt,ar as Bt,as as St,at as Lt,au as ze,av as De,aw as We,ax as Tt,ay as Be,az as Se,aA as Ct,aB as Le,aC as Rt,aD as ce,aE as x,aF as Ot,aG as ue,aH as w,aI as y,aJ as Ut,aK as W,aL as Vt,aM as b,aN as g,aO as m,aP as fe,aQ as Ye,aR as Nt,aS as Te,aT as _t,aU as I,aV as kt,aW as jt,aX as Ft,aY as Ht,aZ as V,a_ as N,a$ as qe,b0 as Mt,b1 as de,b2 as M,b3 as Gt,b4 as X,ac as Dt,b5 as Wt,i as ee,b6 as Yt,a0 as te,ad as le,a8 as Y,c as Ke,ae as qt,b7 as Kt,b8 as Ce,b9 as Zt,ba as Jt,bb as Qt,bc as Xt,bd as en}from"./writeContract-03e44e49.js";import{t as Re,a0 as he,a1 as tn,B as Ze,h as nn,a2 as rn,n as l,f as Je,a3 as G,Y as Oe,a4 as sn,b as on,$ as an,a5 as Qe,a6 as Ue,a7 as cn}from"./createBatchScheduler-7c9ada66.js";import{s as ye}from"./secp256k1-44255658.js";function Wr(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return s=>{const i=typeof s=="function"?s(r):s,o={...r,...i};return Object.assign(o,{extend:n(o)})}}return Object.assign(t,{extend:n(t)})}function Yr(){return{}}function un(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:r,nonce:s,...i}=n,o=n.address;t.push([r?Re(r):"0x",o,s?Re(s):"0x",...F({},i)])}return t}function fn(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:r}=n,s=n.address;if(!_(s))throw new k({address:s});if(r<0)throw new D({chainId:r})}pe(e)}function dn(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new xt;for(const n of t){const r=nn(n),s=rn(wt(n,0,1));if(r!==32)throw new Pt({hash:n,size:r});if(s!==vt)throw new It({hash:n,version:s})}}pe(e)}function pe(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new D({chainId:t});if(s&&!_(s))throw new k({address:s});if(r&&r>ae)throw new he({maxFeePerGas:r});if(n&&r&&n>r)throw new tn({maxFeePerGas:r,maxPriorityFeePerGas:n})}function ln(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i}=e;if(t<=0)throw new D({chainId:t});if(i&&!_(i))throw new k({address:i});if(n||s)throw new Ze("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>ae)throw new he({maxFeePerGas:r})}function hn(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i}=e;if(i&&!_(i))throw new k({address:i});if(typeof t<"u"&&t<=0)throw new D({chainId:t});if(n||s)throw new Ze("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>ae)throw new he({maxFeePerGas:r})}function q(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:s}=e[n];for(let i=0;i<s.length;i++)if(s[i].length-2!==64)throw new Et({storageKey:s[i]});if(!_(r,{strict:!1}))throw new k({address:r});t.push([r,s])}return t}function qr(e,t){const n=At(e);return n==="eip1559"?mn(e,t):n==="eip2930"?bn(e,t):n==="eip4844"?pn(e,t):n==="eip7702"?yn(e,t):gn(e,t)}function yn(e,t){const{authorizationList:n,chainId:r,gas:s,nonce:i,to:o,value:c,maxFeePerGas:u,maxPriorityFeePerGas:a,accessList:f,data:d}=e;fn(e);const p=q(f),h=un(n);return j(["0x04",T([l(r),i?l(i):"0x",a?l(a):"0x",u?l(u):"0x",s?l(s):"0x",o??"0x",c?l(c):"0x",d??"0x",p,h,...F(e,t)])])}function pn(e,t){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:a,accessList:f,data:d}=e;dn(e);let p=e.blobVersionedHashes,h=e.sidecars;if(e.blobs&&(typeof p>"u"||typeof h>"u")){const $=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(U=>Je(U)),H=e.kzg,O=$t({blobs:$,kzg:H});if(typeof p>"u"&&(p=zt({commitments:O})),typeof h>"u"){const U=Bt({blobs:$,commitments:O,kzg:H});h=St({blobs:$,commitments:O,proofs:U})}}const P=q(f),E=[l(n),s?l(s):"0x",a?l(a):"0x",u?l(u):"0x",r?l(r):"0x",i??"0x",o?l(o):"0x",d??"0x",P,c?l(c):"0x",p??[],...F(e,t)],A=[],v=[],R=[];if(h)for(let $=0;$<h.length;$++){const{blob:H,commitment:O,proof:U}=h[$];A.push(H),v.push(O),R.push(U)}return j(["0x03",h?T([E,A,v,R]):T(E)])}function mn(e,t){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:a,data:f}=e;pe(e);const d=q(a),p=[l(n),s?l(s):"0x",u?l(u):"0x",c?l(c):"0x",r?l(r):"0x",i??"0x",o?l(o):"0x",f??"0x",d,...F(e,t)];return j(["0x02",T(p)])}function bn(e,t){const{chainId:n,gas:r,data:s,nonce:i,to:o,value:c,accessList:u,gasPrice:a}=e;ln(e);const f=q(u),d=[l(n),i?l(i):"0x",a?l(a):"0x",r?l(r):"0x",o??"0x",c?l(c):"0x",s??"0x",f,...F(e,t)];return j(["0x01",T(d)])}function gn(e,t){const{chainId:n=0,gas:r,data:s,nonce:i,to:o,value:c,gasPrice:u}=e;hn(e);let a=[i?l(i):"0x",u?l(u):"0x",r?l(r):"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(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const h=27n+(t.v===27n?0n:1n);if(t.v!==h)throw new Lt({v:t.v});return h})(),d=G(t.r),p=G(t.s);a=[...a,l(f),d==="0x00"?"0x":d,p==="0x00"?"0x":p]}else n>0&&(a=[...a,l(n),"0x","0x"]);return T(a)}function F(e,t){const n=t??e,{v:r,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof s>"u")return[];const i=G(n.r),o=G(n.s);return[(()=>typeof s=="number"?s?l(1):"0x":r===0n?"0x":r===1n?l(1):r===27n?"0x":l(1))(),i==="0x00"?"0x":i,o==="0x00"?"0x":o]}function Ve(e){let t;if(typeof e=="string")t=ze(e);else{const n=De(e),r=e.length;for(let s=0;s<r;s++){const i=e[s];if(!We(i)){t=ze(i,n);break}}}if(!t)throw new Tt({signature:e});return t}function Ne(e){const t=[];if(typeof e=="string"){const n=Be(e),r=n.length;for(let s=0;s<r;s++)t.push(Se(n[s],{modifiers:Le}))}else{const n=De(e),r=e.length;for(let s=0;s<r;s++){const i=e[s];if(We(i))continue;const o=Be(i),c=o.length;for(let u=0;u<c;u++)t.push(Se(o[u],{modifiers:Le,structs:n}))}}if(t.length===0)throw new Ct({params:e});return t}function K(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Rt(ce(e));return n==="Bytes"?r:x(r)}function Kr(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Ot(ce(e));return n==="Bytes"?r:x(r)}function Zr(e){return ue(e)&&w(e)===32}const xn={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 Pn({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new wn({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new _e({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 _e({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 n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+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 n=this.inspectBytes(e);return this.position+=t??e,n},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 me(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(xn);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class _e extends y{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class wn extends y{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class Pn extends y{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function Jr(e){return vn(e,"Hex")}function vn(e,t){const n=t??(typeof e=="string"?"Hex":"Bytes"),r=(()=>{if(typeof e=="string"){if(e.length>3&&e.length%2!==0)throw new Ut(e);return W(e)}return e})(),s=me(r,{recursiveReadLimit:Number.POSITIVE_INFINITY});return Xe(s,n)}function Xe(e,t="Hex"){if(e.bytes.length===0)return t==="Hex"?x(e.bytes):e.bytes;const n=e.readByte();if(n<128&&e.decrementPosition(1),n<192){const s=ke(e,n,128),i=e.readBytes(s);return t==="Hex"?x(i):i}const r=ke(e,n,192);return In(e,r,t)}function ke(e,t,n){if(n===128&&t<128)return 1;if(t<=n+55)return t-n;if(t===n+55+1)return e.readUint8();if(t===n+55+2)return e.readUint16();if(t===n+55+3)return e.readUint24();if(t===n+55+4)return e.readUint32();throw new y("Invalid RLP prefix")}function In(e,t,n){const r=e.position,s=[];for(;e.position-r<t;)s.push(Xe(e,n));return s}function En(e,t){const{as:n}=t,r=et(e),s=me(new Uint8Array(r.length));return r.encode(s),n==="Hex"?x(s.bytes):s.bytes}function An(e,t={}){const{as:n="Hex"}=t;return En(e,{as:n})}function et(e){return Array.isArray(e)?$n(e.map(t=>et(t))):zn(e)}function $n(e){const t=e.reduce((s,i)=>s+i.length,0),n=tt(t);return{length:(()=>t<=55?1+t:1+n+t)(),encode(s){t<=55?s.pushByte(192+t):(s.pushByte(192+55+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:i}of e)i(s)}}}function zn(e){const t=typeof e=="string"?W(e):e,n=tt(t.length);return{length:(()=>t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length)(),encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(128+55+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function tt(e){if(e<=255)return 1;if(e<=65535)return 2;if(e<=16777215)return 3;if(e<=4294967295)return 4;throw new y("Length is too large.")}class Bn extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const Sn={checksum:new Bn(8192)},J=Sn.checksum;function nt(e,t={}){const{compressed:n}=t,{prefix:r,x:s,y:i}=e;if(n===!1||typeof s=="bigint"&&typeof i=="bigint"){if(r!==4)throw new je({prefix:r,cause:new Un});return}if(n===!0||typeof s=="bigint"&&typeof i>"u"){if(r!==3&&r!==2)throw new je({prefix:r,cause:new On});return}throw new Rn({publicKey:e})}function Ln(e){const t=(()=>{if(ue(e))return rt(e);if(Vt(e))return Tn(e);const{prefix:n,x:r,y:s}=e;return typeof r=="bigint"&&typeof s=="bigint"?{prefix:n??4,x:r,y:s}:{prefix:n,x:r}})();return nt(t),t}function Tn(e){return rt(x(e))}function rt(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new Vn({publicKey:e});if(e.length===130){const r=BigInt(b(e,0,32)),s=BigInt(b(e,32,64));return{prefix:4,x:r,y:s}}if(e.length===132){const r=Number(b(e,0,1)),s=BigInt(b(e,1,33)),i=BigInt(b(e,33,65));return{prefix:r,x:s,y:i}}const t=Number(b(e,0,1)),n=BigInt(b(e,1,33));return{prefix:t,x:n}}function Cn(e,t={}){return W(st(e,t))}function st(e,t={}){nt(e);const{prefix:n,x:r,y:s}=e,{includePrefix:i=!0}=t;return g(i?m(n,{size:1}):"0x",m(r,{size:32}),typeof s=="bigint"?m(s,{size:32}):"0x")}class Rn extends y{constructor({publicKey:t}){super(`Value \`${Ye(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 je extends y{constructor({prefix:t,cause:n}){super(`Prefix "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class On extends y{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 Un extends y{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let Vn=class extends y{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(fe(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const Nn=/^0x[a-fA-F0-9]{40}$/;function z(e,t={}){const{strict:n=!0}=t;if(!Nn.test(e))throw new Fe({address:e,cause:new Fn});if(n){if(e.toLowerCase()===e)return;if(be(e)!==e)throw new Fe({address:e,cause:new Hn})}}function be(e){if(J.has(e))return J.get(e);z(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=K(Nt(t),{as:"Bytes"}),r=t.split("");for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&r[i]&&(r[i]=r[i].toUpperCase()),(n[i>>1]&15)>=8&&r[i+1]&&(r[i+1]=r[i+1].toUpperCase());const s=`0x${r.join("")}`;return J.set(e,s),s}function _n(e,t={}){const{checksum:n=!1}=t;return z(e),n?be(e):e}function kn(e,t={}){const n=K(`0x${st(e).slice(4)}`).substring(26);return _n(`0x${n}`,t)}function jn(e,t){return z(e,{strict:!1}),z(t,{strict:!1}),e.toLowerCase()===t.toLowerCase()}function ne(e,t={}){const{strict:n=!0}=t??{};try{return z(e,{strict:n}),!0}catch{return!1}}class Fe extends y{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class Fn extends y{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 Hn extends y{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function it(e){return kn(Mn(e))}function Mn(e){const{payload:t,signature:n}=e,{r,s,yParity:i}=n,c=new ye.Signature(BigInt(r),BigInt(s)).addRecoveryBit(i).recoverPublicKey(fe(t).substring(2));return Ln(c)}function Xr(e){const{hash:t,payload:n}=e;return e.address?jn(e.address,it({payload:n,signature:e.signature})):ye.verify(e.signature,ce(n),Cn(e.publicKey),...t?[{prehash:!0,lowS:!0}]:[])}const Gn=/^(.*)\[([0-9]*)\]$/,Dn=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,ot=/^(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)?$/,He=2n**256n-1n;function ge(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new Q({signature:e});if(typeof e.s>"u")throw new Q({signature:e});if(n&&typeof e.yParity>"u")throw new Q({signature:e});if(e.r<0n||e.r>He)throw new Xn({value:e.r});if(e.s<0n||e.s>He)throw new er({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Z({value:e.yParity})}function Wn(e){return at(x(e))}function at(e){if(e.length!==130&&e.length!==132)throw new Qn({signature:e});const t=BigInt(b(e,0,32)),n=BigInt(b(e,32,64)),r=(()=>{const s=+`0x${e.slice(130)}`;if(!Number.isNaN(s))try{return we(s)}catch{throw new Z({value:s})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function ct(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return xe(e)}function xe(e){const t=(()=>typeof e=="string"?at(e):e instanceof Uint8Array?Wn(e):typeof e.r=="string"?qn(e):e.v?Yn(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}})();return ge(t),t}function Yn(e){return{r:e.r,s:e.s,yParity:we(e.v)}}function qn(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=we(n)),typeof r!="number")throw new Z({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function es(e){const[t,n,r]=e;return xe({r:n==="0x"?0n:BigInt(n),s:r==="0x"?0n:BigInt(r),yParity:t==="0x"?0:Number(t)})}function ts(e){ge(e);const t=e.r,n=e.s;return g(m(t,{size:32}),m(n,{size:32}),typeof e.yParity=="number"?m(Jn(e.yParity),{size:1}):"0x")}function Kn(e){const{r:t,s:n,yParity:r}=e;return{r:m(t,{size:32}),s:m(n,{size:32}),yParity:r===0?"0x0":"0x1"}}function Zn(e){const{r:t,s:n,yParity:r}=e;return[r?"0x01":"0x",t===0n?"0x":Te(m(t)),n===0n?"0x":Te(m(n))]}function we(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 tr({value:e})}function Jn(e){if(e===0)return 27;if(e===1)return 28;throw new Z({value:e})}class Qn extends y{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${w(fe(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Q extends y{constructor({signature:t}){super(`Signature \`${Ye(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class Xn extends y{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 er extends y{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 Z extends y{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 tr extends y{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 L(e,t,n){const{checksumAddress:r,staticPosition:s}=n,i=Ie(t.type);if(i){const[o,c]=i;return rr(e,{...t,type:c},{checksumAddress:r,length:o,staticPosition:s})}if(t.type==="tuple")return ar(e,t,{checksumAddress:r,staticPosition:s});if(t.type==="address")return nr(e,{checksum:r});if(t.type==="bool")return sr(e);if(t.type.startsWith("bytes"))return ir(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return or(e,t);if(t.type==="string")return cr(e,{staticPosition:s});throw new Ee(t.type)}const Me=32,re=32;function nr(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(i=>n?be(i):i)(x(_t(r,-20))),32]}function rr(e,t,n){const{checksumAddress:r,length:s,staticPosition:i}=n;if(s===null){const u=I(e.readBytes(re)),a=i+u,f=a+Me;e.setPosition(a);const d=I(e.readBytes(Me)),p=C(t);let h=0;const P=[];for(let E=0;E<d;++E){e.setPosition(f+(p?E*32:h));const[A,v]=L(e,t,{checksumAddress:r,staticPosition:f});h+=v,P.push(A),v===0&&(e.assertReadLimit(),e._touch())}return e.setPosition(i+32),[P,32]}if(C(t)){const u=I(e.readBytes(re)),a=i+u,f=[];for(let d=0;d<s;++d){e.setPosition(a+d*32);const[p]=L(e,t,{checksumAddress:r,staticPosition:a});f.push(p)}return e.setPosition(i+32),[f,32]}let o=0;const c=[];for(let u=0;u<s;++u){const[a,f]=L(e,t,{checksumAddress:r,staticPosition:i+o});o+=f,c.push(a),f===0&&(e.assertReadLimit(),e._touch())}return[c,o]}function sr(e){return[kt(e.readBytes(32),{size:32}),32]}function ir(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const o=I(e.readBytes(32));e.setPosition(n+o);const c=I(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const u=e.readBytes(c);return e.setPosition(n+32),[x(u),32]}return[x(e.readBytes(Number.parseInt(s,10),32)),32]}function or(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[r>48?jt(s,{signed:n}):I(s,{signed:n}),32]}function ar(e,t,n){const{checksumAddress:r,staticPosition:s}=n,i=t.components.length===0||t.components.some(({name:u})=>!u),o=i?[]:{};let c=0;if(C(t)){const u=I(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[p,h]=L(e,d,{checksumAddress:r,staticPosition:a});c+=h,o[i?f:d==null?void 0:d.name]=p}return e.setPosition(s+32),[o,32]}for(let u=0;u<t.components.length;++u){const a=t.components[u],[f,d]=L(e,a,{checksumAddress:r,staticPosition:s});o[i?u:a==null?void 0:a.name]=f,c+=d}return[o,c]}function cr(e,{staticPosition:t}){const n=I(e.readBytes(32)),r=t+n;e.setPosition(r);const s=I(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const i=e.readBytes(s,32),o=Ft(Ht(i));return e.setPosition(t+32),[o,32]}function ur({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(Pe({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function Pe({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=Ie(r.type);if(s){const[i,o]=s;return dr(n,{checksumAddress:e,length:i,parameter:{...r,type:o}})}if(r.type==="tuple")return mr(n,{checksumAddress:e,parameter:r});if(r.type==="address")return fr(n,{checksum:e});if(r.type==="bool")return hr(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const i=r.type.startsWith("int"),[,,o="256"]=ot.exec(r.type)??[];return yr(n,{signed:i,size:Number(o)})}if(r.type.startsWith("bytes"))return lr(n,{type:r.type});if(r.type==="string")return pr(n);throw new Ee(r.type)}function ve(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 n=[],r=[];let s=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:c}=e[i];o?(n.push(m(t+s,{size:32})),r.push(c),s+=w(c)):n.push(c)}return g(...n,...r)}function fr(e,t){const{checksum:n=!1}=t;return z(e,{strict:n}),{dynamic:!1,encoded:V(e.toLowerCase())}}function dr(e,t){const{checksumAddress:n,length:r,parameter:s}=t,i=r===null;if(!Array.isArray(e))throw new Pr(e);if(!i&&e.length!==r)throw new wr({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let o=e.length===0&&C(s);const c=[];for(let u=0;u<e.length;u++){const a=Pe({checksumAddress:n,parameter:s,value:e[u]});a.dynamic&&(o=!0),c.push(a)}if(i||o){const u=ve(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 lr(e,{type:t}){const[,n]=t.split("bytes"),r=w(e);if(!n){let s=e;return r%32!==0&&(s=N(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:g(V(m(r,{size:32})),s)}}if(r!==Number.parseInt(n,10))throw new dt({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:N(e)}}function hr(e){if(typeof e!="boolean")throw new y(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:V(qe(e))}}function yr(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new Mt({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:m(e,{size:32,signed:t})}}function pr(e){const t=de(e),n=Math.ceil(w(t)/32),r=[];for(let s=0;s<n;s++)r.push(N(b(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:g(N(m(w(t),{size:32})),...r)}}function mr(e,t){const{checksumAddress:n,parameter:r}=t;let s=!1;const i=[];for(let o=0;o<r.components.length;o++){const c=r.components[o],u=Array.isArray(e)?o:c.name,a=Pe({checksumAddress:n,parameter:c,value:e[u]});i.push(a),a.dynamic&&(s=!0)}return{dynamic:s,encoded:s?ve(i):g(...i.map(({encoded:o})=>o))}}function Ie(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function C(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(C);const n=Ie(e.type);return!!(n&&C({...e,type:n[1]}))}function br(e,t,n={}){const{as:r="Array",checksumAddress:s=!1}=n,i=typeof t=="string"?W(t):t,o=me(i);if(M(i)===0&&e.length>0)throw new xr;if(M(i)&&M(i)<32)throw new gr({data:typeof t=="string"?t:x(t),parameters:e,size:M(i)});let c=0;const u=r==="Array"?[]:{};for(let a=0;a<e.length;++a){const f=e[a];c<i.length&&o.setPosition(c);const[d,p]=L(o,f,{checksumAddress:s,staticPosition:0});c+=p,r==="Array"?u.push(d):u[f.name??a]=d}return u}function ut(e,t,n){const{checksumAddress:r=!1}=n??{};if(e.length!==t.length)throw new lt({expectedLength:e.length,givenLength:t.length});const s=ur({checksumAddress:r,parameters:e,values:t}),i=ve(s);return i.length===0?"0x":i}function se(e,t){if(e.length!==t.length)throw new lt({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r];n.push(se.encode(s,i))}return g(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const u=r;return z(u),V(u.toLowerCase(),s?32:0)}if(n==="string")return de(r);if(n==="bytes")return r;if(n==="bool")return V(qe(r),s?32:1);const i=n.match(ot);if(i){const[u,a,f="256"]=i,d=Number.parseInt(f,10)/8;return m(r,{size:s?32:d,signed:a==="int"})}const o=n.match(Dn);if(o){const[u,a]=o;if(Number.parseInt(a,10)!==(r.length-2)/2)throw new dt({expectedSize:Number.parseInt(a,10),value:r});return N(r,s?32:0)}const c=n.match(Gn);if(c&&Array.isArray(r)){const[u,a]=c,f=[];for(let d=0;d<r.length;d++)f.push(t(a,r[d],!0));return f.length===0?"0x":g(...f)}throw new Ee(n)}e.encode=t})(se||(se={}));function ft(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Ne(e):e}class gr extends y{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Gt(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class xr extends y{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class wr extends y{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class dt extends y{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${w(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class lt extends y{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
2
2
|
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class Pr extends y{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class Ee extends y{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 ie(e){let t=!0,n="",r=0,s="",i=!1;for(let o=0;o<e.length;o++){const c=e[o];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function","error",""].includes(s))s="";else if(s+=c,c===")"){i=!0;break}continue}if(c===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=c,n+=c}}if(!i)throw new y("Unable to normalize signature.");return s}function oe(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ne(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,i)=>oe(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(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>oe(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function ht(e,t,n){for(const r in e){const s=e[r],i=t[r];if(s.type==="tuple"&&i.type==="tuple"&&"components"in s&&"components"in i)return ht(s.components,i.components,n[r]);const o=[s.type,i.type];if((()=>o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?ne(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?ne(n[r],{strict:!1}):!1)())return o}}function ns(e,t={}){const{prepare:n=!0}=t,r=(()=>Array.isArray(e)||typeof e=="string"?Ve(e):e)();return{...r,...n?{hash:S(r)}:{}}}function Ae(e,t,n){const{args:r=[],prepare:s=!0}=n??{},i=ue(t,{strict:!1}),o=e.filter(a=>i?a.type==="function"||a.type==="error"?vr(a)===b(t,0,4):a.type==="event"?S(a)===t:!1:"name"in a&&a.name===t);if(o.length===0)throw new Ge({name:t});if(o.length===1)return{...o[0],...s?{hash:S(o[0])}:{}};let c;for(const a of o){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return{...a,...s?{hash:S(a)}:{}};continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((d,p)=>{const h="inputs"in a&&a.inputs[p];return h?oe(d,h):!1})){if(c&&"inputs"in c&&c.inputs){const d=ht(a.inputs,c.inputs,r);if(d)throw new Er({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 Ge({name:t});return{...u,...s?{hash:S(u)}:{}}}function vr(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Ae(n,r)}return e[0]})();return b(S(t),0,4)}function Ir(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,s]=e;return Ae(r,s)}return e[0]})(),n=(()=>typeof t=="string"?t:X(t))();return ie(n)}function S(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Ae(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:K(de(Ir(t)))}class Er extends y{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${ie(X(t.abiItem))}\`, and`,`\`${n.type}\` in \`${ie(X(n.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 Ge extends y{constructor({name:t,data:n,type:r="item"}){const s=(()=>t?` with name "${t}"`:n?` with data "${n}"`:"")();super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function Ar(e,t={}){return typeof e.chainId=="string"?yt(e):{...e,...t.signature}}function yt(e){const{address:t,chainId:n,nonce:r}=e,s=ct(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...s}}function rs(e){return e.map(yt)}function $r(e){return zr(e,{presign:!0})}function zr(e,t={}){const{presign:n}=t;return K(g("0x05",An(Sr(n?{address:e.address,chainId:e.chainId,nonce:e.nonce}:e))))}function Br(e){const{address:t,chainId:n,nonce:r,...s}=e;return{address:t,chainId:m(n),nonce:m(r),...Kn(s)}}function ss(e){return e.map(Br)}function Sr(e){const{address:t,chainId:n,nonce:r}=e,s=ct(e);return[n?m(n):"0x",t,r?m(r):"0x",...s?Zn(s):[]]}async function Lr(e,{address:t,blockHash:n,blockNumber:r,blockTag:s="latest",requireCanonical:i}){const o=Dt({blockHash:n,blockNumber:r,blockTag:s,requireCanonical:i}),c=await e.request({method:"eth_getCode",params:[t,o]},{dedupe:typeof r=="bigint"||n!==void 0});if(c!=="0x")return c}const pt="0x6492649264926492649264926492649264926492649264926492649264926492";function Tr(e){if(b(e,-32)!==pt)throw new Or(e)}function Cr(e){const{data:t,signature:n,to:r}=e;return g(ut(ft("address, bytes, bytes"),[r,t,n]),pt)}function Rr(e){try{return Tr(e),!0}catch{return!1}}let Or=class extends y{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 mt="0x8010801080108010801080108010801080108010801080108010801080108010",bt=ft("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function $e(e){if(typeof e=="string"){if(b(e,-32)!==mt)throw new Nr(e)}else ge(e.authorization)}function Ur(e){$e(e);const t=Wt(b(e,-64,-32)),n=b(e,-t-64,-64),r=b(e,0,-t-64),[s,i,o]=br(bt,n);return{authorization:Ar({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:r,...o&&o!=="0x"?{data:o,to:i}:{}}}function os(e){const{data:t,signature:n}=e;$e(e);const r=it({payload:$r(e.authorization),signature:xe(e.authorization)}),s=ut(bt,[{...e.authorization,delegation:e.authorization.address,chainId:BigInt(e.authorization.chainId)},e.to??r,t??"0x"]),i=m(w(s),{size:32});return g(n,s,i,mt)}function Vr(e){try{return $e(e),!0}catch{return!1}}class Nr extends y{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 _r({address:e,authorization:t,signature:n}){return ee(te(e),await Yt({authorization:t,signature:n}))}function kr({r:e,s:t,to:n="hex",v:r,yParity:s}){const i=(()=>{if(s===0||s===1)return s;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),o=`0x${new ye.Signature(Oe(e),Oe(t)).toCompactHex()}${i===0?"1b":"1c"}`;return n==="hex"?o:sn(o)}async function gt(e,t){const{abi:n,address:r,args:s,functionName:i,...o}=t,c=le({abi:n,args:s,functionName:i});try{const{data:u}=await Y(e,Ke,"call")({...o,data:c,to:r});return qt({abi:n,args:s,functionName:i,data:u||"0x"})}catch(u){throw Kt(u,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:i})}}async function as(e,t){var a,f,d,p;const{address:n,chain:r=e.chain,hash:s,erc6492VerifierAddress:i=t.universalSignatureVerifierAddress??((f=(a=r==null?void 0:r.contracts)==null?void 0:a.erc6492Verifier)==null?void 0:f.address),multicallAddress:o=t.multicallAddress??((p=(d=r==null?void 0:r.contracts)==null?void 0:d.multicall3)==null?void 0:p.address),mode:c="auto"}=t;if(r!=null&&r.verifyHash)return await r.verifyHash(e,t);const u=(()=>{const h=t.signature;return on(h)?h:typeof h=="object"&&"r"in h&&"s"in h?kr(h):Je(h)})();try{if(c==="eoa")try{if(ee(te(n),await Ce({hash:s,signature:u})))return!0}catch{}return Vr(u)?await jr(e,{...t,multicallAddress:o,signature:u}):await Fr(e,{...t,verifierAddress:i,signature:u})}catch(h){if(c!=="eoa")try{if(ee(te(n),await Ce({hash:s,signature:u})))return!0}catch{}if(h instanceof B)return!1;throw h}}async function jr(e,t){var R;const{address:n,blockHash:r,blockNumber:s,blockTag:i,hash:o,multicallAddress:c,requireCanonical:u}=t,{authorization:a,data:f,signature:d,to:p}=Ur(t.signature);if(await Lr(e,{address:n,blockHash:r,blockNumber:s,blockTag:i,requireCanonical:u})===j(["0xef0100",a.address]))return await Hr(e,{...t,signature:d});const P={address:a.address,chainId:Number(a.chainId),nonce:Number(a.nonce),r:l(a.r,{size:32}),s:l(a.s,{size:32}),yParity:a.yParity};if(!await _r({address:n,authorization:P}))throw new B;const A=await Y(e,gt,"readContract")({...c?{address:c}:{code:Zt},authorizationList:[P],abi:an,blockHash:r,blockNumber:s,blockTag:"pending",functionName:"aggregate3",requireCanonical:u,args:[[...f?[{allowFailure:!0,target:p??n,callData:f}]:[],{allowFailure:!0,target:n,callData:le({abi:Qe,functionName:"isValidSignature",args:[o,d]})}]]}),v=(R=A[A.length-1])==null?void 0:R.returnData;if(v!=null&&v.startsWith("0x1626ba7e"))return!0;throw new B}async function Fr(e,t){const{address:n,factory:r,factoryData:s,hash:i,signature:o,verifierAddress:c,...u}=t,a=await(async()=>!r&&!s||Rr(o)?o:Cr({data:s,signature:o,to:r}))(),f=c?{to:c,data:le({abi:Ue,functionName:"isValidSig",args:[n,i,a]}),...u}:{data:Jt({abi:Ue,args:[n,i,a],bytecode:en}),...u},{data:d}=await Y(e,Ke,"call")(f).catch(p=>{throw p instanceof Qt?new B:p});if(cn(d??"0x0"))return!0;throw new B}async function Hr(e,t){const{address:n,blockHash:r,blockNumber:s,blockTag:i,hash:o,requireCanonical:c,signature:u}=t;if((await Y(e,gt,"readContract")({address:n,abi:Qe,args:[o,u],blockHash:r,blockNumber:s,blockTag:i,functionName:"isValidSignature",requireCanonical:c}).catch(f=>{throw f instanceof Xt?new B:f})).startsWith("0x1626ba7e"))return!0;throw new B}class B extends Error{}export{rt as $,Kr as A,K as B,_n as C,ne as D,kn as E,Mn as F,at as G,ge as H,Jr as I,Xr as J,jn as K,ts as L,An as M,Ge as N,qn as O,Kn as P,be as Q,z as R,ct as S,rs as T,Jn as U,ss as V,Zr as W,xe as X,it as Y,Zn as Z,es as _,Lr as a,Ae as b,vr as c,br as d,ut as e,ns as f,S as g,fn as h,dn as i,pe as j,ln as k,hn as l,Vr as m,Wr as n,Yr as o,Ve as p,Ne as q,gt as r,qr as s,q as t,Ur as u,as as v,os as w,kr as x,F as y,st as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as v,i as g,b as a}from"./lit-element-0711c853.js";import{n as d,r as w,o as q}from"./class-map-d7835e88.js";import{p as ve,w as ge,s as fe,a as be,R as l,M as f,S as ne,r as P,A as K,e as ce,c as le,C as m,b as Y,d as ye,f as S,E as ie,O as E,g as F,h as oe,i as A,j as H,T as xe,k as Ce,l as ke,m as Se}from"./core-
|
|
1
|
+
import{a as v,i as g,b as a}from"./lit-element-0711c853.js";import{n as d,r as w,o as q}from"./class-map-d7835e88.js";import{p as ve,w as ge,s as fe,a as be,R as l,M as f,S as ne,r as P,A as K,e as ce,c as le,C as m,b as Y,d as ye,f as S,E as ie,O as E,g as F,h as oe,i as A,j as H,T as xe,k as Ce,l as ke,m as Se}from"./core-1a166f08.js";import{c as u,U as Te}from"./index-69a0492a.js";import"./index-10c73e9d.js";import"./index-b3889ac8.js";import"./index-accd8060.js";import"./index-2cab452e.js";import"./index.es-30a0ec70.js";import"./index-6ab757a5.js";import"./index.es-4520fb10.js";import"./http-a4cf4808.js";import"./createBatchScheduler-7c9ada66.js";import"./W3MFrameProviderSingleton-316899f0.js";import"./NetworkUtil-cfdab321.js";import"./async-directive-ff05e1a6.js";const p=ve({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),We={state:p,subscribe(r){return fe(p,()=>r(p))},subscribeKey(r,e){return be(p,r,e)},showTooltip({message:r,triggerRect:e,variant:t}){p.open=!0,p.message=r,p.triggerRect=e,p.variant=t},hide(){p.open=!1,p.message="",p.triggerRect={width:0,height:0,top:0,left:0}}},O=ge(We),we={isUnsupportedChainView(){return l.state.view==="UnsupportedChain"||l.state.view==="SwitchNetwork"&&l.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){f.shake();return}if(await ne.isSIWXCloseDisabled()){f.shake();return}f.close()}},Re=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 g,b as d,a as pe}from"./lit-element-0711c853.js";import{n as l,o as $,r as h}from"./class-map-d7835e88.js";import{d as v,r as V,e as me,v as B,i as fe}from"./index-
|
|
1
|
+
import{i as g,b as d,a as pe}from"./lit-element-0711c853.js";import{n as l,o as $,r as h}from"./class-map-d7835e88.js";import{d as v,r as V,e as me,v as B,i as fe}from"./index-23dd6251.js";import{c as f,U as le}from"./index-5ece9033.js";import{R as c,M as k,J as ce,h as we,A as H,C as w,n as U,F as be,E as K,O as A,d as M,S as E,m as z,T as ge,K as ye}from"./W3MFrameProviderSingleton-316899f0.js";import{P as D}from"./index-a69ba1cc.js";import"./index-e9ab8876.js";import{H as ie}from"./HelpersUtil-47bce835.js";import{C as F}from"./ConstantsUtil-c3a75781.js";import"./index-d2f37bee.js";import"./index-6d8da0b7.js";import"./index-f49c89c1.js";import"./index-3bc5c9df.js";import{S as ve}from"./SwapController-6f3f28da.js";import"./index-d44b19e2.js";import"./index-10c73e9d.js";import"./index-b3889ac8.js";import"./index-accd8060.js";import"./index-2cab452e.js";import"./index-877ffe4a.js";import"./index.es-4520fb10.js";import"./NetworkUtil-cfdab321.js";import"./createBatchScheduler-7c9ada66.js";import"./http-a4cf4808.js";import"./index-e332040b.js";import"./index-401eba13.js";import"./index-b3691f6b.js";import"./index-ad63abcf.js";import"./index-a6a44c61.js";import"./MathUtil-b514a570.js";import"./index-30a8f53e.js";import"./index-8aeaab91.js";const de={isUnsupportedChainView(){return c.state.view==="UnsupportedChain"||c.state.view==="SwitchNetwork"&&c.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){k.shake();return}if(await ce.isSIWXCloseDisabled()){k.shake();return}(c.state.view==="DataCapture"||c.state.view==="DataCaptureOtpConfirm")&&we.disconnect(),k.close()}},xe=v`
|
|
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-1e425ab1.js";import{h as g,f as N}from"./prepare-contract-call-4be4cc68.js";import{s as A}from"./sleep-9eff569f.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};
|