@solarpunkltd/swarm-id 0.8.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +17 -7
  2. package/dist/bus/account-bus.d.ts +12 -0
  3. package/dist/bus/messages.d.ts +12 -0
  4. package/dist/bus/signaling-transport.d.ts +2 -0
  5. package/dist/chunks/ccip-BEanftc1.js +2 -0
  6. package/dist/chunks/ccip-BEanftc1.js.map +1 -0
  7. package/dist/chunks/{chat-binding-DgECjSWW.js → chat-binding-gSvKTm5l.js} +15 -15
  8. package/dist/chunks/chat-binding-gSvKTm5l.js.map +1 -0
  9. package/dist/chunks/index-BbRV2bja.js +2 -0
  10. package/dist/chunks/index-BbRV2bja.js.map +1 -0
  11. package/dist/index.d.ts +5 -1
  12. package/dist/internal.d.ts +3 -1
  13. package/dist/internal.esm.js +1 -1
  14. package/dist/internal.esm.js.map +1 -1
  15. package/dist/schemas.d.ts +59 -0
  16. package/dist/swarm-id-button-frame.d.ts +77 -0
  17. package/dist/swarm-id-client.d.ts +64 -69
  18. package/dist/swarm-id-proxy.d.ts +47 -55
  19. package/dist/swarm-id.esm.js +1 -1
  20. package/dist/swarm-id.esm.js.map +1 -1
  21. package/dist/sync/device-state.d.ts +16 -7
  22. package/dist/sync/index.d.ts +2 -1
  23. package/dist/sync/published-wallet-link.d.ts +27 -0
  24. package/dist/types.d.ts +374 -64
  25. package/dist/utils/button-view.d.ts +16 -0
  26. package/dist/utils/ens-name.d.ts +33 -0
  27. package/dist/utils/ens.d.ts +13 -0
  28. package/dist/utils/json-rpc.d.ts +5 -0
  29. package/dist/utils/personal-sign.d.ts +17 -0
  30. package/dist/utils/postage-stamp-association.d.ts +24 -25
  31. package/dist/utils/site-allow-list.d.ts +0 -4
  32. package/dist/utils/storage-probe.d.ts +20 -10
  33. package/dist/utils/wallet-link.d.ts +70 -0
  34. package/package.json +2 -1
  35. package/dist/chunks/chat-binding-DgECjSWW.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{A as e,S as t,I as n,P as r,a as s,u as o,T as i,b as a,g as c,E as d,c as u,B as f,d as l,i as h,w as p,e as b,f as m,h as y,j as g,M as w,N as A,R as v,k as x,H as I,l as R,m as P,s as B,n as C,t as E,o as M,p as q,q as F,C as k}from"./chat-binding-gSvKTm5l.js";const D=BigInt(2**32-1),O=BigInt(32);function z(e,t=!1){return t?{h:Number(e&D),l:Number(e>>O&D)}:{h:0|Number(e>>O&D),l:0|Number(e&D)}}function Q(e){const t=e.webkitRelativePath;return t?t.replace(/^[^/]*\//,""):e.name}function U(e,n,r){return p(e,n,r).catch(e=>{throw e instanceof b?new t("init-failed",e.message,{cause:e}):e})}function S(e){if(void 0===e)return;const n=y.safeParse(e);if(n.success)return n.data;const r=n.error.issues[0];throw new t("invalid-request",`Invalid button config at ${["config",...r.path].join(".")}: ${r.message}`,{cause:n.error})}function T(e){if(m.safeParse(e).success)return e;throw new t("invalid-request",`Invalid button action: ${JSON.stringify(e)}`)}function j(e){if(!h(e))throw new t("invalid-request","Invalid beeApiUrl: must be an http(s) URL, optionally with a path, and no credentials, query or fragment");return e}class N{constructor(n){if(this.mountedButtons=new Map,this.ready=!1,this.pendingRequests=new Map,this.progressListeners=new Map,this.requestIdCounter=0,"undefined"==typeof window)throw new Error("@solarpunkltd/swarm-id runs in the browser only: construct SwarmIdClient in code that runs there (an effect, onMount, or behind `typeof window !== 'undefined'`), not in a server render");this.iframeOrigin=n.iframeOrigin,this.iframePath=n.iframePath||"/proxy",this.timeout=n.timeout??3e4,this.initializationTimeout=n.initializationTimeout??3e4,this.onConnectionChange=n.onConnectionChange,this.popupMode=n.popupMode||"window",this.metadata=n.metadata,this.subsidisedGatewayUrl=n.subsidisedGatewayUrl,void 0!==n.beeApiUrl&&(this.beeApiUrl=j(n.beeApiUrl));try{e.parse(this.metadata)}catch(e){throw new t("invalid-request",`Invalid app metadata: ${e}`,{cause:e})}this.setupMessageListener()}async initialize(){if(this.iframe)throw new t("invalid-state","SwarmIdClient already initialized");this.firstConnectionInfoPromise=U(new Promise((e,t)=>{this.firstConnectionInfoResolve=e,this.firstConnectionInfoReject=t}),this.initializationTimeout,`Proxy initialization timeout - proxy did not send initial connectionInfoChanged within ${this.initializationTimeout}ms`),this.firstConnectionInfoPromise.catch(()=>{}),this.proxyInitializedPromise=U(new Promise((e,t)=>{this.proxyInitializedResolve=e,this.proxyInitializedReject=t}),this.initializationTimeout,`Proxy initialization timeout - proxy did not signal readiness within ${this.initializationTimeout}ms`),this.proxyInitializedPromise.catch(()=>{}),this.readyPromise=U(new Promise((e,t)=>{this.readyResolve=e,this.readyReject=t}),this.initializationTimeout,`Proxy initialization timeout - proxy did not respond within ${this.initializationTimeout}ms`),this.readyPromise.catch(()=>{}),this.iframe=document.createElement("iframe"),this.iframe.src=`${this.iframeOrigin}${this.iframePath}`,this.iframe.style.display="none",await new Promise((e,n)=>{this.iframeLoadReject=n,this.iframe.onload=()=>e(),this.iframe.onerror=()=>n(new t("init-failed","Failed to load Swarm ID iframe")),document.body.appendChild(this.iframe)}),this.iframeLoadReject=void 0,await this.proxyInitializedPromise,this.sendMessage({type:"parentIdentify",requestId:this.generateRequestId(),metadata:this.metadata,subsidisedGatewayUrl:this.subsidisedGatewayUrl,beeApiUrl:this.beeApiUrl}),await this.readyPromise,await this.firstConnectionInfoPromise}setupMessageListener(){this.messageListener=e=>{if(!this.iframe||e.source!==this.iframe.contentWindow)return;if("proxyInitialized"===e.data?.type)return void(this.proxyInitializedResolve&&(this.proxyInitializedResolve(),this.proxyInitializedResolve=void 0));const t=new URL(this.iframeOrigin).origin;if(e.origin!==t)return void console.warn("[SwarmIdClient] Rejected message from unauthorized origin:",e.origin);let r;try{r=n.parse(e.data)}catch(t){return void console.warn("[SwarmIdClient] Invalid message format:",e.data,t)}this.handleIframeMessage(r)},window.addEventListener("message",this.messageListener)}handleIframeMessage(e){switch(e.type){case"proxyReady":this.ready=!0,this.storageShared=e.storageShared,this.readyResolve&&this.readyResolve();break;case"connectionInfoChanged":{const t={canUpload:e.canUpload,storagePartitioned:e.storagePartitioned,uploadMode:e.uploadMode,uploadUnavailableReason:e.uploadUnavailableReason,identity:e.identity,appKey:e.appKey,partition:e.partition,chatBinding:e.chatBinding,beeApiUrl:e.beeApiUrl,postageBatchId:e.postageBatchId};this.lastConnectionInfo=t,this.firstConnectionInfoResolve&&(this.firstConnectionInfoResolve(),this.firstConnectionInfoResolve=void 0),this.onConnectionChange&&this.onConnectionChange(t);break}case"initError":console.error("[SwarmIdClient] Proxy initialization error:",e.error),this.readyReject&&this.readyReject(new t("init-failed",e.error));break;case"disconnectResponse":if("requestId"in e){const t=this.pendingRequests.get(e.requestId);t&&(clearTimeout(t.timeoutId),this.pendingRequests.delete(e.requestId),t.resolve(e))}break;case"error":{const n=this.pendingRequests.get(e.requestId);n&&(clearTimeout(n.timeoutId),this.pendingRequests.delete(e.requestId),n.reject(t.fromWire(e)));break}case"uploadProgress":this.progressListeners.get(e.requestId)?.({total:e.total,processed:e.processed});break;default:if("requestId"in e){const t=this.pendingRequests.get(e.requestId);t&&(clearTimeout(t.timeoutId),this.pendingRequests.delete(e.requestId),t.resolve(e))}}}sendMessage(e){if(!this.iframe||!this.iframe.contentWindow)throw new t("invalid-state","Iframe not initialized");try{r.parse(e)}catch(e){throw new t("invalid-request",`Invalid message format: ${e}`,{cause:e})}this.iframe.contentWindow.postMessage(e,this.iframeOrigin)}async sendRequest(e){const n=this.roundTripTimeout(e.requestOptions?.timeout);return new Promise((r,s)=>{const o=setTimeout(()=>{this.pendingRequests.delete(e.requestId),s(new t("timeout",`Request timeout after ${n}ms`))},n);this.pendingRequests.set(e.requestId,{resolve:r,reject:s,timeoutId:o}),this.sendMessage(e)})}roundTripTimeout(e){return void 0===e||e<=0?this.timeout:Math.min(e,2147483647)}generateRequestId(){return`req-${++this.requestIdCounter}-${Date.now()}`}normalizeSocIdentifier(e){return e instanceof s?e.toHex():e instanceof Uint8Array?o(e):e}normalizeSocKey(e){return e instanceof Uint8Array?o(e):e}normalizeFeedTopic(e){return e instanceof i?o(e.toUint8Array()):e instanceof s?e.toHex():e instanceof Uint8Array?o(e):e}normalizeReference(e){return e instanceof Uint8Array?o(e):e}normalizeFeedTimestamp(e){return"bigint"==typeof e?e.toString():"number"==typeof e?BigInt(Math.floor(e)).toString():e}normalizeFeedIndex(e){return"bigint"==typeof e?e.toString():"number"==typeof e?BigInt(Math.floor(e)).toString():e}normalizePayload(e){return e instanceof Uint8Array?e:(new TextEncoder).encode(e)}socChunkFromResponse(e){return{data:e.data,identifier:e.identifier,signature:e.signature,span:e.span,payload:e.payload,address:e.address,owner:e.owner}}ensureReady(){if(!this.ready)throw new t("invalid-state","SwarmIdClient not initialized. Call initialize() first.")}async checkAuthStatus(){this.ensureReady();const e=this.generateRequestId(),t=await this.sendRequest({type:"checkAuth",requestId:e});return{authenticated:t.authenticated,origin:t.origin,beeApiUrl:t.beeApiUrl}}async setBeeApiUrl(e){const t=j(e);this.ensureReady(),await this.sendRequest({type:"setBeeApiUrl",requestId:this.generateRequestId(),beeApiUrl:t}),this.beeApiUrl=t}async getPostageBatch(){this.ensureReady();const e=this.generateRequestId();return(await this.sendRequest({type:"getPostageBatch",requestId:e})).postageBatch}async disconnect(){this.ensureReady();const e=this.generateRequestId();if(!(await this.sendRequest({type:"disconnect",requestId:e})).success)throw new t("internal","Failed to disconnect")}async connect(e={}){if(this.ensureReady(),!0!==this.storageShared)throw new t("button-required","Swarm ID's frame cannot read Swarm ID's storage here, so a window opened from this page cannot sign it in. Sign in through the button from client.mountButton().");if(!this.openAuthWindow(e))throw new t("popup-blocked","Failed to open authentication popup")}mountButton(e,n){this.ensureReady();const r=this.iframeOrigin,s=new URL(r).origin;let o=T(n.action),i=S(n.config),a=!1,c=!1,d=!1,u=!1;const h=document.createElement("iframe");let p,b;h.src=`${r}${this.iframePath.replace(/\/proxy$/,"")}/button`,h.title="Swarm ID",Object.assign(h.style,{border:"none",backgroundColor:"transparent",width:"100%",height:"100%",display:"block",borderRadius:i?.borderRadius??"0"});const m=U(new Promise((e,t)=>{p=e,b=t}),this.initializationTimeout,`Swarm ID button did not show within ${this.initializationTimeout}ms`);m.then(()=>c=!0,()=>c=!0);const y=e=>h.contentWindow?.postMessage(e,r),g=e=>{if(e.source!==h.contentWindow)return;if(e.data?.type===f)return a=!0,void y({type:"buttonIdentify",action:o,config:i,metadata:this.metadata,popupMode:this.popupMode});if(e.origin!==s)return;const r=l.safeParse(e.data);if(!r.success)return;const c=r.data;"buttonReady"===c.type?p():"buttonInitError"===c.type?b(new t("init-failed",c.error)):(d="open"===c.state,u?d||w():n.onWindowChange?.(c.state))},w=()=>{this.mountedButtons.delete(A),window.removeEventListener("message",g),h.remove(),c||b(new t("invalid-state","Swarm ID button unmounted"))};window.addEventListener("message",g),e.appendChild(h);const A={ready:m,update:e=>{u||(o=void 0===e.action?o:T(e.action),i=void 0===e.config?i:S(e.config),h.style.borderRadius=i?.borderRadius??"0",a&&y({type:"buttonUpdate",action:o,config:i}))},unmount:()=>{!u&&this.mountedButtons.has(A)&&(u=!0,d?h.style.display="none":w())}};return this.mountedButtons.set(A,w),A}openAuthWindow(e){const t=this.iframePath.replace(/\/proxy$/,""),n=a(this.iframeOrigin+t,window.location.origin,this.metadata),r="popup"===(e.popupMode??this.popupMode)?window.open(n,"_blank","width=500,height=600"):window.open(n,"_blank");return Boolean(r)}get connectionInfo(){if(this.ensureReady(),!this.lastConnectionInfo)throw new t("invalid-state","SwarmIdClient connectionInfo not yet available.");return this.lastConnectionInfo}async getAvatar(e={}){const{identity:t}=this.connectionInfo;if(t)return void 0!==e.size&&"generated"===t.avatar.source?c(t.id,e.size):t.avatar}async isBeeConnected(){try{this.ensureReady();const e=this.generateRequestId();return(await this.sendRequest({type:"isConnected",requestId:e})).connected}catch{return!1}}async getNodeInfo(){this.ensureReady();const e=this.generateRequestId(),t=await this.sendRequest({type:"getNodeInfo",requestId:e});return{beeMode:t.beeMode,chequebookEnabled:t.chequebookEnabled,swapEnabled:t.swapEnabled}}async uploadData(e,t,n){this.ensureReady();const r=this.generateRequestId(),{onProgress:s,useWebSocket:o,useWorkers:i,workerCount:a,concurrency:c,...d}=t??{},u=this.listenForProgress(r,s);try{const t=await this.sendRequest({type:"uploadData",requestId:r,data:new Uint8Array(e),options:d,requestOptions:n,enableProgress:!!s,useWebSocket:o,useWorkers:i,workerCount:a,concurrency:c});return{reference:t.reference,tagUid:t.tagUid}}finally{u()}}async downloadData(e,t,n){this.ensureReady();const r=this.generateRequestId();return(await this.sendRequest({type:"downloadData",requestId:r,reference:e,options:t,requestOptions:n})).data}async deriveAppSecret(e){this.ensureReady();const t=this.generateRequestId();return(await this.sendRequest({type:"deriveAppSecret",requestId:t,label:e})).secret}async getChatKey(){this.ensureReady();const e=this.generateRequestId();return(await this.sendRequest({type:"getChatKey",requestId:e})).chatKey}async stampChunk(e){this.ensureReady();const t=this.generateRequestId(),n="soc"===e.kind?{...e,identifier:this.normalizeSocIdentifier(e.identifier),signer:"app"===e.signer?e.signer:{...e.signer,privateKey:this.normalizeSocKey(e.signer.privateKey)}}:e,r=await this.sendRequest({type:"stampChunk",requestId:t,chunk:n});return{address:r.address,stamp:r.stamp,...void 0!==r.owner&&{owner:r.owner},...void 0!==r.signature&&{signature:r.signature}}}async uploadFile(e,t,n,r){this.ensureReady();const s=this.generateRequestId(),{onProgress:o,useWebSocket:i,useWorkers:a,workerCount:c,concurrency:d,...u}=n??{};let f,l=t;if(e instanceof File){const t=await e.arrayBuffer();f=new Uint8Array(t),l=l||e.name}else f=new Uint8Array(e.buffer.slice(0),e.byteOffset,e.byteLength);const h=this.listenForProgress(s,o);try{const e=await this.sendRequest({type:"uploadFile",requestId:s,data:f,name:l,options:u,requestOptions:r,enableProgress:!!o,useWebSocket:i,useWorkers:a,workerCount:c,concurrency:d});return{reference:e.reference,tagUid:e.tagUid}}finally{h()}}async downloadFile(e,t,n,r){this.ensureReady();const s=this.generateRequestId(),o=await this.sendRequest({type:"downloadFile",requestId:s,reference:e,path:t,options:n,requestOptions:r});return{name:o.name,data:new Uint8Array(o.data)}}async uploadFiles(e,t,n){this.ensureReady();const r=this.generateRequestId(),{onProgress:s,useWorkers:o,workerCount:i,...a}=t??{},c=await Promise.all(Array.from(e,async e=>{const{path:t,file:n}=e instanceof File?{path:Q(e),file:e}:e;return{path:t,data:new Uint8Array(await n.arrayBuffer()),contentType:n.type||void 0}})),d=this.listenForProgress(r,s);try{const e=await this.sendRequest({type:"uploadFiles",requestId:r,files:c,options:a,requestOptions:n,enableProgress:!!s,useWorkers:o,workerCount:i});return{reference:e.reference,tagUid:e.tagUid}}finally{d()}}async listFiles(e,t){this.ensureReady();const n=this.generateRequestId();return(await this.sendRequest({type:"listFiles",requestId:n,reference:e,requestOptions:t})).entries}listenForProgress(e,t){return t?(this.progressListeners.set(e,t),()=>{this.progressListeners.delete(e)}):()=>{}}async uploadChunk(e,t,n){this.ensureReady();const r=this.generateRequestId(),{onProgress:s,...o}=t??{};return{reference:(await this.sendRequest({type:"uploadChunk",requestId:r,data:e,options:o,requestOptions:n})).reference}}async downloadChunk(e,t,n){this.ensureReady();const r=this.generateRequestId(),s=await this.sendRequest({type:"downloadChunk",requestId:r,reference:e,options:t,requestOptions:n});return new Uint8Array(s.data)}makeSOCReader(e,t){this.ensureReady();const n=new d(e).toHex(),r=async(e,r)=>{const s=this.generateRequestId(),o=await this.sendRequest({type:"socDownload",requestId:s,owner:n,identifier:this.normalizeSocIdentifier(e),encryptionKey:this.normalizeSocKey(r),requestOptions:t});return this.socChunkFromResponse(o)},s=async(e,r)=>{const s=this.generateRequestId(),o=await this.sendRequest({type:"socRawDownload",requestId:s,owner:n,identifier:this.normalizeSocIdentifier(e),encryptionKey:r?this.normalizeSocKey(r):void 0,requestOptions:t});return this.socChunkFromResponse(o)};return{getOwner:async()=>n,rawDownload:(e,t)=>s(e,t),download:(e,t)=>r(e,t)}}makeSOCWriter(e,t){this.ensureReady();const n=e?new u(e):void 0,r=n?n.toHex():void 0;let s=n?n.publicKey().address().toHex():void 0;const o=async(e,n)=>{const r=this.generateRequestId(),o=await this.sendRequest({type:"socDownload",requestId:r,owner:s,identifier:this.normalizeSocIdentifier(e),encryptionKey:this.normalizeSocKey(n),requestOptions:t});return this.socChunkFromResponse(o)},i=async(e,n)=>{const r=this.generateRequestId(),o=await this.sendRequest({type:"socRawDownload",requestId:r,owner:s,identifier:this.normalizeSocIdentifier(e),encryptionKey:n?this.normalizeSocKey(n):void 0,requestOptions:t});return this.socChunkFromResponse(o)},a=async(e,n,o)=>{const i=this.generateRequestId(),a=await this.sendRequest({type:"socUpload",requestId:i,identifier:this.normalizeSocIdentifier(e),data:new Uint8Array(n),signer:r,options:o,requestOptions:t});return s=a.owner,{reference:a.reference,tagUid:a.tagUid,encryptionKey:a.encryptionKey,owner:a.owner}},c=async(e,n,o)=>{const i=this.generateRequestId(),a=await this.sendRequest({type:"socRawUpload",requestId:i,identifier:this.normalizeSocIdentifier(e),data:new Uint8Array(n),signer:r,options:o,requestOptions:t});return s=a.owner,{reference:a.reference,tagUid:a.tagUid,encryptionKey:a.encryptionKey,owner:a.owner}};return{getOwner:async()=>{if(s)return s;const e=this.generateRequestId(),t=await this.sendRequest({type:"socGetOwner",requestId:e});return s=t.owner,s},rawDownload:(e,t)=>i(e,t),download:(e,t)=>o(e,t),upload:(e,t,n)=>a(e,t,n),rawUpload:(e,t,n)=>c(e,t,n)}}makeEpochFeedReader(e,t){this.ensureReady();const n=this.normalizeFeedTopic(e.topic);let r=e.owner?new d(e.owner).toHex():void 0;const s=async e=>{const s=void 0!==e?.at?e.at:BigInt(Math.floor(Date.now()/1e3)),o=this.generateRequestId(),i=(await this.sendRequest({type:"epochFeedDownloadReference",requestId:o,topic:n,owner:r,at:this.normalizeFeedTimestamp(s),after:void 0!==e?.after?this.normalizeFeedTimestamp(e.after):void 0,encryptionKey:void 0!==e?.encryptionKey?this.normalizeSocKey(e.encryptionKey):void 0,requestOptions:t})).reference,a=i&&i.startsWith("0x")?i.slice(2):i;return{reference:i,encryptionKey:a&&128===a.length?a.slice(64):void 0}},o=async e=>{const s=void 0!==e?.at?e.at:BigInt(Math.floor(Date.now()/1e3)),o=this.generateRequestId();return{reference:(await this.sendRequest({type:"epochFeedDownloadReference",requestId:o,topic:n,owner:r,at:this.normalizeFeedTimestamp(s),after:void 0!==e?.after?this.normalizeFeedTimestamp(e.after):void 0,encryptionKey:void 0,requestOptions:t})).reference,encryptionKey:void 0}};return{getOwner:async()=>{if(r)return r;const e=this.generateRequestId(),t=await this.sendRequest({type:"feedGetOwner",requestId:e});return r=t.owner,r},downloadReference:s,downloadPayload:async e=>{const n=await s(e);if(!n.reference)return{reference:void 0,payload:void 0,encryptionKey:void 0};const r=await this.downloadData(n.reference,void 0,t);return{reference:n.reference,payload:r,encryptionKey:n.encryptionKey}},downloadRawReference:o,downloadRawPayload:async e=>{const n=await o(e);if(!n.reference)return{reference:void 0,payload:void 0,encryptionKey:void 0};const r=await this.downloadData(n.reference,void 0,t);return{reference:n.reference,payload:r,encryptionKey:void 0}}}}makeEpochFeedWriter(e,t){this.ensureReady();const n=this.normalizeFeedTopic(e.topic),r=e.signer?new u(e.signer):void 0,s=r?r.toHex():void 0;let o=r?r.publicKey().address().toHex():void 0;const i=async e=>{const r=void 0!==e?.at?e.at:BigInt(Math.floor(Date.now()/1e3)),s=this.generateRequestId(),i=(await this.sendRequest({type:"epochFeedDownloadReference",requestId:s,topic:n,owner:o,at:this.normalizeFeedTimestamp(r),after:void 0!==e?.after?this.normalizeFeedTimestamp(e.after):void 0,encryptionKey:void 0!==e?.encryptionKey?this.normalizeSocKey(e.encryptionKey):void 0,requestOptions:t})).reference,a=i&&i.startsWith("0x")?i.slice(2):i;return{reference:i,encryptionKey:a&&128===a.length?a.slice(64):void 0}},a=async e=>{const r=void 0!==e?.at?e.at:BigInt(Math.floor(Date.now()/1e3)),s=this.generateRequestId();return{reference:(await this.sendRequest({type:"epochFeedDownloadReference",requestId:s,topic:n,owner:o,at:this.normalizeFeedTimestamp(r),after:void 0!==e?.after?this.normalizeFeedTimestamp(e.after):void 0,encryptionKey:void 0,requestOptions:t})).reference,encryptionKey:void 0}};return{getOwner:async()=>{if(o)return o;const e=this.generateRequestId(),t=await this.sendRequest({type:"feedGetOwner",requestId:e});return o=t.owner,o},downloadReference:i,downloadPayload:async e=>{const n=await i(e);if(!n.reference)return{reference:void 0,payload:void 0,encryptionKey:void 0};const r=await this.downloadData(n.reference,void 0,t);return{reference:n.reference,payload:r,encryptionKey:n.encryptionKey}},downloadRawReference:a,downloadRawPayload:async e=>{const n=await a(e);if(!n.reference)return{reference:void 0,payload:void 0,encryptionKey:void 0};const r=await this.downloadData(n.reference,void 0,t);return{reference:n.reference,payload:r,encryptionKey:void 0}},uploadReference:async(e,r)=>{const o=void 0!==r?.at?r.at:BigInt(Math.floor(Date.now()/1e3)),i=this.normalizeReference(e),a=i.startsWith("0x")?i.slice(2):i,c=128===a.length?a.slice(64):void 0,d=r?.encryptionKey??c,u=this.generateRequestId(),f=await this.sendRequest({type:"epochFeedUploadReference",requestId:u,topic:n,signer:s,at:this.normalizeFeedTimestamp(o),reference:i,encryptionKey:void 0!==d?this.normalizeSocKey(d):void 0,hints:r?.hints,requestOptions:t});return{socAddress:f.socAddress,reference:i,encryptionKey:c,epoch:f.epoch,timestamp:f.timestamp}},uploadPayload:async(e,r)=>{const o=void 0!==r?.at?r.at:BigInt(Math.floor(Date.now()/1e3)),i=!1!==r?.encrypt,a=await this.uploadData(this.normalizePayload(e),{...r?.uploadOptions,encrypt:i},t),c=a.reference.startsWith("0x")?a.reference.slice(2):a.reference,d=128===c.length?c.slice(64):void 0,u=r?.encryptionKey??d,f=this.generateRequestId(),l=await this.sendRequest({type:"epochFeedUploadReference",requestId:f,topic:n,signer:s,at:this.normalizeFeedTimestamp(o),reference:a.reference,encryptionKey:void 0!==u?this.normalizeSocKey(u):void 0,hints:r?.hints,requestOptions:t}),h=d;return{socAddress:l.socAddress,reference:a.reference,encryptionKey:h,epoch:l.epoch,timestamp:l.timestamp}},uploadRawReference:async(e,r)=>{const o=void 0!==r?.at?r.at:BigInt(Math.floor(Date.now()/1e3)),i=this.normalizeReference(e),a=this.generateRequestId(),c=await this.sendRequest({type:"epochFeedUploadReference",requestId:a,topic:n,signer:s,at:this.normalizeFeedTimestamp(o),reference:i,encryptionKey:void 0,hints:r?.hints,requestOptions:t});return{socAddress:c.socAddress,reference:i,encryptionKey:void 0,epoch:c.epoch,timestamp:c.timestamp}},uploadRawPayload:async(e,r)=>{const o=void 0!==r?.at?r.at:BigInt(Math.floor(Date.now()/1e3)),i=await this.uploadData(this.normalizePayload(e),{...r?.uploadOptions,encrypt:!1},t),a=this.generateRequestId(),c=await this.sendRequest({type:"epochFeedUploadReference",requestId:a,topic:n,signer:s,at:this.normalizeFeedTimestamp(o),reference:i.reference,encryptionKey:void 0,hints:r?.hints,requestOptions:t});return{socAddress:c.socAddress,reference:i.reference,encryptionKey:void 0,epoch:c.epoch,timestamp:c.timestamp}}}}makeSequentialFeedReader(e,t){this.ensureReady();const n=this.normalizeFeedTopic(e.topic);let r=e.owner?new d(e.owner).toHex():void 0;return{getOwner:async()=>{if(r)return r;const e=this.generateRequestId(),t=await this.sendRequest({type:"seqFeedGetOwner",requestId:e});return r=t.owner,r},downloadPayload:async(e,s)=>{const o=this.generateRequestId(),i=await this.sendRequest({type:"seqFeedDownloadPayload",requestId:o,topic:n,owner:r,index:void 0!==s?.index?this.normalizeFeedIndex(s.index):void 0,at:void 0!==s?.at?this.normalizeFeedTimestamp(s.at):void 0,hasTimestamp:s?.hasTimestamp,lookupTimeoutMs:s?.lookupTimeoutMs,encryptionKey:this.normalizeSocKey(e),requestOptions:t});return{payload:i.payload,timestamp:i.timestamp,feedIndex:i.feedIndex,feedIndexNext:i.feedIndexNext}},downloadRawPayload:async e=>{const s=this.generateRequestId(),o=await this.sendRequest({type:"seqFeedDownloadRawPayload",requestId:s,topic:n,owner:r,index:void 0!==e?.index?this.normalizeFeedIndex(e.index):void 0,at:void 0!==e?.at?this.normalizeFeedTimestamp(e.at):void 0,hasTimestamp:e?.hasTimestamp,lookupTimeoutMs:e?.lookupTimeoutMs,encryptionKey:e?.encryptionKey?this.normalizeSocKey(e.encryptionKey):void 0,requestOptions:t});return{payload:o.payload,timestamp:o.timestamp,feedIndex:o.feedIndex,feedIndexNext:o.feedIndexNext}},downloadReference:async(e,s)=>{const o=this.generateRequestId(),i=await this.sendRequest({type:"seqFeedDownloadReference",requestId:o,topic:n,owner:r,index:void 0!==s?.index?this.normalizeFeedIndex(s.index):void 0,at:void 0!==s?.at?this.normalizeFeedTimestamp(s.at):void 0,hasTimestamp:s?.hasTimestamp,lookupTimeoutMs:s?.lookupTimeoutMs,encryptionKey:this.normalizeSocKey(e),requestOptions:t});return{reference:i.reference,feedIndex:i.feedIndex,feedIndexNext:i.feedIndexNext}}}}makeSequentialFeedWriter(e,t){this.ensureReady();const n=this.normalizeFeedTopic(e.topic),r=e.signer?new u(e.signer):void 0,s=r?r.toHex():void 0;let o=r?r.publicKey().address().toHex():void 0;return{getOwner:async()=>{if(o)return o;const e=this.generateRequestId(),t=await this.sendRequest({type:"seqFeedGetOwner",requestId:e});return o=t.owner,o},downloadPayload:async(e,r)=>{const s=this.generateRequestId(),i=await this.sendRequest({type:"seqFeedDownloadPayload",requestId:s,topic:n,owner:o,index:void 0!==r?.index?this.normalizeFeedIndex(r.index):void 0,at:void 0!==r?.at?this.normalizeFeedTimestamp(r.at):void 0,hasTimestamp:r?.hasTimestamp,encryptionKey:this.normalizeSocKey(e),requestOptions:t});return{payload:i.payload,timestamp:i.timestamp,feedIndex:i.feedIndex,feedIndexNext:i.feedIndexNext}},downloadRawPayload:async e=>{const r=this.generateRequestId(),s=await this.sendRequest({type:"seqFeedDownloadRawPayload",requestId:r,topic:n,owner:o,index:void 0!==e?.index?this.normalizeFeedIndex(e.index):void 0,at:void 0!==e?.at?this.normalizeFeedTimestamp(e.at):void 0,hasTimestamp:e?.hasTimestamp,encryptionKey:e?.encryptionKey?this.normalizeSocKey(e.encryptionKey):void 0,requestOptions:t});return{payload:s.payload,timestamp:s.timestamp,feedIndex:s.feedIndex,feedIndexNext:s.feedIndexNext}},downloadReference:async(e,r)=>{const s=this.generateRequestId(),i=await this.sendRequest({type:"seqFeedDownloadReference",requestId:s,topic:n,owner:o,index:void 0!==r?.index?this.normalizeFeedIndex(r.index):void 0,at:void 0!==r?.at?this.normalizeFeedTimestamp(r.at):void 0,hasTimestamp:r?.hasTimestamp,encryptionKey:this.normalizeSocKey(e),requestOptions:t});return{reference:i.reference,feedIndex:i.feedIndex,feedIndexNext:i.feedIndexNext}},uploadPayload:async(e,r)=>{const i=this.generateRequestId(),a=await this.sendRequest({type:"seqFeedUploadPayload",requestId:i,topic:n,signer:s,data:this.normalizePayload(e),index:void 0!==r?.index?this.normalizeFeedIndex(r.index):void 0,at:void 0!==r?.at?this.normalizeFeedTimestamp(r.at):void 0,hasTimestamp:r?.hasTimestamp,lookupTimeoutMs:r?.lookupTimeoutMs,options:r,requestOptions:t});return o=a.owner,{reference:a.reference,feedIndex:a.feedIndex,owner:a.owner,encryptionKey:a.encryptionKey,tagUid:a.tagUid}},uploadRawPayload:async(e,r)=>{const i=this.generateRequestId(),a=await this.sendRequest({type:"seqFeedUploadRawPayload",requestId:i,topic:n,signer:s,data:this.normalizePayload(e),index:void 0!==r?.index?this.normalizeFeedIndex(r.index):void 0,at:void 0!==r?.at?this.normalizeFeedTimestamp(r.at):void 0,hasTimestamp:r?.hasTimestamp,lookupTimeoutMs:r?.lookupTimeoutMs,encryptionKey:r?.encryptionKey?this.normalizeSocKey(r.encryptionKey):void 0,options:r,requestOptions:t});return o=a.owner,{reference:a.reference,feedIndex:a.feedIndex,owner:a.owner,encryptionKey:a.encryptionKey,tagUid:a.tagUid}},uploadReference:async(e,r)=>{const i=this.generateRequestId(),a=await this.sendRequest({type:"seqFeedUploadReference",requestId:i,topic:n,signer:s,reference:this.normalizeReference(e),index:void 0!==r?.index?this.normalizeFeedIndex(r.index):void 0,at:void 0!==r?.at?this.normalizeFeedTimestamp(r.at):void 0,hasTimestamp:r?.hasTimestamp,lookupTimeoutMs:r?.lookupTimeoutMs,options:r,requestOptions:t});return o=a.owner,{reference:a.reference,feedIndex:a.feedIndex,owner:a.owner,encryptionKey:a.encryptionKey,tagUid:a.tagUid}}}}async createFeedManifest(e,t,n){this.ensureReady();const r=this.normalizeFeedTopic(e),s=this.generateRequestId();return(await this.sendRequest({type:"createFeedManifest",requestId:s,topic:r,owner:t?.owner,feedType:t?.feedType,uploadOptions:t?.uploadOptions,requestOptions:n})).reference}async gsocMine(e,t,n){this.ensureReady();const r=this.generateRequestId();return(await this.sendRequest({type:"gsocMine",requestId:r,targetOverlay:e,identifier:t,proximity:n})).signer}async gsocSend(e,t,n,r,s){this.ensureReady();const o=this.generateRequestId(),i=await this.sendRequest({type:"gsocSend",requestId:o,signer:e,identifier:t,data:new Uint8Array(n),options:r,requestOptions:s});return{reference:i.reference,tagUid:i.tagUid}}async actUploadData(e,t,n,r){this.ensureReady();const s=this.generateRequestId(),{onProgress:o,...i}=n??{},a=this.listenForProgress(s,o);try{const n=await this.sendRequest({type:"actUploadData",requestId:s,data:new Uint8Array(e),grantees:t,options:i,requestOptions:r,enableProgress:!!o});return{encryptedReference:n.encryptedReference,historyReference:n.historyReference,granteeListReference:n.granteeListReference,publisherPubKey:n.publisherPubKey,actReference:n.actReference,tagUid:n.tagUid}}finally{a()}}async actDownloadData(e,t,n,r,s){this.ensureReady();const o=this.generateRequestId();return(await this.sendRequest({type:"actDownloadData",requestId:o,encryptedReference:e,historyReference:t,publisherPubKey:n,timestamp:r,requestOptions:s})).data}async actAddGrantees(e,t,n){this.ensureReady();const r=this.generateRequestId(),s=await this.sendRequest({type:"actAddGrantees",requestId:r,historyReference:e,grantees:t,requestOptions:n});return{historyReference:s.historyReference,granteeListReference:s.granteeListReference,actReference:s.actReference}}async actRevokeGrantees(e,t,n,r){this.ensureReady();const s=this.generateRequestId(),o=await this.sendRequest({type:"actRevokeGrantees",requestId:s,historyReference:e,encryptedReference:t,revokeGrantees:n,requestOptions:r});return{encryptedReference:o.encryptedReference,historyReference:o.historyReference,granteeListReference:o.granteeListReference,actReference:o.actReference}}async actGetGrantees(e,t){this.ensureReady();const n=this.generateRequestId();return(await this.sendRequest({type:"actGetGrantees",requestId:n,historyReference:e,requestOptions:t})).grantees}destroy(){const e=()=>new t("invalid-state","Client destroyed");for(const e of[...this.mountedButtons.values()])e();this.pendingRequests.forEach(t=>{clearTimeout(t.timeoutId),t.reject(e())}),this.pendingRequests.clear(),this.progressListeners.clear(),this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=void 0),this.iframe&&this.iframe.parentNode&&(this.iframe.parentNode.removeChild(this.iframe),this.iframe=void 0),this.iframeLoadReject?.(e()),this.proxyInitializedReject?.(e()),this.readyReject?.(e()),this.firstConnectionInfoReject?.(e()),this.iframeLoadReject=void 0,this.readyResolve=void 0,this.readyReject=void 0,this.proxyInitializedResolve=void 0,this.proxyInitializedReject=void 0,this.firstConnectionInfoResolve=void 0,this.firstConnectionInfoReject=void 0,this.readyPromise=void 0,this.proxyInitializedPromise=void 0,this.firstConnectionInfoPromise=void 0,this.ready=!1}}function L(e){const t=e instanceof Uint8Array?e:g(e);if(32!==t.length)throw new Error(`Invalid content reference length: ${t.length} (expected 32 bytes)`);const n=new w;return n.addFork("/",A,{"website-index-document":"index.bin"}),n.addFork("index.bin",t,{"Content-Type":"application/octet-stream",Filename:"index.bin"}),{manifestNode:n}}function K(e){let t=0;for(;e;)t+=1&e,e>>>=1;return t}function G(e){for(let t=0;t<e.length;t++)if(0!==e[t])return!1;return!0}function J(e){if(e.length<96)throw new Error(`Manifest too small: ${e.length} bytes (expected at least 96)`);const t=e.slice(64,96);if(G(t))throw new Error("Manifest entry is zero");return new v(t).toHex()}function H(e){if(e.length<192)throw new Error(`Manifest too small: ${e.length} bytes (expected at least 192)`);const t=e.slice(96,128),n=Math.floor(105/8);if(!(2&t[n]))throw new Error('Manifest does not contain "index.bin" fork');let r=0;for(let e=0;e<n;e++)r+=K(t[e]);for(let e=0;e<1;e++)t[n]&1<<e&&r++;let s=128;for(let t=0;t<r;t++){const t=e[s];if(s+=64,!!(16&t)){s+=2+(e[s]<<8|e[s+1])}}const o=e[s],i=e[s+1];if(105!==e[s+2])throw new Error(`Expected "index.bin" prefix, got byte 0x${e[s+2].toString(16)}`);if(i>=9){const t=e.slice(s+2,s+2+9),n=(new TextEncoder).encode("index.bin");t.every((e,t)=>e===n[t])||console.warn('[ManifestBuilder] Prefix does not fully match "index.bin"')}if(!!!(2&o))throw new Error('"index.bin" fork is not a VALUE type');const a=s+32,c=e.slice(a,a+32);if(G(c))throw new Error('Manifest "index.bin" fork has zero reference');return new v(c).toHex()}let V=class e extends Error{constructor(t,n={}){const r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof e&&n.cause.docsPath||n.docsPath;super([t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],"Version: abitype@1.2.3"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function W(e,t){const n=e.exec(t);return n?.groups}const Y=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,X=/^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)?$/,Z=/^\(.+?\).*?$/,$=/^tuple(?<array>(\[(\d*)\])*)$/;function _(e){let t=e.type;if($.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){t+=_(e.components[r]),r<n-1&&(t+=", ")}const r=W($,e.type);return t+=`)${r?.array||""}`,_({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function ee(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=_(e[r]),r!==n-1&&(t+=", ")}return t}const te=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;const ne=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;const re=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;const se=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function oe(e){return se.test(e)}function ie(e){return W(se,e)}const ae=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;const ce=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;const de=/^receive\(\) external payable$/;const ue=new Set(["indexed"]),fe=new Set(["calldata","memory","storage"]);class le extends V{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class he extends V{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class pe extends V{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class be extends V{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class me extends V{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class ye extends V{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class ge extends V{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class we extends V{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Ae extends V{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class ve extends V{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class xe extends V{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class Ie extends V{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}const Re=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Pe(e,t={}){if(function(e){return re.test(e)}(e))return function(e,t={}){const n=function(e){return W(re,e)}(e);if(!n)throw new we({signature:e,type:"function"});const r=qe(n.parameters),s=[],o=r.length;for(let e=0;e<o;e++)s.push(Me(r[e],{modifiers:fe,structs:t,type:"function"}));const i=[];if(n.returns){const e=qe(n.returns),r=e.length;for(let n=0;n<r;n++)i.push(Me(e[n],{modifiers:fe,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:s,outputs:i}}(e,t);if(function(e){return ne.test(e)}(e))return function(e,t={}){const n=function(e){return W(ne,e)}(e);if(!n)throw new we({signature:e,type:"event"});const r=qe(n.parameters),s=[],o=r.length;for(let e=0;e<o;e++)s.push(Me(r[e],{modifiers:ue,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:s}}(e,t);if(function(e){return te.test(e)}(e))return function(e,t={}){const n=function(e){return W(te,e)}(e);if(!n)throw new we({signature:e,type:"error"});const r=qe(n.parameters),s=[],o=r.length;for(let e=0;e<o;e++)s.push(Me(r[e],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:s}}(e,t);if(function(e){return ae.test(e)}(e))return function(e,t={}){const n=function(e){return W(ae,e)}(e);if(!n)throw new we({signature:e,type:"constructor"});const r=qe(n.parameters),s=[],o=r.length;for(let e=0;e<o;e++)s.push(Me(r[e],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:s}}(e,t);if(function(e){return ce.test(e)}(e))return function(e){const t=function(e){return W(ce,e)}(e);if(!t)throw new we({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}(e);if(function(e){return de.test(e)}(e))return{type:"receive",stateMutability:"payable"};throw new Ae({signature:e})}const Be=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Ce=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Ee=/^u?int$/;function Me(e,t){const n=function(e,t,n){let r="";if(n)for(const e of Object.entries(n)){if(!e)continue;let t="";for(const n of e[1])t+=`[${n.type}${n.name?`:${n.name}`:""}]`;r+=`(${e[0]}{${t}})`}return t?`${t}:${e}${r}`:`${e}${r}`}(e,t?.type,t?.structs);if(Re.has(n))return Re.get(n);const r=Z.test(e),s=W(r?Ce:Be,e);if(!s)throw new pe({param:e});if(s.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||Y.test(e)||X.test(e)||ke.test(e)}(s.name))throw new be({param:e,name:s.name});const o=s.name?{name:s.name}:{},i="indexed"===s.modifier?{indexed:!0}:{},a=t?.structs??{};let c,d={};if(r){c="tuple";const e=qe(s.type),t=[],n=e.length;for(let r=0;r<n;r++)t.push(Me(e[r],{structs:a}));d={components:t}}else if(s.type in a)c="tuple",d={components:a[s.type]};else if(Ee.test(s.type))c=`${s.type}256`;else if("address payable"===s.type)c="address";else if(c=s.type,"struct"!==t?.type&&!Fe(c))throw new he({type:c});if(s.modifier){if(!t?.modifiers?.has?.(s.modifier))throw new me({param:e,type:t?.type,modifier:s.modifier});if(fe.has(s.modifier)&&!function(e,t){return t||"bytes"===e||"string"===e||"tuple"===e}(c,!!s.array))throw new ye({param:e,type:t?.type,modifier:s.modifier})}const u={type:`${c}${s.array??""}`,...o,...i,...d};return Re.set(n,u),u}function qe(e,t=[],n="",r=0){const s=e.trim().length;for(let o=0;o<s;o++){const s=e[o],i=e.slice(o+1);switch(s){case",":return 0===r?qe(i,[...t,n.trim()]):qe(i,t,`${n}${s}`,r);case"(":return qe(i,t,`${n}${s}`,r+1);case")":return qe(i,t,`${n}${s}`,r-1);default:return qe(i,t,`${n}${s}`,r)}}if(""===n)return t;if(0!==r)throw new Ie({current:n,depth:r});return t.push(n.trim()),t}function Fe(e){return"address"===e||"bool"===e||"function"===e||"string"===e||Y.test(e)||X.test(e)}const ke=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;const De=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function Oe(e=[],t={},n=new Set){const r=[],s=e.length;for(let o=0;o<s;o++){const s=e[o];if(Z.test(s.type))r.push(s);else{const e=W(De,s.type);if(!e?.type)throw new ge({abiParameter:s});const{array:o,type:i}=e;if(i in t){if(n.has(i))throw new xe({type:i});r.push({...s,type:`tuple${o??""}`,components:Oe(t[i],t,new Set([...n,i]))})}else{if(!Fe(i))throw new le({type:i});r.push(s)}}}return r}function ze(e){const t=function(e){const t={},n=e.length;for(let r=0;r<n;r++){const n=e[r];if(!oe(n))continue;const s=ie(n);if(!s)throw new we({signature:n,type:"struct"});const o=s.properties.split(";"),i=[],a=o.length;for(let e=0;e<a;e++){const t=o[e].trim();if(!t)continue;const n=Me(t,{type:"struct"});i.push(n)}if(!i.length)throw new ve({signature:n});t[s.name]=i}const r={},s=Object.entries(t),o=s.length;for(let e=0;e<o;e++){const[n,o]=s[e];r[n]=Oe(o,t)}return r}(e),n=[],r=e.length;for(let s=0;s<r;s++){const r=e[s];oe(r)||n.push(Pe(r,t))}return n}function Qe(e,t,n){const r=e[t.name];if("function"==typeof r)return r;const s=e[n];return"function"==typeof s?s:n=>t(e,n)}function Ue(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new dt(e.type);return`${e.name}(${Se(e.inputs,{includeName:t})})`}function Se(e,{includeName:t=!1}={}){return e?e.map(e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${Se(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t})).join(t?", ":","):""}function Te(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function je(e){return Te(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Ne="2.55.13";let Le=({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,Ke=`viem@${Ne}`,Ge=class e extends Error{constructor(t,n={}){const r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,s=n.cause instanceof e&&n.cause.docsPath||n.docsPath,o=Le?.({...n,docsPath:s});super([t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...r?[`Details: ${r}`]:[],...Ke?[`Version: ${Ke}`]:[]].join("\n"),n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Ne}walk(e){return Je(this,e)}};function Je(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?Je(e.cause,t):t?null:e}class He extends Ge{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e,name:"AbiConstructorNotFoundError"})}}class Ve extends Ge{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}class We extends Ge{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${Se(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=n}}class Ye extends Ge{constructor({cause:e}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:e})}}class Xe extends Ge{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n"),{name:"AbiEncodingArrayLengthMismatchError"})}}class Ze extends Ge{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${je(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class $e extends Ge{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n"),{name:"AbiEncodingLengthMismatchError"})}}class _e extends Ge{constructor(e,{docsPath:t}){super([`Arguments (\`args\`) were provided to "${e}", but "${e}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join("\n"),{docsPath:t,name:"AbiErrorInputsNotFoundError"})}}class et extends Ge{constructor(e,{docsPath:t}={}){super([`Error ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join("\n"),{docsPath:t,name:"AbiErrorNotFoundError"})}}class tt extends Ge{constructor(e,{docsPath:t,cause:n}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${e}.`].join("\n"),{docsPath:t,name:"AbiErrorSignatureNotFoundError",cause:n}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class nt extends Ge{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t,name:"AbiFunctionNotFoundError"})}}class rt extends Ge{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t,name:"AbiFunctionOutputsNotFoundError"})}}class st extends Ge{constructor(e,{docsPath:t}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`].join("\n"),{docsPath:t,name:"AbiFunctionSignatureNotFoundError"})}}class ot extends Ge{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Ue(e.abiItem)}\`, and`,`\`${t.type}\` in \`${Ue(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class it extends Ge{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t,name:"InvalidAbiEncodingType"})}}class at extends Ge{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t,name:"InvalidAbiDecodingType"})}}class ct extends Ge{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n"),{name:"InvalidArrayError"})}}class dt extends Ge{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n"),{name:"InvalidDefinitionTypeError"})}}class ut extends Ge{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}let ft=class extends Ge{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}};class lt extends Ge{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${t} ${n} long, but is ${e} ${n} long.`,{name:"InvalidBytesLengthError"})}}function ht(e,{dir:t,size:n=32}={}){return"string"==typeof e?pt(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new ft({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const o="right"===t;r[o?s:n-s-1]=e[o?s:e.length-s-1]}return r}(e,{dir:t,size:n})}function pt(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new ft({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}let bt=class extends Ge{constructor({max:e,min:t,signed:n,size:r,value:s}){super(`Number "${s}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}};class mt extends Ge{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class yt extends Ge{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function gt(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,r=0;for(let e=0;e<n.length-1&&"0"===n["left"===t?e:n.length-e-1].toString();e++)r++;return n="left"===t?n.slice(r):n.slice(0,n.length-r),"string"==typeof e?(1===n.length&&"right"===t&&(n=`${n}0`),`0x${n.length%2==1?`0${n}`:n}`):n}function wt(e,{size:t}){if(je(e)>t)throw new yt({givenSize:je(e),maxSize:t})}function At(e,t={}){const{signed:n}=t;t.size&&wt(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2;return r<=(1n<<8n*BigInt(s)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*s,"f")}`)-1n}const vt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function xt(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(wt(n,{size:t.size}),ht(n,{size:t.size})):n}function It(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=vt[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(wt(r,{size:t.size}),ht(r,{dir:"right",size:t.size})):r}function Rt(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let o;r?o=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(o=BigInt(Number.MAX_SAFE_INTEGER));const i="bigint"==typeof o&&n?-o-1n:0;if(o&&s>o||s<i){const t="bigint"==typeof e?"n":"";throw new bt({max:o?`${o}${t}`:void 0,min:`${i}${t}`,signed:n,size:r,value:`${e}${t}`})}const a=`0x${(n&&s<0?(1n<<BigInt(8*r))+BigInt(s):s).toString(16)}`;return r?ht(a,{size:r}):a}const Pt=new TextEncoder;function Bt(e,t={}){return It(Pt.encode(e),t)}const Ct=new TextEncoder;function Et(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=Rt(e,t);return Ft(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return wt(n,{size:t.size}),ht(n,{size:t.size});return n}(e,t):Te(e)?Ft(e,t):kt(e,t)}const Mt={zero:48,nine:57,A:65,F:70,a:97,f:102};function qt(e){return e>=Mt.zero&&e<=Mt.nine?e-Mt.zero:e>=Mt.A&&e<=Mt.F?e-(Mt.A-10):e>=Mt.a&&e<=Mt.f?e-(Mt.a-10):void 0}function Ft(e,t={}){let n=e;t.size&&(wt(n,{size:t.size}),n=ht(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,o=new Uint8Array(s);for(let e=0,t=0;e<s;e++){const n=qt(r.charCodeAt(t++)),s=qt(r.charCodeAt(t++));if(void 0===n||void 0===s)throw new Ge(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);o[e]=16*n+s}return o}function kt(e,t={}){const n=Ct.encode(e);return"number"==typeof t.size?(wt(n,{size:t.size}),ht(n,{dir:"right",size:t.size})):n}const Dt=BigInt(0),Ot=BigInt(1),zt=BigInt(2),Qt=BigInt(7),Ut=BigInt(256),St=BigInt(113),Tt=[],jt=[],Nt=[];for(let e=0,t=Ot,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Tt.push(2*(5*r+n)),jt.push((e+1)*(e+2)/2%64);let s=Dt;for(let e=0;e<7;e++)t=(t<<Ot^(t>>Qt)*St)%Ut,t&zt&&(s^=Ot<<(Ot<<BigInt(e))-Ot);Nt.push(s)}const Lt=function(e,t=!1){const n=e.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let o=0;o<n;o++){const{h:n,l:i}=z(e[o],t);[r[o],s[o]]=[n,i]}return[r,s]}(Nt,!0),Kt=Lt[0],Gt=Lt[1],Jt=(e,t,n)=>n>32?((e,t,n)=>t<<n-32|e>>>64-n)(e,t,n):((e,t,n)=>e<<n|t>>>32-n)(e,t,n),Ht=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class Vt extends I{constructor(e,t,n,r=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=s,R(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=P(this.state)}clone(){return this._cloneInto()}keccak(){B(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,s=(t+2)%10,o=n[s],i=n[s+1],a=Jt(o,i,1)^n[r],c=Ht(o,i,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=a,e[t+n+1]^=c}let t=e[2],s=e[3];for(let n=0;n<24;n++){const r=jt[n],o=Jt(t,s,r),i=Ht(t,s,r),a=Tt[n];t=e[a],s=e[a+1],e[a]=o,e[a+1]=i}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=Kt[r],e[1]^=Gt[r]}F(n)}(this.state32,this.rounds),B(this.state32),this.posOut=0,this.pos=0}update(e){C(this),e=E(e),M(e);const{blockLen:t,state:n}=this,r=e.length;for(let s=0;s<r;){const o=Math.min(t-this.pos,r-s);for(let t=0;t<o;t++)n[this.pos++]^=e[s++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,128&t&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){C(this,!1),M(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,s=e.length;r<s;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,s-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return R(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(q(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,F(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:s,enableXOF:o}=this;return e||(e=new Vt(t,n,r,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Wt=(()=>{return e=1,t=136,n=32,x(()=>new Vt(t,e,n));var e,t,n})();function Yt(e,t){const n=t||"hex",r=Wt(Te(e,{strict:!1})?Et(e):e);return"bytes"===n?r:function(e,t={}){return"number"==typeof e||"bigint"==typeof e?Rt(e,t):"string"==typeof e?Bt(e,t):"boolean"==typeof e?xt(e,t):It(e,t)}(r)}function Xt(e){return Yt(Et(e))}const Zt=e=>{var t;return function(e){let t=!0,n="",r=0,s="",o=!1;for(let i=0;i<e.length;i++){const a=e[i];if(["(",")",","].includes(a)&&(t=!0),"("===a&&r++,")"===a&&r--,t)if(0!==r)" "!==a?(s+=a,n+=a):","!==e[i-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===a&&["event","function",""].includes(s))s="";else if(s+=a,")"===a){o=!0;break}}if(!o)throw new Ge("Unable to normalize signature.");return s}("string"==typeof e?e:"function"===(t=e).type?`function ${t.name}(${ee(t.inputs)})${t.stateMutability&&"nonpayable"!==t.stateMutability?` ${t.stateMutability}`:""}${t.outputs?.length?` returns (${ee(t.outputs)})`:""}`:"event"===t.type?`event ${t.name}(${ee(t.inputs)})`:"error"===t.type?`error ${t.name}(${ee(t.inputs)})`:"constructor"===t.type?`constructor(${ee(t.inputs)})${"payable"===t.stateMutability?" payable":""}`:"fallback"===t.type?"fallback() external"+("payable"===t.stateMutability?" payable":""):"receive() external payable")};function $t(e){return Xt(Zt(e))}const _t=$t;class en extends Ge{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class tn extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,t)),t}set(e,t){if(super.has(e)&&super.delete(e),super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=super.keys().next().value;void 0!==e&&super.delete(e)}return this}}const nn=new tn(8192);function rn(e,t){if(nn.has(`${e}.${t}`))return nn.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Yt(kt(n),"bytes"),s=n.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&s[e]&&(s[e]=s[e].toUpperCase()),(15&r[e>>1])>=8&&s[e+1]&&(s[e+1]=s[e+1].toUpperCase());const o=`0x${s.join("")}`;return nn.set(`${e}.${t}`,o),o}const sn=/^0x[a-fA-F0-9]{40}$/,on=new tn(8192);function an(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(on.has(r))return on.get(r);const s=!(!sn.test(e)||e.toLowerCase()!==e&&n&&rn(e)!==e);return on.set(r,s),s}function cn(e){return"string"==typeof e[0]?dn(e):function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(e)}function dn(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}function un(e,t,n,{strict:r}={}){return Te(e,{strict:!1})?function(e,t,n,{strict:r}={}){fn(e,t);const s=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&ln(s,t,n);return s}(e,t,n,{strict:r}):hn(e,t,n,{strict:r})}function fn(e,t){if("number"==typeof t&&t>0&&t>je(e)-1)throw new ut({offset:t,position:"start",size:je(e)})}function ln(e,t,n){if("number"==typeof t&&"number"==typeof n&&je(e)!==n-t)throw new ut({offset:n,position:"end",size:je(e)})}function hn(e,t,n,{strict:r}={}){fn(e,t);const s=e.slice(t,n);return r&&ln(s,t,n),s}const pn=/^(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)?$/;function bn(e,t){if(e.length!==t.length)throw new $e({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(mn({param:e[r],value:t[r]}));return n}({params:e,values:t});return yn(n)}function mn({param:e,value:t}){const n=gn(e.type);if(n){const[r,s]=n;return function(e,{length:t,param:n}){const r=null===t;if(!Array.isArray(e))throw new ct(e);if(!r&&e.length!==t)throw new Xe({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=0===e.length&&wn(n);const o=[];for(let t=0;t<e.length;t++){const r=mn({param:n,value:e[t]});r.dynamic&&(s=!0),o.push(r)}if(r||s){const e=yn(o);if(r){return{dynamic:!0,encoded:dn([Rt(o.length,{size:32}),e])}}if(s)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:dn(o.map(({encoded:e})=>e))}}(t,{length:r,param:{...e,type:s}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const o=t.components[s],i=mn({param:o,value:e[Array.isArray(e)?s:o.name]});r.push(i),i.dynamic&&(n=!0)}return{dynamic:n,encoded:n?yn(r):dn(r.map(({encoded:e})=>e))}}(t,{param:e});if("address"===e.type)return function(e){if(!an(e))throw new en({address:e});return{dynamic:!1,encoded:pt(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){if("boolean"!=typeof e)throw new Ge(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:pt(xt(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const n=e.type.startsWith("int"),[,,r="256"]=pn.exec(e.type)??[];return function(e,{signed:t,size:n=256}){if("number"==typeof n){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new bt({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Rt(e,{size:32,signed:t})}}(t,{signed:n,size:Number(r)})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=je(e);if(!n){let t=e;return r%32!=0&&(t=pt(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:dn([pt(Rt(r,{size:32})),t])}}if(r!==Number.parseInt(n,10))throw new Ze({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:pt(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=Bt(e),n=Math.ceil(je(t)/32),r=[];for(let e=0;e<n;e++)r.push(pt(un(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:dn([pt(Rt(je(t),{size:32})),...r])}}(t);throw new it(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function yn(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:r,encoded:s}=e[n];t+=r?32:je(s)}const n=[],r=[];let s=0;for(let o=0;o<e.length;o++){const{dynamic:i,encoded:a}=e[o];i?(n.push(Rt(t+s,{size:32})),r.push(a),s+=je(a)):n.push(a)}return dn([...n,...r])}function gn(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function wn(e){const{type:t}=e;if("string"===t)return!0;if("bytes"===t)return!0;if(t.endsWith("[]"))return!0;if("tuple"===t)return e.components.some(wn);const n=gn(t);return!!n&&wn({...e,type:n[1]})}const An=e=>un($t(e),0,4);function vn(e){const{abi:t,args:n=[],name:r}=e,s=Te(r,{strict:!1}),o=t.filter(e=>s?"function"===e.type?An(e)===r:"event"===e.type&&_t(e)===r:"name"in e&&e.name===r);if(0===o.length)return;if(1===o.length)return o[0];let i;for(const e of o){if(!("inputs"in e))continue;if(!n||0===n.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==n.length)continue;const t=n.every((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&xn(t,r)});if(t){if(i&&"inputs"in i&&i.inputs){const t=In(e.inputs,i.inputs,n);if(t)throw new ot({abiItem:e,type:t[0]},{abiItem:i,type:t[1]})}i=e}}return i||o[0]}function xn(e,t){const n=typeof e,r=t.type;switch(r){case"address":return an(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every((t,r)=>"object"===n&&xn(Object.values(e)[r],t)):/^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)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every(e=>xn(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})))}}function In(e,t,n){for(const r in e){const s=e[r],o=t[r];if("tuple"===s.type&&"tuple"===o.type&&"components"in s&&"components"in o)return In(s.components,o.components,n[r]);const i=[s.type,o.type];if((()=>!(!i.includes("address")||!i.includes("bytes20"))||(i.includes("address")&&i.includes("string")||!(!i.includes("address")||!i.includes("bytes")))&&an(n[r],{strict:!1}))())return i}}function Rn(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const Pn="/docs/contract/encodeFunctionData";function Bn(e){const{args:t}=e,{abi:n,functionName:r}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:function(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const e=vn({abi:t,args:n,name:r});if(!e)throw new nt(r,{docsPath:Pn});s=e}if("function"!==s.type)throw new nt(void 0,{docsPath:Pn});return{abi:[s],functionName:An(Ue(s))}}(e),s=n[0];return dn([r,("inputs"in s&&s.inputs?bn(s.inputs,t??[]):void 0)??"0x"])}const Cn={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},En={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Mn={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class qn extends Ge{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class Fn extends Ge{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class kn extends Ge{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const Dn={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 kn({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Fn({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new qn({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 qn({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,255&e),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 On(e,t={}){void 0!==t.size&&wt(e,{size:t.size});return At(It(e),t)}function zn(e,t={}){let n=e;if(void 0!==t.size&&(wt(n,{size:t.size}),n=gt(n)),n.length>1||n[0]>1)throw new mt(n);return Boolean(n[0])}function Qn(e,t={}){void 0!==t.size&&wt(e,{size:t.size});return function(e,t={}){const n=At(e,t),r=Number(n);if(!Number.isSafeInteger(r))throw new bt({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return r}(It(e),t)}function Un(e,t){const n="string"==typeof t?Ft(t):t,r=function(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Dn);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}(n);if(0===je(n)&&e.length>0)throw new Ye;if(je(t)&&je(t)<32)throw new We({data:"string"==typeof t?t:It(t),params:e,size:je(t)});let s=0;const o=[];for(let t=0;t<e.length;++t){const i=e[t];s<n.length&&r.setPosition(s);const[a,c]=Sn(r,i,{staticPosition:0});s+=c,o.push(a)}return o}function Sn(e,t,{staticPosition:n}){const r=gn(t.type);if(r){const[s,o]=r;return function(e,t,{length:n,staticPosition:r}){if(null===n){const n=r+Qn(e.readBytes(jn)),s=n+Tn;e.setPosition(n);const o=Qn(e.readBytes(Tn)),i=Nn(t);let a=0;const c=[];for(let n=0;n<o;++n){e.setPosition(s+(i?32*n:a));const[r,o]=Sn(e,t,{staticPosition:s});a+=o,c.push(r),0===o&&(e.assertReadLimit(),e._touch())}return e.setPosition(r+32),[c,32]}if(Nn(t)){const s=r+Qn(e.readBytes(jn)),o=[];for(let r=0;r<n;++r){e.setPosition(s+32*r);const[n]=Sn(e,t,{staticPosition:s});o.push(n)}return e.setPosition(r+32),[o,32]}let s=0;const o=[];for(let i=0;i<n;++i){const[n,i]=Sn(e,t,{staticPosition:r+s});s+=i,o.push(n),0===i&&(e.assertReadLimit(),e._touch())}return[o,s]}(e,{...t,type:o},{length:s,staticPosition:n})}if("tuple"===t.type)return function(e,t,{staticPosition:n}){const r=0===t.components.length||t.components.some(({name:e})=>!e),s=r?[]:{};let o=0;if(Nn(t)){const i=n+Qn(e.readBytes(jn));for(let n=0;n<t.components.length;++n){const a=t.components[n];e.setPosition(i+o);const[c,d]=Sn(e,a,{staticPosition:i});o+=d,s[r?n:a?.name]=c}return e.setPosition(n+32),[s,32]}for(let i=0;i<t.components.length;++i){const a=t.components[i],[c,d]=Sn(e,a,{staticPosition:n});s[r?i:a?.name]=c,o+=d}return[s,o]}(e,t,{staticPosition:n});if("address"===t.type)return function(e){const t=e.readBytes(32);return[rn(It(hn(t,-20))),32]}(e);if("bool"===t.type)return function(e){return[zn(e.readBytes(32),{size:32}),32]}(e);if(t.type.startsWith("bytes"))return function(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const t=Qn(e.readBytes(32));e.setPosition(n+t);const r=Qn(e.readBytes(32));if(0===r)return e.setPosition(n+32),["0x",32];const s=e.readBytes(r);return e.setPosition(n+32),[It(s),32]}const o=It(e.readBytes(Number.parseInt(s,10),32));return[o,32]}(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return function(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?On(s,{signed:n}):Qn(s,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=Qn(e.readBytes(32)),r=t+n;e.setPosition(r);const s=Qn(e.readBytes(32));if(0===s)return e.setPosition(t+32),["",32];const o=e.readBytes(s,32),i=function(e,t={}){let n=e;return void 0!==t.size&&(wt(n,{size:t.size}),n=gt(n,{dir:"right"})),(new TextDecoder).decode(n)}(o);return e.setPosition(t+32),[i,32]}(e,{staticPosition:n});throw new at(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Tn=32,jn=32;function Nn(e){const{type:t}=e;if("string"===t)return!0;if("bytes"===t)return!0;if(t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(Nn);const n=gn(e.type);return!(!n||!Nn({...e,type:n[1]}))}function Ln(e){const{abi:t,data:n,cause:r}=e,s=un(n,0,4);if("0x"===s)throw new Ye({cause:r});const o=[...t||[],En,Mn].find(e=>"error"===e.type&&s===An(Ue(e)));if(!o)throw new tt(s,{docsPath:"/docs/contract/decodeErrorResult",cause:r});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Un(o.inputs,un(n,4)):void 0,errorName:o.name}}const Kn=(e,t,n)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,n);function Gn({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((e,n)=>`${r&&e.name?`${e.name}: `:""}${"object"==typeof t[n]?Kn(t[n]):t[n]}`).join(", ")})`}const Jn={wei:0,gwei:9,szabo:12,finney:15,ether:18};function Hn(e,t=0){if(!Number.isInteger(t)||t<0)throw new Vn({decimals:t});let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,o]=[n.slice(0,n.length-t),n.slice(n.length-t)];return o=o.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${o?`.${o}`:""}`}class Vn extends Error{constructor({decimals:e}){super(`\`decimals\` must be a non-negative integer. Got \`${e}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalsError"})}}function Wn(e,t="wei"){return function(e,t="wei"){return Hn(e,Jn.ether-Jn[t])}(e,t)}function Yn(e,t="wei"){return function(e,t="wei"){return Hn(e,Jn.gwei-Jn[t])}(e,t)}class Xn extends Ge{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Zn extends Ge{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function $n(e){return e.reduce((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`,"")}function _n(e){const t=Object.entries(e).map(([e,t])=>void 0===t||!1===t?null:[e,t]).filter(Boolean),n=t.reduce((e,[t])=>Math.max(e,t.length),0);return t.map(([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`).join("\n")}function er(e){if(e?.reason)return e.reason;if("function"==typeof DOMException)return new DOMException("This operation was aborted","AbortError");const t=new Error("This operation was aborted");return t.name="AbortError",t}function tr(e){return"object"==typeof e&&null!==e&&"name"in e&&"AbortError"===e.name}const nr=e=>{try{const t=new URL(e);return t.username||t.password?(t.username="",t.password="",t.toString()):e}catch{return e}};class rr extends Ge{constructor(e,{account:t,docsPath:n,chain:r,data:s,gas:o,gasPrice:i,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:d,to:u,value:f,stateOverride:l}){const h=t?Rn(t):void 0;let p=_n({from:h?.address,to:u,value:void 0!==f&&`${Wn(f)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:o,gasPrice:void 0!==i&&`${Yn(i)} gwei`,maxFeePerGas:void 0!==a&&`${Yn(a)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Yn(c)} gwei`,nonce:d});l&&(p+=`\n${function(e){return e.reduce((e,{address:t,...n})=>{let r=`${e} ${t}:\n`;return n.nonce&&(r+=` nonce: ${n.nonce}\n`),n.balance&&(r+=` balance: ${n.balance}\n`),n.code&&(r+=` code: ${n.code}\n`),n.state&&(r+=" state:\n",r+=$n(n.state)),n.stateDiff&&(r+=" stateDiff:\n",r+=$n(n.stateDiff)),r}," State Override:\n").slice(0,-1)}(l)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",p].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class sr extends Ge{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:s,functionName:o,sender:i}){const a=vn({abi:t,args:n,name:o}),c=a?Gn({abiItem:a,args:n,includeFunctionName:!1,includeName:!1}):void 0,d=_n({address:r&&r,function:a?Ue(a,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(o?.length??0).keys()].map(()=>" ").join("")}${c}`,sender:i});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=r,this.functionName=o,this.sender=i}}class or extends Ge{constructor({abi:e,data:t,functionName:n,message:r,cause:s}){let o,i,a,c,d;if(t&&"0x"!==t)try{i=Ln({abi:e,data:t,cause:s});const{abiItem:n,errorName:r,args:o}=i;if("Error"===r)c=o[0];else if("Panic"===r){const[e]=o;c=Cn[e]}else{const e=n?Ue(n,{includeName:!0}):void 0,t=n&&o?Gn({abiItem:n,args:o,includeFunctionName:!1,includeName:!1}):void 0;a=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map(()=>" ").join("")}${t}`:""]}}catch(e){o=e}else r&&(c=r);o instanceof tt&&(d=o.signature,a=[`Unable to decode signature "${d}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${d}.`]),super(c&&"execution reverted"!==c||d?[`The contract function "${n}" reverted with the following ${d?"signature":"reason"}:`,c||d].join("\n"):`The contract function "${n}" reverted.`,{cause:o??s,metaMessages:a,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.raw=t,this.reason=c,this.signature=d}}class ir extends Ge{constructor({functionName:e,cause:t}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:t})}}class ar extends Ge{constructor({factory:e}){super("Deployment for counterfactual contract call failed"+(e?` for factory "${e}".`:""),{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class cr extends Ge{constructor({data:e,message:t}){super(t||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class dr extends Ge{constructor({body:e,cause:t,details:n,headers:r,status:s,url:o}){super("HTTP request failed.",{cause:t,details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${nr(o)}`,e&&`Request body: ${Kn(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=r,this.status=s,this.url=o}}class ur extends Ge{constructor({maxSize:e,size:t}){super("HTTP response body exceeded the size limit.",{metaMessages:[`Max: ${e} bytes`,`Received: ${t} bytes`],name:"ResponseBodyTooLargeError"}),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e,this.size=t}}class fr extends Ge{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${nr(n)}`,`Request body: ${Kn(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code,this.data=t.data,this.url=n}}class lr extends Ge{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${nr(t)}`,`Request body: ${Kn(e)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=t}}class hr extends Ge{constructor(e,{code:t,docsPath:n,metaMessages:r,name:s,shortMessage:o}){super(o,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages,name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof fr?e.code:t??-1}}class pr extends hr{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class br extends hr{constructor(e){super(e,{code:br.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(br,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class mr extends hr{constructor(e){super(e,{code:mr.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(mr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class yr extends hr{constructor(e,{method:t}={}){super(e,{code:yr.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}}Object.defineProperty(yr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class gr extends hr{constructor(e){super(e,{code:gr.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")})}}Object.defineProperty(gr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class wr extends hr{constructor(e){super(e,{code:wr.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(wr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Ar extends hr{constructor(e){super(e,{code:Ar.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")})}}Object.defineProperty(Ar,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class vr extends hr{constructor(e){super(e,{code:vr.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(vr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class xr extends hr{constructor(e){super(e,{code:xr.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(xr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Ir extends hr{constructor(e){super(e,{code:Ir.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(Ir,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Rr extends hr{constructor(e,{method:t}={}){super(e,{code:Rr.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}}Object.defineProperty(Rr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Pr extends hr{constructor(e){super(e,{code:Pr.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Pr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Br extends hr{constructor(e){super(e,{code:Br.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Br,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Cr extends pr{constructor(e){super(e,{code:Cr.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Cr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Er extends pr{constructor(e){super(e,{code:Er.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(Er,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Mr extends pr{constructor(e,{method:t}={}){super(e,{code:Mr.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}}Object.defineProperty(Mr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class qr extends pr{constructor(e){super(e,{code:qr.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(qr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Fr extends pr{constructor(e){super(e,{code:Fr.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Fr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class kr extends pr{constructor(e){super(e,{code:kr.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(kr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Dr extends pr{constructor(e){super(e,{code:Dr.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(Dr,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class Or extends pr{constructor(e){super(e,{code:Or.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(Or,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class zr extends pr{constructor(e){super(e,{code:zr.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(zr,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class Qr extends pr{constructor(e){super(e,{code:Qr.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(Qr,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class Ur extends pr{constructor(e){super(e,{code:Ur.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(Ur,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Sr extends pr{constructor(e){super(e,{code:Sr.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Sr,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Tr extends pr{constructor(e){super(e,{code:Tr.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Tr,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class jr extends pr{constructor(e){super(e,{code:jr.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(jr,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class Nr extends hr{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const Lr=3;class Kr extends Ge{constructor({cause:e,message:t}={}){const n=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(Kr,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(Kr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class Gr extends Ge{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Yn(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(Gr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Jr extends Ge{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Yn(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(Jr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Hr extends Ge{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(Hr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Vr extends Ge{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(Vr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Wr extends Ge{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(Wr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Yr extends Ge{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(Yr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Xr extends Ge{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Xr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Zr extends Ge{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(Zr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class $r extends Ge{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty($r,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class _r extends Ge{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${Yn(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Yn(n)} gwei`:""}).`].join("\n"),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(_r,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class es extends Ge{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function ts(e,{format:t}){if(!t)return{};const n={};return function t(r){const s=Object.keys(r);for(const o of s)o in e&&(n[o]=e[o]),r[o]&&"object"==typeof r[o]&&!Array.isArray(r[o])&&t(r[o])}(t(e||{})),n}const ns={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function rs(e,t){const n={};return void 0!==e.authorizationList&&(n.authorizationList=e.authorizationList.map(e=>({address:e.address,r:e.r?Rt(BigInt(e.r)):e.r,s:e.s?Rt(BigInt(e.s)):e.s,chainId:Rt(e.chainId),nonce:Rt(e.nonce),...void 0!==e.yParity?{yParity:Rt(e.yParity)}:{},...void 0!==e.v&&void 0===e.yParity?{v:Rt(e.v)}:{}}))),void 0!==e.accessList&&(n.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(n.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?n.blobs=e.blobs.map(e=>It(e)):n.blobs=e.blobs),void 0!==e.data&&(n.data=e.data),e.account&&(n.from=e.account.address),void 0!==e.from&&(n.from=e.from),void 0!==e.gas&&(n.gas=Rt(e.gas)),void 0!==e.gasPrice&&(n.gasPrice=Rt(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(n.maxFeePerBlobGas=Rt(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(n.maxFeePerGas=Rt(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=Rt(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(n.nonce=Rt(e.nonce)),void 0!==e.to&&(n.to=e.to),void 0!==e.type&&(n.type=ns[e.type]),void 0!==e.value&&(n.value=Rt(e.value)),n}function ss(e){if(e&&0!==e.length)return e.reduce((e,{slot:t,value:n})=>{if(66!==t.length)throw new lt({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new lt({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e},{})}function os(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:o}=e,i={};if(void 0!==o&&(i.code=o),void 0!==t&&(i.balance=Rt(t)),void 0!==n&&(i.nonce=Rt(n)),void 0!==r&&(i.state=ss(r)),void 0!==s){if(i.state)throw new Zn;i.stateDiff=ss(s)}return i}const is=2n**256n-1n;function as(e){const{blockHash:t,blockNumber:n,blockTag:r,requireCanonical:s}=e;if(void 0!==s&&!t)throw new Ge("`requireCanonical` can only be provided when `blockHash` is set.");return t?s?{blockHash:t,requireCanonical:s}:{blockHash:t}:"bigint"==typeof n?Rt(n):r??"latest"}function cs(e,t){if(!an(e,{strict:!1}))throw new en({address:e});if(!an(t,{strict:!1}))throw new en({address:t});return e.toLowerCase()===t.toLowerCase()}const ds="/docs/contract/decodeFunctionResult";function us(e){const{abi:t,args:n,functionName:r,data:s}=e;let o=t[0];if(r){const e=vn({abi:t,args:n,name:r});if(!e)throw new nt(r,{docsPath:ds});o=e}if("function"!==o.type)throw new nt(void 0,{docsPath:ds});if(!o.outputs)throw new rt(o.name,{docsPath:ds});const i=Un(o.outputs,s);return i&&i.length>1?i:i&&1===i.length?i[0]:void 0}class fs extends Error{static setStaticOptions(e){fs.prototype.docsOrigin=e.docsOrigin,fs.prototype.showVersion=e.showVersion,fs.prototype.version=e.version}constructor(e,t={}){const n=(()=>{if(t.cause instanceof fs){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&"string"==typeof t.cause.details?t.cause.details:t.cause?.message?t.cause.message:t.details})(),r=t.cause instanceof fs&&t.cause.docsPath||t.docsPath,s=t.docsOrigin??fs.prototype.docsOrigin,o=`${s}${r??""}`,i=Boolean(t.version??fs.prototype.showVersion),a=t.version??fs.prototype.version;super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...n||r||i?["",n?`Details: ${n}`:void 0,r?`See: ${o}`:void 0,i?`Version: ${a}`:void 0]:[]].filter(e=>"string"==typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=t.cause,this.details=n,this.docs=o,this.docsOrigin=s,this.docsPath=r,this.shortMessage=e,this.showVersion=i,this.version=a}walk(e){return ls(this,e)}}function ls(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&e.cause?ls(e.cause,t):t?null:e}function hs(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let o;r?o=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(o=BigInt(Number.MAX_SAFE_INTEGER));const i="bigint"==typeof o&&n?-o-1n:0;if(o&&s>o||s<i){const t="bigint"==typeof e?"n":"";throw new ps({max:o?`${o}${t}`:void 0,min:`${i}${t}`,signed:n,size:r,value:`${e}${t}`})}const a=`0x${(n&&s<0?BigInt.asUintN(8*r,BigInt(s)):s).toString(16)}`;return r?function(e,t){return function(e,t={}){const{dir:n,size:r=32}=t;if(0===r)return e;const s=e.replace("0x","");if(s.length>2*r)throw new bs({size:Math.ceil(s.length/2),targetSize:r,type:"Hex"});return`0x${s["right"===n?"padEnd":"padStart"](2*r,"0")}`}(e,{dir:"left",size:t})}(a,r):a}Object.defineProperty(fs,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:"ox@0.1.1"}}),fs.setStaticOptions(fs.defaultStaticOptions);class ps extends fs{constructor({max:e,min:t,signed:n,size:r,value:s}){super(`Number \`${s}\` is not in safe${r?` ${8*r}-bit`:""}${n?" signed":" unsigned"} integer range ${e?`(\`${t}\` to \`${e}\`)`:`(above \`${t}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class bs extends fs{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function ms(e){return{address:e.address,amount:hs(e.amount),index:hs(e.index),validatorIndex:hs(e.validatorIndex)}}const ys=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],gs=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],ws=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"},{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],As="0x82ad56cb",vs="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",xs="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class Is extends Ge{constructor({blockNumber:e,chain:t,contract:n}){super(`Chain "${t.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class Rs extends Ge{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const Ps="/docs/contract/encodeDeployData";function Bs(e){const{abi:t,args:n,bytecode:r}=e;if(!n||0===n.length)return r;const s=t.find(e=>"type"in e&&"constructor"===e.type);if(!s)throw new He({docsPath:Ps});if(!("inputs"in s))throw new Ve({docsPath:Ps});if(!s.inputs||0===s.inputs.length)throw new Ve({docsPath:Ps});return dn([r,bn(s.inputs,n)])}function Cs({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new Is({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Is({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function Es(e,{docsPath:t,...n}){const r=(()=>{const t=function(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof Ge?e.walk(e=>e?.code===Kr.code):e;return r instanceof Ge?new Kr({cause:e,message:r.details}):Kr.nodeMessage.test(n)?new Kr({cause:e,message:e.details}):Gr.nodeMessage.test(n)?new Gr({cause:e,maxFeePerGas:t?.maxFeePerGas}):Jr.nodeMessage.test(n)?new Jr({cause:e,maxFeePerGas:t?.maxFeePerGas}):Hr.nodeMessage.test(n)?new Hr({cause:e,nonce:t?.nonce}):Vr.nodeMessage.test(n)?new Vr({cause:e,nonce:t?.nonce}):Wr.nodeMessage.test(n)?new Wr({cause:e,nonce:t?.nonce}):Yr.nodeMessage.test(n)?new Yr({cause:e}):Xr.nodeMessage.test(n)?new Xr({cause:e,gas:t?.gas}):Zr.nodeMessage.test(n)?new Zr({cause:e,gas:t?.gas}):$r.nodeMessage.test(n)?new $r({cause:e}):_r.nodeMessage.test(n)?new _r({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new es({cause:e})}(e,n);return t instanceof es?e:t})();return new rr(r,{docsPath:t,...n})}const Ms=new Map;function qs({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const o=async()=>{const t=a();i();const n=t.map(({args:e})=>e);0!==n.length&&e(n).then(e=>{s&&Array.isArray(e)&&e.sort(s);for(let n=0;n<t.length;n++){const{resolve:r}=t[n];r?.([e[n],e])}}).catch(e=>{for(let n=0;n<t.length;n++){const{reject:r}=t[n];r?.(e)}})},i=()=>Ms.delete(t),a=()=>Ms.get(t)||[],c=e=>Ms.set(t,[...a(),e]);return{flush:i,async schedule(e){const{promise:t,resolve:s,reject:i}=function(){let e=()=>{},t=()=>{};return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}(),d=n?.([...a().map(({args:e})=>e),e]);d&&o();return a().length>0?(c({args:e,resolve:s,reject:i}),t):(c({args:e,resolve:s,reject:i}),setTimeout(o,r),t)}}}async function Fs(e,t){const{account:n=e.account,authorizationList:r,batch:s=Boolean(e.batch?.multicall),blockHash:o,blockNumber:i,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c,accessList:d,blobs:u,blockOverrides:f,code:l,data:h,factory:p,factoryData:b,gas:m,gasPrice:y,maxFeePerBlobGas:g,maxFeePerGas:w,maxPriorityFeePerGas:A,nonce:v,requestOptions:x,to:I,value:R,stateOverride:P,...B}=t,C=n?Rn(n):void 0;if(l&&(p||b))throw new Ge("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(l&&I)throw new Ge("Cannot provide both `code` & `to` as parameters.");const E=l&&h,M=p&&b&&I&&h,q=E||M,F=E?Qs({code:l,data:h}):M?function(e){const{data:t,factory:n,factoryData:r,to:s}=e;return Bs({abi:ze(["constructor(address, bytes, address, bytes)"]),bytecode:vs,args:[s,t,n,r]})}({data:h,factory:p,factoryData:b,to:I}):h;try{!function(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:s}=e,o=t?Rn(t):void 0;if(o&&!an(o.address))throw new en({address:o.address});if(s&&!an(s))throw new en({address:s});if(n&&n>is)throw new Gr({maxFeePerGas:n});if(r&&n&&r>n)throw new _r({maxFeePerGas:n,maxPriorityFeePerGas:r})}(t);const n=as({blockHash:o,blockNumber:i,blockTag:a,requireCanonical:c}),l=f?function(e){return{..."bigint"==typeof e.baseFeePerGas&&{baseFeePerGas:hs(e.baseFeePerGas)},..."bigint"==typeof e.blobBaseFee&&{blobBaseFee:hs(e.blobBaseFee)},..."string"==typeof e.feeRecipient&&{feeRecipient:e.feeRecipient},..."bigint"==typeof e.gasLimit&&{gasLimit:hs(e.gasLimit)},..."bigint"==typeof e.number&&{number:hs(e.number)},..."bigint"==typeof e.prevRandao&&{prevRandao:hs(e.prevRandao)},..."bigint"==typeof e.time&&{time:hs(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(ms)}}}(f):void 0,h=function(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!an(n,{strict:!1}))throw new en({address:n});if(t[n])throw new Xn({address:n});t[n]=os(r)}return t}(P),p=e.chain?.formatters?.transactionRequest?.format,b=(p||rs)({...ts(B,{format:p}),accessList:d,account:C,authorizationList:r,blobs:u,data:F,gas:m,gasPrice:y,maxFeePerBlobGas:g,maxFeePerGas:w,maxPriorityFeePerGas:A,nonce:v,to:q?void 0:I,value:R},"call");if(s&&function({request:e}){const{data:t,to:n,...r}=e;return!!t&&(!t.startsWith(As)&&(!!n&&!(Object.values(r).filter(e=>void 0!==e).length>0)))}({request:b})&&!l&&void 0===o)try{const{deployless:t=!1}="object"==typeof e.batch?.multicall?e.batch.multicall:{},n=zs(e,{blockNumber:i,deployless:t});if(!n||!function(e,t){return!!e&&Object.keys(e).some(e=>cs(e,t))}(h,n))return await async function(e,t){const{batchSize:n=1024,deployless:r=!1,wait:s=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockHash:o,blockNumber:i,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c,data:d,multicallAddress:u,requestOptions:f,rpcStateOverride:l,to:h}=t,p=void 0!==u?u:zs(e,{blockNumber:i,deployless:r}),b=as({blockHash:o,blockNumber:i,blockTag:a,requireCanonical:c}),m="string"==typeof b?b:JSON.stringify(b),y=l?`.${JSON.stringify(l)}`:"",{schedule:g}=qs({id:`${e.uid}.${m}.${Os(f)}${y}`,wait:s,shouldSplitBatch(e){const t=e.reduce((e,{data:t})=>e+(t.length-2),0);return t>2*n},fn:async t=>{const n=t.map(e=>({allowFailure:!0,callData:e.data,target:e.to})),r=Bn({abi:ys,args:[n],functionName:"aggregate3"}),s={...null===p?{data:Qs({code:xs,data:r})}:{to:p,data:r}},o=await e.request({method:"eth_call",params:l?[s,b,l]:[s,b]},f);return us({abi:ys,args:[n],functionName:"aggregate3",data:o||"0x"})}}),[{returnData:w,success:A}]=await g({data:d,to:h});if(!A)throw new cr({data:w});return"0x"===w?{data:void 0}:{data:w}}(e,{...b,blockHash:o,blockNumber:i,blockTag:a,multicallAddress:n,requestOptions:x,requireCanonical:c,rpcStateOverride:h})}catch(e){if(!(e instanceof Rs||e instanceof Is))throw e}const E=(()=>{const e=[b,n];return h&&l?[...e,h,l]:h?[...e,h]:l?[...e,{},l]:e})(),M=await e.request({method:"eth_call",params:E},x);return"0x"===M?{data:void 0}:{data:M}}catch(n){if(x?.signal?.aborted)throw er(x.signal);if(tr(n))throw n;const r=function(e){if(!(e instanceof Ge))return;const t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(n),{offchainLookup:s,offchainLookupSignature:o}=await import("./ccip-BEanftc1.js");if(!1!==e.ccipRead&&r?.slice(0,10)===o&&I)return{data:await s(e,{data:r,requestOptions:x,to:I})};if(q&&"0x101bb98d"===r?.slice(0,10))throw new ar({factory:p});throw Es(n,{...t,account:C,chain:e.chain})}}let ks=0;const Ds=new WeakMap;function Os(e){if(!e)return"default";const t=Ds.get(e);if(void 0!==t)return t;const n=ks++;return Ds.set(e,n),n}function zs(e,t){const{blockNumber:n,deployless:r}=t;if(r)return null;if(e.chain)return Cs({blockNumber:n,chain:e.chain,contract:"multicall3"});throw new Rs}function Qs(e){const{code:t,data:n}=e;return Bs({abi:ze(["constructor(bytes, bytes)"]),bytecode:"0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",args:[t,n]})}async function Us(e,t){const{abi:n,address:r,args:s,functionName:o,...i}=t,a=Bn({abi:n,args:s,functionName:o});try{const{data:t}=await Qe(e,Fs,"call")({...i,data:a,to:r});return us({abi:n,args:s,functionName:o,data:t||"0x"})}catch(e){throw function(e,{abi:t,address:n,args:r,docsPath:s,functionName:o,sender:i}){const a=e instanceof cr?e:e instanceof Ge?e.walk(e=>"data"in e)||e.walk():{},{code:c,data:d,details:u,message:f,shortMessage:l}=a,h=e instanceof Ye?new ir({functionName:o,cause:e}):[Lr,wr.code].includes(c)&&(d||u||f||l)||c===Ar.code&&"execution reverted"===u&&d?new or({abi:t,data:"object"==typeof d?d.data:d,functionName:o,message:a instanceof fr?u:l??f,cause:e}):e;return new sr(h,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:o,sender:i})}(e,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:o})}}function Ss(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0,signal:s}={}){return new Promise((o,i)=>{const a=async({count:c=0}={})=>{if(s?.aborted)return void i(er(s));const d=async({error:e})=>{const n="function"==typeof t?t({count:c,error:e}):t;if(n)try{await async function(e,{signal:t}={}){return new Promise((n,r)=>{if(t?.aborted)return void r(er(t));const s=()=>t?.removeEventListener("abort",i),o=setTimeout(()=>{s(),n()},e),i=()=>{clearTimeout(o),s(),r(er(t))};t?.addEventListener("abort",i,{once:!0})})}(n,{signal:s})}catch(e){return void i(e)}return a({count:c+1})};try{const t=await e();o(t)}catch(e){if(s?.aborted)return void i(er(s));if(tr(e))return void i(e);if(c<n&&await r({count:c,error:e}))return d({error:e});i(e)}};a().catch(i)})}let Ts,js=256;function Ns(e=11){if(!Ts||js+e>512){Ts="",js=0;for(let e=0;e<256;e++)Ts+=(256+256*Math.random()|0).toString(16).substring(1)}return Ts.substring(js,js+++e)}function Ls(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}const Ks="/docs/contract/encodeErrorResult";function Gs(e){const{abi:t,errorName:n,args:r}=e;let s=t[0];if(n){const e=vn({abi:t,args:r,name:n});if(!e)throw new et(n,{docsPath:Ks});s=e}if("error"!==s.type)throw new et(void 0,{docsPath:Ks});const o=Ue(s),i=An(o);let a="0x";if(r&&r.length>0){if(!s.inputs)throw new _e(s.name,{docsPath:Ks});a=bn(s.inputs,r)}return dn([i,a])}const Js="/docs/contract/encodeFunctionResult";const Hs="x-batch-gateway:true";async function Vs(e){const{data:t,ccipRequest:n}=e,{args:[r]}=function(e){const{abi:t,data:n}=e,r=un(n,0,4),s=t.find(e=>"function"===e.type&&r===An(Ue(e)));if(!s)throw new st(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Un(s.inputs,un(n,4)):void 0}}({abi:gs,data:t}),s=[],o=[];return await Promise.all(r.map(async(e,t)=>{try{o[t]=e.urls.includes(Hs)?await Vs({data:e.data,ccipRequest:n}):await n(e),s[t]=!1}catch(e){s[t]=!0,o[t]="HttpRequestError"===(r=e).name&&r.status?Gs({abi:gs,errorName:"HttpError",args:[r.status,r.shortMessage]}):Gs({abi:[En],errorName:"Error",args:["shortMessage"in r?r.shortMessage:r.message]})}var r})),function(e){const{abi:t,functionName:n,result:r}=e;let s=t[0];if(n){const e=vn({abi:t,name:n});if(!e)throw new nt(n,{docsPath:Js});s=e}if("function"!==s.type)throw new nt(void 0,{docsPath:Js});if(!s.outputs)throw new rt(s.name,{docsPath:Js});const o=(()=>{if(0===s.outputs.length)return[];if(1===s.outputs.length)return[r];if(Array.isArray(r))return r;throw new ct(r)})();return bn(s.outputs,o)}({abi:gs,functionName:"query",result:[s,o]})}const Ws=new tn(8192);function Ys(e,t={}){return async(n,r={})=>{const{dedupe:s=!1,methods:o,retryDelay:i=150,retryCount:a=3,signal:c,uid:d}={...t,...r},{method:u}=n;if(o?.exclude?.includes(u))throw new Rr(new Error("method not supported"),{method:u});if(o?.include&&!o.include.includes(u))throw new Rr(new Error("method not supported"),{method:u});if(c?.aborted)throw er(c);return function(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Ws.get(n))return Ws.get(n);const r=e().finally(()=>Ws.delete(n));return Ws.set(n,r),r}(()=>Ss(async()=>{try{return await e(n,c?{signal:c}:void 0)}catch(e){if(c?.aborted)throw er(c);if(tr(e))throw e;const t=e;switch(t.code){case br.code:throw new br(t);case mr.code:throw new mr(t);case yr.code:throw new yr(t,{method:n.method});case gr.code:throw new gr(t);case wr.code:throw new wr(t);case Ar.code:throw new Ar(t);case vr.code:throw new vr(t);case xr.code:throw new xr(t);case Ir.code:throw new Ir(t);case Rr.code:throw new Rr(t,{method:n.method});case Pr.code:throw new Pr(t);case Br.code:throw new Br(t);case Cr.code:throw new Cr(t);case Er.code:throw new Er(t);case Mr.code:throw new Mr(t);case qr.code:throw new qr(t);case Fr.code:throw new Fr(t);case kr.code:throw new kr(t);case Dr.code:throw new Dr(t);case Or.code:throw new Or(t);case zr.code:throw new zr(t);case Qr.code:throw new Qr(t);case Ur.code:throw new Ur(t);case Sr.code:throw new Sr(t);case Tr.code:throw new Tr(t);case 5e3:throw new Cr(t);case jr.code:throw new jr(t);default:if(e instanceof Ge)throw e;throw new Nr(t)}}},{delay:({count:e,error:t})=>{if(t&&t instanceof dr){const e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e,10)}return(1<<e)*i},retryCount:a,signal:c,shouldRetry:({error:e})=>function(e){if(tr(e))return!1;if("code"in e&&"number"==typeof e.code)return-1===e.code||(e.code===Pr.code||(e.code===wr.code||429===e.code));if(e instanceof dr&&e.status)return 403===e.status||(408===e.status||(413===e.status||(429===e.status||(500===e.status||(502===e.status||(503===e.status||504===e.status))))));return!0}(e)}),{enabled:s,id:s?function(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0;t<e.length;t++){const s=e.charCodeAt(t);n=Math.imul(n^s,2654435761),r=Math.imul(r^s,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36)}(`${d}.${Kn(n)}`):void 0})}}function Xs(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};return Object.assign(t,{extend:function e(t){return n=>{const r="function"==typeof n?n(t):n,s={...t,...r};return Object.assign(s,{extend:e(s)})}}(t)})}function Zs(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const $s=Zs(),_s=10485760;function eo(e,t={}){const{url:n,headers:r}=function(e){try{const t=new URL(e),n=(()=>{if(t.username){const e=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(e)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}(e);return{async request(e){const{body:s,fetchFn:o=t.fetchFn??fetch,maxResponseBodySize:i=t.maxResponseBodySize??_s,onRequest:a=t.onRequest,onResponse:c=t.onResponse,timeout:d=t.timeout??1e4}=e,u={...t.fetchOptions??{},...e.fetchOptions??{}},{headers:f,method:l,signal:h}=u;try{const e=await function(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((s,o)=>{(async()=>{let i;const a=new AbortController;try{n>0&&(i=setTimeout(()=>{r&&a.abort()},n)),s(await e({signal:a?.signal||null}))}catch(e){if(a?.signal.aborted&&tr(e))return void o(t);o(e)}finally{clearTimeout(i)}})()})}(async({signal:e})=>{const t={...u,body:Array.isArray(s)?Kn(s.map(e=>({jsonrpc:"2.0",id:e.id??$s.take(),...e}))):Kn({jsonrpc:"2.0",id:s.id??$s.take(),...s}),headers:{...r,"Content-Type":"application/json",...f},method:l||"POST",signal:h||(d>0?e:null)},i=new Request(n,t),c=await(a?.(i,t))??{...t,url:n};return await o(c.url??n,c)},{errorInstance:new lr({body:s,url:n}),timeout:d,signal:!0});let t;c&&await c(e);const p=await async function(e,{maxResponseBodySize:t}){if(!1===t)return e.text();const n=e.headers.get("Content-Length");if(n){const e=Number(n);if(e>t)throw new ur({maxSize:t,size:e})}if(!e.body){const n=await e.text(),r=(new TextEncoder).encode(n).length;if(r>t)throw new ur({maxSize:t,size:r});return n}const r=e.body.getReader(),s=new TextDecoder;let o="",i=0;try{for(;;){const{done:e,value:n}=await r.read();if(e)break;if(i+=n.byteLength,i>t)throw await r.cancel(),new ur({maxSize:t,size:i});o+=s.decode(n,{stream:!0})}return o+=s.decode(),o}finally{r.releaseLock()}}(e,{maxResponseBodySize:i});if(e.headers.get("Content-Type")?.startsWith("application/json"))t=JSON.parse(p);else{t=p;try{t=JSON.parse(t||"{}")}catch(n){if(e.ok)throw n;t={error:t}}}if(!e.ok){if("number"==typeof t.error?.code&&"string"==typeof t.error?.message)return t;throw new dr({body:s,details:Kn(t.error)||e.statusText,headers:e.headers,status:e.status,url:n})}return t}catch(e){if(h?.aborted)throw er(h);if(tr(e))throw e;if(e instanceof dr)throw e;if(e instanceof ur)throw e;if(e instanceof lr)throw e;throw new dr({body:s,cause:e,url:n})}}}}class to extends Ge{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}let no=0;const ro=new WeakMap;function so(e){if(!e)return"default";const t=ro.get(e);if(void 0!==t)return t;const n=no++;return ro.set(e,n),n}function oo(e,t={}){const{batch:n,fetchFn:r,fetchOptions:s,key:o="http",maxResponseBodySize:i,methods:a,name:c="HTTP JSON-RPC",onFetchRequest:d,onFetchResponse:u,retryDelay:f,raw:l}=t;return({chain:h,retryCount:p,timeout:b})=>{const{batchSize:m=1e3,wait:y=0}="object"==typeof n?n:{},g=t.retryCount??p,w=b??t.timeout??1e4,A=e||h?.rpcUrls.default.http[0];if(!A)throw new to;const v=eo(A,{fetchFn:r,fetchOptions:s,maxResponseBodySize:i,onRequest:d,onResponse:u,timeout:w});return function({key:e,methods:t,name:n,request:r,retryCount:s=3,retryDelay:o=150,timeout:i,type:a},c){return{config:{key:e,methods:t,name:n,request:r,retryCount:s,retryDelay:o,timeout:i,type:a},request:Ys(r,{methods:t,retryCount:s,retryDelay:o,uid:Ns()}),value:c}}({key:o,methods:a,name:c,async request({method:e,params:t},r){const s={method:e,params:t},o=r?.signal?{signal:r.signal}:void 0,{schedule:i}=qs({id:`${A}.${so(r?.signal)}`,wait:y,shouldSplitBatch:e=>e.length>m,fn:e=>v.request({body:e,fetchOptions:o}),sort:(e,t)=>e.id-t.id}),[{error:a,result:c}]=await(async e=>n?i(e):[await v.request({body:e,fetchOptions:o})])(s);if(l)return{error:a,result:c};if(a)throw new fr({body:s,error:a,url:A});return c},retryCount:g,retryDelay:f,timeout:w,type:"http"},{fetchOptions:s,url:A})}}const io=Xs({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://ethereum.reth.rs/rpc"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});const ao=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]);function co(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,o=[0,1];for(let e=1;e<r;e++)o.push(s+=n());let i=n(),a=t;t+=i;let c=0,d=0;function u(){return 0==c&&(d=d<<8|e[t++],c=8),d>>--c&1}const f=2**31,l=f>>>1,h=l>>1,p=f-1;let b=0;for(let e=0;e<31;e++)b=b<<1|u();let m=[],y=0,g=f;for(;;){let e=Math.floor(((b-y+1)*s-1)/g),t=0,n=r;for(;n-t>1;){let r=t+n>>>1;e<o[r]?n=r:t=r}if(0==t)break;m.push(t);let i=y+Math.floor(g*o[t]/s),a=y+Math.floor(g*o[t+1]/s)-1;for(;0==((i^a)&l);)b=b<<1&p|u(),i=i<<1&p,a=a<<1&p|1;for(;i&~a&h;)b=b&l|b<<1&p>>>1|u(),i=i<<1^l,a=(a^l)<<1|l|1;y=i,g=1+a-i}let w=r-4;return m.map(t=>{switch(t-w){case 3:return w+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return w+256+(e[a++]<<8|e[a++]);case 1:return w+e[a++];default:return t-1}})}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((e,n)=>t[e.charCodeAt(0)]=n);let n=e.length,r=new Uint8Array(6*n>>3);for(let s=0,o=0,i=0,a=0;s<n;s++)a=a<<6|t[e.charCodeAt(s)],i+=6,i>=8&&(r[o++]=a>>(i-=8));return r}(e)))}function uo(e){return 1&e?~e>>1:e>>1}function fo(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=uo(t());return n}function lo(e,t=0){let n=[];for(;;){let r=e(),s=e();if(!s)break;t+=r;for(let e=0;e<s;e++)n.push(t+e);t+=s+1}return n}function ho(e){return bo(()=>{let t=lo(e);if(t.length)return t})}function po(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(yo(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(go(n,e))}return t.flat()}function bo(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function mo(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)fo(e,n).forEach((e,t)=>r[t].push(e));return r}function yo(e,t){let n=1+t(),r=t(),s=bo(t);return mo(s.length,1+e,t).flatMap((e,t)=>{let[o,...i]=e;return Array(s[t]).fill().map((e,t)=>{let s=t*r;return[o+t*n,i.map(e=>e+s)]})})}function go(e,t){return mo(1+t(),1+e,t).map(e=>[e[0],e.slice(1)])}function wo(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function Ao(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let n=[];for(let r=0;r<t;)n.push(String.fromCodePoint(...e.slice(r,r+=4096)));return n.join("")}function vo(e,t){let n=e.length,r=n-t.length;for(let s=0;0==r&&s<n;s++)r=e[s]-t[s];return r}const xo=44032,Io=4352,Ro=4449,Po=4519,Bo=28,Co=588;function Eo(e){return e>>24&255}function Mo(e){return 16777215&e}let qo,Fo,ko,Do;function Oo(e){return e>=xo&&e<55204}function zo(e,t){if(e>=Io&&e<4371&&t>=Ro&&t<4470)return xo+(e-Io)*Co+(t-Ro)*Bo;if(Oo(e)&&t>Po&&t<4547&&(e-xo)%Bo==0)return e+(t-Po);{let n=Do.get(e);return n&&(n=n.get(t),n)?n:-1}}function Qo(e){qo||function(){let e=co("AEUDWAHSCGYATwDVADIAdgAiADQAFAAtABQAIQAPACcADQASAAsAGQAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAecDNACxCmIB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJEMAJpIBpob5AERSMAKNoAXqaQLRBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobPgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5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DeNnAuCLPQFmdRRWJtH20Z8DstfJf+5oj5SSB64d0iF5/Ya4KfTWxfivj9Ap2/zbYaTo/1gO3tM6RYsCZharMBFr7Fm61mLSrQnEI4OF1gbVS4k/JE9UotOrnLJZuswoWodCSV8zbybkJSVIP7n8UaE9xCR39rJZmf27HOAPVOGc9pdkQUcRrI0qyVF9Z3j1RHDbxIfwbWzmPVjwIdPJvtmBYwEQIUsIW1S939hcVikK00ozPRI02cqhzVUNzpOxVdrwRPvlh1aIOf0xFEqD3YkGnCnFah/cFN3J2gB7N+bZSGawwkKFu1tpQMrp1W+27YNkyT0TpcFpTqgOqqLabrgcCUPxh97mREOGy4xItzQ9xSl6rq+8BZsHcrQFReS+QeMxJ3P6CnL9EP/eOLDjumLhvrcQrpPiknsofbzBv9gTP0lU+TIVwE6E7CcKfT36q+ZiEOHJ9ayf0dyUJLezAb2M8aNHwd0+OJmsVgTzRWA");qo=new Map(ho(e).flatMap((e,t)=>e.map(e=>[e,t+1<<24]))),Fo=new Set(lo(e)),ko=new Map,Do=new Map;for(let[t,n]of po(e)){if(!Fo.has(t)&&2==n.length){let[e,r]=n,s=Do.get(e);s||(s=new Map,Do.set(e,s)),s.set(r,t)}ko.set(t,n.reverse())}}();let t=[],n=[],r=!1;function s(e){let n=qo.get(e);n&&(r=!0,e|=n),t.push(e)}for(let r of e)for(;;){if(r<128)t.push(r);else if(Oo(r)){let e=r-xo,t=e%Co/Bo|0,n=e%Bo;s(Io+(e/Co|0)),s(Ro+t),n>0&&s(Po+n)}else{let e=ko.get(r);e?n.push(...e):s(r)}if(!n.length)break;r=n.pop()}if(r&&t.length>1){let e=Eo(t[0]);for(let n=1;n<t.length;n++){let r=Eo(t[n]);if(0==r||e<=r){e=r;continue}let s=n-1;for(;;){let n=t[s+1];if(t[s+1]=t[s],t[s]=n,!s)break;if(e=Eo(t[--s]),e<=r)break}e=Eo(t[n])}}return t}function Uo(e){return Qo(e).map(Mo)}function So(e){return function(e){let t=[],n=[],r=-1,s=0;for(let o of e){let e=Eo(o),i=Mo(o);if(-1==r)0==e?r=i:t.push(i);else if(s>0&&s>=e)0==e?(t.push(r,...n),n.length=0,r=i):n.push(i),s=e;else{let o=zo(r,i);o>=0?r=o:0==s&&0==e?(t.push(r),r=i):(n.push(i),s=e)}}return r>=0&&t.push(r,...n),t}(Qo(e))}const To=".",jo=e=>Array.from(e);function No(e,t){return e.P.has(t)||e.Q.has(t)}class Lo extends Array{get is_emoji(){return!0}}let Ko,Go,Jo,Ho,Vo,Wo,Yo,Xo,Zo,$o,_o;function ei(){if(Ko)return;let e=co("AEkVMQnvDV0B0wKWAQYBQgDpATQAoQDcAIUApwBsAOMAcACTAEUAigBRAHkAPgA/ACwANwAoAGIAHgAvACsAJQAXAC8AHAAhACIALwAVACsAEQAiAAsAGwARABgAFwA7ACoAKwAsADQAFgAtABIAHAAhAA4AHQAdABUAFgAZAA0ADgAXABAAGQAUABIEtAYQASIUOjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqft7uycM2yDPCLspA7EUOwD3LWujAKF9GAAXBCXXFgEdALkZzQT6CSBMNwmXCYgeG1ZZTOODQgATAAwAFQAOa1QAIQAOAEfuFdg98zlYypXmLgoQHV9NWD3sABMADAAVAA5rIFxAlwDD6wAbADkMxQAbFVup+3EB224cHQVbBeIC0J8CxLAKTBykZRRzGm1M9QC7DWcC4QALLTSJF8mRAoF7ARMbAL0NZwLhAAstAUhQJZFMCgMt+wUyCddpF60B10MASSsSdwIxFiEC6ye5N2sAOeEB9SUAxw7LtQEbY4EAsQUABQCK00kFG8MfBxcAqCfRAaErLQObAGcBChk+7Td0BBgXAKoBxwIhANMrEnM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e])),Jo=new Set(Jo),Vo=n(),n();let s=ho(e),o=e();const i=()=>{let e=new Set;return t().forEach(t=>r(e,s[t])),r(e,t()),e};Wo=bo(t=>{let n=bo(e).map(e=>e+96);if(n.length){let r=t>=o;return n[0]-=32,n=Ao(n),r&&(n=`Restricted[${n}]`),{N:n,P:i(),Q:i(),M:!e(),R:r}}}),Yo=n(),Xo=new Map;let a=t().concat(jo(Yo)).sort((e,t)=>e-t);a.forEach((t,n)=>{let r=e(),s=a[n]=r?a[n-r]:{V:[],M:new Map};s.V.push(t),Yo.has(t)||Xo.set(t,s)});for(let{V:e,M:t}of new Set(Xo.values())){let n=[];for(let t of e){let e=Wo.filter(e=>No(e,t)),s=n.find(({G:t})=>e.some(e=>t.has(e)));s||(s={G:new Set,V:[]},n.push(s)),s.V.push(t),r(s.G,e)}let s=n.flatMap(e=>jo(e.G));for(let{G:e,V:r}of n){let n=new Set(s.filter(t=>!e.has(t)));for(let e of r)t.set(e,n)}}Zo=new Set;let c=new Set;const d=e=>Zo.has(e)?c.add(e):Zo.add(e);for(let e of Wo){for(let t of e.P)d(t);for(let t of e.Q)d(t)}for(let e of Zo)Xo.has(e)||c.has(e)||Xo.set(e,1);r(Zo,Uo(Zo)),$o=function(e){let t=[],n=lo(e);return function e({S:n,B:r},s,o){if(!(4&n&&o===s[s.length-1])){2&n&&(o=s[s.length-1]),1&n&&t.push(s);for(let t of r)for(let n of t.Q)e(t,[...s,n],o)}}(function t(r){return{S:e(),B:bo(()=>{let r=lo(e).map(e=>n[e]);if(r.length)return t(r)}),Q:r}}([]),[]),t}(e).map(e=>Lo.from(e)).sort(vo),_o=new Map;for(let e of $o){let t=[_o];for(let n of e){let e=t.map(e=>{let t=e.get(n);return t||(t=new Map,e.set(n,t)),t});65039===n?t.push(...e):t=e}for(let n of t)n.V=e}}function ti(e){return(si(e)?"":`${ni(ri([e]))} `)+wo(e)}function ni(e){return`"${e}"‎`}function ri(e,t=1/0,n=wo){let r=[];var s;s=e[0],ei(),Jo.has(s)&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let o=0,i=e.length;for(let t=0;t<i;t++){let s=e[t];si(s)&&(r.push(Ao(e.slice(o,t))),r.push(n(s)),o=t+1)}return r.push(Ao(e.slice(o,i))),r.join("")}function si(e){return ei(),Vo.has(e)}function oi(e){return function(e){return e.map(({input:t,error:n,output:r})=>{if(n){let r=n.message;throw new Error(1==e.length?r:`Invalid label ${ni(ri(t,63))}: ${r}`)}return Ao(r)}).join(To)}(function(e,t,n){if(!e)return[];ei();let r=0;return e.split(To).map(e=>{let s=function(e){let t=[];for(let n=0,r=e.length;n<r;){let r=e.codePointAt(n);n+=r<65536?1:2,t.push(r)}return t}(e),o={input:s,offset:r};r+=s.length+1;try{let e,r=o.tokens=function(e,t,n){let r=[],s=[];e=e.slice().reverse();for(;e.length;){let o=ui(e);if(o)s.length&&(r.push(t(s)),s=[]),r.push(n(o));else{let t=e.pop();if(Zo.has(t))s.push(t);else{let e=Ko.get(t);if(e)s.push(...e);else if(!Go.has(t))throw ii(t)}}}s.length&&r.push(t(s));return r}(s,t,n),i=r.length;if(!i)throw new Error("empty label");let a=o.output=r.flat();if(function(e){for(let t=e.lastIndexOf(95);t>0;)if(95!==e[--t])throw new Error("underscore allowed only at start")}(a),!(o.emoji=i>1||r[0].is_emoji)&&a.every(e=>e<128))!function(e){if(e.length>=4&&45==e[2]&&45==e[3])throw new Error(`invalid label extension: "${Ao(e.slice(0,4))}"`)}(a),e="ASCII";else{let t=r.flatMap(e=>e.is_emoji?[]:e);if(t.length){if(Jo.has(a[0]))throw ci("leading combining mark");for(let e=1;e<i;e++){let t=r[e];if(!t.is_emoji&&Jo.has(t[0]))throw ci(`emoji + combining mark: "${Ao(r[e-1])} + ${ri([t[0]])}"`)}!function(e){let t=e[0],n=ao.get(t);if(n)throw ci(`leading ${n}`);let r=e.length,s=-1;for(let o=1;o<r;o++){t=e[o];let r=ao.get(t);if(r){if(s==o)throw ci(`${n} + ${r}`);s=o+1,n=r}}if(s==r)throw ci(`trailing ${n}`)}(a);let n=jo(new Set(t)),[s]=function(e){let t=Wo;for(let n of e){let e=t.filter(e=>No(e,n));if(!e.length)throw Wo.some(e=>No(e,n))?ai(t[0],n):ii(n);if(t=e,1==e.length)break}return t}(n);!function(e,t){for(let n of t)if(!No(e,n))throw ai(e,n);if(e.M){let e=Uo(t);for(let t=1,n=e.length;t<n;t++)if(Ho.has(e[t])){let r=t+1;for(let s;r<n&&Ho.has(s=e[r]);r++)for(let n=t;n<r;n++)if(e[n]==s)throw new Error(`duplicate non-spacing marks: ${ti(s)}`);if(r-t>4)throw new Error(`excessive non-spacing marks: ${ni(ri(e.slice(t-1,r)))} (${r-t}/4)`);t=r}}}(s,t),function(e,t){let n,r=[];for(let e of t){let t=Xo.get(e);if(1===t)return;if(t){let r=t.M.get(e);if(n=n?n.filter(e=>r.has(e)):jo(r),!n.length)return}else r.push(e)}if(n)for(let t of n)if(r.every(e=>No(t,e)))throw new Error(`whole-script confusable: ${e.N}/${t.N}`)}(s,n),e=s.N}else e="Emoji"}o.type=e}catch(e){o.error=e}return o})}(e,So,di))}function ii(e){return new Error(`disallowed character: ${ti(e)}`)}function ai(e,t){let n=ti(t),r=Wo.find(e=>e.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function ci(e){return new Error(`illegal placement: ${e}`)}function di(e){return e.filter(e=>65039!=e)}function ui(e,t){let n,r=_o,s=e.length;for(;s&&(r=r.get(e[--s]),r);){let{V:t}=r;t&&(n=t,e.length=s)}return n}function fi(e){return function(e){return oi(e)}(e)}const li=6e5,hi=3e4,pi=new Set(["ResolverNotFound","ReverseAddressMismatch","ResolverNotContract","UnsupportedResolverProfile"]),bi=/^(0x)?[0-9a-fA-F]{40}$/,mi=new Map,yi=new Map;async function gi(e,t,n){const r=function(e){const{batch:t,chain:n,ccipRead:r,dataSuffix:s,key:o="base",name:i="Base Client",tokens:a,type:c="base"}=e,d=e.experimental_blockTag??("number"==typeof n?.experimental_preconfirmationTime?"pending":void 0),u=n?.blockTime??12e3,f=Math.min(Math.max(Math.floor(u/2),500),4e3),l=e.pollingInterval??f,h=e.cacheTime??l,p=e.account?Rn(e.account):void 0,{config:b,request:m,value:y}=e.transport({account:p,chain:n,pollingInterval:l}),g={account:p,batch:t,cacheTime:h,ccipRead:r,chain:n,dataSuffix:s,key:o,name:i,pollingInterval:l,request:m,tokens:a,transport:{...b,...y},type:c,uid:Ns(),...d?{experimental_blockTag:d}:{}};return Object.assign(g,{extend:function e(t){return n=>{const r=n(t);for(const e in g)delete r[e];const s={...t,...r};for(const e in r){const n=t[e],o=r[e];Ls(n)&&Ls(o)&&(s[e]={...n,...o})}return Object.assign(s,{extend:e(s)})}}(g)})}({chain:io,transport:oo(e,{timeout:n,retryCount:0})});try{const e=await async function(e,t){const{address:n,blockNumber:r,blockTag:s,coinType:o=60n,gatewayUrls:i}=t,{chain:a}=e,c=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return Cs({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})();try{const t={address:c,abi:ws,args:[n,o,i??[Hs]],functionName:"reverseWithGateways",blockNumber:r,blockTag:s},a=Qe(e,Us,"readContract"),[d]=await a(t);return d||null}catch(e){throw e}}(r,{address:t,strict:!0});return e&&function(e){try{return fi(e)===e}catch{return!1}}(e)?e:void 0}catch(e){if(function(e){if(!(e instanceof Ge))return!1;const t=e.walk(e=>e instanceof or);return t instanceof or&&pi.has(t.data?.errorName??"")}(e))return;throw e}}async function wi(e,t){if(!t.rpcUrl||!bi.test(e))return;const n=e.toLowerCase().replace(/^0x/,""),r=`${t.rpcUrl}\n${n}`,s=mi.get(r);if(s){const e=Date.now()-s.fetchedAt;if(e>=0&&e<s.keepMs)return s.name;mi.delete(r)}const o=yi.get(r);if(o)return o;const i=t.timeoutMs??k,a=p(gi(t.rpcUrl,`0x${n}`,i),i,`The ENS name of 0x${n} was not read within ${i}ms.`).then(e=>(mi.set(r,{name:e,fetchedAt:Date.now(),keepMs:li}),e)).catch(e=>{console.warn(`[EnsName] Could not read the name of 0x${n}:`,function(e){return e instanceof Ge?e.shortMessage:e instanceof Error?e.message:String(e)}(e)),mi.set(r,{name:void 0,fetchedAt:Date.now(),keepMs:3e4})}).finally(()=>{yi.delete(r)});return yi.set(r,a),a}export{Ge as B,li as E,dr as H,N as S,Vs as a,cn as b,Fs as c,Ln as d,bn as e,er as f,nr as g,tr as h,cs as i,Te as j,L as k,Hs as l,H as m,J as n,Q as o,hi as p,wi as r,Kn as s};
2
+ //# sourceMappingURL=index-BbRV2bja.js.map