(self.webpackChunkfrog=self.webpackChunkfrog||[]).push([[4984],{3625:(e,t,r)=>{"use strict";function s(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}r.d(t,{rCZ:()=>n});const n=s({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}})},4707:(e,t,r)=>{"use strict";r.d(t,{u$:()=>n,zC:()=>o});var s=r(71285);function n(e,t,r,n){let o=e[t];return(0,s.B1)(e,(()=>{const s=e[t];Object.is(o,s)||r(o=s)}),n)}Symbol();function o(e){const t=(0,s.BX)({data:Array.from(e||[]),has(e){return this.data.some((t=>t[0]===e))},set(e,t){const r=this.data.find((t=>t[0]===e));return r?r[1]=t:this.data.push([e,t]),this},get(e){var t;return null==(t=this.data.find((t=>t[0]===e)))?void 0:t[1]},delete(e){const t=this.data.findIndex((t=>t[0]===e));return-1!==t&&(this.data.splice(t,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(e){this.data.forEach((t=>{e(t[1],t[0],this)}))},keys(){return this.data.map((e=>e[0])).values()},values(){return this.data.map((e=>e[1])).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(t,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(t),t}},6973:(e,t,r)=>{"use strict";r.d(t,{s:()=>d});var s=r(96540),n=r(24693),o=r(19888),a=r(71285);const{use:c}=s,{useSyncExternalStore:i}=o,u=(e,t)=>{const r=(0,s.useRef)();(0,s.useEffect)((()=>{r.current=(0,n.JR)(e,t,!0)})),(0,s.useDebugValue)(r.current)},l=new WeakMap;function d(e,t){const r=null==t?void 0:t.sync,o=(0,s.useRef)(),d=(0,s.useRef)();let h=!0;const f=i((0,s.useCallback)((t=>{const s=(0,a.B1)(e,t,r);return t(),s}),[e,r]),(()=>{const t=(0,a.P9)(e,c);try{if(!h&&o.current&&d.current&&!(0,n.Hq)(o.current,t,d.current,new WeakMap))return o.current}catch(e){}return t}),(()=>(0,a.P9)(e,c)));h=!1;const p=new WeakMap;(0,s.useEffect)((()=>{o.current=f,d.current=p})),u(f,p);const b=(0,s.useMemo)((()=>new WeakMap),[]);return(0,n.tz)(f,p,b,l)}},18463:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const s=(e,t,r)=>JSON.stringify(e,((e,r)=>{const s="bigint"==typeof r?r.toString():r;return"function"==typeof t?t(e,s):s}),r)},27513:(e,t,r)=>{"use strict";r.d(t,{CL:()=>i,D5:()=>l,Di:()=>h,Gi:()=>u,MI:()=>O,RV:()=>P,Sf:()=>x,XU:()=>c,YW:()=>b,ab:()=>m,bq:()=>d,ch:()=>C,hA:()=>f,qZ:()=>p,s0:()=>g,sV:()=>v,vx:()=>w,xQ:()=>y,xq:()=>j});var s=r(51344),n=r(73589);class o extends s.C{constructor(e,{code:t,docsPath:r,metaMessages:s,name:o,shortMessage:a}){super(a,{cause:e,docsPath:r,metaMessages:s||e?.metaMessages,name:o||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=o||e.name,this.code=e instanceof n.J8?e.code:t??-1}}class a extends o{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class c extends o{constructor(e){super(e,{code:c.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class i extends o{constructor(e){super(e,{code:i.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(i,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class u extends o{constructor(e,{method:t}={}){super(e,{code:u.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}}Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class l extends o{constructor(e){super(e,{code:l.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")})}}Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class d extends o{constructor(e){super(e,{code:d.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class h extends o{constructor(e){super(e,{code:h.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")})}}Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class f extends o{constructor(e){super(e,{code:f.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class p extends o{constructor(e){super(e,{code:p.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class b extends o{constructor(e){super(e,{code:b.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class m extends o{constructor(e,{method:t}={}){super(e,{code:m.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}}Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class g extends o{constructor(e){super(e,{code:g.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class y extends o{constructor(e){super(e,{code:y.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class w extends a{constructor(e){super(e,{code:w.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class v extends a{constructor(e){super(e,{code:v.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class x extends a{constructor(e,{method:t}={}){super(e,{code:x.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}}Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class P extends a{constructor(e){super(e,{code:P.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(P,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class j extends a{constructor(e){super(e,{code:j.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(j,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class C extends a{constructor(e){super(e,{code:C.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class O extends o{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}},34915:e=>{e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},50669:(e,t,r)=>{"use strict";async function s(e){return new Promise((t=>setTimeout(t,e)))}r.d(t,{u:()=>s})},51344:(e,t,r)=>{"use strict";r.d(t,{C:()=>o});const s="2.23.2";let n={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${s}`};class o extends Error{constructor(e,t={}){const r=t.cause instanceof o?t.cause.details:t.cause?.message?t.cause.message:t.details,a=t.cause instanceof o&&t.cause.docsPath||t.docsPath,c=n.getDocsUrl?.({...t,docsPath:a});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...c?[`Docs: ${c}`]:[],...r?[`Details: ${r}`]:[],...n.version?[`Version: ${n.version}`]:[]].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,"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=a,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=s}walk(e){return a(this,e)}}function a(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?a(e.cause,t):t?null:e}},58198:(e,t,r)=>{"use strict";r.d(t,{N:()=>v});const s={ether:-9,wei:9};function n(e,t="wei"){return function(e,t){let r=e.toString();const s=r.startsWith("-");s&&(r=r.slice(1)),r=r.padStart(t,"0");let[n,o]=[r.slice(0,r.length-t),r.slice(r.length-t)];return o=o.replace(/(0+)$/,""),`${s?"-":""}${n||"0"}${o?`.${o}`:""}`}(e,s[t])}var o=r(51344);class a extends o.C{constructor({cause:e,message:t}={}){const r=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class c extends o.C{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${n(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(c,"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 i extends o.C{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${n(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(i,"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 u extends o.C{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(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class l extends o.C{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(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class d extends o.C{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class h extends o.C{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(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class f extends o.C{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(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class p extends o.C{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(p,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class b extends o.C{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(b,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class m extends o.C{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${n(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${n(r)} gwei`:""}).`].join("\n"),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(m,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});o.C;var g=r(27513),y=r(50669),w=r(73674);function v(e,t={}){const{key:r="fallback",name:s="Fallback",rank:n=!1,retryCount:o,retryDelay:c}=t;return({chain:t,pollingInterval:i=4e3,timeout:u,...l})=>{let d=e,h=()=>{};const f=(0,w.o)({key:r,name:s,async request({method:e,params:r}){let s;const n=async(o=0)=>{const c=d[o]({...l,chain:t,retryCount:0,timeout:u});try{const t=await c.request({method:e,params:r});return h({method:e,params:r,response:t,transport:c,status:"success"}),t}catch(i){if(h({error:i,method:e,params:r,transport:c,status:"error"}),function(e){if("code"in e&&"number"==typeof e.code&&(e.code===g.YW.code||e.code===g.vx.code||a.nodeMessage.test(e.message)||5e3===e.code))return!0;return!1}(i))throw i;if(o===d.length-1)throw i;if(s??=d.slice(o+1).some((r=>{const{include:s,exclude:n}=r({chain:t}).config.methods||{};return s?s.includes(e):!n||!n.includes(e)})),!s)throw i;return n(o+1)}};return n()},retryCount:o,retryDelay:c,type:"fallback"},{onResponse:e=>h=e,transports:d.map((e=>e({chain:t,retryCount:0})))});if(n){const e="object"==typeof n?n:{};!function({chain:e,interval:t=4e3,onTransports:r,ping:s,sampleCount:n=10,timeout:o=1e3,transports:a,weights:c={}}){const{stability:i=.7,latency:u=.3}=c,l=[],d=async()=>{const c=await Promise.all(a.map((async t=>{const r=t({chain:e,retryCount:0,timeout:o}),n=Date.now();let a,c;try{await(s?s({transport:r}):r.request({method:"net_listening"})),c=1}catch{c=0}finally{a=Date.now()}return{latency:a-n,success:c}})));l.push(c),l.length>n&&l.shift();const h=Math.max(...l.map((e=>Math.max(...e.map((({latency:e})=>e)))))),f=a.map(((e,t)=>{const r=l.map((e=>e[t].latency)),s=1-r.reduce(((e,t)=>e+t),0)/r.length/h,n=l.map((e=>e[t].success)),o=n.reduce(((e,t)=>e+t),0)/n.length;return 0===o?[0,t]:[u*s+i*o,t]})).sort(((e,t)=>t[0]-e[0]));r(f.map((([,e])=>a[e]))),await(0,y.u)(t),d()};d()}({chain:t,interval:e.interval??i,onTransports:e=>d=e,ping:e.ping,sampleCount:e.sampleCount,timeout:e.timeout,transports:d,weights:e.weights})}return f}}},71285:(e,t,r)=>{"use strict";r.d(t,{B1:()=>l,BX:()=>u,KR:()=>h,P9:()=>d});var s=r(24693);const n=e=>"object"==typeof e&&null!==e,o=new WeakMap,a=new WeakSet,c=(e=Object.is,t=(e,t)=>new Proxy(e,t),r=e=>n(e)&&!a.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer),c=e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}},i=new WeakMap,u=(e,t,r=c)=>{const n=i.get(e);if((null==n?void 0:n[0])===t)return n[1];const l=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return(0,s.OC)(l,!0),i.set(e,[t,l]),Reflect.ownKeys(e).forEach((t=>{if(Object.getOwnPropertyDescriptor(l,t))return;const n=Reflect.get(e,t),{enumerable:c}=Reflect.getOwnPropertyDescriptor(e,t),i={value:n,enumerable:c,configurable:!0};if(a.has(n))(0,s.OC)(n,!1);else if(n instanceof Promise)delete i.value,i.get=()=>r(n);else if(o.has(n)){const[e,t]=o.get(n);i.value=u(e,t(),r)}Object.defineProperty(l,t,i)})),Object.preventExtensions(l)},l=new WeakMap,d=[1,1],h=c=>{if(!n(c))throw new Error("object required");const i=l.get(c);if(i)return i;let f=d[0];const p=new Set,b=(e,t=++d[0])=>{f!==t&&(f=t,p.forEach((r=>r(e,t))))};let m=d[1];const g=e=>(t,r)=>{const s=[...t];s[1]=[e,...s[1]],b(s,r)},y=new Map,w=e=>{var t;const r=y.get(e);r&&(y.delete(e),null==(t=r[1])||t.call(r))},v=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),x=t(v,{deleteProperty(e,t){const r=Reflect.get(e,t);w(t);const s=Reflect.deleteProperty(e,t);return s&&b(["delete",[t],r]),s},set(t,c,i,u){const d=Reflect.has(t,c),f=Reflect.get(t,c,u);if(d&&(e(f,i)||l.has(i)&&e(f,l.get(i))))return!0;w(c),n(i)&&(i=(0,s.Ai)(i)||i);let m=i;if(i instanceof Promise)i.then((e=>{i.status="fulfilled",i.value=e,b(["resolve",[c],e])})).catch((e=>{i.status="rejected",i.reason=e,b(["reject",[c],e])}));else{!o.has(i)&&r(i)&&(m=h(i));const e=!a.has(m)&&o.get(m);e&&((e,t)=>{if(y.has(e))throw new Error("prop listener already exists");if(p.size){const r=t[3](g(e));y.set(e,[t,r])}else y.set(e,[t])})(c,e)}return Reflect.set(t,c,m,u),b(["set",[c],i,f]),!0}});l.set(c,x);const P=[v,(e=++d[1])=>(m===e||p.size||(m=e,y.forEach((([t])=>{const r=t[1](e);r>f&&(f=r)}))),f),u,e=>{p.add(e),1===p.size&&y.forEach((([e,t],r)=>{if(t)throw new Error("remove already exists");const s=e[3](g(r));y.set(r,[e,s])}));return()=>{p.delete(e),0===p.size&&y.forEach((([e,t],r)=>{t&&(t(),y.set(r,[e]))}))}}];return o.set(x,P),Reflect.ownKeys(c).forEach((e=>{const t=Object.getOwnPropertyDescriptor(c,e);"value"in t&&(x[e]=c[e],delete t.value,delete t.writable),Object.defineProperty(v,e,t)})),x})=>[h,o,a,e,t,r,c,i,u,l,d],[i]=c();function u(e={}){return i(e)}function l(e,t,r){const s=o.get(e);let n;const a=[],c=s[3];let i=!1;const u=c((e=>{a.push(e),r?t(a.splice(0)):n||(n=Promise.resolve().then((()=>{n=void 0,i&&t(a.splice(0))})))}));return i=!0,()=>{i=!1,u()}}function d(e,t){const r=o.get(e),[s,n,a]=r;return a(s,n(),t)}function h(e){return a.add(e),e}},73589:(e,t,r)=>{"use strict";r.d(t,{Ci:()=>o,J8:()=>a,MU:()=>c});var s=r(18463),n=r(51344);class o extends n.C{constructor({body:e,cause:t,details:r,headers:n,status:o,url:a}){super("HTTP request failed.",{cause:t,details:r,metaMessages:[o&&`Status: ${o}`,`URL: ${a}`,e&&`Request body: ${(0,s.A)(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=n,this.status=o,this.url=a}}n.C;class a extends n.C{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${r}`,`Request body: ${(0,s.A)(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}),this.code=t.code,this.data=t.data}}n.C;class c extends n.C{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${t}`,`Request body: ${(0,s.A)(e)}`],name:"TimeoutError"})}}},73674:(e,t,r)=>{"use strict";r.d(t,{o:()=>m});var s=r(51344),n=r(73589),o=r(27513),a=r(81727);class c 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)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const i=new c(8192);var u=r(50669);function l(e,{delay:t=100,retryCount:r=2,shouldRetry:s=()=>!0}={}){return new Promise(((n,o)=>{const a=async({count:c=0}={})=>{try{const t=await e();n(t)}catch(e){if(c{const r="function"==typeof t?t({count:c,error:e}):t;r&&await(0,u.u)(r),a({count:c+1})})({error:e});o(e)}};a()}))}var d=r(18463);function h(e,t={}){return async(r,c={})=>{const{dedupe:u=!1,methods:h,retryDelay:f=150,retryCount:p=3,uid:b}={...t,...c},{method:m}=r;if(h?.exclude?.includes(m))throw new o.ab(new Error("method not supported"),{method:m});if(h?.include&&!h.include.includes(m))throw new o.ab(new Error("method not supported"),{method:m});return function(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(i.get(r))return i.get(r);const s=e().finally((()=>i.delete(r)));return i.set(r,s),s}((()=>l((async()=>{try{return await e(r)}catch(e){const t=e;switch(t.code){case o.XU.code:throw new o.XU(t);case o.CL.code:throw new o.CL(t);case o.Gi.code:throw new o.Gi(t,{method:r.method});case o.D5.code:throw new o.D5(t);case o.bq.code:throw new o.bq(t);case o.Di.code:throw new o.Di(t);case o.hA.code:throw new o.hA(t);case o.qZ.code:throw new o.qZ(t);case o.YW.code:throw new o.YW(t);case o.ab.code:throw new o.ab(t,{method:r.method});case o.s0.code:throw new o.s0(t);case o.xQ.code:throw new o.xQ(t);case o.vx.code:throw new o.vx(t);case o.sV.code:throw new o.sV(t);case o.Sf.code:throw new o.Sf(t);case o.RV.code:throw new o.RV(t);case o.xq.code:throw new o.xq(t);case o.ch.code:throw new o.ch(t);case 5e3:throw new o.vx(t);default:if(e instanceof s.C)throw e;throw new o.MI(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof n.Ci){const e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e)}return(1<function(e){if("code"in e&&"number"==typeof e.code)return-1===e.code||(e.code===o.s0.code||e.code===o.bq.code);if(e instanceof n.Ci&&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:u,id:u?(0,a.i3)(`${b}.${(0,d.A)(r)}`):void 0})}}const f=256;let p,b=f;function m({key:e,methods:t,name:r,request:s,retryCount:n=3,retryDelay:o=150,timeout:a,type:c},i){return{config:{key:e,methods:t,name:r,request:s,retryCount:n,retryDelay:o,timeout:a,type:c},request:h(s,{methods:t,retryCount:n,retryDelay:o,uid:function(e=11){if(!p||b+e>2*f){p="",b=0;for(let e=0;e{"use strict";r.d(t,{i3:()=>p,nj:()=>d});var s=r(51344);class n extends s.C{constructor({max:e,min:t,signed:r,size:s,value:n}){super(`Number "${n}" is not in safe ${s?`${8*s}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}s.C;s.C;s.C;class o extends s.C{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}s.C;class a extends s.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}s.C;function c(e,{dir:t,size:r=32}={}){return"string"==typeof e?function(e,{dir:t,size:r=32}={}){if(null===r)return e;const s=e.replace("0x","");if(s.length>2*r)throw new a({size:Math.ceil(s.length/2),targetSize:r,type:"hex"});return`0x${s["right"===t?"padEnd":"padStart"](2*r,"0")}`}(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new a({size:e.length,targetSize:r,type:"bytes"});const s=new Uint8Array(r);for(let n=0;nt)throw new o({givenSize:i(e),maxSize:t})}const l=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function d(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t={}){const{signed:r,size:s}=t,o=BigInt(e);let a;s?a=r?(1n<<8n*BigInt(s)-1n)-1n:2n**(8n*BigInt(s))-1n:"number"==typeof e&&(a=BigInt(Number.MAX_SAFE_INTEGER));const i="bigint"==typeof a&&r?-a-1n:0;if(a&&o>a||o{"use strict";r.d(t,{L:()=>f});var s=r(73589),n=r(51344);class o extends n.C{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}const a=new Map;function c({fn:e,id:t,shouldSplitBatch:r,wait:s=0,sort:n}){const o=async()=>{const t=i();c();const r=t.map((({args:e})=>e));0!==r.length&&e(r).then((e=>{n&&Array.isArray(e)&&e.sort(n);for(let r=0;r{for(let r=0;ra.delete(t),i=()=>a.get(t)||[],u=e=>a.set(t,[...i(),e]);return{flush:c,async schedule(e){const{promise:t,resolve:n,reject:a}=function(){let e=()=>{},t=()=>{};return{promise:new Promise(((r,s)=>{e=r,t=s})),resolve:e,reject:t}}(),c=r?.([...i().map((({args:e})=>e)),e]);c&&o();return i().length>0?(u({args:e,resolve:n,reject:a}),t):(u({args:e,resolve:n,reject:a}),setTimeout(o,s),t)}}}var i=r(18463);function u(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const l=u();function d(e,t={}){return{async request(r){const{body:n,onRequest:o=t.onRequest,onResponse:a=t.onResponse,timeout:c=t.timeout??1e4}=r,u={...t.fetchOptions??{},...r.fetchOptions??{}},{headers:d,method:h,signal:f}=u;try{const t=await function(e,{errorInstance:t=new Error("timed out"),timeout:r,signal:s}){return new Promise(((n,o)=>{(async()=>{let a;try{const c=new AbortController;r>0&&(a=setTimeout((()=>{s?c.abort():o(t)}),r)),n(await e({signal:c?.signal||null}))}catch(e){"AbortError"===e?.name&&o(t),o(e)}finally{clearTimeout(a)}})()}))}((async({signal:t})=>{const r={...u,body:Array.isArray(n)?(0,i.A)(n.map((e=>({jsonrpc:"2.0",id:e.id??l.take(),...e})))):(0,i.A)({jsonrpc:"2.0",id:n.id??l.take(),...n}),headers:{"Content-Type":"application/json",...d},method:h||"POST",signal:f||(c>0?t:null)},s=new Request(e,r),a=await(o?.(s,r))??{...r,url:e};return await fetch(a.url??e,a)}),{errorInstance:new s.MU({body:n,url:e}),timeout:c,signal:!0});let r;if(a&&await a(t),t.headers.get("Content-Type")?.startsWith("application/json"))r=await t.json();else{r=await t.text();try{r=JSON.parse(r||"{}")}catch(e){if(t.ok)throw e;r={error:r}}}if(!t.ok)throw new s.Ci({body:n,details:(0,i.A)(r.error)||t.statusText,headers:t.headers,status:t.status,url:e});return r}catch(t){if(t instanceof s.Ci)throw t;if(t instanceof s.MU)throw t;throw new s.Ci({body:n,cause:t,url:e})}}}}var h=r(73674);function f(e,t={}){const{batch:r,fetchOptions:n,key:a="http",methods:i,name:u="HTTP JSON-RPC",onFetchRequest:l,onFetchResponse:f,retryDelay:p}=t;return({chain:b,retryCount:m,timeout:g})=>{const{batchSize:y=1e3,wait:w=0}="object"==typeof r?r:{},v=t.retryCount??m,x=g??t.timeout??1e4,P=e||b?.rpcUrls.default.http[0];if(!P)throw new o;const j=d(P,{fetchOptions:n,onRequest:l,onResponse:f,timeout:x});return(0,h.o)({key:a,methods:i,name:u,async request({method:e,params:t}){const n={method:e,params:t},{schedule:o}=c({id:P,wait:w,shouldSplitBatch:e=>e.length>y,fn:e=>j.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:a,result:i}]=await(async e=>r?o(e):[await j.request({body:e})])(n);if(a)throw new s.J8({body:n,error:a,url:P});return i},retryCount:v,retryDelay:p,timeout:x,type:"http"},{fetchOptions:n,url:P})}}}}]);