@ozdao/prometheus-framework 0.1.68 → 0.1.69
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/BackofficeGallery-59a591ab.js +1 -0
- package/dist/BackofficeGallery-be6f69a9.mjs +307 -0
- package/dist/BackofficeReports-06166952.js +1 -0
- package/dist/BackofficeReports-50fd799c.mjs +44 -0
- package/dist/BlockTags-00325fa0.mjs +853 -0
- package/dist/BlockTags-58f95c8a.js +1 -0
- package/dist/ButtonToggleMembership-84d0e018.mjs +90 -0
- package/dist/ButtonToggleMembership-b905812f.js +1 -0
- package/dist/CardBlogpost-1b81b54e.mjs +246 -0
- package/dist/CardBlogpost-7107e04a.js +1 -0
- package/dist/CardOrganization-49ab5190.mjs +234 -0
- package/dist/CardOrganization-e6ac27f1.js +1 -0
- package/dist/CardProduct-4c0cb9a1.js +1 -0
- package/dist/CardProduct-ea0e1f84.mjs +192 -0
- package/dist/Chips-817cf959.js +1 -0
- package/dist/Chips-8c836ba6.mjs +213 -0
- package/dist/Community-8c4e011b.js +1 -0
- package/dist/Community-bd6f0cbb.mjs +131 -0
- package/dist/Dashboard-73b50724.js +1 -0
- package/dist/Dashboard-bc81b5f6.mjs +151 -0
- package/dist/Dropdown-60e3dc6c.js +1 -0
- package/dist/Dropdown-d1c81d45.mjs +169 -0
- package/dist/EditOrder-2b746caf.mjs +221 -0
- package/dist/EditOrder-e632f0cc.js +1 -0
- package/dist/Events-999cc8ed.js +1 -0
- package/dist/Events-ad8bbf27.mjs +134 -0
- package/dist/Feed-35e13c22.mjs +156 -0
- package/dist/Feed-53d96b18.mjs +361 -0
- package/dist/Feed-694a2fad.js +1 -0
- package/dist/Feed-ac4bb6ea.js +1 -0
- package/dist/Feed-d1d01771.js +1 -0
- package/dist/Feed-f7c04014.mjs +124 -0
- package/dist/Image-61cfd52d.js +9 -0
- package/dist/Image-e8be4acc.mjs +480 -0
- package/dist/LeftoverAdd-a268a95c.js +1 -0
- package/dist/LeftoverAdd-e4d93760.mjs +229 -0
- package/dist/Leftovers-6976802d.mjs +135 -0
- package/dist/Leftovers-d8f1d152.js +1 -0
- package/dist/Members-aeb2bca1.mjs +109 -0
- package/dist/Members-b9664e83.js +1 -0
- package/dist/Menu-93d34d9f.js +1 -0
- package/dist/Menu-eaf6b44c.mjs +13 -0
- package/dist/MenuItem-4a5881bd.mjs +85 -0
- package/dist/MenuItem-f35cad93.js +1 -0
- package/dist/Orders-8bc8963c.js +1 -0
- package/dist/Orders-eb262d8c.mjs +75 -0
- package/dist/Organizations-9926aa51.mjs +72 -0
- package/dist/Organizations-c653d814.js +1 -0
- package/dist/Payments-98328000.js +1 -0
- package/dist/Payments-a9066cdf.mjs +11 -0
- package/dist/Popup-0d8e1392.mjs +96 -0
- package/dist/Popup-eb11fa82.js +1 -0
- package/dist/Product-15043af7.mjs +651 -0
- package/dist/Product-82c022a4.js +7 -0
- package/dist/ProductEdit-05da9866.mjs +258 -0
- package/dist/ProductEdit-2f075296.js +1 -0
- package/dist/ProductsBackoffice-8462f626.js +1 -0
- package/dist/ProductsBackoffice-8d0f0ee8.mjs +85 -0
- package/dist/ProfileBlogposts-43855cb9.js +1 -0
- package/dist/ProfileBlogposts-f32170a3.mjs +78 -0
- package/dist/ProfileEvents-54be2d43.mjs +69 -0
- package/dist/ProfileEvents-ab69e27e.js +1 -0
- package/dist/ProfileOrganizations-0787cf34.mjs +72 -0
- package/dist/ProfileOrganizations-eb62dde4.js +1 -0
- package/dist/Publics-8e726d20.mjs +45 -0
- package/dist/Publics-ae589bf1.js +1 -0
- package/dist/Select-95f4701a.js +1 -0
- package/dist/Select-dab17282.mjs +80 -0
- package/dist/Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-0ea8fbf8.js +1 -0
- package/dist/Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-4ed993c7.mjs +1 -0
- package/dist/Socials-43293869.js +1 -0
- package/dist/Socials-8193477c.mjs +189 -0
- package/dist/UploadImage-0e8e4278.mjs +83 -0
- package/dist/UploadImage-8c71bda6.js +1 -0
- package/dist/UploadImageMultiple-c34a6c6f.mjs +58 -0
- package/dist/UploadImageMultiple-d1316df5.js +1 -0
- package/dist/Wallet-727195d9.mjs +21700 -0
- package/dist/Wallet-f4dda407.js +10 -0
- package/dist/auth-04684a60.js +7 -0
- package/dist/auth-7e39361f.mjs +633 -0
- package/dist/auth.client.cjs +1 -1
- package/dist/auth.client.js +5 -5
- package/dist/auth.server.js +1 -1
- package/dist/auth.server.mjs +1 -1
- package/dist/auth.validation-d614130d.js +1 -0
- package/dist/auth.validation-f4bf1deb.mjs +24 -0
- package/dist/axios-33aeb810.mjs +1435 -0
- package/dist/axios-ceccf20e.js +5 -0
- package/dist/backoffice.client.cjs +1 -1
- package/dist/backoffice.client.js +20 -20
- package/dist/categories-7e17a7eb.js +1 -0
- package/dist/categories-b7f9e8c0.mjs +122 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +209 -202
- package/dist/components/Upload/Upload.vue.d.ts.map +1 -1
- package/dist/events.client.cjs +2 -2
- package/dist/events.client.js +24 -27
- package/dist/landing.client.cjs +1 -1
- package/dist/landing.client.js +64 -40
- package/dist/leftovers-86e7d438.mjs +67 -0
- package/dist/leftovers-c9f70579.js +1 -0
- package/dist/legal.client.cjs +1 -1
- package/dist/legal.client.js +6 -7
- package/dist/main.css +1 -1
- package/dist/memberships-559590ad.mjs +68 -0
- package/dist/memberships-58af22e0.js +1 -0
- package/dist/modules/constructor/components/elements/H2.vue.d.ts +1 -1
- package/dist/modules/constructor/components/elements/Textarea.vue.d.ts +1 -1
- package/dist/modules/products/components/sections/EditProductInfo.vue.d.ts +1 -5
- package/dist/orders-1325c51b.js +1 -0
- package/dist/orders-c7cbe706.mjs +85 -0
- package/dist/organizations-71777b32.js +1 -0
- package/dist/organizations-93f7b610.mjs +122 -0
- package/dist/organizations.client-6ca27fb3.js +3 -0
- package/dist/organizations.client-bd63a7b2.mjs +2997 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +56 -61
- package/dist/products-61d83d74.js +1 -0
- package/dist/products-7f1e5a75.mjs +108 -0
- package/dist/prometheus-framework.cjs.js +21 -21
- package/dist/prometheus-framework.es.js +682 -690
- package/dist/reports-a67b4fb4.js +1 -0
- package/dist/reports-c579b02a.mjs +91 -0
- package/dist/reports.client.cjs +1 -1
- package/dist/reports.client.js +2 -2
- package/dist/states.validation-3b4604bc.mjs +13 -0
- package/dist/states.validation-9b43a097.js +1 -0
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +279 -208
- package/package.json +30 -35
- package/src/components/Button/Button.vue +1 -1
- package/src/components/Sidebar/Sidebar.vue +10 -8
- package/src/components/Upload/Upload.vue +8 -28
- package/src/modules/auth/controllers/auth.controller.js +1 -1
- package/src/modules/auth/store/auth.js +21 -24
- package/src/modules/backoffice/components/admin/ProductEdit.vue +2 -0
- package/src/modules/constructor/components/sections/Constructor.vue +7 -54
- package/src/modules/gallery/components/pages/Gallery.vue +7 -1
- package/src/modules/gallery/components/sections/GalleryWithCategories.vue +24 -8
- package/src/modules/gallery/gallery.client.js +5 -1
- package/src/modules/marketplace/components/layouts/Marketplace.vue +1 -0
- package/src/modules/organizations/components/pages/Organization.vue +2 -2
- package/src/modules/payments/components/pages/Payments.vue +4 -3
- package/src/modules/products/components/blocks/CardLeftover.vue +0 -1
- package/src/modules/products/components/blocks/CardProduct.vue +15 -1
- package/src/modules/products/components/sections/EditProductInfo.vue +16 -14
- package/src/modules/products/components/sections/FilterProducts.vue +0 -2
- package/src/modules/products/components/sections/SectionProduct.vue +1 -0
- package/src/modules/products/components/sections/SortProducts.vue +2 -0
- package/src/modules/products/store/categories.js +9 -9
- package/src/modules/products/store/leftovers.js +6 -9
- package/src/modules/products/store/products.js +2 -0
- package/src/modules/users/components/pages/Profile.vue +3 -5
- package/src/modules/wallet/components/pages/Wallet.vue +1 -1
- package/src/styles/components/button.scss +253 -0
- package/src/styles/theme.scss +1 -0
- package/src/modules/constructor/components/elements/Audio.vue +0 -82
- package/src/modules/constructor/components/elements/Embed.vue +0 -85
- package/src/modules/globals/mixins/mixins.js +0 -52
- package/src/modules/globals/router/routerGuards.js +0 -28
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("vue"),tn=require("./auth-04684a60.js"),tf=require("vue-router");require("./axios-ceccf20e.js");require("./globals-928eb13c.js");require("vue-i18n");const nf=100,rf=101,sf=201,of=202,af=203,cf=204,uf=205,df=206,lf=207,ff=300,hf=301,mf=310,pf=311,gf=400,yf=402,vf=405,bf=407,wf=408,Af=410,_f=411,Ef=412,xf=413,If=414,Tf=415,Sf=416,kf=417,Bf=418,Cf=419,Rf=420,Pf=421,Nf=422,Of=423,Mf=424,Lf=425,Df=426,Hf=427,Ff=428,jf=429,Uf=430,Gf=431,qf=432,Vf=433,zf=434,Qf=435,Zf=436,Wf=437,$f=438,Kf=439,Jf=440,Xf=441,Yf=500,eh=503,th=505,nh=506,rh=507,ih=600,sh=602,oh=603,ah=604,ch=701,uh=702,dh=703,lh=704,fh=705,hh=706,mh=707,ph=709,gh=801,yh=802,vh=4001,bh=4100,wh=4200,Ah=4900,_h=4901,Eh=902,xh=903,Ih=1001,Th=1002,Sh=1003,kh=1004,Bh=1005,Ch=1006,Rh=1008,Ph=1009,Nh=1010,Oh=1011,Mh=1012,Lh=1014,Dh=1100,Wc=1101,Hh=1200,di=-32700,li=-32600,fi=-32601,hi=-32602,mi=-32603,pi=-32e3,gi=-32001,yi=-32002,vi=-32003,bi=-32004,wi=-32005,Ai=-32006;class $ extends Error{constructor(e,n){super(e),this.innerError=n,this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(new.target.constructor):this.stack=new Error().stack}static convertToString(e,n=!1){if(e==null)return"undefined";const r=JSON.stringify(e,(i,s)=>typeof s=="bigint"?s.toString():s);return n&&["bigint","string"].includes(typeof e)?r.replace(/['\\"]+/g,""):r}toJSON(){return{name:this.name,code:this.code,message:this.message,innerError:this.innerError}}}class ee extends ${constructor(e,n){super(`Invalid value given "${$.convertToString(e,!0)}". Error: ${n}.`),this.name=this.constructor.name}}class Ua extends ${constructor(){super("Private key must be 32 bytes."),this.code=ch}}class Fh extends ${constructor(){super("Invalid Private Key, Not a valid string or uint8Array"),this.code=uh}}class jh extends ${constructor(e){super(`"${e}"`),this.code=yh}}class $c extends ${constructor(){super("Invalid key derivation function"),this.code=dh}}class Uh extends ${constructor(){super("Key derivation failed - possibly wrong password"),this.code=lh}}class Gh extends ${constructor(){super("Unsupported key store version"),this.code=fh}}class qh extends ${constructor(){super("Password cannot be empty"),this.code=hh}}class Vh extends ${constructor(){super("Initialization vector must be 16 bytes"),this.code=mh}}class zh extends ${constructor(){super("c > 1000, pbkdf2 is less secure with less iterations"),this.code=ph}}class Gr extends ${constructor(e,n){super(e),this.code=Yf,n&&(this.errorCode=n.code,this.errorReason=n.reason)}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{errorCode:this.errorCode,errorReason:this.errorReason})}}class $s extends Gr{constructor(e){super("Connection not open",e),this.code=eh}}class Qh extends Gr{constructor(e){super(`Maximum number of reconnect attempts reached! (${e})`),this.code=th}}class Zh extends Gr{constructor(){super("CONNECTION ERROR: Provider started to reconnect before the response got received!"),this.code=nh}}class Wh extends Gr{constructor(e){super(`Request already sent with following id: ${e}`),this.code=rh}}class je extends ${constructor(e,n){super(e),this.code=ff,this.receipt=n}}class Ga extends ${constructor(e,n){super(`The resolver at ${e} does not implement requested method: "${n}".`),this.address=e,this.name=n,this.code=hf}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{address:this.address,name:this.name})}}class ts extends je{constructor(e){if(super(e.message||"Error"),this.name="name"in e&&e.name||this.constructor.name,this.stack="stack"in e&&e.stack||void 0,this.code=e.code,typeof e.data=="object"){let n;"originalError"in e.data?n=e.data.originalError:n=e.data,this.data=n.data,this.innerError=new ts(n)}else this.data=e.data}setDecodedProperties(e,n,r){this.errorName=e,this.errorSignature=n,this.errorArgs=r}toJSON(){let e=Object.assign(Object.assign({},super.toJSON()),{data:this.data});return this.errorName&&(e=Object.assign(Object.assign({},e),{errorName:this.errorName,errorSignature:this.errorSignature,errorArgs:this.errorArgs})),e}}class nn extends je{constructor(e){super("Error happened while trying to execute a function inside a smart contract"),this.code=mf,this.innerError=new ts(e)}}class $h extends ee{constructor(e){var n,r;super(`data: ${(n=e.data)!==null&&n!==void 0?n:"undefined"}, input: ${(r=e.input)!==null&&r!==void 0?r:"undefined"}`,`You can't have "data" and "input" as properties of a contract at the same time, please use either "data" or "input" instead.`),this.code=pf}}class Kh extends ${constructor(e){super(`ENS is not supported on network ${e}`),this.code=Eh}}class Jh extends ${constructor(){super("Network not synced"),this.code=xh}}class qa extends ${constructor(e){super(`Invalid parameters passed. "${typeof e<"u"?e:""}"`),this.hint=e,this.code=lf}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{hint:this.hint})}}class Ks extends ${constructor(){super(...arguments),this.code=sf}}class ht extends ${constructor(){super("The method you're trying to call is not implemented."),this.code=of}}class Kc extends ${constructor(){super(...arguments),this.code=af}}class Xh extends ${constructor(){super(...arguments),this.code=cf}}class ie extends ${constructor(e,n){super(e),this.code=uf,this.props=n??{}}}class Yh extends ${constructor(e){super(`A plugin with the namespace: ${e} has already been registered.`),this.code=df}}class ei extends ${constructor(){super(...arguments),this.code=ih}}class Js extends ${constructor(e){super(`Client URL "${e}" is invalid.`),this.code=sh}}class Xe extends ${constructor(){super(...arguments),this.code=oh}}class em extends ${constructor(){super(...arguments),this.code=ah}}class tm extends ee{constructor(){super(...arguments),this.code=gh}}class Do extends ${constructor(e,n){super(e),this.receipt=n,this.code=gf}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{receipt:this.receipt})}}class _i extends ${constructor(e,n,r,i){super(`Transaction has been reverted by the EVM${r===void 0?"":`:
|
2
|
+
${$.convertToString(r)}`}`),this.reason=e,this.signature=n,this.receipt=r,this.data=i,this.code=yf}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,signature:this.signature,receipt:this.receipt,data:this.data})}}class Jc extends _i{constructor(e,n,r,i,s,o,a){super(e),this.reason=e,this.customErrorName=n,this.customErrorDecodedSignature=r,this.customErrorArguments=i,this.signature=s,this.receipt=o,this.data=a,this.code=$f}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,customErrorName:this.customErrorName,customErrorDecodedSignature:this.customErrorDecodedSignature,customErrorArguments:this.customErrorArguments,signature:this.signature,receipt:this.receipt,data:this.data})}}class Xc extends Do{constructor(e){super(`Transaction has been reverted by the EVM${e===void 0?"":`:
|
3
|
+
${$.convertToString(e)}`}`,e),this.code=vf}}class nm extends Do{constructor(){super("Raw transaction undefined"),this.code=bf}}class Va extends Do{constructor(){super("Transaction not found"),this.code=Uf}}class rm extends ee{constructor(e){super(e,"invalid transaction with invalid sender"),this.code=wf}}class im extends ee{constructor(e){super(e,"invalid transaction with invalid receiver"),this.code=Wf}}class sm extends ee{constructor(){super("MissingCustomChainError","If tx.common is provided it must have tx.common.customChain"),this.code=Af}}class om extends ee{constructor(){super("MissingCustomChainIdError","If tx.common is provided it must have tx.common.customChain and tx.common.customChain.chainId"),this.code=_f}}class am extends ee{constructor(e){super(JSON.stringify(e),"Chain Id doesnt match in tx.chainId tx.common.customChain.chainId"),this.code=Ef}}class cm extends ee{constructor(e){super(JSON.stringify(e),"Chain doesnt match in tx.chain tx.common.basechain"),this.code=Qf}}class um extends ee{constructor(e){super(JSON.stringify(e),"hardfork doesnt match in tx.hardfork tx.common.hardfork"),this.code=Zf}}class dm extends ee{constructor(){super("CommonOrChainAndHardforkError","Please provide the common object or the chain and hardfork property but not all together."),this.code=xf}}class lm extends ee{constructor(e){var n,r;super("MissingChainOrHardforkError",`When specifying chain and hardfork, both values must be defined. Received "chain": ${(n=e.chain)!==null&&n!==void 0?n:"undefined"}, "hardfork": ${(r=e.hardfork)!==null&&r!==void 0?r:"undefined"}`),this.code=If}}class fm extends ${constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions'),this.code=Jf}}class hm extends ee{constructor(e){var n,r,i,s;super(`gas: ${(n=e.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=e.gasPrice)!==null&&r!==void 0?r:"undefined"}, maxPriorityFeePerGas: ${(i=e.maxPriorityFeePerGas)!==null&&i!==void 0?i:"undefined"}, maxFeePerGas: ${(s=e.maxFeePerGas)!==null&&s!==void 0?s:"undefined"}`,'"gas" is missing'),this.code=Tf,this.innerError=new fm}}class mm extends ${constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions, not both'),this.code=Xf}}class pm extends ee{constructor(e){var n,r,i,s;super(`gas: ${(n=e.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=e.gasPrice)!==null&&r!==void 0?r:"undefined"}, maxPriorityFeePerGas: ${(i=e.maxPriorityFeePerGas)!==null&&i!==void 0?i:"undefined"}, maxFeePerGas: ${(s=e.maxFeePerGas)!==null&&s!==void 0?s:"undefined"}`,"transaction must specify legacy or fee market gas properties, not both"),this.code=zf,this.innerError=new mm}}class gm extends ee{constructor(e){var n,r;super(`gas: ${(n=e.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=e.gasPrice)!==null&&r!==void 0?r:"undefined"}`,"Gas or gasPrice is lower than 0"),this.code=Sf}}class ym extends ee{constructor(e){var n,r;super(`maxPriorityFeePerGas: ${(n=e.maxPriorityFeePerGas)!==null&&n!==void 0?n:"undefined"}, maxFeePerGas: ${(r=e.maxFeePerGas)!==null&&r!==void 0?r:"undefined"}`,"maxPriorityFeePerGas or maxFeePerGas is lower than 0"),this.code=kf}}class vm extends ee{constructor(e){super(e,"eip-1559 transactions don't support gasPrice"),this.code=Bf}}class Yc extends ee{constructor(e){var n,r;super(`maxPriorityFeePerGas: ${(n=e.maxPriorityFeePerGas)!==null&&n!==void 0?n:"undefined"}, maxFeePerGas: ${(r=e.maxFeePerGas)!==null&&r!==void 0?r:"undefined"}`,"pre-eip-1559 transaction don't support maxFeePerGas/maxPriorityFeePerGas"),this.code=Cf}}class bm extends ee{constructor(e){super(e,"invalid transaction object"),this.code=Rf}}class wm extends ee{constructor(e){var n,r;super(`nonce: ${(n=e.nonce)!==null&&n!==void 0?n:"undefined"}, chainId: ${(r=e.chainId)!==null&&r!==void 0?r:"undefined"}`,"Nonce or chainId is lower than 0"),this.code=Pf}}class Am extends ee{constructor(){super("UnableToPopulateNonceError","unable to populate nonce, no from address available"),this.code=Nf}}class _m extends ee{constructor(){super("Eip1559NotSupportedError","Network doesn't support eip-1559"),this.code=Of}}class za extends ee{constructor(e){super(e,"unsupported transaction type"),this.code=Mf}}class eu extends ee{constructor(e){var n,r;super(`data: ${(n=e.data)!==null&&n!==void 0?n:"undefined"}, input: ${(r=e.input)!==null&&r!==void 0?r:"undefined"}`,`You can't have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.`),this.code=Lf}}class Em extends ${constructor(e){super(`The connected Ethereum Node did not respond within ${e.numberOfSeconds} seconds, please make sure your transaction was properly sent and you are connected to a healthy Node. Be aware that transaction might still be pending or mined!
|
4
|
+
Transaction Hash: ${e.transactionHash?e.transactionHash.toString():"not available"}`),this.code=Gf}}function tu(t){return`Please make sure your transaction was properly sent and there are no previous pending transaction for the same account. However, be aware that it might still be mined!
|
5
|
+
Transaction Hash: ${t?t.toString():"not available"}`}class xm extends ${constructor(e){super(`Transaction was not mined within ${e.numberOfSeconds} seconds. ${tu(e.transactionHash)}`),this.code=Df}}class nu extends ${constructor(e){super(`Transaction started at ${e.starterBlockNumber} but was not mined within ${e.numberOfBlocks} blocks. ${tu(e.transactionHash)}`),this.code=qf}}class Im extends ee{constructor(e){var n,r;super(`receipt: ${JSON.stringify(e.receipt)}, blockHash: ${(n=e.blockHash)===null||n===void 0?void 0:n.toString()}, transactionHash: ${(r=e.transactionHash)===null||r===void 0?void 0:r.toString()}`,"Receipt missing or blockHash null"),this.code=Hf}}class Tm extends ee{constructor(e){super(`receipt: ${JSON.stringify(e.receipt)}`,"Receipt missing block number"),this.code=Ff}}class Xs extends ${constructor(e){super(`Invalid signature. "${e}"`),this.code=Vf}}class Qa extends ee{constructor(){super("LocalWalletNotAvailableError","Attempted to index account in local wallet, but no wallet is available"),this.code=jf}}class Sm extends ${constructor(e,n){const r=[];e.forEach(i=>r.push(i.keyword)),super(`The following properties are invalid for the transaction type ${n}: ${r.join(", ")}`),this.code=Kf}}class fr extends ee{constructor(e){super(e,"can not parse as byte data"),this.code=Th}}class Ho extends ee{constructor(e){super(e,"can not parse as number data"),this.code=Sh}}class Fo extends ee{constructor(e){super(e,"invalid ethereum address"),this.code=Bh}}class km extends ee{constructor(e){super(e,"not a valid string"),this.code=Ih}}class ru extends ee{constructor(e){super(e,"invalid unit"),this.code=kh}}class Bm extends ee{constructor(e){super(e,"can not be converted to hex"),this.code=Ch}}class iu extends ee{constructor(e){super(e,"value greater than the nibble width"),this.code=Lh}}class jo extends ee{constructor(e){super(e,"not a valid boolean."),this.code=Rh}}class Cm extends ee{constructor(e){super(e,"not a valid unsigned integer."),this.code=Ph}}class Za extends ee{constructor(e){super(e,"invalid size given."),this.code=Nh}}class Wa extends ee{constructor(e){super(e,"value is larger than size."),this.code=Oh}}class Rm extends ee{constructor(e){super(e,"invalid string given"),this.code=Mh}}const Pm=t=>!Array.isArray(t)&&t.jsonrpc==="2.0"&&!!t&&(t.result===void 0||t.result===null)&&"error"in t&&(typeof t.id=="number"||typeof t.id=="string"),$a=t=>Pm(t)?t.error.message:"";class gt extends ${constructor(e,n,r){var i;super(n??`Returned error: ${Array.isArray(e)?e.map(o=>$a(o)).join(","):$a(e)}`),this.code=nf,n||(this.data=Array.isArray(e)?e.map(o=>{var a;return(a=o.error)===null||a===void 0?void 0:a.data}):(i=e==null?void 0:e.error)===null||i===void 0?void 0:i.data),this.request=r;let s;"error"in e?s=e.error:e instanceof Array&&(s=e.map(o=>o.error)),this.innerError=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{data:this.data,request:this.request})}}class yr extends gt{constructor(e,n){super(e,void 0,n),this.code=rf;let r;"error"in e?r=e.error:e instanceof Array&&(r=e.map(i=>i.error)),this.innerError=r}}class Ka extends ${constructor(e,n){super(`Web3Config hardfork doesnt match in defaultHardfork ${e} and common.hardfork ${n}`),this.code=Wc}}class Ja extends ${constructor(e,n){super(`Web3Config chain doesnt match in defaultHardfork ${e} and common.hardfork ${n}`),this.code=Wc}}const su="An Rpc error has occured with a code of *code*",ke={[di]:{message:"Parse error",description:"Invalid JSON"},[li]:{message:"Invalid request",description:"JSON is not a valid request object "},[fi]:{message:"Method not found",description:"Method does not exist "},[hi]:{message:"Invalid params",description:"Invalid method parameters"},[mi]:{message:"Internal error",description:"Internal JSON-RPC error"},[pi]:{message:"Invalid input",description:"Missing or invalid parameters"},[gi]:{message:"Resource not found",description:"Requested resource not found"},[yi]:{message:"Resource unavailable",description:"Requested resource not available"},[vi]:{message:"Transaction rejected",description:"Transaction creation failed"},[bi]:{message:"Method not supported",description:"Method is not implemented"},[wi]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[Ai]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[vh]:{name:"User Rejected Request",message:"The user rejected the request."},[bh]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[wh]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[Ah]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[_h]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}};class qe extends ${constructor(e,n){super(n??su.replace("*code*",e.error.code.toString())),this.code=e.error.code,this.id=e.id,this.jsonrpc=e.jsonrpc,this.jsonRpcError=e.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}}class Nm extends ${constructor(e,n){var r,i,s,o;if(!e)super();else if(!((r=ke[e])===null||r===void 0)&&r.message)super(ke[e].message);else{const a=Object.keys(ke).find(u=>typeof u=="string"&&e>=parseInt(u.split("-")[0],10)&&e<=parseInt(u.split("-")[1],10));super((s=(i=ke[a??""])===null||i===void 0?void 0:i.message)!==null&&s!==void 0?s:su.replace("*code*",(o=e==null?void 0:e.toString())!==null&&o!==void 0?o:'""'))}this.code=e,this.data=n}}class Om extends qe{constructor(e){super(e,ke[di].message),this.code=di}}class Mm extends qe{constructor(e){super(e,ke[li].message),this.code=li}}class Lm extends qe{constructor(e){super(e,ke[fi].message),this.code=fi}}class Dm extends qe{constructor(e){super(e,ke[hi].message),this.code=hi}}class Hm extends qe{constructor(e){super(e,ke[mi].message),this.code=mi}}class Fm extends qe{constructor(e){super(e,ke[pi].message),this.code=pi}}class jm extends qe{constructor(e){super(e,ke[bi].message),this.code=bi}}class Um extends qe{constructor(e){super(e,ke[yi].message),this.code=yi}}class Gm extends qe{constructor(e){super(e,ke[gi].message),this.code=gi}}class qm extends qe{constructor(e){super(e,ke[Ai].message),this.code=Ai}}class Vm extends qe{constructor(e){super(e,ke[vi].message),this.code=vi}}class zm extends qe{constructor(e){super(e,ke[wi].message),this.code=wi}}const Re=new Map;Re.set(di,{error:Om});Re.set(li,{error:Mm});Re.set(fi,{error:Lm});Re.set(hi,{error:Dm});Re.set(mi,{error:Hm});Re.set(pi,{error:Fm});Re.set(bi,{error:jm});Re.set(yi,{error:Um});Re.set(vi,{error:Vm});Re.set(gi,{error:Gm});Re.set(Ai,{error:qm});Re.set(wi,{error:zm});class Qm extends ${constructor(e){super(`Format for the type ${e} is unsupported`),this.type=e,this.code=Hh}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}function Ys(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Zm(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function ou(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function Wm(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ys(t.outputLen),Ys(t.blockLen)}function $m(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Km(t,e){ou(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const pe={number:Ys,bool:Zm,bytes:ou,hash:Wm,exists:$m,output:Km},Kr=BigInt(2**32-1),eo=BigInt(32);function au(t,e=!1){return e?{h:Number(t&Kr),l:Number(t>>eo&Kr)}:{h:Number(t>>eo&Kr)|0,l:Number(t&Kr)|0}}function Jm(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=au(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}const Xm=(t,e)=>BigInt(t>>>0)<<eo|BigInt(e>>>0),Ym=(t,e,n)=>t>>>n,ep=(t,e,n)=>t<<32-n|e>>>n,tp=(t,e,n)=>t>>>n|e<<32-n,np=(t,e,n)=>t<<32-n|e>>>n,rp=(t,e,n)=>t<<64-n|e>>>n-32,ip=(t,e,n)=>t>>>n-32|e<<64-n,sp=(t,e)=>e,op=(t,e)=>t,ap=(t,e,n)=>t<<n|e>>>32-n,cp=(t,e,n)=>e<<n|t>>>32-n,up=(t,e,n)=>e<<n-32|t>>>64-n,dp=(t,e,n)=>t<<n-32|e>>>64-n;function lp(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const fp=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),hp=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,mp=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),pp=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,gp=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),yp=(t,e,n,r,i,s)=>e+n+r+i+s+(t/2**32|0)|0,Q={fromBig:au,split:Jm,toBig:Xm,shrSH:Ym,shrSL:ep,rotrSH:tp,rotrSL:np,rotrBH:rp,rotrBL:ip,rotr32H:sp,rotr32L:op,rotlSH:ap,rotlSL:cp,rotlBH:up,rotlBL:dp,add:lp,add3L:fp,add3H:hp,add4L:mp,add4H:pp,add5H:yp,add5L:gp},ti=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const cu=t=>t instanceof Uint8Array,ni=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),ri=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),it=(t,e)=>t<<32-e|t>>>e,vp=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!vp)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Un(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function cn(t){if(typeof t=="string"&&(t=Un(t)),!cu(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Ei(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!cu(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class Uo{clone(){return this._cloneInto()}}const bp=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function uu(t,e){if(e!==void 0&&(typeof e!="object"||!bp(e)))throw new Error("Options should be object or undefined");return Object.assign(t,e)}function yn(t){const e=r=>t().update(cn(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function wp(t){const e=(r,i)=>t(i).update(cn(r)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=r=>t(r),e}function du(t=32){if(ti&&typeof ti.getRandomValues=="function")return ti.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}const[lu,fu,hu]=[[],[],[]],Ap=BigInt(0),ir=BigInt(1),_p=BigInt(2),Ep=BigInt(7),xp=BigInt(256),Ip=BigInt(113);for(let t=0,e=ir,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],lu.push(2*(5*r+n)),fu.push((t+1)*(t+2)/2%64);let i=Ap;for(let s=0;s<7;s++)e=(e<<ir^(e>>Ep)*Ip)%xp,e&_p&&(i^=ir<<(ir<<BigInt(s))-ir);hu.push(i)}const[Tp,Sp]=Q.split(hu,!0),Xa=(t,e,n)=>n>32?Q.rotlBH(t,e,n):Q.rotlSH(t,e,n),Ya=(t,e,n)=>n>32?Q.rotlBL(t,e,n):Q.rotlSL(t,e,n);function kp(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,u=(o+2)%10,d=n[u],c=n[u+1],l=Xa(d,c,1)^n[a],f=Ya(d,c,1)^n[a+1];for(let m=0;m<50;m+=10)t[o+m]^=l,t[o+m+1]^=f}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=fu[o],u=Xa(i,s,a),d=Ya(i,s,a),c=lu[o];i=t[c],s=t[c+1],t[c]=u,t[c+1]=d}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=Tp[r],t[1]^=Sp[r]}n.fill(0)}class ns extends Uo{constructor(e,n,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,pe.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=ni(this.state)}keccak(){kp(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){pe.exists(this);const{blockLen:n,state:r}=this;e=cn(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,n&128&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){pe.exists(this,!1),pe.bytes(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=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 pe.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(pe.output(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,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new ns(n,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const jt=(t,e,n)=>yn(()=>new ns(e,t,n));jt(6,144,224/8);jt(6,136,256/8);jt(6,104,384/8);jt(6,72,512/8);jt(1,144,224/8);const ec=jt(1,136,256/8);jt(1,104,384/8);jt(1,72,512/8);const mu=(t,e,n)=>wp((r={})=>new ns(e,t,r.dkLen===void 0?n:r.dkLen,!0));mu(31,168,128/8);mu(31,136,256/8);const xi=pe.bytes;function pu(t){if(!(t instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof t}`);return new TextDecoder().decode(t)}function Bp(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Cp(t){return e=>(pe.bytes(e),t(e))}(()=>{const t=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,e=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:e&&!t?e("crypto"):void 0,web:t}})();const Be=(()=>{const t=Cp(ec);return t.create=ec.create,t})();var oe;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(oe||(oe={}));var to;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(to||(to={}));const N=oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nt=t=>{switch(typeof t){case"undefined":return N.undefined;case"string":return N.string;case"number":return isNaN(t)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":return Array.isArray(t)?N.array:t===null?N.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?N.promise:typeof Map<"u"&&t instanceof Map?N.map:typeof Set<"u"&&t instanceof Set?N.set:typeof Date<"u"&&t instanceof Date?N.date:N.object;default:return N.unknown}},k=oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Rp=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class et extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,u=0;for(;u<o.path.length;){const d=o.path[u];u===o.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(o))):a[d]=a[d]||{_errors:[]},a=a[d],u++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}et.create=t=>new et(t);const vr=(t,e)=>{let n;switch(t.code){case k.invalid_type:t.received===N.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case k.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,oe.jsonStringifyReplacer)}`;break;case k.unrecognized_keys:n=`Unrecognized key(s) in object: ${oe.joinValues(t.keys,", ")}`;break;case k.invalid_union:n="Invalid input";break;case k.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${oe.joinValues(t.options)}`;break;case k.invalid_enum_value:n=`Invalid enum value. Expected ${oe.joinValues(t.options)}, received '${t.received}'`;break;case k.invalid_arguments:n="Invalid function arguments";break;case k.invalid_return_type:n="Invalid function return type";break;case k.invalid_date:n="Invalid date";break;case k.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:oe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case k.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case k.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case k.custom:n="Invalid input";break;case k.invalid_intersection_types:n="Intersection results could not be merged";break;case k.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case k.not_finite:n="Number must be finite";break;default:n=e.defaultError,oe.assertNever(t)}return{message:n}};let gu=vr;function Pp(t){gu=t}function Ii(){return gu}const Ti=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],o={...i,path:s};let a="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)a=d(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},Np=[];function M(t,e){const n=Ti({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ii(),vr].filter(r=>!!r)});t.common.issues.push(n)}class Ce{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return K;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Ce.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return K;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const K=Object.freeze({status:"aborted"}),yu=t=>({status:"dirty",value:t}),Pe=t=>({status:"valid",value:t}),no=t=>t.status==="aborted",ro=t=>t.status==="dirty",br=t=>t.status==="valid",Si=t=>typeof Promise<"u"&&t instanceof Promise;var G;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(G||(G={}));class ct{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const tc=(t,e)=>{if(br(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new et(t.common.issues);return this._error=n,this._error}}};function J(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class Y{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Nt(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Nt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ce,ctx:{common:e.parent.common,data:e.data,parsedType:Nt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Si(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)},s=this._parseSync({data:e,path:i.path,parent:i});return tc(i,s)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nt(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(Si(i)?i:Promise.resolve(i));return tc(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:k.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new nt({schema:this,typeName:q.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return _t.create(this,this._def)}nullable(){return ln.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return tt.create(this,this._def)}promise(){return qn.create(this,this._def)}or(e){return Er.create([this,e],this._def)}and(e){return xr.create(this,e,this._def)}transform(e){return new nt({...J(this._def),schema:this,typeName:q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Br({...J(this._def),innerType:this,defaultValue:n,typeName:q.ZodDefault})}brand(){return new bu({typeName:q.ZodBranded,type:this,...J(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Ri({...J(this._def),innerType:this,catchValue:n,typeName:q.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return qr.create(this,e)}readonly(){return Ni.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Op=/^c[^\s-]{8,}$/i,Mp=/^[a-z][a-z0-9]*$/,Lp=/^[0-9A-HJKMNP-TV-Z]{26}$/,Dp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Hp=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Fp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Rs;const jp=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Up=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Gp=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function qp(t,e){return!!((e==="v4"||!e)&&jp.test(t)||(e==="v6"||!e)&&Up.test(t))}class Ye extends Y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==N.string){const s=this._getOrReturnCtx(e);return M(s,{code:k.invalid_type,expected:N.string,received:s.parsedType}),K}const r=new Ce;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:k.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:k.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?M(i,{code:k.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&M(i,{code:k.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Hp.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"email",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Rs||(Rs=new RegExp(Fp,"u")),Rs.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"emoji",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Dp.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"uuid",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Op.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"cuid",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Mp.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"cuid2",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")Lp.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"ulid",code:k.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),M(i,{validation:"url",code:k.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"regex",code:k.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),M(i,{code:k.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),M(i,{code:k.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),M(i,{code:k.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Gp(s).test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{code:k.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?qp(e.data,s.version)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"ip",code:k.invalid_string,message:s.message}),r.dirty()):oe.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:k.invalid_string,...G.errToObj(r)})}_addCheck(e){return new Ye({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...G.errToObj(e)})}url(e){return this._addCheck({kind:"url",...G.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...G.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...G.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...G.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...G.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...G.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...G.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...G.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...G.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...G.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...G.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...G.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...G.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...G.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...G.errToObj(n)})}nonempty(e){return this.min(1,G.errToObj(e))}trim(){return new Ye({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ye({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ye({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ye.create=t=>{var e;return new Ye({checks:[],typeName:q.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...J(t)})};function Vp(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class Mt extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==N.number){const s=this._getOrReturnCtx(e);return M(s,{code:k.invalid_type,expected:N.number,received:s.parsedType}),K}let r;const i=new Ce;for(const s of this._def.checks)s.kind==="int"?oe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{code:k.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:k.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:k.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Vp(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),M(r,{code:k.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{code:k.not_finite,message:s.message}),i.dirty()):oe.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,G.toString(n))}gt(e,n){return this.setLimit("min",e,!1,G.toString(n))}lte(e,n){return this.setLimit("max",e,!0,G.toString(n))}lt(e,n){return this.setLimit("max",e,!1,G.toString(n))}setLimit(e,n,r,i){return new Mt({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:G.toString(i)}]})}_addCheck(e){return new Mt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:G.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:G.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:G.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:G.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:G.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&oe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Mt.create=t=>new Mt({checks:[],typeName:q.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...J(t)});class Lt extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==N.bigint){const s=this._getOrReturnCtx(e);return M(s,{code:k.invalid_type,expected:N.bigint,received:s.parsedType}),K}let r;const i=new Ce;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:k.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:k.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),M(r,{code:k.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):oe.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,G.toString(n))}gt(e,n){return this.setLimit("min",e,!1,G.toString(n))}lte(e,n){return this.setLimit("max",e,!0,G.toString(n))}lt(e,n){return this.setLimit("max",e,!1,G.toString(n))}setLimit(e,n,r,i){return new Lt({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:G.toString(i)}]})}_addCheck(e){return new Lt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:G.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Lt.create=t=>{var e;return new Lt({checks:[],typeName:q.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...J(t)})};class wr extends Y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==N.boolean){const r=this._getOrReturnCtx(e);return M(r,{code:k.invalid_type,expected:N.boolean,received:r.parsedType}),K}return Pe(e.data)}}wr.create=t=>new wr({typeName:q.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...J(t)});class un extends Y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==N.date){const s=this._getOrReturnCtx(e);return M(s,{code:k.invalid_type,expected:N.date,received:s.parsedType}),K}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return M(s,{code:k.invalid_date}),K}const r=new Ce;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:k.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:k.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):oe.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new un({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:G.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:G.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}un.create=t=>new un({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:q.ZodDate,...J(t)});class ki extends Y{_parse(e){if(this._getType(e)!==N.symbol){const r=this._getOrReturnCtx(e);return M(r,{code:k.invalid_type,expected:N.symbol,received:r.parsedType}),K}return Pe(e.data)}}ki.create=t=>new ki({typeName:q.ZodSymbol,...J(t)});class Ar extends Y{_parse(e){if(this._getType(e)!==N.undefined){const r=this._getOrReturnCtx(e);return M(r,{code:k.invalid_type,expected:N.undefined,received:r.parsedType}),K}return Pe(e.data)}}Ar.create=t=>new Ar({typeName:q.ZodUndefined,...J(t)});class _r extends Y{_parse(e){if(this._getType(e)!==N.null){const r=this._getOrReturnCtx(e);return M(r,{code:k.invalid_type,expected:N.null,received:r.parsedType}),K}return Pe(e.data)}}_r.create=t=>new _r({typeName:q.ZodNull,...J(t)});class Gn extends Y{constructor(){super(...arguments),this._any=!0}_parse(e){return Pe(e.data)}}Gn.create=t=>new Gn({typeName:q.ZodAny,...J(t)});class rn extends Y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Pe(e.data)}}rn.create=t=>new rn({typeName:q.ZodUnknown,...J(t)});class Et extends Y{_parse(e){const n=this._getOrReturnCtx(e);return M(n,{code:k.invalid_type,expected:N.never,received:n.parsedType}),K}}Et.create=t=>new Et({typeName:q.ZodNever,...J(t)});class Bi extends Y{_parse(e){if(this._getType(e)!==N.undefined){const r=this._getOrReturnCtx(e);return M(r,{code:k.invalid_type,expected:N.void,received:r.parsedType}),K}return Pe(e.data)}}Bi.create=t=>new Bi({typeName:q.ZodVoid,...J(t)});class tt extends Y{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==N.array)return M(n,{code:k.invalid_type,expected:N.array,received:n.parsedType}),K;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(M(n,{code:o?k.too_big:k.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(M(n,{code:k.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(M(n,{code:k.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new ct(n,o,n.path,a)))).then(o=>Ce.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new ct(n,o,n.path,a)));return Ce.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new tt({...this._def,minLength:{value:e,message:G.toString(n)}})}max(e,n){return new tt({...this._def,maxLength:{value:e,message:G.toString(n)}})}length(e,n){return new tt({...this._def,exactLength:{value:e,message:G.toString(n)}})}nonempty(e){return this.min(1,e)}}tt.create=(t,e)=>new tt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...J(e)});function Bn(t){if(t instanceof ve){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=_t.create(Bn(r))}return new ve({...t._def,shape:()=>e})}else return t instanceof tt?new tt({...t._def,type:Bn(t.element)}):t instanceof _t?_t.create(Bn(t.unwrap())):t instanceof ln?ln.create(Bn(t.unwrap())):t instanceof ut?ut.create(t.items.map(e=>Bn(e))):t}class ve extends Y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=oe.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==N.object){const d=this._getOrReturnCtx(e);return M(d,{code:k.invalid_type,expected:N.object,received:d.parsedType}),K}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Et&&this._def.unknownKeys==="strip"))for(const d in i.data)o.includes(d)||a.push(d);const u=[];for(const d of o){const c=s[d],l=i.data[d];u.push({key:{status:"valid",value:d},value:c._parse(new ct(i,l,i.path,d)),alwaysSet:d in i.data})}if(this._def.catchall instanceof Et){const d=this._def.unknownKeys;if(d==="passthrough")for(const c of a)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(d==="strict")a.length>0&&(M(i,{code:k.unrecognized_keys,keys:a}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const c of a){const l=i.data[c];u.push({key:{status:"valid",value:c},value:d._parse(new ct(i,l,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const d=[];for(const c of u){const l=await c.key;d.push({key:l,value:await c.value,alwaysSet:c.alwaysSet})}return d}).then(d=>Ce.mergeObjectSync(r,d)):Ce.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return G.errToObj,new ve({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const u=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=G.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new ve({...this._def,unknownKeys:"strip"})}passthrough(){return new ve({...this._def,unknownKeys:"passthrough"})}extend(e){return new ve({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ve({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:q.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ve({...this._def,catchall:e})}pick(e){const n={};return oe.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ve({...this._def,shape:()=>n})}omit(e){const n={};return oe.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new ve({...this._def,shape:()=>n})}deepPartial(){return Bn(this)}partial(e){const n={};return oe.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new ve({...this._def,shape:()=>n})}required(e){const n={};return oe.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof _t;)s=s._def.innerType;n[r]=s}}),new ve({...this._def,shape:()=>n})}keyof(){return vu(oe.objectKeys(this.shape))}}ve.create=(t,e)=>new ve({shape:()=>t,unknownKeys:"strip",catchall:Et.create(),typeName:q.ZodObject,...J(e)});ve.strictCreate=(t,e)=>new ve({shape:()=>t,unknownKeys:"strict",catchall:Et.create(),typeName:q.ZodObject,...J(e)});ve.lazycreate=(t,e)=>new ve({shape:t,unknownKeys:"strip",catchall:Et.create(),typeName:q.ZodObject,...J(e)});class Er extends Y{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new et(a.ctx.common.issues));return M(n,{code:k.invalid_union,unionErrors:o}),K}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const u of r){const d={...n,common:{...n.common,issues:[]},parent:null},c=u._parseSync({data:n.data,path:n.path,parent:d});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(u=>new et(u));return M(n,{code:k.invalid_union,unionErrors:a}),K}}get options(){return this._def.options}}Er.create=(t,e)=>new Er({options:t,typeName:q.ZodUnion,...J(e)});const ii=t=>t instanceof Tr?ii(t.schema):t instanceof nt?ii(t.innerType()):t instanceof Sr?[t.value]:t instanceof Dt?t.options:t instanceof kr?Object.keys(t.enum):t instanceof Br?ii(t._def.innerType):t instanceof Ar?[void 0]:t instanceof _r?[null]:null;class rs extends Y{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==N.object)return M(n,{code:k.invalid_type,expected:N.object,received:n.parsedType}),K;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(M(n,{code:k.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),K)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const o=ii(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new rs({typeName:q.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...J(r)})}}function io(t,e){const n=Nt(t),r=Nt(e);if(t===e)return{valid:!0,data:t};if(n===N.object&&r===N.object){const i=oe.objectKeys(e),s=oe.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const u=io(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(n===N.array&&r===N.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const o=t[s],a=e[s],u=io(o,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===N.date&&r===N.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class xr extends Y{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,o)=>{if(no(s)||no(o))return K;const a=io(s.value,o.value);return a.valid?((ro(s)||ro(o))&&n.dirty(),{status:n.value,value:a.data}):(M(r,{code:k.invalid_intersection_types}),K)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}xr.create=(t,e,n)=>new xr({left:t,right:e,typeName:q.ZodIntersection,...J(n)});class ut extends Y{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.array)return M(r,{code:k.invalid_type,expected:N.array,received:r.parsedType}),K;if(r.data.length<this._def.items.length)return M(r,{code:k.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K;!this._def.rest&&r.data.length>this._def.items.length&&(M(r,{code:k.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const u=this._def.items[a]||this._def.rest;return u?u._parse(new ct(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>Ce.mergeArray(n,o)):Ce.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new ut({...this._def,rest:e})}}ut.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ut({items:t,typeName:q.ZodTuple,rest:null,...J(e)})};class Ir extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.object)return M(r,{code:k.invalid_type,expected:N.object,received:r.parsedType}),K;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new ct(r,a,r.path,a)),value:o._parse(new ct(r,r.data[a],r.path,a))});return r.common.async?Ce.mergeObjectAsync(n,i):Ce.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Y?new Ir({keyType:e,valueType:n,typeName:q.ZodRecord,...J(r)}):new Ir({keyType:Ye.create(),valueType:e,typeName:q.ZodRecord,...J(n)})}}class Ci extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.map)return M(r,{code:k.invalid_type,expected:N.map,received:r.parsedType}),K;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,u],d)=>({key:i._parse(new ct(r,a,r.path,[d,"key"])),value:s._parse(new ct(r,u,r.path,[d,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const u of o){const d=await u.key,c=await u.value;if(d.status==="aborted"||c.status==="aborted")return K;(d.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(d.value,c.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const u of o){const d=u.key,c=u.value;if(d.status==="aborted"||c.status==="aborted")return K;(d.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(d.value,c.value)}return{status:n.value,value:a}}}}Ci.create=(t,e,n)=>new Ci({valueType:e,keyType:t,typeName:q.ZodMap,...J(n)});class dn extends Y{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.set)return M(r,{code:k.invalid_type,expected:N.set,received:r.parsedType}),K;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(M(r,{code:k.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(M(r,{code:k.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(u){const d=new Set;for(const c of u){if(c.status==="aborted")return K;c.status==="dirty"&&n.dirty(),d.add(c.value)}return{status:n.value,value:d}}const a=[...r.data.values()].map((u,d)=>s._parse(new ct(r,u,r.path,d)));return r.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,n){return new dn({...this._def,minSize:{value:e,message:G.toString(n)}})}max(e,n){return new dn({...this._def,maxSize:{value:e,message:G.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}dn.create=(t,e)=>new dn({valueType:t,minSize:null,maxSize:null,typeName:q.ZodSet,...J(e)});class Mn extends Y{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==N.function)return M(n,{code:k.invalid_type,expected:N.function,received:n.parsedType}),K;function r(a,u){return Ti({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ii(),vr].filter(d=>!!d),issueData:{code:k.invalid_arguments,argumentsError:u}})}function i(a,u){return Ti({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ii(),vr].filter(d=>!!d),issueData:{code:k.invalid_return_type,returnTypeError:u}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof qn){const a=this;return Pe(async function(...u){const d=new et([]),c=await a._def.args.parseAsync(u,s).catch(m=>{throw d.addIssue(r(u,m)),d}),l=await Reflect.apply(o,this,c);return await a._def.returns._def.type.parseAsync(l,s).catch(m=>{throw d.addIssue(i(l,m)),d})})}else{const a=this;return Pe(function(...u){const d=a._def.args.safeParse(u,s);if(!d.success)throw new et([r(u,d.error)]);const c=Reflect.apply(o,this,d.data),l=a._def.returns.safeParse(c,s);if(!l.success)throw new et([i(c,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Mn({...this._def,args:ut.create(e).rest(rn.create())})}returns(e){return new Mn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Mn({args:e||ut.create([]).rest(rn.create()),returns:n||rn.create(),typeName:q.ZodFunction,...J(r)})}}class Tr extends Y{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Tr.create=(t,e)=>new Tr({getter:t,typeName:q.ZodLazy,...J(e)});class Sr extends Y{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return M(n,{received:n.data,code:k.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:e.data}}get value(){return this._def.value}}Sr.create=(t,e)=>new Sr({value:t,typeName:q.ZodLiteral,...J(e)});function vu(t,e){return new Dt({values:t,typeName:q.ZodEnum,...J(e)})}class Dt extends Y{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return M(n,{expected:oe.joinValues(r),received:n.parsedType,code:k.invalid_type}),K}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),r=this._def.values;return M(n,{received:n.data,code:k.invalid_enum_value,options:r}),K}return Pe(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return Dt.create(e)}exclude(e){return Dt.create(this.options.filter(n=>!e.includes(n)))}}Dt.create=vu;class kr extends Y{_parse(e){const n=oe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==N.string&&r.parsedType!==N.number){const i=oe.objectValues(n);return M(r,{expected:oe.joinValues(i),received:r.parsedType,code:k.invalid_type}),K}if(n.indexOf(e.data)===-1){const i=oe.objectValues(n);return M(r,{received:r.data,code:k.invalid_enum_value,options:i}),K}return Pe(e.data)}get enum(){return this._def.values}}kr.create=(t,e)=>new kr({values:t,typeName:q.ZodNativeEnum,...J(e)});class qn extends Y{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==N.promise&&n.common.async===!1)return M(n,{code:k.invalid_type,expected:N.promise,received:n.parsedType}),K;const r=n.parsedType===N.promise?n.data:Promise.resolve(n.data);return Pe(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}qn.create=(t,e)=>new qn({type:t,typeName:q.ZodPromise,...J(e)});class nt extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{M(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:o,path:r.path,parent:r})}if(i.type==="refinement"){const o=a=>{const u=i.refinement(a,s);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?K:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?K:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!br(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>br(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);oe.assertNever(i)}}nt.create=(t,e,n)=>new nt({schema:t,typeName:q.ZodEffects,effect:e,...J(n)});nt.createWithPreprocess=(t,e,n)=>new nt({schema:e,effect:{type:"preprocess",transform:t},typeName:q.ZodEffects,...J(n)});class _t extends Y{_parse(e){return this._getType(e)===N.undefined?Pe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_t.create=(t,e)=>new _t({innerType:t,typeName:q.ZodOptional,...J(e)});class ln extends Y{_parse(e){return this._getType(e)===N.null?Pe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ln.create=(t,e)=>new ln({innerType:t,typeName:q.ZodNullable,...J(e)});class Br extends Y{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===N.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Br.create=(t,e)=>new Br({innerType:t,typeName:q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...J(e)});class Ri extends Y{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Si(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new et(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new et(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ri.create=(t,e)=>new Ri({innerType:t,typeName:q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...J(e)});class Pi extends Y{_parse(e){if(this._getType(e)!==N.nan){const r=this._getOrReturnCtx(e);return M(r,{code:k.invalid_type,expected:N.nan,received:r.parsedType}),K}return{status:"valid",value:e.data}}}Pi.create=t=>new Pi({typeName:q.ZodNaN,...J(t)});const zp=Symbol("zod_brand");class bu extends Y{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class qr extends Y{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?K:s.status==="dirty"?(n.dirty(),yu(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?K:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new qr({in:e,out:n,typeName:q.ZodPipeline})}}class Ni extends Y{_parse(e){const n=this._def.innerType._parse(e);return br(n)&&(n.value=Object.freeze(n.value)),n}}Ni.create=(t,e)=>new Ni({innerType:t,typeName:q.ZodReadonly,...J(e)});const wu=(t,e={},n)=>t?Gn.create().superRefine((r,i)=>{var s,o;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,u=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,d=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...d,fatal:u})}}):Gn.create(),Qp={object:ve.lazycreate};var q;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(q||(q={}));const Zp=(t,e={message:`Input not instance of ${t.name}`})=>wu(n=>n instanceof t,e),Au=Ye.create,_u=Mt.create,Wp=Pi.create,$p=Lt.create,Eu=wr.create,Kp=un.create,Jp=ki.create,Xp=Ar.create,Yp=_r.create,e0=Gn.create,t0=rn.create,n0=Et.create,r0=Bi.create,i0=tt.create,s0=ve.create,o0=ve.strictCreate,a0=Er.create,c0=rs.create,u0=xr.create,d0=ut.create,l0=Ir.create,f0=Ci.create,h0=dn.create,m0=Mn.create,p0=Tr.create,g0=Sr.create,y0=Dt.create,v0=kr.create,b0=qn.create,nc=nt.create,w0=_t.create,A0=ln.create,_0=nt.createWithPreprocess,E0=qr.create,x0=()=>Au().optional(),I0=()=>_u().optional(),T0=()=>Eu().optional(),S0={string:t=>Ye.create({...t,coerce:!0}),number:t=>Mt.create({...t,coerce:!0}),boolean:t=>wr.create({...t,coerce:!0}),bigint:t=>Lt.create({...t,coerce:!0}),date:t=>un.create({...t,coerce:!0})},k0=K;var st=Object.freeze({__proto__:null,defaultErrorMap:vr,setErrorMap:Pp,getErrorMap:Ii,makeIssue:Ti,EMPTY_PATH:Np,addIssueToContext:M,ParseStatus:Ce,INVALID:K,DIRTY:yu,OK:Pe,isAborted:no,isDirty:ro,isValid:br,isAsync:Si,get util(){return oe},get objectUtil(){return to},ZodParsedType:N,getParsedType:Nt,ZodType:Y,ZodString:Ye,ZodNumber:Mt,ZodBigInt:Lt,ZodBoolean:wr,ZodDate:un,ZodSymbol:ki,ZodUndefined:Ar,ZodNull:_r,ZodAny:Gn,ZodUnknown:rn,ZodNever:Et,ZodVoid:Bi,ZodArray:tt,ZodObject:ve,ZodUnion:Er,ZodDiscriminatedUnion:rs,ZodIntersection:xr,ZodTuple:ut,ZodRecord:Ir,ZodMap:Ci,ZodSet:dn,ZodFunction:Mn,ZodLazy:Tr,ZodLiteral:Sr,ZodEnum:Dt,ZodNativeEnum:kr,ZodPromise:qn,ZodEffects:nt,ZodTransformer:nt,ZodOptional:_t,ZodNullable:ln,ZodDefault:Br,ZodCatch:Ri,ZodNaN:Pi,BRAND:zp,ZodBranded:bu,ZodPipeline:qr,ZodReadonly:Ni,custom:wu,Schema:Y,ZodSchema:Y,late:Qp,get ZodFirstPartyTypeKind(){return q},coerce:S0,any:e0,array:i0,bigint:$p,boolean:Eu,date:Kp,discriminatedUnion:c0,effect:nc,enum:y0,function:m0,instanceof:Zp,intersection:u0,lazy:p0,literal:g0,map:f0,nan:Wp,nativeEnum:v0,never:n0,null:Yp,nullable:A0,number:_u,object:s0,oboolean:T0,onumber:I0,optional:w0,ostring:x0,pipeline:E0,preprocess:_0,promise:b0,record:l0,set:h0,strictObject:o0,string:Au,symbol:Jp,transformer:nc,tuple:d0,undefined:Xp,union:a0,unknown:t0,void:r0,NEVER:k0,ZodIssueCode:k,quotelessJson:Rp,ZodError:et});const B0=t=>t.message?t.message:"unspecified error";class Vn extends ${constructor(e){super(),this.code=Dh,this.errors=e,super.message=`Web3 validator found ${e.length} error[s]:
|
6
|
+
${this._compileErrors().join(`
|
7
|
+
`)}`}_compileErrors(){return this.errors.map(B0)}}const C0=["bool","int","uint","bytes","string","address","tuple"],xu=t=>typeof t=="object"&&"type"in t&&"name"in t,Go=t=>typeof t=="string",ae=t=>typeof t=="string"&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(t);function Iu(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e<"u"&&e>0&&t.length!==2+2*e)}const qo=t=>typeof t=="number"||typeof t=="bigint"||typeof t=="string"&&/^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(t);function Vo(t){if(typeof t!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof t}`);return t.startsWith("0x")}const zo=function(t){for(const[e,n]of Object.entries(t))if(n!==void 0&&n.length>0&&n[0]===0)throw new Error(`${e} cannot have leading zeroes, received: ${n.toString()}`)},R0=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],vn=t=>{let e=t.replace(/ /,""),n,r=!1,i=[];if(t.includes("[")&&(e=e.slice(0,e.indexOf("[")),i=[...t.matchAll(/(?:\[(\d*)\])/g)].map(s=>parseInt(s[1],10)).map(s=>Number.isNaN(s)?-1:s),r=i.length>0),C0.includes(e))return{baseType:e,isArray:r,baseTypeSize:n,arraySizes:i};if(e.startsWith("int"))n=parseInt(e.substring(3),10),e="int";else if(e.startsWith("uint"))n=parseInt(t.substring(4),10),e="uint";else if(e.startsWith("bytes"))n=parseInt(e.substring(5),10),e="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:i};return{baseType:e,isArray:r,baseTypeSize:n,arraySizes:i}},Ps=(t,e={})=>{if(Object.keys(e).includes("type"))throw new Vn([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:t},instancePath:"",schemaPath:""}]);const{baseType:r,baseTypeSize:i}=vn(t);if(!r&&!R0.includes(t))throw new Vn([{keyword:"eth",message:`Eth data type "${t}" is not valid`,params:{eth:t},instancePath:"",schemaPath:""}]);if(r){if(r==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${r}${i??""}`,required:!0}}return t?{format:t,required:!0}:{}},Oi=(t,e="/0")=>{const n={type:"array",items:[],maxItems:t.length,minItems:t.length};for(const[r,i]of t.entries()){let s,o,a=[];xu(i)?(s=i.type,o=i.name,a=i.components):typeof i=="string"?(s=i,o=`${e}/${r}`):Array.isArray(i)&&(i[0]&&typeof i[0]=="string"&&i[0].startsWith("tuple")&&!Array.isArray(i[0])&&i[1]&&Array.isArray(i[1])?(s=i[0],o=`${e}/${r}`,a=i[1]):(s="tuple",o=`${e}/${r}`,a=i));const{baseType:u,isArray:d,arraySizes:c}=vn(s);let l,f=n;for(let m=c.length-1;m>0;m-=1)l={type:"array",items:[],maxItems:c[m],minItems:c[m]},c[m]<0&&(delete l.maxItems,delete l.minItems),Array.isArray(f.items)?f.items.length===0?f.items=l:f.items.push(l):f.items=[f.items,l],f=l;if(u==="tuple"&&!d){const m=Oi(a,o);m.$id=o,f.items.push(m)}else if(u==="tuple"&&d){const m=c[0],g={$id:o,type:"array",items:Oi(a,o),maxItems:m,minItems:m};m<0&&(delete g.maxItems,delete g.minItems),f.items.push(g)}else if(d){const m=c[0],g={type:"array",$id:o,items:Ps(String(u)),minItems:m,maxItems:m};m<0&&(delete g.maxItems,delete g.minItems),f.items.push(g)}else Array.isArray(f.items)?f.items.push(Object.assign({$id:o},Ps(s))):f.items.items.push(Object.assign({$id:o},Ps(s)));f=n}return n},Qo=t=>Oi(t),Zo=(t,e)=>e===1?t:Zo(t[0],e-1),hr=(t,e,n)=>{const r=[];for(const[i,s]of t.entries()){let o,a,u=[];xu(s)?(o=s.type,a=s.name,u=s.components):typeof s=="string"?o=s:Array.isArray(s)&&(s[1]&&Array.isArray(s[1])?(o=s[0],u=s[1]):(o="tuple",u=s));const{baseType:d,isArray:c,arraySizes:l}=vn(o),f=Array.isArray(e)?e[i]:e[a];if(d==="tuple"&&!c)r.push(hr(u,f,n));else if(d==="tuple"&&c){const m=[];for(const g of f)if(l.length>1){const p=Zo(g,l.length-1),y=[];for(const b of p)y.push(hr(u,b,n));m.push(y)}else m.push(hr(u,g,n));r.push(m)}else r.push(f)}return n=n??[],n.push(...r),n},Tu=t=>{if(t>=48&&t<=57)return t-48;if(t>=65&&t<=70)return t-55;if(t>=97&&t<=102)return t-87;throw new Error(`Invalid code point: ${t}`)},is=t=>{if(!ae(t))throw new Error("Invalid hex string");const[e,n]=t.startsWith("-")?[!0,t.slice(1)]:[!1,t],r=BigInt(n);return r>Number.MAX_SAFE_INTEGER?e?-r:r:r<Number.MIN_SAFE_INTEGER?r:e?-1*Number(r):Number(r)},ss=t=>{if((typeof t=="number"||typeof t=="bigint")&&t<0)return`-0x${t.toString(16).slice(1)}`;if((typeof t=="number"||typeof t=="bigint")&&t>=0)return`0x${t.toString(16)}`;if(typeof t=="string"&&ae(t)){const[e,n]=t.startsWith("-")?[!0,t.slice(1)]:[!1,t],r=n.split(/^(-)?0(x|X)/).slice(-1)[0];return`${e?"-":""}0x${r.replace(/^0+/,"").toLowerCase()}`}if(typeof t=="string"&&!ae(t))return ss(BigInt(t));throw new Ho(t)},Mi=(t,e,n="0")=>{if(typeof t=="string"&&!ae(t))return t.padStart(e,n);const r=typeof t=="string"&&ae(t)?t:ss(t),[i,s]=r.startsWith("-")?["-0x",r.slice(3)]:["0x",r.slice(2)];return`${i}${s.padStart(e,n)}`};function Ut(t){let e="0x";for(const n of t){const r=n.toString(16);e+=r.length===1?`0${r}`:r}return e}function bn(t){let e;if(t.toLowerCase().startsWith("0x")?e=t.slice(2):e=t,e.length%2!==0)throw new fr(`hex string has odd length: ${t}`);const n=new Uint8Array(Math.ceil(e.length/2));for(let r=0;r<n.length;r+=1){const i=parseInt(e.substring(r*2,r*2+2),16);n[r]=i}return n}const Su=Object.freeze(Object.defineProperty({__proto__:null,abiSchemaToJsonSchema:Oi,codePointToInt:Tu,ethAbiToJsonSchema:Qo,fetchArrayElement:Zo,hexToNumber:is,hexToUint8Array:bn,numberToHex:ss,padLeft:Mi,parseBaseType:vn,transformJsonDataToAbiFormat:hr,uint8ArrayToHexString:Ut},Symbol.toStringTag,{value:"Module"})),ku=t=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(t))return!1;const e=t.slice(2),n=Un(e.toLowerCase()),r=Ut(Be(n)).slice(2);for(let i=0;i<40;i+=1)if(parseInt(r[i],16)>7&&e[i].toUpperCase()!==e[i]||parseInt(r[i],16)<=7&&e[i].toLowerCase()!==e[i])return!1;return!0},Ke=(t,e=!0)=>{if(typeof t!="string"&&!(t instanceof Uint8Array))return!1;let n;return t instanceof Uint8Array?n=Ut(t):typeof t=="string"&&!ae(t)?n=t.toLowerCase().startsWith("0x")?t:`0x${t}`:n=t,/^(0x)?[0-9a-f]{40}$/i.test(n)?/^(0x|0X)?[0-9a-f]{40}$/.test(n)||/^(0x|0X)?[0-9A-F]{40}$/.test(n)?!0:e?ku(n):!0:!1};var $e;(function(t){t.NUMBER="NUMBER_NUMBER",t.HEX="NUMBER_HEX",t.STR="NUMBER_STR",t.BIGINT="NUMBER_BIGINT"})($e||($e={}));var xt;(function(t){t.HEX="BYTES_HEX",t.UINT8ARRAY="BYTES_UINT8ARRAY"})(xt||(xt={}));const j={number:$e.BIGINT,bytes:xt.HEX},W={number:$e.HEX,bytes:xt.HEX};var yt;(function(t){t.EARLIEST="earliest",t.LATEST="latest",t.PENDING="pending",t.SAFE="safe",t.FINALIZED="finalized"})(yt||(yt={}));var mr;(function(t){t.chainstart="chainstart",t.frontier="frontier",t.homestead="homestead",t.dao="dao",t.tangerineWhistle="tangerineWhistle",t.spuriousDragon="spuriousDragon",t.byzantium="byzantium",t.constantinople="constantinople",t.petersburg="petersburg",t.istanbul="istanbul",t.muirGlacier="muirGlacier",t.berlin="berlin",t.london="london",t.altair="altair",t.arrowGlacier="arrowGlacier",t.grayGlacier="grayGlacier",t.bellatrix="bellatrix",t.merge="merge",t.capella="capella",t.shanghai="shanghai"})(mr||(mr={}));const Wo=Object.getPrototypeOf(Uint8Array);var rc=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const ic=Symbol.for("web3/base-provider");class Vr{static isWeb3Provider(e){return e instanceof Vr||!!(e&&e[ic])}get[ic](){return!0}send(e,n){this.request(e).then(r=>{n(null,r)}).catch(r=>{n(r)})}sendAsync(e){return rc(this,void 0,void 0,function*(){return this.request(e)})}asEIP1193Provider(){const e=Object.create(this),n=e.request;return e.request=function(i){return rc(this,void 0,void 0,function*(){return(yield n(i)).result})},e.asEIP1193Provider=void 0,e}}class P0 extends Array{constructor(e){super(),this._accountProvider=e}}const Cr=(t,e)=>{let n=t;for(let r=1;r<e;r+=1)n*=t;return n},fn=(t,e={abiType:"uint"})=>{if(!["number","string","bigint"].includes(typeof t)||typeof t=="string"&&t.length===0)return!1;let n;if(e!=null&&e.abiType){const{baseTypeSize:i}=vn(e.abiType);i&&(n=i)}else e.bitSize&&(n=e.bitSize);const r=Cr(BigInt(2),BigInt(n??256))-BigInt(1);try{const i=typeof t=="string"&&ae(t)?BigInt(is(t)):BigInt(t);return i>=0&&i<=r}catch{return!1}},os=(t,e={abiType:"int"})=>{if(!["number","string","bigint"].includes(typeof t)||typeof t=="number"&&t>Number.MAX_SAFE_INTEGER)return!1;let n;if(e!=null&&e.abiType){const{baseTypeSize:s,baseType:o}=vn(e.abiType);if(o!=="int")return!1;s&&(n=s)}else e.bitSize&&(n=e.bitSize);const r=Cr(BigInt(2),BigInt((n??256)-1)),i=BigInt(-1)*Cr(BigInt(2),BigInt((n??256)-1));try{const s=typeof t=="string"&&ae(t)?BigInt(is(t)):BigInt(t);return s>=i&&s<=r}catch{return!1}},Bu=t=>!!(os(t)||typeof t=="string"&&/[0-9.]/.test(t)&&t.indexOf(".")===t.lastIndexOf(".")||typeof t=="number"),Cu=t=>fn(t),Te=t=>Object.values(yt).includes(t),so=t=>Te(t)||Cu(t),tr=t=>typeof t!="string"||!/^(0x)?[0-9a-f]{512}$/i.test(t)?!1:!!(/^(0x)?[0-9a-f]{512}$/.test(t)||/^(0x)?[0-9A-F]{512}$/.test(t)),as=(t,e)=>{if(typeof e=="string"&&!ae(e)||!tr(t))return!1;const n=typeof e=="string"?bn(e):e,r=Ut(Be(n)).slice(2);for(let i=0;i<12;i+=4){const s=(parseInt(r.slice(i,i+2),16)<<8)+parseInt(r.slice(i+2,i+4),16)&2047,o=Tu(t.charCodeAt(t.length-1-Math.floor(s/4))),a=1<<s%4;if((o&a)!==a)return!1}return!0},N0=(t,e)=>{if(!tr(t)||!Ke(e))return!1;const n=Mi(e,64);return as(t,n)},O0=(t,e)=>!tr(t)||!Ke(e)?!1:as(t,e),M0=t=>["number","string","boolean"].includes(typeof t)?typeof t=="boolean"?!0:typeof t=="string"&&!ae(t)?t==="1"||t==="0":typeof t=="string"&&ae(t)?t==="0x1"||t==="0x0":t===1||t===0:!1,Gt=(t,e={abiType:"bytes"})=>{if(typeof t!="string"&&!Array.isArray(t)&&!(t instanceof Uint8Array)||typeof t=="string"&&ae(t)&&t.startsWith("-")||typeof t=="string"&&!ae(t))return!1;let n;if(typeof t=="string"){if(t.length%2!==0)return!1;n=bn(t)}else if(Array.isArray(t)){if(t.some(r=>r<0||r>255||!Number.isInteger(r)))return!1;n=new Uint8Array(t)}else n=t;if(e!=null&&e.abiType){const{baseTypeSize:r}=vn(e.abiType);return r?n.length===r:!0}return e!=null&&e.size?n.length===(e==null?void 0:e.size):!0},A=t=>t==null,Ln=t=>typeof t=="object"&&!A(t)&&!Array.isArray(t)&&!(t instanceof Wo),Li=t=>typeof t!="string"||!/^(0x)?[0-9a-f]{64}$/i.test(t)?!1:!!(/^(0x)?[0-9a-f]{64}$/.test(t)||/^(0x)?[0-9A-F]{64}$/.test(t)),L0=(t,e)=>!tr(t)||!Li(e)?!1:as(t,e),D0=t=>{const e=["fromBlock","toBlock","address","topics","blockHash"];if(A(t)||typeof t!="object"||!Object.keys(t).every(n=>e.includes(n))||!A(t.fromBlock)&&!so(t.fromBlock)||!A(t.toBlock)&&!so(t.toBlock))return!1;if(!A(t.address)){if(Array.isArray(t.address)){if(!t.address.every(n=>Ke(n)))return!1}else if(!Ke(t.address))return!1}return!(!A(t.topics)&&!t.topics.every(n=>A(n)?!0:Array.isArray(n)?n.every(r=>Li(r)):!!Li(n)))},hn={address:t=>Ke(t),bloom:t=>tr(t),blockNumber:t=>Cu(t),blockTag:t=>Te(t),blockNumberOrTag:t=>so(t),bool:t=>M0(t),bytes:t=>Gt(t),filter:t=>D0(t),hex:t=>ae(t),uint:t=>fn(t),int:t=>os(t),number:t=>Bu(t),string:t=>Go(t)};for(let t=8;t<=256;t+=8)hn[`int${t}`]=e=>os(e,{bitSize:t}),hn[`uint${t}`]=e=>fn(e,{bitSize:t});for(let t=1;t<=32;t+=1)hn[`bytes${t}`]=e=>Gt(e,{size:t});hn.bytes256=hn.bytes;const ur=t=>{if((!(t!=null&&t.type)||(t==null?void 0:t.type)==="object")&&(t!=null&&t.properties)){const e={};for(const n of Object.keys(t.properties)){const r=ur(t.properties[n]);r&&(e[n]=r)}return Array.isArray(t.required)?st.object(e).partial().required(t.required.reduce((n,r)=>Object.assign(Object.assign({},n),{[r]:!0}),{})):st.object(e).partial()}if((t==null?void 0:t.type)==="array"&&(t!=null&&t.items)){if(Array.isArray(t.items)&&t.items.length>0){const e=[];for(const n of t.items){const r=ur(n);r&&e.push(r)}return st.tuple(e)}return st.array(ur(t.items))}if(t.oneOf&&Array.isArray(t.oneOf))return st.union(t.oneOf.map(e=>ur(e)));if(t!=null&&t.format){if(!hn[t.format])throw new Qm(t.format);return st.any().refine(hn[t.format],e=>({params:{value:e,format:t.format}}))}return t!=null&&t.type&&(t==null?void 0:t.type)!=="object"&&typeof st[String(t.type)]=="function"?st[String(t.type)]():st.object({data:st.any()}).partial()};class Nn{static factory(){return Nn.validatorInstance||(Nn.validatorInstance=new Nn),Nn.validatorInstance}validate(e,n,r){var i,s;const a=ur(e).safeParse(n);if(!a.success){const u=this.convertErrors((s=(i=a.error)===null||i===void 0?void 0:i.issues)!==null&&s!==void 0?s:[]);if(u){if(r!=null&&r.silent)return u;throw new Vn(u)}}}convertErrors(e){if(e&&Array.isArray(e)&&e.length>0)return e.map(n=>{var r;let i,s,o,a;a=n.path.join("/");const u=String(n.path[n.path.length-1]),d=n.path.join("/");if(n.code===k.too_big)s="maxItems",a=`${d}/maxItems`,o={limit:n.maximum},i=`must NOT have more than ${n.maximum} items`;else if(n.code===k.too_small)s="minItems",a=`${d}/minItems`,o={limit:n.minimum},i=`must NOT have fewer than ${n.minimum} items`;else if(n.code===k.custom){const{value:c,format:l}=(r=n.params)!==null&&r!==void 0?r:{};typeof c>"u"?i=`value at "/${a}" is required`:i=`value "${typeof c=="object"?JSON.stringify(c):c}" at "/${a}" must pass "${l}" validation`,o={value:c}}return{keyword:s??u,instancePath:d?`/${d}`:"",schemaPath:a?`#${a}`:"#",params:o??{value:n.message},message:i??n.message}})}}class H0{constructor(){this._validator=Nn.factory()}validateJSONSchema(e,n,r){return this._validator.validate(e,n,r)}validate(e,n,r={silent:!1}){var i,s;const o=Qo(e);if(!(Array.isArray(o.items)&&((i=o.items)===null||i===void 0?void 0:i.length)===0&&n.length===0)){if(Array.isArray(o.items)&&((s=o.items)===null||s===void 0?void 0:s.length)===0&&n.length!==0)throw new Vn([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:n}]);return this._validator.validate(o,n,r)}}}const V=new H0,$o={noether:BigInt(0),wei:BigInt(1),kwei:BigInt(1e3),Kwei:BigInt(1e3),babbage:BigInt(1e3),femtoether:BigInt(1e3),mwei:BigInt(1e6),Mwei:BigInt(1e6),lovelace:BigInt(1e6),picoether:BigInt(1e6),gwei:BigInt(1e9),Gwei:BigInt(1e9),shannon:BigInt(1e9),nanoether:BigInt(1e9),nano:BigInt(1e9),szabo:BigInt(1e12),microether:BigInt(1e12),micro:BigInt(1e12),finney:BigInt(1e15),milliether:BigInt(1e15),milli:BigInt(1e15),ether:BigInt("1000000000000000000"),kether:BigInt("1000000000000000000000"),grand:BigInt("1000000000000000000000"),mether:BigInt("1000000000000000000000000"),gether:BigInt("1000000000000000000000000000"),tether:BigInt("1000000000000000000000000000000")},dt=t=>{if(V.validate(["bytes"],[t]),t instanceof Uint8Array)return t;if(Array.isArray(t))return new Uint8Array(t);if(typeof t=="string")return bn(t);throw new fr(t)},{uint8ArrayToHexString:F0}=Su,te=t=>F0(dt(t)),me=t=>typeof t=="string"&&t.slice(0,2).toLowerCase()!=="0x"?dt(`0x${t}`):dt(t),zr=t=>(V.validate(["hex"],[t]),is(t)),j0=zr,Ue=(t,e)=>{typeof t!="bigint"&&V.validate(["int"],[t]);let n=ss(t);return e&&(!n.startsWith("-")&&n.length%2===1?n="0x0".concat(n.slice(2)):n.length%2===0&&n.startsWith("-")&&(n="-0x0".concat(n.slice(3)))),n},U0=Ue,G0=t=>zr(t).toString(),rt=t=>{V.validate(["string"],[t]);let e=t.replace(/^(?:\u0000)/,"");return e=e.replace(/(?:\u0000)$/,""),te(new TextEncoder().encode(e))},Ru=rt,q0=rt,cs=t=>pu(me(t)),V0=t=>typeof t=="string"?cs(t):(V.validate(["bytes"],[t]),pu(t)),Ko=Un,z0=cs,Pu=t=>{V.validate(["string"],[t]);let e="";for(let n=0;n<t.length;n+=1){const r=t.charCodeAt(n).toString(16);e+=r.length%2!==0?`0${r}`:r}return`0x${e}`},Q0=Pu,Nu=t=>new TextDecoder("ascii").decode(me(t)),Z0=Nu,Ht=(t,e)=>{if(typeof t=="string"&&Ke(t))return e?"address":`0x${t.toLowerCase().replace(/^0x/i,"")}`;if(typeof t=="boolean")return e?"bool":t?"0x01":"0x00";if(typeof t=="number")return e?t<0?"int256":"uint256":Ue(t);if(typeof t=="bigint")return e?"bigint":Ue(t);if(typeof t=="object"&&t)return e?"string":rt(JSON.stringify(t));if(typeof t=="string"){if(t.startsWith("-0x")||t.startsWith("-0X"))return e?"int256":Ue(t);if(ae(t))return e?"bytes":t;if(qo(t)&&!os(t))return e?"bytes":`0x${t}`;if(!Number.isFinite(t))return e?"string":rt(t)}throw new Bm(t)},Le=t=>{if(typeof t=="number")return t;if(typeof t=="bigint")return t>=Number.MIN_SAFE_INTEGER&&t<=Number.MAX_SAFE_INTEGER?Number(t):t;if(typeof t=="string"&&ae(t))return zr(t);try{return Le(BigInt(t))}catch{throw new Ho(t)}},$t=t=>{if(typeof t=="number")return BigInt(t);if(typeof t=="bigint")return t;if(typeof t=="string"&&qo(t))return t.startsWith("-")?-BigInt(t.substring(1)):BigInt(t);throw new Ho(t)},W0=(t,e)=>{const n=$o[e];if(!n)throw new ru(e);const r=String(Le(t)),i=n.toString().length-1;if(i<=0)return r.toString();const s=r.padStart(i,"0"),o=s.slice(0,-i),a=s.slice(-i).replace(/\.?0+$/,"");return o===""?`0.${a}`:a===""?o:`${o}.${a}`},$0=(t,e)=>{V.validate(["number"],[t]);const n=$o[e];if(!n)throw new ru(e);const[r,i]=String(typeof t=="string"&&!ae(t)?t:Le(t)).split(".").concat(""),o=BigInt(`${r}${i}`)*n,a=n.toString().length-1,u=Math.min(i.length,a);return u===0?o.toString():o.toString().padStart(u,"0").slice(0,-u)},ft=t=>{if(!Ke(t,!1))throw new Fo(t);const e=t.toLowerCase().replace(/^0x/i,""),n=Ut(Be(Ko(e)));if(A(n)||n==="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")return"";let r="0x";const i=n.replace(/^0x/i,"");for(let s=0;s<e.length;s+=1)parseInt(i[s],16)>7?r+=e[s].toUpperCase():r+=e[s];return r},Ou=t=>{if(typeof t=="boolean")return t;if(typeof t=="number"&&(t===0||t===1)||typeof t=="bigint"&&(t===BigInt(0)||t===BigInt(1)))return!!t;if(typeof t=="string"&&!ae(t)&&(t==="1"||t==="0"||t==="false"||t==="true"))return t==="true"?!0:t==="false"?!1:!!Number(t);if(typeof t=="string"&&ae(t)&&(t==="0x1"||t==="0x0"))return!!Le(t);throw new jo(t)};var Jo={exports:{}},Dn=typeof Reflect=="object"?Reflect:null,sc=Dn&&typeof Dn.apply=="function"?Dn.apply:function(e,n,r){return Function.prototype.apply.call(e,n,r)},si;Dn&&typeof Dn.ownKeys=="function"?si=Dn.ownKeys:Object.getOwnPropertySymbols?si=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:si=function(e){return Object.getOwnPropertyNames(e)};function K0(t){console&&console.warn&&console.warn(t)}var Mu=Number.isNaN||function(e){return e!==e};function ue(){ue.init.call(this)}Jo.exports=ue;Jo.exports.once=eg;ue.EventEmitter=ue;ue.prototype._events=void 0;ue.prototype._eventsCount=0;ue.prototype._maxListeners=void 0;var oc=10;function us(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(ue,"defaultMaxListeners",{enumerable:!0,get:function(){return oc},set:function(t){if(typeof t!="number"||t<0||Mu(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");oc=t}});ue.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};ue.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Mu(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Lu(t){return t._maxListeners===void 0?ue.defaultMaxListeners:t._maxListeners}ue.prototype.getMaxListeners=function(){return Lu(this)};ue.prototype.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[e];if(u===void 0)return!1;if(typeof u=="function")sc(u,this,n);else for(var d=u.length,c=Uu(u,d),r=0;r<d;++r)sc(c[r],this,n);return!0};function Du(t,e,n,r){var i,s,o;if(us(n),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),o=s[e]),o===void 0)o=s[e]=n,++t._eventsCount;else if(typeof o=="function"?o=s[e]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),i=Lu(t),i>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,K0(a)}return t}ue.prototype.addListener=function(e,n){return Du(this,e,n,!1)};ue.prototype.on=ue.prototype.addListener;ue.prototype.prependListener=function(e,n){return Du(this,e,n,!0)};function J0(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Hu(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=J0.bind(r);return i.listener=n,r.wrapFn=i,i}ue.prototype.once=function(e,n){return us(n),this.on(e,Hu(this,e,n)),this};ue.prototype.prependOnceListener=function(e,n){return us(n),this.prependListener(e,Hu(this,e,n)),this};ue.prototype.removeListener=function(e,n){var r,i,s,o,a;if(us(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(s=-1,o=r.length-1;o>=0;o--)if(r[o]===n||r[o].listener===n){a=r[o].listener,s=o;break}if(s<0)return this;s===0?r.shift():X0(r,s),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||n)}return this};ue.prototype.off=ue.prototype.removeListener;ue.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var s=Object.keys(r),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[e],typeof n=="function")this.removeListener(e,n);else if(n!==void 0)for(i=n.length-1;i>=0;i--)this.removeListener(e,n[i]);return this};function Fu(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?Y0(i):Uu(i,i.length)}ue.prototype.listeners=function(e){return Fu(this,e,!0)};ue.prototype.rawListeners=function(e){return Fu(this,e,!1)};ue.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ju.call(t,e)};ue.prototype.listenerCount=ju;function ju(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}ue.prototype.eventNames=function(){return this._eventsCount>0?si(this._events):[]};function Uu(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function X0(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Y0(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}function eg(t,e){return new Promise(function(n,r){function i(o){t.removeListener(e,s),r(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),n([].slice.call(arguments))}Gu(t,e,s,{once:!0}),e!=="error"&&tg(t,i,{once:!0})})}function tg(t,e,n){typeof t.on=="function"&&Gu(t,"error",e,n)}function Gu(t,e,n,r){if(typeof t.on=="function")r.once?t.once(e,n):t.on(e,n);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(s){r.once&&t.removeEventListener(e,i),n(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var qu=Jo.exports,ng=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const rg=t=>e=>t(e.detail);class ig extends EventTarget{constructor(){super(...arguments),this._listeners={},this.maxListeners=Number.MAX_SAFE_INTEGER}on(e,n){return this.addEventListener(e,n),this}once(e,n){const r=i=>ng(this,void 0,void 0,function*(){this.off(e,r),yield n(i)});return this.on(e,r)}off(e,n){return this.removeEventListener(e,n),this}emit(e,n){const r=new CustomEvent(e,{detail:n});return super.dispatchEvent(r)}listenerCount(e){const n=this._listeners[e];return n?n.length:0}listeners(e){return this._listeners[e].map(n=>n[0])||[]}eventNames(){return Object.keys(this._listeners)}removeAllListeners(){return Object.keys(this._listeners).forEach(e=>{this._listeners[e].forEach(n=>{super.removeEventListener(e,n[1])})}),this._listeners={},this}setMaxListeners(e){return this.maxListeners=e,this}getMaxListeners(){return this.maxListeners}addEventListener(e,n){const r=rg(n);super.addEventListener(e,r),this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push([n,r])}removeEventListener(e,n){const r=this._listeners[e];if(r){const i=r.findIndex(s=>s[0]===n);i!==-1&&(super.removeEventListener(e,r[i][1]),r.splice(i,1))}}}let oo;typeof window>"u"?oo=qu.EventEmitter:oo=ig;class Xo extends oo{}const sg=ae,og=qo,ag=ku,cg=Ke,ug=tr,dg=as,lg=N0,fg=O0,hg=Li,mg=L0,pg=(t,e)=>{const n=typeof t=="string"&&Te(t),r=typeof e=="string"&&Te(e);if(t===e||(t==="earliest"||t===0)&&(e==="earliest"||e===0))return 0;if(t==="earliest"&&e>0)return-1;if(e==="earliest"&&t>0)return 1;if(n&&r){const o={[yt.EARLIEST]:1,[yt.FINALIZED]:2,[yt.SAFE]:3,[yt.LATEST]:4,[yt.PENDING]:5};return o[t]<o[e]?-1:1}if(n&&!r||!n&&r)throw new Rm("Cannot compare blocktag with provided non-blocktag input.");const i=BigInt(t),s=BigInt(e);return i<s?-1:i===s?0:1},Z=A,ac=t=>typeof t=="object"&&!A(t)&&!Array.isArray(t)&&!(t instanceof Wo),qt=(t,...e)=>{const n=t;if(!ac(n))return n;for(const r of e)for(const i in r)ac(r[i])?(n[i]||(n[i]={}),qt(n[i],r[i])):!A(r[i])&&Object.hasOwnProperty.call(r,i)&&(Array.isArray(r[i])||r[i]instanceof Wo?n[i]=r[i].slice(0):n[i]=r[i]);return n},zn=(t,e,n="0")=>typeof t=="string"?ae(t)?Mi(t,e,n):t.padStart(e,n):(V.validate(["int"],[t]),Mi(t,e,n)),Vu=(t,e,n="0")=>{if(typeof t=="string"&&!ae(t))return t.padEnd(e,n);V.validate(["int"],[t]);const r=typeof t=="string"&&ae(t)?t:Ue(t),i=r.startsWith("-")?3:2;return r.padEnd(e+i,n)},zu=Vu,Rr=zn,Qu=(t,e=64)=>{V.validate(["int"],[t]);const n=Le(t);if(n>=0)return zn(Ht(n),e);const r=Cr(BigInt(2),BigInt(e*4));if(-n>=r)throw new iu(`value: ${t}, nibbleWidth: ${e}`);const s=BigInt(n)+r;return zn(Ue(s),e)},gg=(t,e=64)=>{V.validate(["int"],[t]);const n=Le(t);if(n<0)return n;const r=Math.ceil(Math.log(Number(n))/Math.log(2));if(r>e*4)throw new iu(`value: "${t}", nibbleWidth: "${e}"`);if(e*4!==r)return n;const i=Cr(BigInt(2),BigInt(e)*BigInt(4));return Le(BigInt(n)-i)};function Ne(...t){const e=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function ds(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.byteLength;n+=1)if(t[n]!==e[n])return!1;return!0}const{parseBaseType:yg}=Su,Zt=t=>typeof t=="object"&&!A(t)&&"number"in t&&"bytes"in t,vg=(t,e,n=[])=>{let r=Object.assign({},t),i;for(const s of e){if(r.oneOf&&i){const o=n.find(function(a){return this===a[0]},i??"");o&&o[0]===i&&(r=r.oneOf[o[1]])}if(!r.properties&&!r.items)return;if(r.properties)r=r.properties[s];else if(r.items&&r.items.properties){const o=r.items.properties;if(!o)return;r=o[s]}else r.items&&Ln(r.items)?r=r.items:r.items&&Array.isArray(r.items)&&(r=r.items[parseInt(s,10)]);r&&s&&(i=s)}return r},dr=(t,e,n)=>{try{const{baseType:r,baseTypeSize:i}=yg(e);if(r==="int"||r==="uint")switch(n.number){case $e.NUMBER:return Number($t(t));case $e.HEX:return Ue($t(t));case $e.STR:return $t(t).toString();case $e.BIGINT:return $t(t);default:throw new Ks(`Invalid format: ${String(n.number)}`)}if(r==="bytes"){let s;switch(i?typeof t=="string"?s=zn(t,i*2):t instanceof Uint8Array&&(s=Ne(new Uint8Array(i-t.length),t)):s=t,n.bytes){case xt.HEX:return te(dt(s));case xt.UINT8ARRAY:return dt(s);default:throw new Ks(`Invalid format: ${String(n.bytes)}`)}}}catch{return t}return t},Di=(t,e,n,r,i=[])=>{var s,o;if(!Ln(t)&&!Array.isArray(t))return dr(t,e==null?void 0:e.format,r);const a=t;for(const[u,d]of Object.entries(a)){n.push(u);const c=vg(e,n,i);if(A(c)){delete a[u],n.pop();continue}if(Ln(d)){Di(d,e,n,r),n.pop();continue}if(Array.isArray(d)){let l=c;if((c==null?void 0:c.oneOf)!==void 0&&c.oneOf.forEach((f,m)=>{var g,p;!Array.isArray(c==null?void 0:c.items)&&(typeof d[0]=="object"&&((g=f==null?void 0:f.items)===null||g===void 0?void 0:g.type)==="object"||typeof d[0]=="string"&&((p=f==null?void 0:f.items)===null||p===void 0?void 0:p.type)!=="object")&&(l=f,i.push([u,m]))}),A(l==null?void 0:l.items)){delete a[u],n.pop();continue}if(Ln(l.items)&&!A(l.items.format)){for(let f=0;f<d.length;f+=1)a[u][f]=dr(d[f],(s=l==null?void 0:l.items)===null||s===void 0?void 0:s.format,r);n.pop();continue}if(!Array.isArray(l==null?void 0:l.items)&&((o=l==null?void 0:l.items)===null||o===void 0?void 0:o.type)==="object"){for(const f of d)Di(f,e,n,r,i);n.pop();continue}if(Array.isArray(l==null?void 0:l.items)){for(let f=0;f<d.length;f+=1)a[u][f]=dr(d[f],l.items[f].format,r);n.pop();continue}}a[u]=dr(d,c.format,r),n.pop()}return a},S=(t,e,n)=>{let r;Ln(e)?r=qt({},e):Array.isArray(e)?r=[...e]:r=e;const i=Ln(t)?t:Qo(t);if(!i.properties&&!i.items&&!i.format)throw new Ks("Invalid json schema for formatting");return Di(r,i,[],n)},Zu="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",Qr=t=>{let e;typeof t=="string"?t.startsWith("0x")&&ae(t)?e=me(t):e=Un(t):e=t;const n=te(Be(e));return n===Zu?void 0:n},Ge=t=>{const e=Qr(t);return A(e)?Zu:e},Pr=t=>{let e;return typeof t=="bigint"||typeof t=="number"?e=Un(t.toString()):Array.isArray(t)?e=new Uint8Array(t):typeof t=="string"&&!ae(t)?e=Un(t):e=dt(t),te(Be(e))},bg=t=>{if(Array.isArray(t))throw new Error("Autodetection of array types is not supported.");let e,n;if(typeof t=="object"&&("t"in t||"type"in t)&&("v"in t||"value"in t))e="t"in t?t.t:t.type,n="v"in t?t.v:t.value,e=e.toLowerCase()==="bigint"?"int":e;else{if(typeof t=="bigint")return["int",t];e=Ht(t,!0),n=Ht(t),!e.startsWith("int")&&!e.startsWith("uint")&&(e="bytes")}return(e.startsWith("int")||e.startsWith("uint"))&&typeof n=="string"&&!/^(-)?0x/i.test(n)&&(n=$t(n)),[e,n]},wg=t=>t.startsWith("int[")?`int256${t.slice(3)}`:t==="int"?"int256":t.startsWith("uint[")?`uint256'${t.slice(4)}`:t==="uint"?"uint256":t,Ns=(t,e)=>{const n=/^(\d+).*$/.exec(t.slice(e));return n?parseInt(n[1],10):0},cc=t=>t.toString(2).length,uc=(t,e)=>{const n=e.toString();if(t==="string"){if(typeof e=="string")return rt(e);throw new km(e)}if(t==="bool"||t==="boolean"){if(typeof e=="boolean")return e?"01":"00";throw new jo(e)}if(t==="address"){if(!Ke(n))throw new Fo(n);return n}const r=wg(t);if(t.startsWith("uint")){const i=Ns(r,4);if(i%8||i<8||i>256)throw new Za(n);const s=Le(n);if(cc(s)>i)throw new Wa(n);if(s<BigInt(0))throw new Cm(n);return i?Rr(s.toString(16),i/8*2):s.toString(16)}if(t.startsWith("int")){const i=Ns(r,3);if(i%8||i<8||i>256)throw new Za(t);const s=Le(n);if(cc(s)>i)throw new Wa(n);return s<BigInt(0)?Qu(s.toString(),i/8*2):i?Rr(s.toString(16),i/4):s.toString(16)}if(r==="bytes"){if(n.replace(/^0x/i,"").length%2!==0)throw new fr(n);return n}if(t.startsWith("bytes")){if(n.replace(/^0x/i,"").length%2!==0)throw new fr(n);const i=Ns(t,5);if(!i||i<1||i>64||i<n.replace(/^0x/i,"").length/2)throw new fr(n);return zu(n,i*2)}return""},Wu=t=>{const[e,n]=bg(t);return Array.isArray(n)?n.map(s=>uc(e,s).replace("0x","")).join(""):uc(e,n).replace("0x","")},Yo=(...t)=>`0x${Array.prototype.slice.call(t).map(Wu).join("").toLowerCase()}`,Ag=(...t)=>Qr(Yo(...t)),_g=(...t)=>Ge(Yo(...t)),Eg=t=>Qr(`0x${(typeof t=="number"?t.toString():t).padStart(64,"0")}`);function xg(t){return du(t)}const Nr=t=>xg(t),Ig=t=>te(Nr(t));var ls=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};function $u(t){return(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function Ku(t,e,n){return ls(this,void 0,void 0,function*(){let r;const i=yield Promise.race([t instanceof Promise?t:t(),new Promise((s,o)=>{r=setTimeout(()=>n?o(n):s(void 0),e)})]);if(r&&clearTimeout(r),i instanceof Error)throw i;return i})}function ea(t,e){let n;return[new Promise((i,s)=>{n=setInterval(function o(){return ls(this,void 0,void 0,function*(){try{const a=yield Ku(t,e);A(a)||(clearInterval(n),i(a))}catch(a){clearInterval(n),s(a)}}),o}(),e)}),n]}function Tg(t,e){return ls(this,void 0,void 0,function*(){return ea(t,e)[0]})}function ta(t,e){let n;const r=new Promise((i,s)=>{n=setTimeout(()=>{s(e)},t)});return[n,r]}function Ju(t,e){let n;const r=new Promise((i,s)=>{n=setInterval(()=>{ls(this,void 0,void 0,function*(){const o=yield t();o&&(clearInterval(n),s(o))})},e)});return[n,r]}const na=()=>{const t=Nr(16);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const e=te(t);return[e.substring(2,10),e.substring(10,14),e.substring(14,18),e.substring(18,22),e.substring(22,34)].join("-")},ra=t=>{const e=t.error.code;return Re.has(e)||e>=-32099&&e<=-32e3},bt=t=>!Array.isArray(t)&&!!t&&t.jsonrpc==="2.0"&&"result"in t&&A(t.error)&&(typeof t.id=="number"||typeof t.id=="string"),wt=t=>!Array.isArray(t)&&t.jsonrpc==="2.0"&&!!t&&A(t.result)&&"error"in t&&(typeof t.id=="number"||typeof t.id=="string"),fs=t=>!Array.isArray(t)&&!!t&&t.jsonrpc==="2.0"&&!A(t.params)&&!A(t.method),Xu=t=>!Array.isArray(t)&&!!t&&t.jsonrpc==="2.0"&&"id"in t&&"result"in t,Hi=t=>bt(t)||wt(t),ia=t=>Array.isArray(t)?t.every(Hi):Hi(t),Or=t=>Array.isArray(t)&&t.length>0&&ia(t);let oi;const Yu=t=>{oi=t},mn=t=>{var e,n,r,i;return typeof oi<"u"&&(oi+=1),{jsonrpc:(e=t.jsonrpc)!==null&&e!==void 0?e:"2.0",id:(r=(n=t.id)!==null&&n!==void 0?n:oi)!==null&&r!==void 0?r:na(),method:t.method,params:(i=t.params)!==null&&i!==void 0?i:void 0}},sa=t=>t.map(e=>mn(e)),ze=t=>Array.isArray(t)&&t.length>0,Sg=Object.freeze(Object.defineProperty({__proto__:null,isBatchRequest:ze,isBatchResponse:Or,isResponseRpcError:ra,isResponseWithError:wt,isResponseWithNotification:fs,isResponseWithResult:bt,isSubscriptionResult:Xu,isValidResponse:ia,setRequestIdStart:Yu,toBatchPayload:sa,toPayload:mn,validateResponse:Hi},Symbol.toStringTag,{value:"Module"}));var Os=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})},ed;class Fi{constructor({timeout:e,eagerStart:n,timeoutMessage:r}={timeout:0,eagerStart:!1,timeoutMessage:"DeferredPromise timed out"}){this[ed]="Promise",this._state="pending",this._promise=new Promise((i,s)=>{this._resolve=i,this._reject=s}),this._timeoutMessage=r,this._timeoutInterval=e,n&&this.startTimer()}get state(){return this._state}then(e,n){return Os(this,void 0,void 0,function*(){return this._promise.then(e,n)})}catch(e){return Os(this,void 0,void 0,function*(){return this._promise.catch(e)})}finally(e){return Os(this,void 0,void 0,function*(){return this._promise.finally(e)})}resolve(e){this._resolve(e),this._state="fulfilled",this._clearTimeout()}reject(e){this._reject(e),this._state="rejected",this._clearTimeout()}startTimer(){this._timeoutInterval&&this._timeoutInterval>0&&(this._timeoutId=setTimeout(this._checkTimeout.bind(this),this._timeoutInterval))}_checkTimeout(){this._state==="pending"&&this._timeoutId&&this.reject(new Kc(this._timeoutMessage))}_clearTimeout(){this._timeoutId&&clearTimeout(this._timeoutId)}}ed=Symbol.toStringTag;class td{constructor(e,n){this.eventEmitter=e,this.autoReconnect=n}clearQueues(){typeof this._clearQueues=="function"&&this._clearQueues()}onError(e){this._clearQueues=e}parseResponse(e){const n=[];return e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(i=>{let s=i;this.lastChunk&&(s=this.lastChunk+s);let o;try{o=JSON.parse(s)}catch{this.lastChunk=s,this.lastChunkTimeout&&clearTimeout(this.lastChunkTimeout),this.lastChunkTimeout=setTimeout(()=>{this.autoReconnect||(this.clearQueues(),this.eventEmitter.emit("error",new yr({id:1,jsonrpc:"2.0",error:{code:2,message:"Chunk timeout"}})))},1e3*15);return}clearTimeout(this.lastChunkTimeout),this.lastChunk=void 0,o&&n.push(o)}),n}}var dc=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class nd extends Vr{constructor(){super(...arguments),this._eventEmitter=new qu.EventEmitter,this._chainId="",this._accounts=[]}_getChainId(){var e;return dc(this,void 0,void 0,function*(){const n=yield this.request(mn({method:"eth_chainId",params:[]}));return(e=n==null?void 0:n.result)!==null&&e!==void 0?e:""})}_getAccounts(){var e;return dc(this,void 0,void 0,function*(){const n=yield this.request(mn({method:"eth_accounts",params:[]}));return(e=n==null?void 0:n.result)!==null&&e!==void 0?e:[]})}_onConnect(){Promise.all([this._getChainId().then(e=>{e!==this._chainId&&(this._chainId=e,this._eventEmitter.emit("chainChanged",this._chainId))}).catch(e=>{console.error(e)}),this._getAccounts().then(e=>{this._accounts.length===e.length&&e.every(n=>e.includes(n))||(this._accounts=e,this._onAccountsChanged())}).catch(e=>{console.error(e)})]).then(()=>this._eventEmitter.emit("connect",{chainId:this._chainId})).catch(e=>{console.error(e)})}_onDisconnect(e,n){this._eventEmitter.emit("disconnect",new Nm(e,n))}_onAccountsChanged(){this._eventEmitter.emit("accountsChanged",this._accounts)}}var kg=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const Bg={autoReconnect:!0,delay:5e3,maxAttempts:5},Cg=1e3;class rd extends nd{constructor(e,n,r){if(super(),this._connectionStatus="connecting",this._onMessageHandler=this._onMessage.bind(this),this._onOpenHandler=this._onConnect.bind(this),this._onCloseHandler=this._onCloseEvent.bind(this),this._onErrorHandler=this._onError.bind(this),!this._validateProviderPath(e))throw new Js(e);this._socketPath=e,this._socketOptions=n,this._reconnectOptions=Object.assign(Object.assign({},Bg),r??{}),this._pendingRequestsQueue=new Map,this._sentRequestsQueue=new Map,this._init(),this.connect(),this.chunkResponseParser=new td(this._eventEmitter,this._reconnectOptions.autoReconnect),this.chunkResponseParser.onError(()=>{this._clearQueues()}),this.isReconnecting=!1}get SocketConnection(){return this._socketConnection}_init(){this._reconnectAttempts=0}connect(){try{this._openSocketConnection(),this._connectionStatus="connecting",this._addSocketListeners()}catch(e){if(this.isReconnecting)setImmediate(()=>{this._reconnect()});else throw this._connectionStatus="disconnected",e&&e.message?new Gr(`Error while connecting to ${this._socketPath}. Reason: ${e.message}`):new Js(this._socketPath)}}_validateProviderPath(e){return!!e}supportsSubscriptions(){return!0}on(e,n){this._eventEmitter.on(e,n)}once(e,n){this._eventEmitter.once(e,n)}removeListener(e,n){this._eventEmitter.removeListener(e,n)}_onDisconnect(e,n){this._connectionStatus="disconnected",super._onDisconnect(e,n)}disconnect(e,n){const r=e??Cg;this._removeSocketListeners(),this.getStatus()!=="disconnected"&&this._closeSocketConnection(r,n),this._onDisconnect(r,n)}removeAllListeners(e){this._eventEmitter.removeAllListeners(e)}_onError(e){this.isReconnecting?this._reconnect():this._eventEmitter.emit("error",e)}reset(){this._sentRequestsQueue.clear(),this._pendingRequestsQueue.clear(),this._init(),this._removeSocketListeners(),this._addSocketListeners()}_reconnect(){this.isReconnecting||(this.isReconnecting=!0,this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((e,n)=>{e.deferredPromise.reject(new Zh),this._sentRequestsQueue.delete(n)}),this._reconnectAttempts<this._reconnectOptions.maxAttempts?(this._reconnectAttempts+=1,setTimeout(()=>{this._removeSocketListeners(),this.connect(),this.isReconnecting=!1},this._reconnectOptions.delay)):(this.isReconnecting=!1,this._clearQueues(),this._removeSocketListeners(),this._eventEmitter.emit("error",new Qh(this._reconnectOptions.maxAttempts))))}request(e){return kg(this,void 0,void 0,function*(){if(Z(this._socketConnection))throw new Error("Connection is undefined");this.getStatus()==="disconnected"&&this.connect();const n=ze(e)?e[0].id:e.id;if(!n)throw new em("Request Id not defined");if(this._sentRequestsQueue.has(n))throw new Wh(n);const r=new Fi;r.catch(s=>{this._eventEmitter.emit("error",s)});const i={payload:e,deferredPromise:r};if(this.getStatus()==="connecting")return this._pendingRequestsQueue.set(n,i),i.deferredPromise;this._sentRequestsQueue.set(n,i);try{this._sendToSocket(i.payload)}catch(s){this._sentRequestsQueue.delete(n),this._eventEmitter.emit("error",s)}return r})}_onConnect(){this._connectionStatus="connected",this._reconnectAttempts=0,super._onConnect(),this._sendPendingRequests()}_sendPendingRequests(){for(const[e,n]of this._pendingRequestsQueue.entries())this._sendToSocket(n.payload),this._pendingRequestsQueue.delete(e),this._sentRequestsQueue.set(e,n)}_onMessage(e){const n=this._parseResponses(e);if(!(Z(n)||n.length===0))for(const r of n){if(fs(r)&&r.method.endsWith("_subscription")){this._eventEmitter.emit("message",r);return}const i=Or(r)?r[0].id:r.id,s=this._sentRequestsQueue.get(i);if(!s)return;(Or(r)||bt(r)||wt(r))&&(this._eventEmitter.emit("message",r),s.deferredPromise.resolve(r)),this._sentRequestsQueue.delete(i)}}_clearQueues(e){this._pendingRequestsQueue.size>0&&this._pendingRequestsQueue.forEach((n,r)=>{n.deferredPromise.reject(new $s(e)),this._pendingRequestsQueue.delete(r)}),this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((n,r)=>{n.deferredPromise.reject(new $s(e)),this._sentRequestsQueue.delete(r)}),this._removeSocketListeners()}}const id=Object.freeze(Object.defineProperty({__proto__:null,ChunkResponseParser:td,Eip1193Provider:nd,EventEmitter:Xo,SocketProvider:rd,Web3DeferredPromise:Fi,asciiToHex:Pu,bytesToHex:te,bytesToUint8Array:dt,checkAddressCheckSum:ag,compareBlockNumbers:pg,convert:Di,convertScalarValue:dr,encodePacked:Yo,ethUnitMap:$o,format:S,fromAscii:Q0,fromDecimal:U0,fromTwosComplement:gg,fromUtf8:Ru,fromWei:W0,getStorageSlotNumForLongString:Eg,hexToAscii:Nu,hexToBytes:me,hexToNumber:zr,hexToNumberString:G0,hexToString:z0,hexToUtf8:cs,isAddress:cg,isBatchRequest:ze,isBatchResponse:Or,isBloom:ug,isContractAddressInBloom:fg,isDataFormat:Zt,isHex:og,isHexStrict:sg,isInBloom:dg,isNullish:Z,isPromise:$u,isResponseRpcError:ra,isResponseWithError:wt,isResponseWithNotification:fs,isResponseWithResult:bt,isSubscriptionResult:Xu,isTopic:hg,isTopicInBloom:mg,isUserEthereumAddressInBloom:lg,isValidResponse:ia,jsonRpc:Sg,keccak256:Pr,keccak256Wrapper:Pr,leftPad:Rr,mergeDeep:qt,numberToHex:Ue,padLeft:zn,padRight:Vu,pollTillDefined:Tg,pollTillDefinedAndReturnIntervalId:ea,processSolidityEncodePackedArgs:Wu,randomBytes:Nr,randomHex:Ig,rejectIfConditionAtInterval:Ju,rejectIfTimeout:ta,rightPad:zu,setRequestIdStart:Yu,sha3:Qr,sha3Raw:Ge,soliditySha3:Ag,soliditySha3Raw:_g,stringToHex:q0,toAscii:Z0,toBatchPayload:sa,toBigInt:$t,toBool:Ou,toChecksumAddress:ft,toDecimal:j0,toHex:Ht,toNumber:Le,toPayload:mn,toTwosComplement:Qu,toUtf8:V0,toWei:$0,uint8ArrayConcat:Ne,uint8ArrayEquals:ds,utf8ToBytes:Ko,utf8ToHex:rt,uuidV4:na,validateResponse:Hi,waitWithTimeout:Ku},Symbol.toStringTag,{value:"Module"}));class hs{constructor(){this._emitter=new Xo}on(e,n){this._emitter.on(e,n)}once(e,n){this._emitter.once(e,n)}off(e,n){this._emitter.off(e,n)}emit(e,n){this._emitter.emit(e,n)}listenerCount(e){return this._emitter.listenerCount(e)}listeners(e){return this._emitter.listeners(e)}eventNames(){return this._emitter.eventNames()}removeAllListeners(){return this._emitter.removeAllListeners()}setMaxListenerWarningThreshold(e){this._emitter.setMaxListeners(e)}getMaxListeners(){return this._emitter.getMaxListeners()}}var Qn;(function(t){t.CONFIG_CHANGE="CONFIG_CHANGE"})(Qn||(Qn={}));class Rg extends hs{constructor(e){super(),this.config={handleRevert:!1,defaultAccount:void 0,defaultBlock:"latest",transactionBlockTimeout:50,transactionConfirmationBlocks:24,transactionPollingInterval:1e3,transactionPollingTimeout:750*1e3,transactionReceiptPollingInterval:void 0,transactionSendTimeout:750*1e3,transactionConfirmationPollingInterval:void 0,blockHeaderTimeout:10,maxListenersWarningThreshold:100,contractDataInputFill:"input",defaultNetworkId:void 0,defaultChain:"mainnet",defaultHardfork:"london",defaultCommon:void 0,defaultTransactionType:"0x2",defaultMaxPriorityFeePerGas:Ht(25e8),enableExperimentalFeatures:{useSubscriptionWhenCheckingBlockTimeout:!1,useRpcCallSpecification:!1},transactionBuilder:void 0,transactionTypeParser:void 0},this.setConfig(e??{})}setConfig(e){Object.assign(this.config,e)}get handleRevert(){return this.config.handleRevert}set handleRevert(e){this._triggerConfigChange("handleRevert",e),this.config.handleRevert=e}get contractDataInputFill(){return this.config.contractDataInputFill}set contractDataInputFill(e){this._triggerConfigChange("contractDataInputFill",e),this.config.contractDataInputFill=e}get defaultAccount(){return this.config.defaultAccount}set defaultAccount(e){this._triggerConfigChange("defaultAccount",e),this.config.defaultAccount=e}get defaultBlock(){return this.config.defaultBlock}set defaultBlock(e){this._triggerConfigChange("defaultBlock",e),this.config.defaultBlock=e}get transactionSendTimeout(){return this.config.transactionSendTimeout}set transactionSendTimeout(e){this._triggerConfigChange("transactionSendTimeout",e),this.config.transactionSendTimeout=e}get transactionBlockTimeout(){return this.config.transactionBlockTimeout}set transactionBlockTimeout(e){this._triggerConfigChange("transactionBlockTimeout",e),this.config.transactionBlockTimeout=e}get transactionConfirmationBlocks(){return this.config.transactionConfirmationBlocks}set transactionConfirmationBlocks(e){this._triggerConfigChange("transactionConfirmationBlocks",e),this.config.transactionConfirmationBlocks=e}get transactionPollingInterval(){return this.config.transactionPollingInterval}set transactionPollingInterval(e){this._triggerConfigChange("transactionPollingInterval",e),this.config.transactionPollingInterval=e,this.transactionReceiptPollingInterval=e,this.transactionConfirmationPollingInterval=e}get transactionPollingTimeout(){return this.config.transactionPollingTimeout}set transactionPollingTimeout(e){this._triggerConfigChange("transactionPollingTimeout",e),this.config.transactionPollingTimeout=e}get transactionReceiptPollingInterval(){return this.config.transactionReceiptPollingInterval}set transactionReceiptPollingInterval(e){this._triggerConfigChange("transactionReceiptPollingInterval",e),this.config.transactionReceiptPollingInterval=e}get transactionConfirmationPollingInterval(){return this.config.transactionConfirmationPollingInterval}set transactionConfirmationPollingInterval(e){this._triggerConfigChange("transactionConfirmationPollingInterval",e),this.config.transactionConfirmationPollingInterval=e}get blockHeaderTimeout(){return this.config.blockHeaderTimeout}set blockHeaderTimeout(e){this._triggerConfigChange("blockHeaderTimeout",e),this.config.blockHeaderTimeout=e}get enableExperimentalFeatures(){return this.config.enableExperimentalFeatures}set enableExperimentalFeatures(e){this._triggerConfigChange("enableExperimentalFeatures",e),this.config.enableExperimentalFeatures=e}get maxListenersWarningThreshold(){return this.config.maxListenersWarningThreshold}set maxListenersWarningThreshold(e){this._triggerConfigChange("maxListenersWarningThreshold",e),this.setMaxListenerWarningThreshold(e),this.config.maxListenersWarningThreshold=e}get defaultNetworkId(){return this.config.defaultNetworkId}set defaultNetworkId(e){this._triggerConfigChange("defaultNetworkId",e),this.config.defaultNetworkId=e}get defaultChain(){return this.config.defaultChain}set defaultChain(e){if(!Z(this.config.defaultCommon)&&!Z(this.config.defaultCommon.baseChain)&&e!==this.config.defaultCommon.baseChain)throw new Ja(this.config.defaultChain,e);this._triggerConfigChange("defaultChain",e),this.config.defaultChain=e}get defaultHardfork(){return this.config.defaultHardfork}set defaultHardfork(e){if(!Z(this.config.defaultCommon)&&!Z(this.config.defaultCommon.hardfork)&&e!==this.config.defaultCommon.hardfork)throw new Ka(this.config.defaultCommon.hardfork,e);this._triggerConfigChange("defaultHardfork",e),this.config.defaultHardfork=e}get defaultCommon(){return this.config.defaultCommon}set defaultCommon(e){if(!Z(this.config.defaultHardfork)&&!Z(e)&&!Z(e.hardfork)&&this.config.defaultHardfork!==e.hardfork)throw new Ka(this.config.defaultHardfork,e.hardfork);if(!Z(this.config.defaultChain)&&!Z(e)&&!Z(e.baseChain)&&this.config.defaultChain!==e.baseChain)throw new Ja(this.config.defaultChain,e.baseChain);this._triggerConfigChange("defaultCommon",e),this.config.defaultCommon=e}get defaultTransactionType(){return this.config.defaultTransactionType}set defaultTransactionType(e){this._triggerConfigChange("defaultTransactionType",e),this.config.defaultTransactionType=e}get defaultMaxPriorityFeePerGas(){return this.config.defaultMaxPriorityFeePerGas}set defaultMaxPriorityFeePerGas(e){this._triggerConfigChange("defaultMaxPriorityFeePerGas",e),this.config.defaultMaxPriorityFeePerGas=e}get transactionBuilder(){return this.config.transactionBuilder}set transactionBuilder(e){this._triggerConfigChange("transactionBuilder",e),this.config.transactionBuilder=e}get transactionTypeParser(){return this.config.transactionTypeParser}set transactionTypeParser(e){this._triggerConfigChange("transactionTypeParser",e),this.config.transactionTypeParser=e}_triggerConfigChange(e,n){this.emit(Qn.CONFIG_CHANGE,{name:e,oldValue:this.config[e],newValue:n})}}var ao={exports:{}};(function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof tn.commonjsGlobal<"u"&&tn.commonjsGlobal,r=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof a<"u"&&a,u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function d(h){return h&&DataView.prototype.isPrototypeOf(h)}if(u.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(h){return h&&c.indexOf(Object.prototype.toString.call(h))>-1};function f(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(h)||h==="")throw new TypeError('Invalid character in header field name: "'+h+'"');return h.toLowerCase()}function m(h){return typeof h!="string"&&(h=String(h)),h}function g(h){var v={next:function(){var C=h.shift();return{done:C===void 0,value:C}}};return u.iterable&&(v[Symbol.iterator]=function(){return v}),v}function p(h){this.map={},h instanceof p?h.forEach(function(v,C){this.append(C,v)},this):Array.isArray(h)?h.forEach(function(v){this.append(v[0],v[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(v){this.append(v,h[v])},this)}p.prototype.append=function(h,v){h=f(h),v=m(v);var C=this.map[h];this.map[h]=C?C+", "+v:v},p.prototype.delete=function(h){delete this.map[f(h)]},p.prototype.get=function(h){return h=f(h),this.has(h)?this.map[h]:null},p.prototype.has=function(h){return this.map.hasOwnProperty(f(h))},p.prototype.set=function(h,v){this.map[f(h)]=m(v)},p.prototype.forEach=function(h,v){for(var C in this.map)this.map.hasOwnProperty(C)&&h.call(v,this.map[C],C,this)},p.prototype.keys=function(){var h=[];return this.forEach(function(v,C){h.push(C)}),g(h)},p.prototype.values=function(){var h=[];return this.forEach(function(v){h.push(v)}),g(h)},p.prototype.entries=function(){var h=[];return this.forEach(function(v,C){h.push([C,v])}),g(h)},u.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function y(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function b(h){return new Promise(function(v,C){h.onload=function(){v(h.result)},h.onerror=function(){C(h.error)}})}function _(h){var v=new FileReader,C=b(v);return v.readAsArrayBuffer(h),C}function E(h){var v=new FileReader,C=b(v);return v.readAsText(h),C}function T(h){for(var v=new Uint8Array(h),C=new Array(v.length),D=0;D<v.length;D++)C[D]=String.fromCharCode(v[D]);return C.join("")}function x(h){if(h.slice)return h.slice(0);var v=new Uint8Array(h.byteLength);return v.set(new Uint8Array(h)),v.buffer}function B(){return this.bodyUsed=!1,this._initBody=function(h){this.bodyUsed=this.bodyUsed,this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:u.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:u.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():u.arrayBuffer&&u.blob&&d(h)?(this._bodyArrayBuffer=x(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||l(h))?this._bodyArrayBuffer=x(h):this._bodyText=h=Object.prototype.toString.call(h):this._bodyText="",this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var h=y(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var h=y(this);return h||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(_)}),this.text=function(){var h=y(this);if(h)return h;if(this._bodyBlob)return E(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(T(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(I)}),this.json=function(){return this.text().then(JSON.parse)},this}var R=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(h){var v=h.toUpperCase();return R.indexOf(v)>-1?v:h}function L(h,v){if(!(this instanceof L))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');v=v||{};var C=v.body;if(h instanceof L){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,v.headers||(this.headers=new p(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!C&&h._bodyInit!=null&&(C=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=v.credentials||this.credentials||"same-origin",(v.headers||!this.headers)&&(this.headers=new p(v.headers)),this.method=w(v.method||this.method||"GET"),this.mode=v.mode||this.mode||null,this.signal=v.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&C)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(C),(this.method==="GET"||this.method==="HEAD")&&(v.cache==="no-store"||v.cache==="no-cache")){var D=/([?&])_=[^&]*/;if(D.test(this.url))this.url=this.url.replace(D,"$1_="+new Date().getTime());else{var H=/\?/;this.url+=(H.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}L.prototype.clone=function(){return new L(this,{body:this._bodyInit})};function I(h){var v=new FormData;return h.trim().split("&").forEach(function(C){if(C){var D=C.split("="),H=D.shift().replace(/\+/g," "),F=D.join("=").replace(/\+/g," ");v.append(decodeURIComponent(H),decodeURIComponent(F))}}),v}function P(h){var v=new p,C=h.replace(/\r?\n[\t ]+/g," ");return C.split("\r").map(function(D){return D.indexOf(`
|
8
|
+
`)===0?D.substr(1,D.length):D}).forEach(function(D){var H=D.split(":"),F=H.shift().trim();if(F){var fe=H.join(":").trim();v.append(F,fe)}}),v}B.call(L.prototype);function O(h,v){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');v||(v={}),this.type="default",this.status=v.status===void 0?200:v.status,this.ok=this.status>=200&&this.status<300,this.statusText=v.statusText===void 0?"":""+v.statusText,this.headers=new p(v.headers),this.url=v.url||"",this._initBody(h)}B.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},O.error=function(){var h=new O(null,{status:0,statusText:""});return h.type="error",h};var z=[301,302,303,307,308];O.redirect=function(h,v){if(z.indexOf(v)===-1)throw new RangeError("Invalid status code");return new O(null,{status:v,headers:{location:h}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(v,C){this.message=v,this.name=C;var D=Error(v);this.stack=D.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function le(h,v){return new Promise(function(C,D){var H=new L(h,v);if(H.signal&&H.signal.aborted)return D(new o.DOMException("Aborted","AbortError"));var F=new XMLHttpRequest;function fe(){F.abort()}F.onload=function(){var we={status:F.status,statusText:F.statusText,headers:P(F.getAllResponseHeaders()||"")};we.url="responseURL"in F?F.responseURL:we.headers.get("X-Request-URL");var He="response"in F?F.response:F.responseText;setTimeout(function(){C(new O(He,we))},0)},F.onerror=function(){setTimeout(function(){D(new TypeError("Network request failed"))},0)},F.ontimeout=function(){setTimeout(function(){D(new TypeError("Network request failed"))},0)},F.onabort=function(){setTimeout(function(){D(new o.DOMException("Aborted","AbortError"))},0)};function Ee(we){try{return we===""&&a.location.href?a.location.href:we}catch{return we}}F.open(H.method,Ee(H.url),!0),H.credentials==="include"?F.withCredentials=!0:H.credentials==="omit"&&(F.withCredentials=!1),"responseType"in F&&(u.blob?F.responseType="blob":u.arrayBuffer&&H.headers.get("Content-Type")&&H.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(F.responseType="arraybuffer")),v&&typeof v.headers=="object"&&!(v.headers instanceof p)?Object.getOwnPropertyNames(v.headers).forEach(function(we){F.setRequestHeader(we,m(v.headers[we]))}):H.headers.forEach(function(we,He){F.setRequestHeader(He,we)}),H.signal&&(H.signal.addEventListener("abort",fe),F.onreadystatechange=function(){F.readyState===4&&H.signal.removeEventListener("abort",fe)}),F.send(typeof H._bodyInit>"u"?null:H._bodyInit)})}return le.polyfill=!0,a.fetch||(a.fetch=le,a.Headers=p,a.Request=L,a.Response=O),o.Headers=p,o.Request=L,o.Response=O,o.fetch=le,o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(ao,ao.exports);var Pg=ao.exports;const Ng=tn.getDefaultExportFromCjs(Pg);var Og=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class oa extends Vr{constructor(e,n){if(super(),!oa.validateClientUrl(e))throw new Js(e);this.clientUrl=e,this.httpProviderOptions=n}static validateClientUrl(e){return typeof e=="string"?/^http(s)?:\/\//i.test(e):!1}getStatus(){throw new ht}supportsSubscriptions(){return!1}request(e,n){var r;return Og(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},(r=this.httpProviderOptions)===null||r===void 0?void 0:r.providerOptions),n),s=yield Ng(this.clientUrl,Object.assign(Object.assign({},i),{method:"POST",headers:Object.assign(Object.assign({},i.headers),{"Content-Type":"application/json"}),body:JSON.stringify(e)}));if(!s.ok)throw new gt(yield s.json());return yield s.json()})}on(){throw new ht}removeListener(){throw new ht}once(){throw new ht}removeAllListeners(){throw new ht}connect(){throw new ht}disconnect(){throw new ht}reset(){throw new ht}reconnect(){throw new ht}}var Cn=null;typeof WebSocket<"u"?Cn=WebSocket:typeof MozWebSocket<"u"?Cn=MozWebSocket:typeof global<"u"?Cn=global.WebSocket||global.MozWebSocket:typeof window<"u"?Cn=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(Cn=self.WebSocket||self.MozWebSocket);const Mg=Cn;class Lg extends rd{constructor(e,n,r){super(e,n,r)}_validateProviderPath(e){return typeof e=="string"?/^ws(s)?:\/\//i.test(e):!1}getStatus(){if(this._socketConnection&&!Z(this._socketConnection))switch(this._socketConnection.readyState){case this._socketConnection.CONNECTING:return"connecting";case this._socketConnection.OPEN:return"connected";default:return"disconnected"}return"disconnected"}_openSocketConnection(){this._socketConnection=new Mg(this._socketPath,void 0,this._socketOptions&&Object.keys(this._socketOptions).length===0?void 0:this._socketOptions)}_closeSocketConnection(e,n){var r;(r=this._socketConnection)===null||r===void 0||r.close(e,n)}_sendToSocket(e){var n;if(this.getStatus()==="disconnected")throw new $s;(n=this._socketConnection)===null||n===void 0||n.send(JSON.stringify(e))}_parseResponses(e){return this.chunkResponseParser.parseResponse(e.data)}_addSocketListeners(){var e,n,r,i;(e=this._socketConnection)===null||e===void 0||e.addEventListener("open",this._onOpenHandler),(n=this._socketConnection)===null||n===void 0||n.addEventListener("message",this._onMessageHandler),(r=this._socketConnection)===null||r===void 0||r.addEventListener("close",s=>this._onCloseHandler(s)),(i=this._socketConnection)===null||i===void 0||i.addEventListener("error",this._onErrorHandler)}_removeSocketListeners(){var e,n,r;(e=this._socketConnection)===null||e===void 0||e.removeEventListener("message",this._onMessageHandler),(n=this._socketConnection)===null||n===void 0||n.removeEventListener("open",this._onOpenHandler),(r=this._socketConnection)===null||r===void 0||r.removeEventListener("close",this._onCloseHandler)}_onCloseEvent(e){var n;if(this._reconnectOptions.autoReconnect&&(![1e3,1001].includes(e.code)||!e.wasClean)){this._reconnect();return}this._clearQueues(e),this._removeSocketListeners(),this._onDisconnect(e.code,e.reason),(n=this._socketConnection)===null||n===void 0||n.removeEventListener("error",this._onErrorHandler)}}const sd=t=>Vr.isWeb3Provider(t),Dg=t=>typeof t!="string"&&"request"in t&&t.request.constructor.name==="AsyncFunction"&&"isMetaMask"in t&&t.isMetaMask,od=t=>typeof t!="string"&&"request"in t&&t.request.constructor.name==="Function",ad=t=>typeof t!="string"&&"request"in t&&t.request.constructor.name==="AsyncFunction",cd=t=>typeof t!="string"&&"send"in t,ud=t=>typeof t!="string"&&"sendAsync"in t,ji=t=>t&&(sd(t)||ad(t)||od(t)||ud(t)||cd(t)),Hg=t=>t&&"supportsSubscriptions"in t?t.supportsSubscriptions():!!(t&&typeof t!="string"&&"on"in t);var Ms=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})},Zn;(function(t){t.PROVIDER_CHANGED="PROVIDER_CHANGED",t.BEFORE_PROVIDER_CHANGE="BEFORE_PROVIDER_CHANGE"})(Zn||(Zn={}));const lc={HttpProvider:oa,WebsocketProvider:Lg},fc=t=>{var e;if(Array.isArray(t.params)){const n=t.params[0];if(n.input&&!n.data)return Object.assign(Object.assign({},t),{params:[Object.assign(Object.assign({},n),{data:(e=n.data)!==null&&e!==void 0?e:n.input})]})}return t};class sn extends hs{constructor(e,n){super(),Z(e)||this.setProvider(e),this.useRpcCallSpecification=n}static get providers(){return lc}get provider(){return this._provider}get providers(){return lc}setProvider(e){let n;if(e&&typeof e=="string"&&this.providers)if(/^http(s)?:\/\//i.test(e))n=new this.providers.HttpProvider(e);else if(/^ws(s)?:\/\//i.test(e))n=new this.providers.WebsocketProvider(e);else throw new ei(`Can't autodetect provider for "${e}"`);else Z(e)?n=void 0:n=e;return this.emit(Zn.BEFORE_PROVIDER_CHANGE,this._provider),this._provider=n,this.emit(Zn.PROVIDER_CHANGED,this._provider),!0}send(e){return Ms(this,void 0,void 0,function*(){const n=yield this._sendRequest(e);if(bt(n))return n.result;throw new gt(n)})}sendBatch(e){return Ms(this,void 0,void 0,function*(){return yield this._sendRequest(e)})}_sendRequest(e){return Ms(this,void 0,void 0,function*(){const{provider:n}=this;if(Z(n))throw new ei("Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.");let r=ze(e)?sa(e):mn(e);if(Dg(n)&&r.method==="eth_sendTransaction"&&(ze(r)?r=r.map(i=>fc(i)):r=fc(r)),sd(n)){let i;try{i=yield n.request(r)}catch(s){i=s}return this._processJsonRpcResponse(r,i,{legacy:!1,error:!1})}if(ad(n))return n.request(r).then(i=>this._processJsonRpcResponse(r,i,{legacy:!0,error:!1})).catch(i=>this._processJsonRpcResponse(r,i,{legacy:!0,error:!0}));if(od(n))return new Promise((i,s)=>{const o=d=>s(this._processJsonRpcResponse(r,d,{legacy:!0,error:!0})),a=d=>i(this._processJsonRpcResponse(r,d,{legacy:!0,error:!1})),u=n.request(r,(d,c)=>d?o(d):a(c));$u(u)&&u.then(a).catch(o)});if(cd(n))return new Promise((i,s)=>{n.send(r,(o,a)=>{if(o)return s(this._processJsonRpcResponse(r,o,{legacy:!0,error:!0}));if(Z(a))throw new gt("",'Got a "nullish" response from provider.');return i(this._processJsonRpcResponse(r,a,{legacy:!0,error:!1}))})});if(ud(n))return n.sendAsync(r).then(i=>this._processJsonRpcResponse(r,i,{legacy:!0,error:!1})).catch(i=>this._processJsonRpcResponse(r,i,{legacy:!0,error:!0}));throw new ei("Provider does not have a request or send method to use.")})}_processJsonRpcResponse(e,n,{legacy:r,error:i}){if(Z(n))return this._buildResponse(e,null,i);if(wt(n)){if(this.useRpcCallSpecification&&ra(n)){const s=n;if(Re.get(s.error.code)){const o=Re.get(s.error.code).error;throw new o(s)}else throw new qe(s)}else if(!sn._isReverted(n))throw new yr(n,e)}if(bt(n))return n;if(n instanceof Error)throw sn._isReverted(n),n;if(!r&&ze(e)&&Or(n)||r&&!i&&ze(e))return n;if(r&&i&&ze(e))throw n;if(r&&!wt(n)&&!bt(n))return this._buildResponse(e,n,i);throw ze(e)&&!Array.isArray(n)?new gt(n,"Got normal response for a batch request."):!ze(e)&&Array.isArray(n)?new gt(n,"Got batch response for a normal request."):(wt(n)||bt(n))&&!ze(e)&&n.id&&e.id!==n.id?new yr(n):new gt(n,"Invalid response")}static _isReverted(e){let n;if(wt(e)?n=e.error:e instanceof Error&&(n=e),n!=null&&n.message.includes("revert"))throw new nn(n);return!1}_buildResponse(e,n,r){const i={jsonrpc:"2.0",id:ze(e)?e[0].id:"id"in e?e.id:null};return r?Object.assign(Object.assign({},i),{error:n}):Object.assign(Object.assign({},i),{result:n})}}var sr=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class co{constructor(e,n,r=!1){this.requestManager=e,this.registeredSubscriptions=n,this.tolerateUnlinkedSubscription=r,this._subscriptions=new Map,this.requestManager.on(Zn.BEFORE_PROVIDER_CHANGE,()=>sr(this,void 0,void 0,function*(){yield this.unsubscribe()})),this.requestManager.on(Zn.PROVIDER_CHANGED,()=>{this.clear(),this.listenToProviderEvents()}),this.listenToProviderEvents()}listenToProviderEvents(){const e=this.requestManager.provider;!this.requestManager.provider||typeof(e==null?void 0:e.supportsSubscriptions)=="function"&&!(e!=null&&e.supportsSubscriptions())||typeof this.requestManager.provider.on=="function"&&(typeof this.requestManager.provider.request=="function"?this.requestManager.provider.on("message",n=>this.messageListener(n)):e.on("data",n=>this.messageListener(n)))}messageListener(e){var n,r,i;if(!e)throw new Xe("Should not call messageListener with no data. Type was");const s=((n=e.params)===null||n===void 0?void 0:n.subscription)||((r=e.data)===null||r===void 0?void 0:r.subscription)||((i=e.id)===null||i===void 0?void 0:i.toString(16));if(s){const o=this._subscriptions.get(s);o==null||o.processSubscriptionData(e)}}subscribe(e,n,r=j){return sr(this,void 0,void 0,function*(){const i=this.registeredSubscriptions[e];if(!i)throw new Xe("Invalid subscription type");const s=new i(n??void 0,{subscriptionManager:this,returnFormat:r});return yield this.addSubscription(s),s})}get subscriptions(){return this._subscriptions}addSubscription(e){return sr(this,void 0,void 0,function*(){if(!this.requestManager.provider)throw new ei("Provider not available");if(!this.supportsSubscriptions())throw new Xe("The current provider does not support subscriptions");if(e.id&&this._subscriptions.has(e.id))throw new Xe(`Subscription with id "${e.id}" already exists`);if(yield e.sendSubscriptionRequest(),Z(e.id))throw new Xe("Subscription is not subscribed yet.");return this._subscriptions.set(e.id,e),e.id})}removeSubscription(e){return sr(this,void 0,void 0,function*(){const{id:n}=e;if(Z(n))throw new Xe("Subscription is not subscribed yet. Or, had already been unsubscribed but not through the Subscription Manager.");if(!this._subscriptions.has(n)&&!this.tolerateUnlinkedSubscription)throw new Xe(`Subscription with id "${n.toString()}" does not exists`);return yield e.sendUnsubscribeRequest(),this._subscriptions.delete(n),n})}unsubscribe(e){return sr(this,void 0,void 0,function*(){const n=[];for(const[r,i]of this.subscriptions.entries())(!e||typeof e=="function"&&e({id:r,sub:i}))&&n.push(this.removeSubscription(i));return Promise.all(n)})}clear(){this._subscriptions.clear()}supportsSubscriptions(){return Z(this.requestManager.provider)?!1:Hg(this.requestManager.provider)}}var or=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class Zr extends hs{constructor(e,n){var r;super(),this.args=e;const{requestManager:i}=n,{subscriptionManager:s}=n;if(i&&s)throw new Xe("Only requestManager or subscriptionManager should be provided at Subscription constructor");if(!i&&!s)throw new Xe("Either requestManager or subscriptionManager should be provided at Subscription constructor");i?this._subscriptionManager=new co(i,{},!0):this._subscriptionManager=s,this._returnFormat=(r=n==null?void 0:n.returnFormat)!==null&&r!==void 0?r:j}get id(){return this._id}get lastBlock(){return this._lastBlock}subscribe(){return or(this,void 0,void 0,function*(){return this._subscriptionManager.addSubscription(this)})}processSubscriptionData(e){var n,r;e!=null&&e.data?this._processSubscriptionResult((r=(n=e==null?void 0:e.data)===null||n===void 0?void 0:n.result)!==null&&r!==void 0?r:e==null?void 0:e.data):e&&fs(e)&&this._processSubscriptionResult(e==null?void 0:e.params.result)}sendSubscriptionRequest(){return or(this,void 0,void 0,function*(){return this._id=yield this._subscriptionManager.requestManager.send({method:"eth_subscribe",params:this._buildSubscriptionParams()}),this.emit("connected",this._id),this._id})}get returnFormat(){return this._returnFormat}get subscriptionManager(){return this._subscriptionManager}resubscribe(){return or(this,void 0,void 0,function*(){yield this.unsubscribe(),yield this.subscribe()})}unsubscribe(){return or(this,void 0,void 0,function*(){this.id&&(yield this._subscriptionManager.removeSubscription(this))})}sendUnsubscribeRequest(){return or(this,void 0,void 0,function*(){yield this._subscriptionManager.requestManager.send({method:"eth_unsubscribe",params:[this.id]}),this._id=void 0})}formatSubscriptionResult(e){return e}_processSubscriptionResult(e){this.emit("data",this.formatSubscriptionResult(e))}_processSubscriptionError(e){this.emit("error",e)}_buildSubscriptionParams(){throw new Error("Implement in the child class")}}var hc=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const Fg=1e3;class jg{constructor(e){this._requestManager=e,this._requests=new Map}get requests(){return[...this._requests.values()].map(e=>e.payload)}add(e){const n=mn(e),r=new Fi;return this._requests.set(n.id,{payload:n,promise:r}),r}execute(e){var n;return hc(this,void 0,void 0,function*(){if(this.requests.length===0)return Promise.resolve([]);const r=new Fi({timeout:(n=e==null?void 0:e.timeout)!==null&&n!==void 0?n:Fg,eagerStart:!0,timeoutMessage:"Batch request timeout"});return this._processBatchRequest(r).catch(i=>r.reject(i)),r.catch(i=>{i instanceof Kc&&this._abortAllRequests("Batch request timeout"),r.reject(i)}),r})}_processBatchRequest(e){var n,r;return hc(this,void 0,void 0,function*(){const i=yield this._requestManager.sendBatch([...this._requests.values()].map(a=>a.payload));if(i.length!==this._requests.size)throw this._abortAllRequests("Invalid batch response"),new gt(i,`Batch request size mismatch the results size. Requests: ${this._requests.size}, Responses: ${i.length}`);const s=this.requests.map(a=>a.id).map(Number).sort((a,u)=>a-u),o=i.map(a=>a.id).map(Number).sort((a,u)=>a-u);if(JSON.stringify(s)!==JSON.stringify(o))throw this._abortAllRequests("Invalid batch response"),new gt(i,`Batch request mismatch the results. Requests: [${s.join()}], Responses: [${o.join()}]`);for(const a of i)bt(a)?(n=this._requests.get(a.id))===null||n===void 0||n.promise.resolve(a.result):wt(a)&&((r=this._requests.get(a.id))===null||r===void 0||r.promise.reject(a.error));e.resolve(i)})}_abortAllRequests(e){for(const{promise:n}of this._requests.values())n.reject(new Xh(e))}}var Ug=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class lt extends Rg{constructor(e){var n;if(super(),this.providers=sn.providers,Z(e)||typeof e=="string"&&e.trim()!==""||ji(e)){this._requestManager=new sn(e),this._subscriptionManager=new co(this._requestManager,{});return}const{config:r,provider:i,requestManager:s,subscriptionManager:o,registeredSubscriptions:a,accountProvider:u,wallet:d}=e;this.setConfig(r??{}),this._requestManager=s??new sn(i,(n=r==null?void 0:r.enableExperimentalFeatures)===null||n===void 0?void 0:n.useSubscriptionWhenCheckingBlockTimeout),o?this._subscriptionManager=o:this._subscriptionManager=new co(this.requestManager,a??{}),u&&(this._accountProvider=u),d&&(this._wallet=d)}get requestManager(){return this._requestManager}get subscriptionManager(){return this._subscriptionManager}get wallet(){return this._wallet}get accountProvider(){return this._accountProvider}static fromContextObject(...e){return new this(...e.reverse())}getContextObject(){var e;return{config:this.config,provider:this.provider,requestManager:this.requestManager,subscriptionManager:this.subscriptionManager,registeredSubscriptions:(e=this.subscriptionManager)===null||e===void 0?void 0:e.registeredSubscriptions,providers:this.providers,wallet:this.wallet,accountProvider:this.accountProvider}}use(e,...n){const r=new e(...n,this.getContextObject());return this.on(Qn.CONFIG_CHANGE,i=>{r.setConfig({[i.name]:i.newValue})}),r}link(e){this.setConfig(e.config),this._requestManager=e.requestManager,this.provider=e.provider,this._subscriptionManager=e.subscriptionManager,this._wallet=e.wallet,this._accountProvider=e._accountProvider,e.on(Qn.CONFIG_CHANGE,n=>{this.setConfig({[n.name]:n.newValue})})}registerPlugin(e){if(this[e.pluginNamespace]!==void 0)throw new Yh(e.pluginNamespace);const n={[e.pluginNamespace]:e};n[e.pluginNamespace].link(this),Object.assign(this,n)}get provider(){return this.currentProvider}set provider(e){this.requestManager.setProvider(e)}get currentProvider(){return this.requestManager.provider}set currentProvider(e){this.requestManager.setProvider(e)}get givenProvider(){return lt.givenProvider}setProvider(e){return this.provider=e,!0}get BatchRequest(){return jg.bind(void 0,this._requestManager)}extend(e){var n;return e.property&&!this[e.property]&&(this[e.property]={}),(n=e.methods)===null||n===void 0||n.forEach(r=>{const i=(...s)=>Ug(this,void 0,void 0,function*(){return this.requestManager.send({method:r.call,params:s})});e.property?this[e.property][r.name]=i:this[r.name]=i}),this}}lt.providers=sn.providers;class _e{constructor(e){if(this.toAddress=()=>{if(this.isDirect()){const n=this._iban.slice(4),r=_e._parseInt(n,36),i=Rr(r,40);return ft(i)}throw new Error("Iban is indirect and cannot be converted. Must be length of 34 or 35")},_e.isIndirect(e)||_e.isDirect(e))this._iban=e;else throw new Error("Invalid IBAN was provided")}static isDirect(e){return e.length===34||e.length===35}isDirect(){return _e.isDirect(this._iban)}static isIndirect(e){return e.length===20}isIndirect(){return _e.isIndirect(this._iban)}static isValid(e){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(e)&&_e._mod9710(_e._iso13616Prepare(e))===1}isValid(){return _e.isValid(this._iban)}static fromBban(e){const n="XE",i=`0${(98-this._mod9710(this._iso13616Prepare(`${n}00${e}`))).toString()}`.slice(-2);return new _e(`${n}${i}${e}`)}static createIndirect(e){return _e.fromBban(`ETH${e.institution}${e.identifier}`)}static fromAddress(e){if(!Ke(e))throw new Fo(e);const r=BigInt(zr(e)).toString(36),i=Rr(r,15);return _e.fromBban(i.toUpperCase())}static toIban(e){return _e.fromAddress(e).toString()}client(){return this.isIndirect()?this._iban.slice(11):""}checksum(){return this._iban.slice(2,4)}institution(){return this.isIndirect()?this._iban.slice(7,11):""}toString(){return this._iban}}_e._iso13616Prepare=t=>{const e="A".charCodeAt(0),n="Z".charCodeAt(0),r=t.toUpperCase();return`${r.slice(4)}${r.slice(0,4)}`.split("").map(s=>{const o=s.charCodeAt(0);return o>=e&&o<=n?o-e+10:s}).join("")};_e._parseInt=(t,e)=>[...t].reduce((n,r)=>BigInt(parseInt(r,e))+BigInt(e)*n,BigInt(0));_e._mod9710=t=>{let e=t,n;for(;e.length>2;)n=e.slice(0,9),e=`${(parseInt(n,10)%97).toString()}${e.slice(n.length)}`;return parseInt(e,10)%97};_e.toAddress=t=>new _e(t).toAddress();var Ls=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})},dd;class ld extends hs{constructor(e){super(),this[dd]="Promise",this._promise=new Promise(e)}then(e,n){return Ls(this,void 0,void 0,function*(){return this._promise.then(e,n)})}catch(e){return Ls(this,void 0,void 0,function*(){return this._promise.catch(e)})}finally(e){return Ls(this,void 0,void 0,function*(){return this._promise.finally(e)})}on(e,n){return super.on(e,n),this}once(e,n){return super.once(e,n),this}}dd=Symbol.toStringTag;(function(t,e){if(t.setImmediate)return;var n=1,r={},i=!1,s=t.document,o;function a(_){typeof _!="function"&&(_=new Function(""+_));for(var E=new Array(arguments.length-1),T=0;T<E.length;T++)E[T]=arguments[T+1];var x={callback:_,args:E};return r[n]=x,o(n),n++}function u(_){delete r[_]}function d(_){var E=_.callback,T=_.args;switch(T.length){case 0:E();break;case 1:E(T[0]);break;case 2:E(T[0],T[1]);break;case 3:E(T[0],T[1],T[2]);break;default:E.apply(e,T);break}}function c(_){if(i)setTimeout(c,0,_);else{var E=r[_];if(E){i=!0;try{d(E)}finally{u(_),i=!1}}}}function l(){o=function(_){process.nextTick(function(){c(_)})}}function f(){if(t.postMessage&&!t.importScripts){var _=!0,E=t.onmessage;return t.onmessage=function(){_=!1},t.postMessage("","*"),t.onmessage=E,_}}function m(){var _="setImmediate$"+Math.random()+"$",E=function(T){T.source===t&&typeof T.data=="string"&&T.data.indexOf(_)===0&&c(+T.data.slice(_.length))};t.addEventListener?t.addEventListener("message",E,!1):t.attachEvent("onmessage",E),o=function(T){t.postMessage(_+T,"*")}}function g(){var _=new MessageChannel;_.port1.onmessage=function(E){var T=E.data;c(T)},o=function(E){_.port2.postMessage(E)}}function p(){var _=s.documentElement;o=function(E){var T=s.createElement("script");T.onreadystatechange=function(){c(E),T.onreadystatechange=null,_.removeChild(T),T=null},_.appendChild(T)}}function y(){o=function(_){setTimeout(c,0,_)}}var b=Object.getPrototypeOf&&Object.getPrototypeOf(t);b=b&&b.setTimeout?b:t,{}.toString.call(t.process)==="[object process]"?l():f()?m():t.MessageChannel?g():s&&"onreadystatechange"in s.createElement("script")?p():y(),b.setImmediate=a,b.clearImmediate=u})(typeof self>"u"?(typeof tn.commonjsGlobal>"u",tn.commonjsGlobal):self);var X=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};function Gg(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_protocolVersion",params:[]})})}function fd(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_syncing",params:[]})})}function qg(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_coinbase",params:[]})})}function Vg(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_mining",params:[]})})}function zg(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_hashrate",params:[]})})}function Qg(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_gasPrice",params:[]})})}function Zg(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_accounts",params:[]})})}function Wg(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_blockNumber",params:[]})})}function $g(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["address","blockNumberOrTag"],[e,n]),t.send({method:"eth_getBalance",params:[e,n]})})}function Kg(t,e,n,r){return X(this,void 0,void 0,function*(){return V.validate(["address","hex","blockNumberOrTag"],[e,n,r]),t.send({method:"eth_getStorageAt",params:[e,n,r]})})}function Jg(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["address","blockNumberOrTag"],[e,n]),t.send({method:"eth_getTransactionCount",params:[e,n]})})}function Xg(t,e){return X(this,void 0,void 0,function*(){return V.validate(["bytes32"],[e]),t.send({method:"eth_getBlockTransactionCountByHash",params:[e]})})}function Yg(t,e){return X(this,void 0,void 0,function*(){return V.validate(["blockNumberOrTag"],[e]),t.send({method:"eth_getBlockTransactionCountByNumber",params:[e]})})}function ey(t,e){return X(this,void 0,void 0,function*(){return V.validate(["bytes32"],[e]),t.send({method:"eth_getUncleCountByBlockHash",params:[e]})})}function ty(t,e){return X(this,void 0,void 0,function*(){return V.validate(["blockNumberOrTag"],[e]),t.send({method:"eth_getUncleCountByBlockNumber",params:[e]})})}function ny(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["address","blockNumberOrTag"],[e,n]),t.send({method:"eth_getCode",params:[e,n]})})}function ry(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["address","hex"],[e,n]),t.send({method:"eth_sign",params:[e,n]})})}function iy(t,e){return X(this,void 0,void 0,function*(){return t.send({method:"eth_signTransaction",params:[e]})})}function sy(t,e){return X(this,void 0,void 0,function*(){return t.send({method:"eth_sendTransaction",params:[e]})})}function hd(t,e){return X(this,void 0,void 0,function*(){return V.validate(["hex"],[e]),t.send({method:"eth_sendRawTransaction",params:[e]})})}function oy(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["blockNumberOrTag"],[n]),t.send({method:"eth_call",params:[e,n]})})}function ay(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["blockNumberOrTag"],[n]),t.send({method:"eth_estimateGas",params:[e,n]})})}function cy(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["bytes32","bool"],[e,n]),t.send({method:"eth_getBlockByHash",params:[e,n]})})}function md(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["blockNumberOrTag","bool"],[e,n]),t.send({method:"eth_getBlockByNumber",params:[e,n]})})}function uy(t,e){return X(this,void 0,void 0,function*(){return V.validate(["bytes32"],[e]),t.send({method:"eth_getTransactionByHash",params:[e]})})}function dy(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["bytes32","hex"],[e,n]),t.send({method:"eth_getTransactionByBlockHashAndIndex",params:[e,n]})})}function ly(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["blockNumberOrTag","hex"],[e,n]),t.send({method:"eth_getTransactionByBlockNumberAndIndex",params:[e,n]})})}function fy(t,e){return X(this,void 0,void 0,function*(){return V.validate(["bytes32"],[e]),t.send({method:"eth_getTransactionReceipt",params:[e]})})}function hy(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["bytes32","hex"],[e,n]),t.send({method:"eth_getUncleByBlockHashAndIndex",params:[e,n]})})}function my(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["blockNumberOrTag","hex"],[e,n]),t.send({method:"eth_getUncleByBlockNumberAndIndex",params:[e,n]})})}function py(t,e){return X(this,void 0,void 0,function*(){return V.validate(["filter"],[e]),t.send({method:"eth_getLogs",params:[e]})})}function gy(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_getWork",params:[]})})}function yy(t,e,n,r){return X(this,void 0,void 0,function*(){return V.validate(["bytes8","bytes32","bytes32"],[e,n,r]),t.send({method:"eth_submitWork",params:[e,n,r]})})}function vy(t,e,n,r){return X(this,void 0,void 0,function*(){V.validate(["hex","blockNumberOrTag"],[e,n]);for(const i of r)V.validate(["number"],[i]);return t.send({method:"eth_feeHistory",params:[e,n,r]})})}function by(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_pendingTransactions",params:[]})})}function wy(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_requestAccounts",params:[]})})}function Ay(t){return X(this,void 0,void 0,function*(){return t.send({method:"eth_chainId",params:[]})})}function _y(t,e,n,r){return X(this,void 0,void 0,function*(){return V.validate(["address","bytes32[]","blockNumberOrTag"],[e,n,r]),t.send({method:"eth_getProof",params:[e,n,r]})})}function Ey(t){return X(this,void 0,void 0,function*(){return t.send({method:"web3_clientVersion",params:[]})})}function xy(t,e,n){return X(this,void 0,void 0,function*(){return V.validate(["blockNumberOrTag"],[n]),t.send({method:"eth_createAccessList",params:[e,n]})})}function Iy(t,e,n,r=!1){return X(this,void 0,void 0,function*(){return V.validate(["address"],[e]),t.send({method:`eth_signTypedData${r?"":"_v4"}`,params:[e,n]})})}var aa=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};function Ty(t){return aa(this,void 0,void 0,function*(){return t.send({method:"net_version",params:[]})})}function Sy(t){return aa(this,void 0,void 0,function*(){return t.send({method:"net_peerCount",params:[]})})}function ky(t){return aa(this,void 0,void 0,function*(){return t.send({method:"net_listening",params:[]})})}var It=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const By=t=>It(void 0,void 0,void 0,function*(){return t.send({method:"personal_listAccounts",params:[]})}),Cy=(t,e)=>It(void 0,void 0,void 0,function*(){return t.send({method:"personal_newAccount",params:[e]})}),Ry=(t,e,n,r)=>It(void 0,void 0,void 0,function*(){return t.send({method:"personal_unlockAccount",params:[e,n,r]})}),Py=(t,e)=>It(void 0,void 0,void 0,function*(){return t.send({method:"personal_lockAccount",params:[e]})}),Ny=(t,e,n)=>It(void 0,void 0,void 0,function*(){return t.send({method:"personal_importRawKey",params:[e,n]})}),Oy=(t,e,n)=>It(void 0,void 0,void 0,function*(){return t.send({method:"personal_sendTransaction",params:[e,n]})}),My=(t,e,n)=>It(void 0,void 0,void 0,function*(){return t.send({method:"personal_signTransaction",params:[e,n]})}),Ly=(t,e,n,r)=>It(void 0,void 0,void 0,function*(){return t.send({method:"personal_sign",params:[e,n,r]})}),Dy=(t,e,n)=>It(void 0,void 0,void 0,function*(){return t.send({method:"personal_ecRecover",params:[e,n]})});var xn=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class Ui extends P0{constructor(){super(...arguments),this._addressMap=new Map,this._defaultKeyName="web3js_wallet"}static getStorage(){let e;try{e=window.localStorage;const n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch(n){return n&&(n.code===22||n.code===1014||n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")&&!A(e)&&e.length!==0?e:void 0}}create(e){for(let n=0;n<e;n+=1)this.add(this._accountProvider.create());return this}add(e){var n;if(typeof e=="string")return this.add(this._accountProvider.privateKeyToAccount(e));let r=this.length;return this.get(e.address)&&(console.warn(`Account ${e.address.toLowerCase()} already exists.`),r=(n=this._addressMap.get(e.address.toLowerCase()))!==null&&n!==void 0?n:r),this._addressMap.set(e.address.toLowerCase(),r),this[r]=e,this}get(e){if(typeof e=="string"){const n=this._addressMap.get(e.toLowerCase());return A(n)?void 0:this[n]}return this[e]}remove(e){if(typeof e=="string"){const n=this._addressMap.get(e.toLowerCase());return A(n)?!1:(this._addressMap.delete(e.toLowerCase()),this.splice(n,1),!0)}return this[e]?(this.splice(e,1),!0):!1}clear(){return this._addressMap.clear(),this.length=0,this}encrypt(e,n){return xn(this,void 0,void 0,function*(){return Promise.all(this.map(r=>xn(this,void 0,void 0,function*(){return r.encrypt(e,n)})))})}decrypt(e,n,r){return xn(this,void 0,void 0,function*(){const i=yield Promise.all(e.map(s=>xn(this,void 0,void 0,function*(){return this._accountProvider.decrypt(s,n,r)})));for(const s of i)this.add(s);return this})}save(e,n){return xn(this,void 0,void 0,function*(){const r=Ui.getStorage();if(!r)throw new Error("Local storage not available.");return r.setItem(n??this._defaultKeyName,JSON.stringify(yield this.encrypt(e))),!0})}load(e,n){return xn(this,void 0,void 0,function*(){const r=Ui.getStorage();if(!r)throw new Error("Local storage not available.");const i=r.getItem(n??this._defaultKeyName);return i&&(yield this.decrypt(JSON.parse(i)||[],e)),this})}}const at={web:ti};function pd(t,e,n){if(!n.startsWith("aes-"))throw new Error(`AES submodule doesn't support mode ${n}`);if(e.length!==16)throw new Error("AES: wrong IV length");if(n.startsWith("aes-128")&&t.length!==16||n.startsWith("aes-256")&&t.length!==32)throw new Error("AES: wrong key length")}async function gd(t,e,n){if(!at.web)throw new Error("Browser crypto not available.");let r;if(["aes-128-cbc","aes-256-cbc"].includes(t)&&(r="cbc"),["aes-128-ctr","aes-256-ctr"].includes(t)&&(r="ctr"),!r)throw new Error("AES: unsupported mode");return[await at.web.subtle.importKey("raw",e,{name:`AES-${r.toUpperCase()}`,length:e.length*8},!0,["encrypt","decrypt"]),{name:`aes-${r}`,iv:n,counter:n,length:128}]}async function ca(t,e,n,r="aes-128-ctr",i=!0){if(pd(e,n,r),at.web){const[s,o]=await gd(r,e,n),a=await at.web.subtle.encrypt(o,s,t);let u=new Uint8Array(a);return!i&&o.name==="aes-cbc"&&!(t.length%16)&&(u=u.slice(0,-16)),u}else if(at.node){const s=at.node.createCipheriv(r,e,n);return s.setAutoPadding(i),Ei(s.update(t),s.final())}else throw new Error("The environment doesn't have AES module")}async function Hy(t,e,n,r){const i=t.slice(-16);for(let o=0;o<16;o++)i[o]^=n[o]^16;return(await ca(i,e,n,r)).slice(0,16)}async function Fy(t,e,n,r="aes-128-ctr",i=!0){if(pd(e,n,r),at.web){const[s,o]=await gd(r,e,n);if(!i&&o.name==="aes-cbc"){const d=await Hy(t,e,n,r);t=Ei(t,d)}const a=await at.web.subtle.decrypt(o,s,t),u=new Uint8Array(a);if(o.name==="aes-cbc"){const d=await ca(u,e,n,r);if(!Bp(d,t))throw new Error("AES: wrong padding")}return u}else if(at.node){const s=at.node.createDecipheriv(r,e,n);return s.setAutoPadding(i),Ei(s.update(t),s.final())}else throw new Error("The environment doesn't have AES module")}class yd extends Uo{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,pe.hash(e);const r=cn(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return pe.exists(this),this.iHash.update(e),this}digestInto(e){pe.exists(this),pe.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ua=(t,e,n)=>new yd(t,e).update(n).digest();ua.create=(t,e)=>new yd(t,e);function jy(t,e,n,r){pe.hash(t);const i=uu({dkLen:32,asyncTick:10},r),{c:s,dkLen:o,asyncTick:a}=i;if(pe.number(s),pe.number(o),pe.number(a),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const u=cn(e),d=cn(n),c=new Uint8Array(o),l=ua.create(t,u),f=l._cloneInto().update(d);return{c:s,dkLen:o,asyncTick:a,DK:c,PRF:l,PRFSalt:f}}function Uy(t,e,n,r,i){return t.destroy(),e.destroy(),r&&r.destroy(),i.fill(0),n}function da(t,e,n,r){const{c:i,dkLen:s,DK:o,PRF:a,PRFSalt:u}=jy(t,e,n,r);let d;const c=new Uint8Array(4),l=ri(c),f=new Uint8Array(a.outputLen);for(let m=1,g=0;g<s;m++,g+=a.outputLen){const p=o.subarray(g,g+a.outputLen);l.setInt32(0,m,!1),(d=u._cloneInto(d)).update(c).digestInto(f),p.set(f.subarray(0,p.length));for(let y=1;y<i;y++){a._cloneInto(d).update(f).digestInto(f);for(let b=0;b<p.length;b++)p[b]^=f[b]}}return Uy(a,u,o,d,f)}function Gy(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),u=r?4:0,d=r?0:4;t.setUint32(e+u,o,r),t.setUint32(e+d,a,r)}class vd extends Uo{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ri(this.buffer)}update(e){pe.exists(this);const{view:n,buffer:r,blockLen:i}=this;e=cn(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const u=ri(e);for(;i<=s-o;o+=i)this.process(u,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){pe.exists(this),pe.output(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(r,0),o=0);for(let l=o;l<i;l++)n[l]=0;Gy(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=ri(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=u/4,c=this.get();if(d>c.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<d;l++)a.setUint32(4*l,c[l],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%n&&e.buffer.set(r),e}}const qy=(t,e,n)=>t&e^~t&n,Vy=(t,e,n)=>t&e^t&n^e&n,zy=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),kt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Bt=new Uint32Array(64);class bd extends vd{constructor(){super(64,32,8,!1),this.A=kt[0]|0,this.B=kt[1]|0,this.C=kt[2]|0,this.D=kt[3]|0,this.E=kt[4]|0,this.F=kt[5]|0,this.G=kt[6]|0,this.H=kt[7]|0}get(){const{A:e,B:n,C:r,D:i,E:s,F:o,G:a,H:u}=this;return[e,n,r,i,s,o,a,u]}set(e,n,r,i,s,o,a,u){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=u|0}process(e,n){for(let l=0;l<16;l++,n+=4)Bt[l]=e.getUint32(n,!1);for(let l=16;l<64;l++){const f=Bt[l-15],m=Bt[l-2],g=it(f,7)^it(f,18)^f>>>3,p=it(m,17)^it(m,19)^m>>>10;Bt[l]=p+Bt[l-7]+g+Bt[l-16]|0}let{A:r,B:i,C:s,D:o,E:a,F:u,G:d,H:c}=this;for(let l=0;l<64;l++){const f=it(a,6)^it(a,11)^it(a,25),m=c+f+qy(a,u,d)+zy[l]+Bt[l]|0,p=(it(r,2)^it(r,13)^it(r,22))+Vy(r,i,s)|0;c=d,d=u,u=a,a=o+m|0,o=s,s=i,i=r,r=m+p|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,u=u+this.F|0,d=d+this.G|0,c=c+this.H|0,this.set(r,i,s,o,a,u,d,c)}roundClean(){Bt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class Qy extends bd{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const ms=yn(()=>new bd);yn(()=>new Qy);const[Zy,Wy]=Q.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ct=new Uint32Array(80),Rt=new Uint32Array(80);class ps extends vd{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:s,Cl:o,Dh:a,Dl:u,Eh:d,El:c,Fh:l,Fl:f,Gh:m,Gl:g,Hh:p,Hl:y}=this;return[e,n,r,i,s,o,a,u,d,c,l,f,m,g,p,y]}set(e,n,r,i,s,o,a,u,d,c,l,f,m,g,p,y){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=u|0,this.Eh=d|0,this.El=c|0,this.Fh=l|0,this.Fl=f|0,this.Gh=m|0,this.Gl=g|0,this.Hh=p|0,this.Hl=y|0}process(e,n){for(let E=0;E<16;E++,n+=4)Ct[E]=e.getUint32(n),Rt[E]=e.getUint32(n+=4);for(let E=16;E<80;E++){const T=Ct[E-15]|0,x=Rt[E-15]|0,B=Q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l:f}=Q.add(this.Eh|0,this.El|0,l|0,f|0),{h:m,l:g}=Q.add(this.Fh|0,this.Fl|0,m|0,g|0),{h:p,l:y}=Q.add(this.Gh|0,this.Gl|0,p|0,y|0),{h:b,l:_}=Q.add(this.Hh|0,this.Hl|0,b|0,_|0),this.set(r,i,s,o,a,u,d,c,l,f,m,g,p,y,b,_)}roundClean(){Ct.fill(0),Rt.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class $y extends ps{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class Ky extends ps{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class Jy extends ps{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const Xy=yn(()=>new ps);yn(()=>new $y);yn(()=>new Ky);yn(()=>new Jy);function wd(t,e,n,r,i){if(!["sha256","sha512"].includes(i))throw new Error("Only sha256 and sha512 are supported");return xi(t),xi(e),da(i==="sha256"?ms:Xy,t,e,{c:n,dkLen:r})}const se=(t,e)=>t<<e|t>>>32-e;function mc(t,e,n,r,i,s){let o=t[e++]^n[r++],a=t[e++]^n[r++],u=t[e++]^n[r++],d=t[e++]^n[r++],c=t[e++]^n[r++],l=t[e++]^n[r++],f=t[e++]^n[r++],m=t[e++]^n[r++],g=t[e++]^n[r++],p=t[e++]^n[r++],y=t[e++]^n[r++],b=t[e++]^n[r++],_=t[e++]^n[r++],E=t[e++]^n[r++],T=t[e++]^n[r++],x=t[e++]^n[r++],B=o,R=a,w=u,L=d,I=c,P=l,O=f,z=m,le=g,h=p,v=y,C=b,D=_,H=E,F=T,fe=x;for(let Ee=0;Ee<8;Ee+=2)I^=se(B+D|0,7),le^=se(I+B|0,9),D^=se(le+I|0,13),B^=se(D+le|0,18),h^=se(P+R|0,7),H^=se(h+P|0,9),R^=se(H+h|0,13),P^=se(R+H|0,18),F^=se(v+O|0,7),w^=se(F+v|0,9),O^=se(w+F|0,13),v^=se(O+w|0,18),L^=se(fe+C|0,7),z^=se(L+fe|0,9),C^=se(z+L|0,13),fe^=se(C+z|0,18),R^=se(B+L|0,7),w^=se(R+B|0,9),L^=se(w+R|0,13),B^=se(L+w|0,18),O^=se(P+I|0,7),z^=se(O+P|0,9),I^=se(z+O|0,13),P^=se(I+z|0,18),C^=se(v+h|0,7),le^=se(C+v|0,9),h^=se(le+C|0,13),v^=se(h+le|0,18),D^=se(fe+F|0,7),H^=se(D+fe|0,9),F^=se(H+D|0,13),fe^=se(F+H|0,18);i[s++]=o+B|0,i[s++]=a+R|0,i[s++]=u+w|0,i[s++]=d+L|0,i[s++]=c+I|0,i[s++]=l+P|0,i[s++]=f+O|0,i[s++]=m+z|0,i[s++]=g+le|0,i[s++]=p+h|0,i[s++]=y+v|0,i[s++]=b+C|0,i[s++]=_+D|0,i[s++]=E+H|0,i[s++]=T+F|0,i[s++]=x+fe|0}function Ds(t,e,n,r,i){let s=r+0,o=r+16*i;for(let a=0;a<16;a++)n[o+a]=t[e+(2*i-1)*16+a];for(let a=0;a<i;a++,s+=16,e+=16)mc(n,o,t,e,n,s),a>0&&(o+=16),mc(n,s,t,e+=16,n,o)}function Yy(t,e,n){const r=uu({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:i,r:s,p:o,dkLen:a,asyncTick:u,maxmem:d,onProgress:c}=r;if(pe.number(i),pe.number(s),pe.number(o),pe.number(a),pe.number(u),pe.number(d),c!==void 0&&typeof c!="function")throw new Error("progressCb should be function");const l=128*s,f=l/4;if(i<=1||i&i-1||i>=2**(l/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/l)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const m=l*(i+o);if(m>d)throw new Error(`Scrypt: parameters too large, ${m} (128 * r * (N + p)) > ${d} (maxmem)`);const g=da(ms,t,e,{c:1,dkLen:l*o}),p=ni(g),y=ni(new Uint8Array(l*i)),b=ni(new Uint8Array(l));let _=()=>{};if(c){const E=2*i*o,T=Math.max(Math.floor(E/1e4),1);let x=0;_=()=>{x++,c&&(!(x%T)||x===E)&&c(x/E)}}return{N:i,r:s,p:o,dkLen:a,blockSize32:f,V:y,B32:p,B:g,tmp:b,blockMixCb:_,asyncTick:u}}function ev(t,e,n,r,i){const s=da(ms,t,n,{c:1,dkLen:e});return n.fill(0),r.fill(0),i.fill(0),s}function tv(t,e,n){const{N:r,r:i,p:s,dkLen:o,blockSize32:a,V:u,B32:d,B:c,tmp:l,blockMixCb:f}=Yy(t,e,n);for(let m=0;m<s;m++){const g=a*m;for(let p=0;p<a;p++)u[p]=d[g+p];for(let p=0,y=0;p<r-1;p++)Ds(u,y,u,y+=a,i),f();Ds(u,(r-1)*a,d,g,i),f();for(let p=0;p<r;p++){const y=d[g+a-16]%r;for(let b=0;b<a;b++)l[b]=d[g+b]^u[y*a+b];Ds(l,0,d,g,i),f()}}return ev(t,o,c,u,l)}function Ad(t,e,n,r,i,s,o){return xi(t),xi(e),tv(t,e,{N:n,r:i,p:r,dkLen:s,onProgress:o})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _d=BigInt(0),gs=BigInt(1),nv=BigInt(2),ys=t=>t instanceof Uint8Array,rv=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Wn(t){if(!ys(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=rv[t[n]];return e}function Ed(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function la(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function $n(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let r=0;r<n.length;r++){const i=r*2,s=t.slice(i,i+2),o=Number.parseInt(s,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");n[r]=o}return n}function on(t){return la(Wn(t))}function fa(t){if(!ys(t))throw new Error("Uint8Array expected");return la(Wn(Uint8Array.from(t).reverse()))}function Hn(t,e){return $n(t.toString(16).padStart(e*2,"0"))}function xd(t,e){return Hn(t,e).reverse()}function iv(t){return $n(Ed(t))}function Qe(t,e,n){let r;if(typeof e=="string")try{r=$n(e)}catch(s){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${s}`)}else if(ys(e))r=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(`${t} expected ${n} bytes, got ${i}`);return r}function Mr(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!ys(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function sv(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function ov(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function av(t){let e;for(e=0;t>_d;t>>=gs,e+=1);return e}function cv(t,e){return t>>BigInt(e)&gs}const uv=(t,e,n)=>t|(n?gs:_d)<<BigInt(e),ha=t=>(nv<<BigInt(t-1))-gs,Hs=t=>new Uint8Array(t),pc=t=>Uint8Array.from(t);function Id(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Hs(t),i=Hs(t),s=0;const o=()=>{r.fill(1),i.fill(0),s=0},a=(...l)=>n(i,r,...l),u=(l=Hs())=>{i=a(pc([0]),l),r=a(),l.length!==0&&(i=a(pc([1]),l),r=a())},d=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let l=0;const f=[];for(;l<e;){r=a();const m=r.slice();f.push(m),l+=r.length}return Mr(...f)};return(l,f)=>{o(),u(l);let m;for(;!(m=f(d()));)u();return o(),m}}const dv={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Wr(t,e,n={}){const r=(i,s,o)=>{const a=dv[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const u=t[i];if(!(o&&u===void 0)&&!a(u,t))throw new Error(`Invalid param ${String(i)}=${u} (${typeof u}), expected ${s}`)};for(const[i,s]of Object.entries(e))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return t}const lv=Object.freeze(Object.defineProperty({__proto__:null,bitGet:cv,bitLen:av,bitMask:ha,bitSet:uv,bytesToHex:Wn,bytesToNumberBE:on,bytesToNumberLE:fa,concatBytes:Mr,createHmacDrbg:Id,ensureBytes:Qe,equalBytes:sv,hexToBytes:$n,hexToNumber:la,numberToBytesBE:Hn,numberToBytesLE:xd,numberToHexUnpadded:Ed,numberToVarBytesBE:iv,utf8ToBytes:ov,validateObject:Wr},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ie=BigInt(0),Ae=BigInt(1),Wt=BigInt(2),fv=BigInt(3),uo=BigInt(4),gc=BigInt(5),yc=BigInt(8);BigInt(9);BigInt(16);function Oe(t,e){const n=t%e;return n>=Ie?n:e+n}function hv(t,e,n){if(n<=Ie||e<Ie)throw new Error("Expected power/modulo > 0");if(n===Ae)return Ie;let r=Ae;for(;e>Ie;)e&Ae&&(r=r*t%n),t=t*t%n,e>>=Ae;return r}function Ve(t,e,n){let r=t;for(;e-- >Ie;)r*=r,r%=n;return r}function lo(t,e){if(t===Ie||e<=Ie)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=Oe(t,e),r=e,i=Ie,s=Ae;for(;n!==Ie;){const a=r/n,u=r%n,d=i-s*a;r=n,n=u,i=s,s=d}if(r!==Ae)throw new Error("invert: does not exist");return Oe(i,e)}function mv(t){const e=(t-Ae)/Wt;let n,r,i;for(n=t-Ae,r=0;n%Wt===Ie;n/=Wt,r++);for(i=Wt;i<t&&hv(i,e,t)!==t-Ae;i++);if(r===1){const o=(t+Ae)/uo;return function(u,d){const c=u.pow(d,o);if(!u.eql(u.sqr(c),d))throw new Error("Cannot find square root");return c}}const s=(n+Ae)/Wt;return function(a,u){if(a.pow(u,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let d=r,c=a.pow(a.mul(a.ONE,i),n),l=a.pow(u,s),f=a.pow(u,n);for(;!a.eql(f,a.ONE);){if(a.eql(f,a.ZERO))return a.ZERO;let m=1;for(let p=a.sqr(f);m<d&&!a.eql(p,a.ONE);m++)p=a.sqr(p);const g=a.pow(c,Ae<<BigInt(d-m-1));c=a.sqr(g),l=a.mul(l,g),f=a.mul(f,c),d=m}return l}}function pv(t){if(t%uo===fv){const e=(t+Ae)/uo;return function(r,i){const s=r.pow(i,e);if(!r.eql(r.sqr(s),i))throw new Error("Cannot find square root");return s}}if(t%yc===gc){const e=(t-gc)/yc;return function(r,i){const s=r.mul(i,Wt),o=r.pow(s,e),a=r.mul(i,o),u=r.mul(r.mul(a,Wt),o),d=r.mul(a,r.sub(u,r.ONE));if(!r.eql(r.sqr(d),i))throw new Error("Cannot find square root");return d}}return mv(t)}const gv=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function yv(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=gv.reduce((r,i)=>(r[i]="function",r),e);return Wr(t,n)}function vv(t,e,n){if(n<Ie)throw new Error("Expected power > 0");if(n===Ie)return t.ONE;if(n===Ae)return e;let r=t.ONE,i=e;for(;n>Ie;)n&Ae&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Ae;return r}function bv(t,e){const n=new Array(e.length),r=e.reduce((s,o,a)=>t.is0(o)?s:(n[a]=s,t.mul(s,o)),t.ONE),i=t.inv(r);return e.reduceRight((s,o,a)=>t.is0(o)?s:(n[a]=t.mul(s,n[a]),t.mul(s,o)),i),n}function ma(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function wv(t,e,n=!1,r={}){if(t<=Ie)throw new Error(`Expected Fp ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=ma(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=pv(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:ha(i),ZERO:Ie,ONE:Ae,create:u=>Oe(u,t),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return Ie<=u&&u<t},is0:u=>u===Ie,isOdd:u=>(u&Ae)===Ae,neg:u=>Oe(-u,t),eql:(u,d)=>u===d,sqr:u=>Oe(u*u,t),add:(u,d)=>Oe(u+d,t),sub:(u,d)=>Oe(u-d,t),mul:(u,d)=>Oe(u*d,t),pow:(u,d)=>vv(a,u,d),div:(u,d)=>Oe(u*lo(d,t),t),sqrN:u=>u*u,addN:(u,d)=>u+d,subN:(u,d)=>u-d,mulN:(u,d)=>u*d,inv:u=>lo(u,t),sqrt:r.sqrt||(u=>o(a,u)),invertBatch:u=>bv(a,u),cmov:(u,d,c)=>c?d:u,toBytes:u=>n?xd(u,s):Hn(u,s),fromBytes:u=>{if(u.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${u.length}`);return n?fa(u):on(u)}});return Object.freeze(a)}function Av(t,e,n=!1){t=Qe("privateHash",t);const r=t.length,i=ma(e).nByteLength+8;if(i<24||r<i||r>1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${r}`);const s=n?fa(t):on(t);return Oe(s,e-Ae)+Ae}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _v=BigInt(0),Fs=BigInt(1);function Ev(t,e){const n=(i,s)=>{const o=s.negate();return i?o:s},r=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:n,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>_v;)s&Fs&&(o=o.add(a)),a=a.double(),s>>=Fs;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=r(s),u=[];let d=i,c=d;for(let l=0;l<o;l++){c=d,u.push(c);for(let f=1;f<a;f++)c=c.add(d),u.push(c);d=c.double()}return u},wNAF(i,s,o){const{windows:a,windowSize:u}=r(i);let d=t.ZERO,c=t.BASE;const l=BigInt(2**i-1),f=2**i,m=BigInt(i);for(let g=0;g<a;g++){const p=g*u;let y=Number(o&l);o>>=m,y>u&&(y-=f,o+=Fs);const b=p,_=p+Math.abs(y)-1,E=g%2!==0,T=y<0;y===0?c=c.add(n(E,s[b])):d=d.add(n(T,s[_]))}return{p:d,f:c}},wNAFCached(i,s,o,a){const u=i._WINDOW_SIZE||1;let d=s.get(i);return d||(d=this.precomputeWindow(i,u),u!==1&&s.set(i,a(d))),this.wNAF(u,d,o)}}}function Td(t){return yv(t.Fp),Wr(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ma(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function xv(t){const e=Td(t);Wr(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:Iv,hexToBytes:Tv}=lv,Kt={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Kt;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Iv(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Kt,n=typeof t=="string"?Tv(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=Kt._parseInt(n.subarray(2)),{d:o,l:a}=Kt._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=d=>Number.parseInt(d[0],16)&8?"00"+d:d,n=d=>{const c=d.toString(16);return c.length&1?`0${c}`:c},r=e(n(t.s)),i=e(n(t.r)),s=r.length/2,o=i.length/2,a=n(s),u=n(o);return`30${n(o+s+4)}02${u}${i}02${a}${r}`}},vt=BigInt(0),Ze=BigInt(1);BigInt(2);const vc=BigInt(3);BigInt(4);function Sv(t){const e=xv(t),{Fp:n}=e,r=e.toBytes||((g,p,y)=>{const b=p.toAffine();return Mr(Uint8Array.from([4]),n.toBytes(b.x),n.toBytes(b.y))}),i=e.fromBytes||(g=>{const p=g.subarray(1),y=n.fromBytes(p.subarray(0,n.BYTES)),b=n.fromBytes(p.subarray(n.BYTES,2*n.BYTES));return{x:y,y:b}});function s(g){const{a:p,b:y}=e,b=n.sqr(g),_=n.mul(b,g);return n.add(n.add(_,n.mul(g,p)),y)}if(!n.eql(n.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(g){return typeof g=="bigint"&&vt<g&&g<e.n}function a(g){if(!o(g))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function u(g){const{allowedPrivateKeyLengths:p,nByteLength:y,wrapPrivateKey:b,n:_}=e;if(p&&typeof g!="bigint"){if(g instanceof Uint8Array&&(g=Wn(g)),typeof g!="string"||!p.includes(g.length))throw new Error("Invalid key");g=g.padStart(y*2,"0")}let E;try{E=typeof g=="bigint"?g:on(Qe("private key",g,y))}catch{throw new Error(`private key must be ${y} bytes, hex or bigint, not ${typeof g}`)}return b&&(E=Oe(E,_)),a(E),E}const d=new Map;function c(g){if(!(g instanceof l))throw new Error("ProjectivePoint expected")}class l{constructor(p,y,b){if(this.px=p,this.py=y,this.pz=b,p==null||!n.isValid(p))throw new Error("x required");if(y==null||!n.isValid(y))throw new Error("y required");if(b==null||!n.isValid(b))throw new Error("z required")}static fromAffine(p){const{x:y,y:b}=p||{};if(!p||!n.isValid(y)||!n.isValid(b))throw new Error("invalid affine point");if(p instanceof l)throw new Error("projective point not allowed");const _=E=>n.eql(E,n.ZERO);return _(y)&&_(b)?l.ZERO:new l(y,b,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){const y=n.invertBatch(p.map(b=>b.pz));return p.map((b,_)=>b.toAffine(y[_])).map(l.fromAffine)}static fromHex(p){const y=l.fromAffine(i(Qe("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return l.BASE.multiply(u(p))}_setWindowSize(p){this._WINDOW_SIZE=p,d.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:p,y}=this.toAffine();if(!n.isValid(p)||!n.isValid(y))throw new Error("bad point: x or y not FE");const b=n.sqr(y),_=s(p);if(!n.eql(b,_))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:p}=this.toAffine();if(n.isOdd)return!n.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){c(p);const{px:y,py:b,pz:_}=this,{px:E,py:T,pz:x}=p,B=n.eql(n.mul(y,x),n.mul(E,_)),R=n.eql(n.mul(b,x),n.mul(T,_));return B&&R}negate(){return new l(this.px,n.neg(this.py),this.pz)}double(){const{a:p,b:y}=e,b=n.mul(y,vc),{px:_,py:E,pz:T}=this;let x=n.ZERO,B=n.ZERO,R=n.ZERO,w=n.mul(_,_),L=n.mul(E,E),I=n.mul(T,T),P=n.mul(_,E);return P=n.add(P,P),R=n.mul(_,T),R=n.add(R,R),x=n.mul(p,R),B=n.mul(b,I),B=n.add(x,B),x=n.sub(L,B),B=n.add(L,B),B=n.mul(x,B),x=n.mul(P,x),R=n.mul(b,R),I=n.mul(p,I),P=n.sub(w,I),P=n.mul(p,P),P=n.add(P,R),R=n.add(w,w),w=n.add(R,w),w=n.add(w,I),w=n.mul(w,P),B=n.add(B,w),I=n.mul(E,T),I=n.add(I,I),w=n.mul(I,P),x=n.sub(x,w),R=n.mul(I,L),R=n.add(R,R),R=n.add(R,R),new l(x,B,R)}add(p){c(p);const{px:y,py:b,pz:_}=this,{px:E,py:T,pz:x}=p;let B=n.ZERO,R=n.ZERO,w=n.ZERO;const L=e.a,I=n.mul(e.b,vc);let P=n.mul(y,E),O=n.mul(b,T),z=n.mul(_,x),le=n.add(y,b),h=n.add(E,T);le=n.mul(le,h),h=n.add(P,O),le=n.sub(le,h),h=n.add(y,_);let v=n.add(E,x);return h=n.mul(h,v),v=n.add(P,z),h=n.sub(h,v),v=n.add(b,_),B=n.add(T,x),v=n.mul(v,B),B=n.add(O,z),v=n.sub(v,B),w=n.mul(L,h),B=n.mul(I,z),w=n.add(B,w),B=n.sub(O,w),w=n.add(O,w),R=n.mul(B,w),O=n.add(P,P),O=n.add(O,P),z=n.mul(L,z),h=n.mul(I,h),O=n.add(O,z),z=n.sub(P,z),z=n.mul(L,z),h=n.add(h,z),P=n.mul(O,h),R=n.add(R,P),P=n.mul(v,h),B=n.mul(le,B),B=n.sub(B,P),P=n.mul(le,O),w=n.mul(v,w),w=n.add(w,P),new l(B,R,w)}subtract(p){return this.add(p.negate())}is0(){return this.equals(l.ZERO)}wNAF(p){return m.wNAFCached(this,d,p,y=>{const b=n.invertBatch(y.map(_=>_.pz));return y.map((_,E)=>_.toAffine(b[E])).map(l.fromAffine)})}multiplyUnsafe(p){const y=l.ZERO;if(p===vt)return y;if(a(p),p===Ze)return this;const{endo:b}=e;if(!b)return m.unsafeLadder(this,p);let{k1neg:_,k1:E,k2neg:T,k2:x}=b.splitScalar(p),B=y,R=y,w=this;for(;E>vt||x>vt;)E&Ze&&(B=B.add(w)),x&Ze&&(R=R.add(w)),w=w.double(),E>>=Ze,x>>=Ze;return _&&(B=B.negate()),T&&(R=R.negate()),R=new l(n.mul(R.px,b.beta),R.py,R.pz),B.add(R)}multiply(p){a(p);let y=p,b,_;const{endo:E}=e;if(E){const{k1neg:T,k1:x,k2neg:B,k2:R}=E.splitScalar(y);let{p:w,f:L}=this.wNAF(x),{p:I,f:P}=this.wNAF(R);w=m.constTimeNegate(T,w),I=m.constTimeNegate(B,I),I=new l(n.mul(I.px,E.beta),I.py,I.pz),b=w.add(I),_=L.add(P)}else{const{p:T,f:x}=this.wNAF(y);b=T,_=x}return l.normalizeZ([b,_])[0]}multiplyAndAddUnsafe(p,y,b){const _=l.BASE,E=(x,B)=>B===vt||B===Ze||!x.equals(_)?x.multiplyUnsafe(B):x.multiply(B),T=E(this,y).add(E(p,b));return T.is0()?void 0:T}toAffine(p){const{px:y,py:b,pz:_}=this,E=this.is0();p==null&&(p=E?n.ONE:n.inv(_));const T=n.mul(y,p),x=n.mul(b,p),B=n.mul(_,p);if(E)return{x:n.ZERO,y:n.ZERO};if(!n.eql(B,n.ONE))throw new Error("invZ was invalid");return{x:T,y:x}}isTorsionFree(){const{h:p,isTorsionFree:y}=e;if(p===Ze)return!0;if(y)return y(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:p,clearCofactor:y}=e;return p===Ze?this:y?y(l,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),r(l,this,p)}toHex(p=!0){return Wn(this.toRawBytes(p))}}l.BASE=new l(e.Gx,e.Gy,n.ONE),l.ZERO=new l(n.ZERO,n.ONE,n.ZERO);const f=e.nBitLength,m=Ev(l,e.endo?Math.ceil(f/2):f);return{CURVE:e,ProjectivePoint:l,normPrivateKeyToScalar:u,weierstrassEquation:s,isWithinCurveOrder:o}}function kv(t){const e=Td(t);return Wr(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Bv(t){const e=kv(t),{Fp:n,n:r}=e,i=n.BYTES+1,s=2*n.BYTES+1;function o(h){return vt<h&&h<n.ORDER}function a(h){return Oe(h,r)}function u(h){return lo(h,r)}const{ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:l,isWithinCurveOrder:f}=Sv({...e,toBytes(h,v,C){const D=v.toAffine(),H=n.toBytes(D.x),F=Mr;return C?F(Uint8Array.from([v.hasEvenY()?2:3]),H):F(Uint8Array.from([4]),H,n.toBytes(D.y))},fromBytes(h){const v=h.length,C=h[0],D=h.subarray(1);if(v===i&&(C===2||C===3)){const H=on(D);if(!o(H))throw new Error("Point is not on curve");const F=l(H);let fe=n.sqrt(F);const Ee=(fe&Ze)===Ze;return(C&1)===1!==Ee&&(fe=n.neg(fe)),{x:H,y:fe}}else if(v===s&&C===4){const H=n.fromBytes(D.subarray(0,n.BYTES)),F=n.fromBytes(D.subarray(n.BYTES,2*n.BYTES));return{x:H,y:F}}else throw new Error(`Point of length ${v} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),m=h=>Wn(Hn(h,e.nByteLength));function g(h){const v=r>>Ze;return h>v}function p(h){return g(h)?a(-h):h}const y=(h,v,C)=>on(h.slice(v,C));class b{constructor(v,C,D){this.r=v,this.s=C,this.recovery=D,this.assertValidity()}static fromCompact(v){const C=e.nByteLength;return v=Qe("compactSignature",v,C*2),new b(y(v,0,C),y(v,C,2*C))}static fromDER(v){const{r:C,s:D}=Kt.toSig(Qe("DER",v));return new b(C,D)}assertValidity(){if(!f(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!f(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(v){return new b(this.r,this.s,v)}recoverPublicKey(v){const{r:C,s:D,recovery:H}=this,F=R(Qe("msgHash",v));if(H==null||![0,1,2,3].includes(H))throw new Error("recovery id invalid");const fe=H===2||H===3?C+e.n:C;if(fe>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Ee=H&1?"03":"02",we=d.fromHex(Ee+m(fe)),He=u(fe),wn=a(-F*He),rr=a(D*He),St=d.BASE.multiplyAndAddUnsafe(we,wn,rr);if(!St)throw new Error("point at infinify");return St.assertValidity(),St}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return $n(this.toDERHex())}toDERHex(){return Kt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return $n(this.toCompactHex())}toCompactHex(){return m(this.r)+m(this.s)}}const _={isValidPrivateKey(h){try{return c(h),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const h=e.randomBytes(n.BYTES+8),v=Av(h,r);return Hn(v,e.nByteLength)},precompute(h=8,v=d.BASE){return v._setWindowSize(h),v.multiply(BigInt(3)),v}};function E(h,v=!0){return d.fromPrivateKey(h).toRawBytes(v)}function T(h){const v=h instanceof Uint8Array,C=typeof h=="string",D=(v||C)&&h.length;return v?D===i||D===s:C?D===2*i||D===2*s:h instanceof d}function x(h,v,C=!0){if(T(h))throw new Error("first arg must be private key");if(!T(v))throw new Error("second arg must be public key");return d.fromHex(v).multiply(c(h)).toRawBytes(C)}const B=e.bits2int||function(h){const v=on(h),C=h.length*8-e.nBitLength;return C>0?v>>BigInt(C):v},R=e.bits2int_modN||function(h){return a(B(h))},w=ha(e.nBitLength);function L(h){if(typeof h!="bigint")throw new Error("bigint expected");if(!(vt<=h&&h<w))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Hn(h,e.nByteLength)}function I(h,v,C=P){if(["recovered","canonical"].some(zt=>zt in C))throw new Error("sign() legacy options not supported");const{hash:D,randomBytes:H}=e;let{lowS:F,prehash:fe,extraEntropy:Ee}=C;F==null&&(F=!0),h=Qe("msgHash",h),fe&&(h=Qe("prehashed msgHash",D(h)));const we=R(h),He=c(v),wn=[L(He),L(we)];if(Ee!=null){const zt=Ee===!0?H(n.BYTES):Ee;wn.push(Qe("extraEntropy",zt,n.BYTES))}const rr=Mr(...wn),St=we;function Cs(zt){const An=B(zt);if(!f(An))return;const Ha=u(An),_n=d.BASE.multiply(An).toAffine(),Je=a(_n.x);if(Je===vt)return;const En=a(Ha*a(St+Je*He));if(En===vt)return;let Fa=(_n.x===Je?0:2)|Number(_n.y&Ze),ja=En;return F&&g(En)&&(ja=p(En),Fa^=1),new b(Je,ja,Fa)}return{seed:rr,k2sig:Cs}}const P={lowS:e.lowS,prehash:!1},O={lowS:e.lowS,prehash:!1};function z(h,v,C=P){const{seed:D,k2sig:H}=I(h,v,C),F=e;return Id(F.hash.outputLen,F.nByteLength,F.hmac)(D,H)}d.BASE._setWindowSize(8);function le(h,v,C,D=O){var _n;const H=h;if(v=Qe("msgHash",v),C=Qe("publicKey",C),"strict"in D)throw new Error("options.strict was renamed to lowS");const{lowS:F,prehash:fe}=D;let Ee,we;try{if(typeof H=="string"||H instanceof Uint8Array)try{Ee=b.fromDER(H)}catch(Je){if(!(Je instanceof Kt.Err))throw Je;Ee=b.fromCompact(H)}else if(typeof H=="object"&&typeof H.r=="bigint"&&typeof H.s=="bigint"){const{r:Je,s:En}=H;Ee=new b(Je,En)}else throw new Error("PARSE");we=d.fromHex(C)}catch(Je){if(Je.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(F&&Ee.hasHighS())return!1;fe&&(v=e.hash(v));const{r:He,s:wn}=Ee,rr=R(v),St=u(wn),Cs=a(rr*St),zt=a(He*St),An=(_n=d.BASE.multiplyAndAddUnsafe(we,Cs,zt))==null?void 0:_n.toAffine();return An?a(An.x)===He:!1}return{CURVE:e,getPublicKey:E,getSharedSecret:x,sign:z,verify:le,ProjectivePoint:d,Signature:b,utils:_}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Cv(t){return{hash:t,hmac:(e,...n)=>ua(t,e,Ei(...n)),randomBytes:du}}function Rv(t,e){const n=r=>Bv({...t,...Cv(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Sd=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),bc=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Pv=BigInt(1),fo=BigInt(2),wc=(t,e)=>(t+e/fo)/e;function Nv(t){const e=Sd,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),u=BigInt(88),d=t*t*t%e,c=d*d*t%e,l=Ve(c,n,e)*c%e,f=Ve(l,n,e)*c%e,m=Ve(f,fo,e)*d%e,g=Ve(m,i,e)*m%e,p=Ve(g,s,e)*g%e,y=Ve(p,a,e)*p%e,b=Ve(y,u,e)*y%e,_=Ve(b,a,e)*p%e,E=Ve(_,n,e)*c%e,T=Ve(E,o,e)*g%e,x=Ve(T,r,e)*d%e,B=Ve(x,fo,e);if(!ho.eql(ho.sqr(B),t))throw new Error("Cannot find square root");return B}const ho=wv(Sd,void 0,void 0,{sqrt:Nv}),pa=Rv({a:BigInt(0),b:BigInt(7),Fp:ho,n:bc,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=bc,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Pv*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,o=BigInt("0x100000000000000000000000000000000"),a=wc(s*t,e),u=wc(-r*t,e);let d=Oe(t-a*n-u*i,e),c=Oe(-a*r-u*s,e);const l=d>o,f=c>o;if(l&&(d=e-d),f&&(c=e-c),d>o||c>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:d,k2neg:f,k2:c}}}},ms);BigInt(0);pa.ProjectivePoint;const Ov=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:pa},Symbol.toStringTag,{value:"Module"}));var js;const Vt=(js=pa)!==null&&js!==void 0?js:Ov,Ac=BigInt("0xffffffffffffffff"),Lr=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Mv=Vt.CURVE.n,Lv=Mv/BigInt(2),Dv={type:"object",required:["crypto","id","version","address"],properties:{crypto:{type:"object",required:["cipher","ciphertext","cipherparams","kdf","kdfparams","mac"],properties:{cipher:{type:"string"},ciphertext:{type:"string"},cipherparams:{type:"object"},kdf:{type:"string"},kdfparams:{type:"object"},salt:{type:"string"},mac:{type:"string"}}},id:{type:"string"},version:{type:"number"},address:{type:"string"}}};var Gi;(function(t){t[t.Mainnet=1]="Mainnet",t[t.Goerli=5]="Goerli",t[t.Sepolia=11155111]="Sepolia"})(Gi||(Gi={}));var he;(function(t){t.Chainstart="chainstart",t.Homestead="homestead",t.Dao="dao",t.TangerineWhistle="tangerineWhistle",t.SpuriousDragon="spuriousDragon",t.Byzantium="byzantium",t.Constantinople="constantinople",t.Petersburg="petersburg",t.Istanbul="istanbul",t.MuirGlacier="muirGlacier",t.Berlin="berlin",t.London="london",t.ArrowGlacier="arrowGlacier",t.GrayGlacier="grayGlacier",t.MergeForkIdTransition="mergeForkIdTransition",t.Merge="merge",t.Shanghai="shanghai",t.ShardingForkDev="shardingFork"})(he||(he={}));var _c;(function(t){t.ProofOfStake="pos",t.ProofOfWork="pow",t.ProofOfAuthority="poa"})(_c||(_c={}));var Ec;(function(t){t.Ethash="ethash",t.Clique="clique",t.Casper="casper"})(Ec||(Ec={}));var Se;(function(t){t.PolygonMainnet="polygon-mainnet",t.PolygonMumbai="polygon-mumbai",t.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",t.ArbitrumOne="arbitrum-one",t.xDaiChain="x-dai-chain",t.OptimisticKovan="optimistic-kovan",t.OptimisticEthereum="optimistic-ethereum"})(Se||(Se={}));var We;(function(t){t[t.Number=0]="Number",t[t.BigInt=1]="BigInt",t[t.Uint8Array=2]="Uint8Array",t[t.PrefixedHexString=3]="PrefixedHexString"})(We||(We={}));const kd=t=>{if(typeof t!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof t}`);return Vo(t)?t.slice(2):t};function Hv(t){return!t||t==="0x0"?"0x0000000000000000":Vo(t)?`0x${kd(t).padStart(16,"0")}`:`0x${t.padStart(16,"0")}`}const Bd=function(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Received an invalid integer type: ${t}`);return`0x${t.toString(16)}`};function Fv(t,e=!0){var n,r;const{name:i,config:s,difficulty:o,mixHash:a,gasLimit:u,coinbase:d,baseFeePerGas:c}=t;let{extraData:l,timestamp:f,nonce:m}=t;const g=Number(f),{chainId:p}=s;if(l===""&&(l="0x"),Vo(f)||(f=Bd(parseInt(f))),m.length!==18&&(m=Hv(m)),s.eip155Block!==s.eip158Block)throw new Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");const y={name:i,chainId:p,networkId:p,genesis:{timestamp:f,gasLimit:parseInt(u),difficulty:parseInt(o),nonce:m,extraData:l,mixHash:a,coinbase:d,baseFeePerGas:c},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:s.clique!==void 0?{type:"poa",algorithm:"clique",clique:{period:(n=s.clique.period)!==null&&n!==void 0?n:s.clique.blockperiodseconds,epoch:(r=s.clique.epoch)!==null&&r!==void 0?r:s.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},b={[he.Homestead]:{name:"homesteadBlock"},[he.Dao]:{name:"daoForkBlock"},[he.TangerineWhistle]:{name:"eip150Block"},[he.SpuriousDragon]:{name:"eip155Block"},[he.Byzantium]:{name:"byzantiumBlock"},[he.Constantinople]:{name:"constantinopleBlock"},[he.Petersburg]:{name:"petersburgBlock"},[he.Istanbul]:{name:"istanbulBlock"},[he.MuirGlacier]:{name:"muirGlacierBlock"},[he.Berlin]:{name:"berlinBlock"},[he.London]:{name:"londonBlock"},[he.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:e},[he.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[he.ShardingForkDev]:{name:"shardingForkTime",postMerge:!0,isTimestamp:!0}},_=Object.keys(b).reduce((x,B)=>(x[b[B].name]=B,x),{}),E=Object.keys(s).filter(x=>_[x]!==void 0&&s[x]!==void 0&&s[x]!==null);if(y.hardforks=E.map(x=>({name:_[x],block:b[_[x]].isTimestamp===!0||typeof s[x]!="number"?null:s[x],timestamp:b[_[x]].isTimestamp===!0&&typeof s[x]=="number"?s[x]:void 0})).filter(x=>x.block!==null||x.timestamp!==void 0),y.hardforks.sort((x,B)=>{var R,w;return((R=x.block)!==null&&R!==void 0?R:1/0)-((w=B.block)!==null&&w!==void 0?w:1/0)}),y.hardforks.sort((x,B)=>{var R,w;return((R=x.timestamp)!==null&&R!==void 0?R:g)-((w=B.timestamp)!==null&&w!==void 0?w:g)}),s.terminalTotalDifficulty!==void 0){const x={name:he.Merge,ttd:s.terminalTotalDifficulty,block:null},B=y.hardforks.findIndex(R=>{var w;return((w=b[R.name])===null||w===void 0?void 0:w.postMerge)===!0});B!==-1?y.hardforks.splice(B,0,x):y.hardforks.push(x)}const T=y.hardforks.length>0?y.hardforks.slice(-1)[0]:void 0;return y.hardfork=T==null?void 0:T.name,y.hardforks.unshift({name:he.Chainstart,block:0}),y}function jv(t,e,n){try{if(["config","difficulty","gasLimit","alloc"].some(r=>!(r in t)))throw new Error("Invalid format, expected geth genesis fields missing");return e!==void 0&&(t.name=e),Fv(t,n)}catch(r){throw new Error(`Error parsing parameters file: ${r.message}`)}}function Cd(t){let e=t;if(typeof e!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof e}`);return e.length%2&&(e=`0${e}`),e}const Uv=function(t){const e=Bd(t);return me(`0x${Cd(e.slice(2))}`)},ge=function(t){if(t==null)return new Uint8Array;if(t instanceof Uint8Array)return t;if(Array.isArray(t))return Uint8Array.from(t);if(typeof t=="string"){if(!Iu(t))throw new Error(`Cannot convert string to Uint8Array. only supports 0x-prefixed hex strings and this string was given: ${t}`);return me(Cd(kd(t)))}if(typeof t=="number")return ge(Ue(t));if(typeof t=="bigint"){if(t<BigInt(0))throw new Error(`Cannot convert negative bigint to Uint8Array. Given: ${t}`);let e=t.toString(16);return e.length%2&&(e=`0${e}`),ge(`0x${e}`)}if(t.toArray)return Uint8Array.from(t.toArray());throw new Error("invalid type")};function de(t){const e=te(t);return BigInt(e==="0x"?0:e)}function Gv(t){return ge(`0x${t.toString(16)}`)}const Rd=function(t){return new Uint8Array(t).fill(0)},qv=function(t,e,n){const r=Rd(e);return n?t.length<e?(r.set(t),r):t.subarray(0,e):t.length<e?(r.set(t,e-t.length),r):t.subarray(-e)};function ga(t){if(!(t instanceof Uint8Array)){const e=`This method only supports Uint8Array but input was: ${t}`;throw new Error(e)}}const xc=function(t,e){return ga(t),qv(t,e,!1)};function Vv(t){let e=t[0];for(;t.length>0&&e.toString()==="0";)t=t.slice(1),e=t[0];return t}const qi=function(t){return ga(t),Vv(t)},ye=t=>`0x${t.toString(16)}`;function re(t){return qi(Gv(t))}function zv(t,e){return t===BigInt(0)||t===BigInt(1)?t:e===void 0?t-BigInt(27):t-(e*BigInt(2)+BigInt(35))}function Qv(t){return t===BigInt(0)||t===BigInt(1)}const ya=function(t,e,n,r,i){const s=zv(e,i);if(!Qv(s))throw new Error("Invalid signature v value");return new Vt.Signature(de(n),de(r)).addRecoveryBit(Number(s)).recoverPublicKey(t).toRawBytes(!1).slice(1)};function In(t,e){if(t===null)return null;if(t===void 0)return;if(typeof t=="string"&&!Iu(t))throw new Error(`A string must be provided with a 0x-prefix, given: ${t}`);if(typeof t=="number"&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const n=ge(t);switch(e){case We.Uint8Array:return n;case We.BigInt:return de(n);case We.Number:{const r=de(n);if(r>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(r)}case We.PrefixedHexString:return te(n);default:throw new Error("unknown outputType")}}var At={};Object.defineProperty(At,"__esModule",{value:!0});var Fe=At.RLP=At.utils=At.decode=At.encode=void 0;function va(t){if(Array.isArray(t)){const n=[];let r=0;for(let i=0;i<t.length;i++){const s=va(t[i]);n.push(s),r+=s.length}return po(Tc(r,192),...n)}const e=Dd(t);return e.length===1&&e[0]<128?e:po(Tc(e.length,128),e)}At.encode=va;function Tn(t,e,n){if(n>t.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return t.slice(e,n)}function Ic(t){if(t[0]===0)throw new Error("invalid RLP: extra zeros");return Od(Nd(t))}function Tc(t,e){if(t<56)return Uint8Array.from([t+e]);const n=go(t),r=n.length/2,i=go(e+55+r);return Uint8Array.from(Vi(i+n))}function Pd(t,e=!1){if(typeof t>"u"||t===null||t.length===0)return Uint8Array.from([]);const n=Dd(t),r=mo(n);if(e)return r;if(r.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return r.data}At.decode=Pd;function mo(t){let e,n,r,i,s;const o=[],a=t[0];if(a<=127)return{data:t.slice(0,1),remainder:t.slice(1)};if(a<=183){if(e=a-127,a===128?r=Uint8Array.from([]):r=Tn(t,1,e),e===2&&r[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:r,remainder:t.slice(e)}}else if(a<=191){if(n=a-182,t.length-1<n)throw new Error("invalid RLP: not enough bytes for string length");if(e=Ic(Tn(t,1,n)),e<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return r=Tn(t,n,e+n),{data:r,remainder:t.slice(e+n)}}else if(a<=247){for(e=a-191,i=Tn(t,1,e);i.length;)s=mo(i),o.push(s.data),i=s.remainder;return{data:o,remainder:t.slice(e)}}else{if(n=a-246,e=Ic(Tn(t,1,n)),e<56)throw new Error("invalid RLP: encoded list too short");const u=n+e;if(u>t.length)throw new Error("invalid RLP: total length is larger than the data");for(i=Tn(t,n,u);i.length;)s=mo(i),o.push(s.data),i=s.remainder;return{data:o,remainder:t.slice(u)}}}const Zv=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Nd(t){let e="";for(let n=0;n<t.length;n++)e+=Zv[t[n]];return e}function Od(t){const e=Number.parseInt(t,16);if(Number.isNaN(e))throw new Error("Invalid byte sequence");return e}function Vi(t){if(typeof t!="string")throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){const r=n*2;e[n]=Od(t.slice(r,r+2))}return e}function po(...t){if(t.length===1)return t[0];const e=t.reduce((r,i)=>r+i.length,0),n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}function Md(t){return new TextEncoder().encode(t)}function go(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");const e=t.toString(16);return e.length%2?`0${e}`:e}function Wv(t){return t.length%2?`0${t}`:t}function Ld(t){return t.length>=2&&t[0]==="0"&&t[1]==="x"}function $v(t){return typeof t!="string"?t:Ld(t)?t.slice(2):t}function Dd(t){if(t instanceof Uint8Array)return t;if(typeof t=="string")return Ld(t)?Vi(Wv($v(t))):Md(t);if(typeof t=="number"||typeof t=="bigint")return t?Vi(go(t)):Uint8Array.from([]);if(t==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof t)}At.utils={bytesToHex:Nd,concatBytes:po,hexToBytes:Vi,utf8ToBytes:Md};Fe=At.RLP={encode:va,decode:Pd};var Hd={};/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */(function(t){(function(e){e(typeof DO_NOT_EXPORT_CRC>"u"?t:{})})(function(e){e.version="1.2.2";function n(){for(var w=0,L=new Array(256),I=0;I!=256;++I)w=I,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,w=w&1?-306674912^w>>>1:w>>>1,L[I]=w;return typeof Int32Array<"u"?new Int32Array(L):L}var r=n();function i(w){var L=0,I=0,P=0,O=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(P=0;P!=256;++P)O[P]=w[P];for(P=0;P!=256;++P)for(I=w[P],L=256+P;L<4096;L+=256)I=O[L]=I>>>8^w[I&255];var z=[];for(P=1;P!=16;++P)z[P-1]=typeof Int32Array<"u"?O.subarray(P*256,P*256+256):O.slice(P*256,P*256+256);return z}var s=i(r),o=s[0],a=s[1],u=s[2],d=s[3],c=s[4],l=s[5],f=s[6],m=s[7],g=s[8],p=s[9],y=s[10],b=s[11],_=s[12],E=s[13],T=s[14];function x(w,L){for(var I=L^-1,P=0,O=w.length;P<O;)I=I>>>8^r[(I^w.charCodeAt(P++))&255];return~I}function B(w,L){for(var I=L^-1,P=w.length-15,O=0;O<P;)I=T[w[O++]^I&255]^E[w[O++]^I>>8&255]^_[w[O++]^I>>16&255]^b[w[O++]^I>>>24]^y[w[O++]]^p[w[O++]]^g[w[O++]]^m[w[O++]]^f[w[O++]]^l[w[O++]]^c[w[O++]]^d[w[O++]]^u[w[O++]]^a[w[O++]]^o[w[O++]]^r[w[O++]];for(P+=15;O<P;)I=I>>>8^r[(I^w[O++])&255];return~I}function R(w,L){for(var I=L^-1,P=0,O=w.length,z=0,le=0;P<O;)z=w.charCodeAt(P++),z<128?I=I>>>8^r[(I^z)&255]:z<2048?(I=I>>>8^r[(I^(192|z>>6&31))&255],I=I>>>8^r[(I^(128|z&63))&255]):z>=55296&&z<57344?(z=(z&1023)+64,le=w.charCodeAt(P++)&1023,I=I>>>8^r[(I^(240|z>>8&7))&255],I=I>>>8^r[(I^(128|z>>2&63))&255],I=I>>>8^r[(I^(128|le>>6&15|(z&3)<<4))&255],I=I>>>8^r[(I^(128|le&63))&255]):(I=I>>>8^r[(I^(224|z>>12&15))&255],I=I>>>8^r[(I^(128|z>>6&63))&255],I=I>>>8^r[(I^(128|z&63))&255]);return~I}e.table=r,e.bstr=x,e.buf=B,e.str=R})})(Hd);const Kv=tn.getDefaultExportFromCjs(Hd),Jv={name:"goerli",chainId:5,networkId:5,defaultHardfork:"merge",consensus:{type:"poa",algorithm:"clique",clique:{period:15,epoch:3e4}},comment:"Cross-client PoA test network",url:"https://github.com/goerli/testnet",genesis:{timestamp:"0x5c51a607",gasLimit:10485760,difficulty:1,nonce:"0x0000000000000000",extraData:"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},hardforks:[{name:"chainstart",block:0,forkHash:"0xa3f5ab08"},{name:"homestead",block:0,forkHash:"0xa3f5ab08"},{name:"tangerineWhistle",block:0,forkHash:"0xa3f5ab08"},{name:"spuriousDragon",block:0,forkHash:"0xa3f5ab08"},{name:"byzantium",block:0,forkHash:"0xa3f5ab08"},{name:"constantinople",block:0,forkHash:"0xa3f5ab08"},{name:"petersburg",block:0,forkHash:"0xa3f5ab08"},{name:"istanbul",block:1561651,forkHash:"0xc25efa5c"},{name:"berlin",block:4460644,forkHash:"0x757a1c47"},{name:"london",block:5062605,forkHash:"0xb8c6299d"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://goerli.etherscan.io/block/7382818",name:"merge",ttd:"10790000",block:7382819,forkHash:"0xb8c6299d"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]},Xv={name:"mainnet",chainId:1,networkId:1,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"The Ethereum main chain",url:"https://ethstats.net/",genesis:{gasLimit:5e3,difficulty:17179869184,nonce:"0x0000000000000042",extraData:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfc64ec04"},{name:"homestead",block:115e4,forkHash:"0x97c2c34c"},{name:"dao",block:192e4,forkHash:"0x91d1f948"},{name:"tangerineWhistle",block:2463e3,forkHash:"0x7a64da13"},{name:"spuriousDragon",block:2675e3,forkHash:"0x3edd5b10"},{name:"byzantium",block:437e4,forkHash:"0xa00bc324"},{name:"constantinople",block:728e4,forkHash:"0x668db0af"},{name:"petersburg",block:728e4,forkHash:"0x668db0af"},{name:"istanbul",block:9069e3,forkHash:"0x879d6e30"},{name:"muirGlacier",block:92e5,forkHash:"0xe029e991"},{name:"berlin",block:12244e3,forkHash:"0x0eb440f6"},{name:"london",block:12965e3,forkHash:"0xb715077d"},{name:"arrowGlacier",block:13773e3,forkHash:"0x20c327fc"},{name:"grayGlacier",block:1505e4,forkHash:"0xf0afd0e3"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://etherscan.io/block/15537393",name:"merge",ttd:"58750000000000000000000",block:15537394,forkHash:"0xf0afd0e3"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]},Yv={name:"sepolia",chainId:11155111,networkId:11155111,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"PoW test network to replace Ropsten",url:"https://github.com/ethereum/go-ethereum/pull/23730",genesis:{timestamp:"0x6159af19",gasLimit:3e7,difficulty:131072,nonce:"0x0000000000000000",extraData:"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfe3366e7"},{name:"homestead",block:0,forkHash:"0xfe3366e7"},{name:"tangerineWhistle",block:0,forkHash:"0xfe3366e7"},{name:"spuriousDragon",block:0,forkHash:"0xfe3366e7"},{name:"byzantium",block:0,forkHash:"0xfe3366e7"},{name:"constantinople",block:0,forkHash:"0xfe3366e7"},{name:"petersburg",block:0,forkHash:"0xfe3366e7"},{name:"istanbul",block:0,forkHash:"0xfe3366e7"},{name:"muirGlacier",block:0,forkHash:"0xfe3366e7"},{name:"berlin",block:0,forkHash:"0xfe3366e7"},{name:"london",block:0,forkHash:"0xfe3366e7"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://sepolia.etherscan.io/block/1450408",name:"merge",ttd:"17000000000000000",block:1450409,forkHash:"0xfe3366e7"},{name:"mergeForkIdTransition",block:1735371,forkHash:"0xb96cbd13"},{name:"shanghai",block:null,timestamp:"1677557088",forkHash:"0xf7f9bc08"}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]},eb={name:"EIP-1153",number:1153,comment:"Transient Storage",url:"https://eips.ethereum.org/EIPS/eip-1153",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{tstore:{v:100,d:"Base fee of the TSTORE opcode"},tload:{v:100,d:"Base fee of the TLOAD opcode"}},vm:{},pow:{}},tb={name:"EIP-1559",number:1559,comment:"Fee market change for ETH 1.0 chain",url:"https://eips.ethereum.org/EIPS/eip-1559",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2930],gasConfig:{baseFeeMaxChangeDenominator:{v:8,d:"Maximum base fee change denominator"},elasticityMultiplier:{v:2,d:"Maximum block gas target elasticity"},initialBaseFee:{v:1e9,d:"Initial base fee on first EIP1559 block"}},gasPrices:{},vm:{},pow:{}},nb={name:"EIP-2315",number:2315,comment:"Simple subroutines for the EVM",url:"https://eips.ethereum.org/EIPS/eip-2315",status:"Draft",minimumHardfork:"istanbul",gasConfig:{},gasPrices:{beginsub:{v:2,d:"Base fee of the BEGINSUB opcode"},returnsub:{v:5,d:"Base fee of the RETURNSUB opcode"},jumpsub:{v:10,d:"Base fee of the JUMPSUB opcode"}},vm:{},pow:{}},rb={name:"EIP-2537",number:2537,comment:"BLS12-381 precompiles",url:"https://eips.ethereum.org/EIPS/eip-2537",status:"Draft",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{Bls12381G1AddGas:{v:600,d:"Gas cost of a single BLS12-381 G1 addition precompile-call"},Bls12381G1MulGas:{v:12e3,d:"Gas cost of a single BLS12-381 G1 multiplication precompile-call"},Bls12381G2AddGas:{v:4500,d:"Gas cost of a single BLS12-381 G2 addition precompile-call"},Bls12381G2MulGas:{v:55e3,d:"Gas cost of a single BLS12-381 G2 multiplication precompile-call"},Bls12381PairingBaseGas:{v:115e3,d:"Base gas cost of BLS12-381 pairing check"},Bls12381PairingPerPairGas:{v:23e3,d:"Per-pair gas cost of BLS12-381 pairing check"},Bls12381MapG1Gas:{v:5500,d:"Gas cost of BLS12-381 map field element to G1"},Bls12381MapG2Gas:{v:11e4,d:"Gas cost of BLS12-381 map field element to G2"},Bls12381MultiExpGasDiscount:{v:[[1,1200],[2,888],[3,764],[4,641],[5,594],[6,547],[7,500],[8,453],[9,438],[10,423],[11,408],[12,394],[13,379],[14,364],[15,349],[16,334],[17,330],[18,326],[19,322],[20,318],[21,314],[22,310],[23,306],[24,302],[25,298],[26,294],[27,289],[28,285],[29,281],[30,277],[31,273],[32,269],[33,268],[34,266],[35,265],[36,263],[37,262],[38,260],[39,259],[40,257],[41,256],[42,254],[43,253],[44,251],[45,250],[46,248],[47,247],[48,245],[49,244],[50,242],[51,241],[52,239],[53,238],[54,236],[55,235],[56,233],[57,232],[58,231],[59,229],[60,228],[61,226],[62,225],[63,223],[64,222],[65,221],[66,220],[67,219],[68,219],[69,218],[70,217],[71,216],[72,216],[73,215],[74,214],[75,213],[76,213],[77,212],[78,211],[79,211],[80,210],[81,209],[82,208],[83,208],[84,207],[85,206],[86,205],[87,205],[88,204],[89,203],[90,202],[91,202],[92,201],[93,200],[94,199],[95,199],[96,198],[97,197],[98,196],[99,196],[100,195],[101,194],[102,193],[103,193],[104,192],[105,191],[106,191],[107,190],[108,189],[109,188],[110,188],[111,187],[112,186],[113,185],[114,185],[115,184],[116,183],[117,182],[118,182],[119,181],[120,180],[121,179],[122,179],[123,178],[124,177],[125,176],[126,176],[127,175],[128,174]],d:"Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair"}},vm:{},pow:{}},ib={name:"EIP-2565",number:2565,comment:"ModExp gas cost",url:"https://eips.ethereum.org/EIPS/eip-2565",status:"Final",minimumHardfork:"byzantium",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:3,d:"Gquaddivisor from modexp precompile for gas calculation"}},vm:{},pow:{}},sb={name:"EIP-2718",comment:"Typed Transaction Envelope",url:"https://eips.ethereum.org/EIPS/eip-2718",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{},vm:{},pow:{}},ob={name:"EIP-2929",comment:"Gas cost increases for state access opcodes",url:"https://eips.ethereum.org/EIPS/eip-2929",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{coldsload:{v:2100,d:"Gas cost of the first read of storage from a given location (per transaction)"},coldaccountaccess:{v:2600,d:"Gas cost of the first read of a given address (per transaction)"},warmstorageread:{v:100,d:"Gas cost of reading storage locations which have already loaded 'cold'"},sstoreCleanGasEIP2200:{v:2900,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreNoopGasEIP2200:{v:100,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:100,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitRefundEIP2200:{v:19900,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanRefundEIP2200:{v:4900,d:"Once per SSTORE operation for resetting to the original non-zero value"},call:{v:0,d:"Base fee of the CALL opcode"},callcode:{v:0,d:"Base fee of the CALLCODE opcode"},delegatecall:{v:0,d:"Base fee of the DELEGATECALL opcode"},staticcall:{v:0,d:"Base fee of the STATICCALL opcode"},balance:{v:0,d:"Base fee of the BALANCE opcode"},extcodesize:{v:0,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:0,d:"Base fee of the EXTCODECOPY opcode"},extcodehash:{v:0,d:"Base fee of the EXTCODEHASH opcode"},sload:{v:0,d:"Base fee of the SLOAD opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"}},vm:{},pow:{}},ab={name:"EIP-2930",comment:"Optional access lists",url:"https://eips.ethereum.org/EIPS/eip-2930",status:"Final",minimumHardfork:"istanbul",requiredEIPs:[2718,2929],gasConfig:{},gasPrices:{accessListStorageKeyCost:{v:1900,d:"Gas cost per storage key in an Access List transaction"},accessListAddressCost:{v:2400,d:"Gas cost per storage key in an Access List transaction"}},vm:{},pow:{}},cb={name:"EIP-3198",number:3198,comment:"BASEFEE opcode",url:"https://eips.ethereum.org/EIPS/eip-3198",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{basefee:{v:2,d:"Gas cost of the BASEFEE opcode"}},vm:{},pow:{}},ub={name:"EIP-3529",comment:"Reduction in refunds",url:"https://eips.ethereum.org/EIPS/eip-3529",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2929],gasConfig:{maxRefundQuotient:{v:5,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{selfdestructRefund:{v:0,d:"Refunded following a selfdestruct operation"},sstoreClearRefundEIP2200:{v:4800,d:"Once per SSTORE operation for clearing an originally existing storage slot"}},vm:{},pow:{}},db={name:"EIP-3540",number:3540,comment:"EVM Object Format (EOF) v1",url:"https://eips.ethereum.org/EIPS/eip-3540",status:"Review",minimumHardfork:"london",requiredEIPs:[3541],gasConfig:{},gasPrices:{},vm:{},pow:{}},lb={name:"EIP-3541",comment:"Reject new contracts starting with the 0xEF byte",url:"https://eips.ethereum.org/EIPS/eip-3541",status:"Final",minimumHardfork:"berlin",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},fb={name:"EIP-3554",comment:"Reduction in refunds",url:"Difficulty Bomb Delay to December 1st 2021",status:"Final",minimumHardfork:"muirGlacier",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:95e5,d:"the amount of blocks to delay the difficulty bomb with"}}},hb={name:"EIP-3607",number:3607,comment:"Reject transactions from senders with deployed code",url:"https://eips.ethereum.org/EIPS/eip-3607",status:"Final",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},mb={name:"EIP-3651",number:3198,comment:"Warm COINBASE",url:"https://eips.ethereum.org/EIPS/eip-3651",status:"Review",minimumHardfork:"london",requiredEIPs:[2929],gasConfig:{},gasPrices:{},vm:{},pow:{}},pb={name:"EIP-3670",number:3670,comment:"EOF - Code Validation",url:"https://eips.ethereum.org/EIPS/eip-3670",status:"Review",minimumHardfork:"london",requiredEIPs:[3540],gasConfig:{},gasPrices:{},vm:{},pow:{}},gb={name:"EIP-3675",number:3675,comment:"Upgrade consensus to Proof-of-Stake",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Final",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},yb={name:"EIP-3855",number:3855,comment:"PUSH0 instruction",url:"https://eips.ethereum.org/EIPS/eip-3855",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{push0:{v:2,d:"Base fee of the PUSH0 opcode"}},vm:{},pow:{}},vb={name:"EIP-3860",number:3860,comment:"Limit and meter initcode",url:"https://eips.ethereum.org/EIPS/eip-3860",status:"Review",minimumHardfork:"spuriousDragon",requiredEIPs:[],gasConfig:{},gasPrices:{initCodeWordCost:{v:2,d:"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},vm:{maxInitCodeSize:{v:49152,d:"Maximum length of initialization code when creating a contract"}},pow:{}},bb={name:"EIP-4345",number:4345,comment:"Difficulty Bomb Delay to June 2022",url:"https://eips.ethereum.org/EIPS/eip-4345",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:107e5,d:"the amount of blocks to delay the difficulty bomb with"}}},wb={name:"EIP-4399",number:4399,comment:"Supplant DIFFICULTY opcode with PREVRANDAO",url:"https://eips.ethereum.org/EIPS/eip-4399",status:"Review",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},Ab={name:"EIP-5133",number:5133,comment:"Delaying Difficulty Bomb to mid-September 2022",url:"https://eips.ethereum.org/EIPS/eip-5133",status:"Draft",minimumHardfork:"grayGlacier",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:114e5,d:"the amount of blocks to delay the difficulty bomb with"}}},Sn={1153:eb,1559:tb,2315:nb,2537:rb,2565:ib,2718:sb,2929:ob,2930:ab,3198:cb,3529:ub,3540:db,3541:lb,3554:fb,3607:hb,3651:mb,3670:pb,3675:gb,3855:yb,3860:vb,4345:bb,4399:wb,5133:Ab},_b={name:"chainstart",comment:"Start of the Ethereum main chain",url:"",status:"",gasConfig:{minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be"},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations"},maxRefundQuotient:{v:2,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{base:{v:2,d:"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},tierStep:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them"},exp:{v:10,d:"Base fee of the EXP opcode"},expByte:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction"},sha3:{v:30,d:"Base fee of the SHA3 opcode"},sha3Word:{v:6,d:"Once per word of the SHA3 operation's data"},sload:{v:50,d:"Base fee of the SLOAD opcode"},sstoreSet:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero"},sstoreReset:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero"},sstoreRefund:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero"},jumpdest:{v:1,d:"Base fee of the JUMPDEST opcode"},log:{v:375,d:"Base fee of the LOG opcode"},logData:{v:8,d:"Per byte in a LOG* operation's data"},logTopic:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},create:{v:32e3,d:"Base fee of the CREATE opcode"},call:{v:40,d:"Base fee of the CALL opcode"},callStipend:{v:2300,d:"Free gas given at beginning of call"},callValueTransfer:{v:9e3,d:"Paid for CALL when the value transfor is non-zero"},callNewAccount:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior"},selfdestructRefund:{v:24e3,d:"Refunded following a selfdestruct operation"},memory:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation"},createData:{v:200,d:""},tx:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions"},txCreation:{v:32e3,d:"The cost of creating a contract via tx"},txDataZero:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},txDataNonZero:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},copy:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},ecRecover:{v:3e3,d:""},sha256:{v:60,d:""},sha256Word:{v:12,d:""},ripemd160:{v:600,d:""},ripemd160Word:{v:120,d:""},identity:{v:15,d:""},identityWord:{v:3,d:""},stop:{v:0,d:"Base fee of the STOP opcode"},add:{v:3,d:"Base fee of the ADD opcode"},mul:{v:5,d:"Base fee of the MUL opcode"},sub:{v:3,d:"Base fee of the SUB opcode"},div:{v:5,d:"Base fee of the DIV opcode"},sdiv:{v:5,d:"Base fee of the SDIV opcode"},mod:{v:5,d:"Base fee of the MOD opcode"},smod:{v:5,d:"Base fee of the SMOD opcode"},addmod:{v:8,d:"Base fee of the ADDMOD opcode"},mulmod:{v:8,d:"Base fee of the MULMOD opcode"},signextend:{v:5,d:"Base fee of the SIGNEXTEND opcode"},lt:{v:3,d:"Base fee of the LT opcode"},gt:{v:3,d:"Base fee of the GT opcode"},slt:{v:3,d:"Base fee of the SLT opcode"},sgt:{v:3,d:"Base fee of the SGT opcode"},eq:{v:3,d:"Base fee of the EQ opcode"},iszero:{v:3,d:"Base fee of the ISZERO opcode"},and:{v:3,d:"Base fee of the AND opcode"},or:{v:3,d:"Base fee of the OR opcode"},xor:{v:3,d:"Base fee of the XOR opcode"},not:{v:3,d:"Base fee of the NOT opcode"},byte:{v:3,d:"Base fee of the BYTE opcode"},address:{v:2,d:"Base fee of the ADDRESS opcode"},balance:{v:20,d:"Base fee of the BALANCE opcode"},origin:{v:2,d:"Base fee of the ORIGIN opcode"},caller:{v:2,d:"Base fee of the CALLER opcode"},callvalue:{v:2,d:"Base fee of the CALLVALUE opcode"},calldataload:{v:3,d:"Base fee of the CALLDATALOAD opcode"},calldatasize:{v:2,d:"Base fee of the CALLDATASIZE opcode"},calldatacopy:{v:3,d:"Base fee of the CALLDATACOPY opcode"},codesize:{v:2,d:"Base fee of the CODESIZE opcode"},codecopy:{v:3,d:"Base fee of the CODECOPY opcode"},gasprice:{v:2,d:"Base fee of the GASPRICE opcode"},extcodesize:{v:20,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:20,d:"Base fee of the EXTCODECOPY opcode"},blockhash:{v:20,d:"Base fee of the BLOCKHASH opcode"},coinbase:{v:2,d:"Base fee of the COINBASE opcode"},timestamp:{v:2,d:"Base fee of the TIMESTAMP opcode"},number:{v:2,d:"Base fee of the NUMBER opcode"},difficulty:{v:2,d:"Base fee of the DIFFICULTY opcode"},gaslimit:{v:2,d:"Base fee of the GASLIMIT opcode"},pop:{v:2,d:"Base fee of the POP opcode"},mload:{v:3,d:"Base fee of the MLOAD opcode"},mstore:{v:3,d:"Base fee of the MSTORE opcode"},mstore8:{v:3,d:"Base fee of the MSTORE8 opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"},jump:{v:8,d:"Base fee of the JUMP opcode"},jumpi:{v:10,d:"Base fee of the JUMPI opcode"},pc:{v:2,d:"Base fee of the PC opcode"},msize:{v:2,d:"Base fee of the MSIZE opcode"},gas:{v:2,d:"Base fee of the GAS opcode"},push:{v:3,d:"Base fee of the PUSH opcode"},dup:{v:3,d:"Base fee of the DUP opcode"},swap:{v:3,d:"Base fee of the SWAP opcode"},callcode:{v:40,d:"Base fee of the CALLCODE opcode"},return:{v:0,d:"Base fee of the RETURN opcode"},invalid:{v:0,d:"Base fee of the INVALID opcode"},selfdestruct:{v:0,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{stackLimit:{v:1024,d:"Maximum size of VM stack allowed"},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack"},maxExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis"}},pow:{minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be"},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations"},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:0,d:"the amount of blocks to delay the difficulty bomb with"}}},Eb={name:"dao",comment:"DAO rescue hardfork",url:"https://eips.ethereum.org/EIPS/eip-779",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{}},xb={name:"homestead",comment:"Homestead hardfork with protocol and network changes",url:"https://eips.ethereum.org/EIPS/eip-606",status:"Final",gasConfig:{},gasPrices:{delegatecall:{v:40,d:"Base fee of the DELEGATECALL opcode"}},vm:{},pow:{}},Ib={name:"tangerineWhistle",comment:"Hardfork with gas cost changes for IO-heavy operations",url:"https://eips.ethereum.org/EIPS/eip-608",status:"Final",gasConfig:{},gasPrices:{sload:{v:200,d:"Once per SLOAD operation"},call:{v:700,d:"Once per CALL operation & message call transaction"},extcodesize:{v:700,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:700,d:"Base fee of the EXTCODECOPY opcode"},balance:{v:400,d:"Base fee of the BALANCE opcode"},delegatecall:{v:700,d:"Base fee of the DELEGATECALL opcode"},callcode:{v:700,d:"Base fee of the CALLCODE opcode"},selfdestruct:{v:5e3,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{},pow:{}},Tb={name:"spuriousDragon",comment:"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit",url:"https://eips.ethereum.org/EIPS/eip-607",status:"Final",gasConfig:{},gasPrices:{expByte:{v:50,d:"Times ceil(log256(exponent)) for the EXP instruction"}},vm:{maxCodeSize:{v:24576,d:"Maximum length of contract code"}},pow:{}},Sb={name:"byzantium",comment:"Hardfork with new precompiles, instructions and other protocol changes",url:"https://eips.ethereum.org/EIPS/eip-609",status:"Final",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:20,d:"Gquaddivisor from modexp precompile for gas calculation"},ecAdd:{v:500,d:"Gas costs for curve addition precompile"},ecMul:{v:4e4,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:1e5,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:8e4,d:"Gas costs regarding curve pairing precompile input length"},revert:{v:0,d:"Base fee of the REVERT opcode"},staticcall:{v:700,d:"Base fee of the STATICCALL opcode"},returndatasize:{v:2,d:"Base fee of the RETURNDATASIZE opcode"},returndatacopy:{v:3,d:"Base fee of the RETURNDATACOPY opcode"}},vm:{},pow:{minerReward:{v:"3000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:3e6,d:"the amount of blocks to delay the difficulty bomb with"}}},kb={name:"constantinople",comment:"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)",url:"https://eips.ethereum.org/EIPS/eip-1013",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:200,d:"Once per SSTORE operation if the value doesn't change"},netSstoreInitGas:{v:2e4,d:"Once per SSTORE operation from clean zero"},netSstoreCleanGas:{v:5e3,d:"Once per SSTORE operation from clean non-zero"},netSstoreDirtyGas:{v:200,d:"Once per SSTORE operation from dirty"},netSstoreClearRefund:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},netSstoreResetRefund:{v:4800,d:"Once per SSTORE operation for resetting to the original non-zero value"},netSstoreResetClearRefund:{v:19800,d:"Once per SSTORE operation for resetting to the original zero value"},shl:{v:3,d:"Base fee of the SHL opcode"},shr:{v:3,d:"Base fee of the SHR opcode"},sar:{v:3,d:"Base fee of the SAR opcode"},extcodehash:{v:400,d:"Base fee of the EXTCODEHASH opcode"},create2:{v:32e3,d:"Base fee of the CREATE2 opcode"}},vm:{},pow:{minerReward:{v:"2000000000000000000",d:"The amount a miner gets rewarded for mining a block"},difficultyBombDelay:{v:5e6,d:"the amount of blocks to delay the difficulty bomb with"}}},Bb={name:"petersburg",comment:"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople",url:"https://eips.ethereum.org/EIPS/eip-1716",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:null,d:"Removed along EIP-1283"},netSstoreInitGas:{v:null,d:"Removed along EIP-1283"},netSstoreCleanGas:{v:null,d:"Removed along EIP-1283"},netSstoreDirtyGas:{v:null,d:"Removed along EIP-1283"},netSstoreClearRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetClearRefund:{v:null,d:"Removed along EIP-1283"}},vm:{},pow:{}},Cb={name:"istanbul",comment:"HF targeted for December 2019 following the Constantinople/Petersburg HF",url:"https://eips.ethereum.org/EIPS/eip-1679",status:"Final",gasConfig:{},gasPrices:{blake2Round:{v:1,d:"Gas cost per round for the Blake2 F precompile"},ecAdd:{v:150,d:"Gas costs for curve addition precompile"},ecMul:{v:6e3,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:45e3,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:34e3,d:"Gas costs regarding curve pairing precompile input length"},txDataNonZero:{v:16,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},sstoreSentryGasEIP2200:{v:2300,d:"Minimum gas required to be present for an SSTORE call, not consumed"},sstoreNoopGasEIP2200:{v:800,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:800,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitGasEIP2200:{v:2e4,d:"Once per SSTORE operation from clean zero to non-zero"},sstoreInitRefundEIP2200:{v:19200,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanGasEIP2200:{v:5e3,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreCleanRefundEIP2200:{v:4200,d:"Once per SSTORE operation for resetting to the original non-zero value"},sstoreClearRefundEIP2200:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},balance:{v:700,d:"Base fee of the BALANCE opcode"},extcodehash:{v:700,d:"Base fee of the EXTCODEHASH opcode"},chainid:{v:2,d:"Base fee of the CHAINID opcode"},selfbalance:{v:5,d:"Base fee of the SELFBALANCE opcode"},sload:{v:800,d:"Base fee of the SLOAD opcode"}},vm:{},pow:{}},Rb={name:"muirGlacier",comment:"HF to delay the difficulty bomb",url:"https://eips.ethereum.org/EIPS/eip-2384",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:9e6,d:"the amount of blocks to delay the difficulty bomb with"}}},Pb={name:"berlin",comment:"HF targeted for July 2020 following the Muir Glacier HF",url:"https://eips.ethereum.org/EIPS/eip-2070",status:"Final",eips:[2565,2929,2718,2930]},Nb={name:"london",comment:"HF targeted for July 2021 following the Berlin fork",url:"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",status:"Final",eips:[1559,3198,3529,3541]},Ob={name:"shanghai",comment:"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md",status:"Final",eips:[3651,3855,3860,4895]},Mb={name:"arrowGlacier",comment:"HF to delay the difficulty bomb",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md",status:"Final",eips:[4345],gasConfig:{},gasPrices:{},vm:{},pow:{}},Lb={name:"grayGlacier",comment:"Delaying the difficulty bomb to Mid September 2022",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md",status:"Draft",eips:[5133],gasConfig:{},gasPrices:{},vm:{},pow:{}},Db={name:"mergeForkIdTransition",comment:"Pre-merge hardfork to fork off non-upgraded clients",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Draft",eips:[]},Hb={name:"merge",comment:"Hardfork to upgrade the consensus mechanism to Proof-of-Stake",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md",status:"Final",consensus:{type:"pos",algorithm:"casper",casper:{}},eips:[3675,4399]},Fb={chainstart:_b,homestead:xb,dao:Eb,tangerineWhistle:Ib,spuriousDragon:Tb,byzantium:Sb,constantinople:kb,petersburg:Bb,istanbul:Cb,muirGlacier:Rb,berlin:Pb,london:Nb,shanghai:Ob,arrowGlacier:Mb,grayGlacier:Lb,mergeForkIdTransition:Db,merge:Hb},{buf:jb}=Kv;class xe extends Xo{constructor(e){var n,r;super(),this._eips=[],this._customChains=(n=e.customChains)!==null&&n!==void 0?n:[],this._chainParams=this.setChain(e.chain),this.DEFAULT_HARDFORK=(r=this._chainParams.defaultHardfork)!==null&&r!==void 0?r:he.Merge,this.HARDFORK_CHANGES=this.hardforks().map(i=>[i.name,Fb[i.name]]),this._hardfork=this.DEFAULT_HARDFORK,e.hardfork!==void 0&&this.setHardfork(e.hardfork),e.eips&&this.setEIPs(e.eips)}static custom(e,n={}){var r;const i=(r=n.baseChain)!==null&&r!==void 0?r:"mainnet",s=Object.assign({},xe._getChainParams(i));if(s.name="custom-chain",typeof e!="string")return new xe(Object.assign({chain:Object.assign(Object.assign({},s),e)},n));if(e===Se.PolygonMainnet)return xe.custom({name:Se.PolygonMainnet,chainId:137,networkId:137},n);if(e===Se.PolygonMumbai)return xe.custom({name:Se.PolygonMumbai,chainId:80001,networkId:80001},n);if(e===Se.ArbitrumRinkebyTestnet)return xe.custom({name:Se.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},n);if(e===Se.ArbitrumOne)return xe.custom({name:Se.ArbitrumOne,chainId:42161,networkId:42161},n);if(e===Se.xDaiChain)return xe.custom({name:Se.xDaiChain,chainId:100,networkId:100},n);if(e===Se.OptimisticKovan)return xe.custom({name:Se.OptimisticKovan,chainId:69,networkId:69},Object.assign({hardfork:he.Berlin},n));if(e===Se.OptimisticEthereum)return xe.custom({name:Se.OptimisticEthereum,chainId:10,networkId:10},Object.assign({hardfork:he.Berlin},n));throw new Error(`Custom chain ${e} not supported`)}static fromGethGenesis(e,{chain:n,eips:r,genesisHash:i,hardfork:s,mergeForkIdPostMerge:o}){var a;const u=jv(e,n,o),d=new xe({chain:(a=u.name)!==null&&a!==void 0?a:"custom",customChains:[u],eips:r,hardfork:s??u.hardfork});return i!==void 0&&d.setForkHashes(i),d}static isSupportedChainId(e){return!!this._getInitializedChains().names[e.toString()]}static _getChainParams(e,n){let r=e;const i=this._getInitializedChains(n);if(typeof r=="number"||typeof r=="bigint"){if(r=r.toString(),i.names[r]){const s=i.names[r];return i[s]}throw new Error(`Chain with ID ${r} not supported`)}if(i[r]!==void 0)return i[r];throw new Error(`Chain with name ${r} not supported`)}setChain(e){if(typeof e=="number"||typeof e=="bigint"||typeof e=="string")this._chainParams=xe._getChainParams(e,this._customChains);else if(typeof e=="object"){if(this._customChains.length>0)throw new Error("Chain must be a string, number, or bigint when initialized with customChains passed in");const n=["networkId","genesis","hardforks","bootstrapNodes"];for(const r of n)if(!(r in e))throw new Error(`Missing required chain parameter: ${r}`);this._chainParams=e}else throw new Error("Wrong input format");for(const n of this.hardforks())if(n.block===void 0)throw new Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(e){let n=!1;for(const r of this.HARDFORK_CHANGES)r[0]===e&&(this._hardfork!==e&&(this._hardfork=e,this.emit("hardforkChanged",e)),n=!0);if(!n)throw new Error(`Hardfork with name ${e} not supported`)}getHardforkByBlockNumber(e,n,r){const i=In(e,We.BigInt),s=In(n,We.BigInt),o=In(r,We.Number),a=this.hardforks().filter(m=>m.block!==null||m.ttd!==null&&m.ttd!==void 0||m.timestamp!==void 0),u=a.findIndex(m=>m.ttd!==null&&m.ttd!==void 0);if(a.slice(u+1).findIndex(m=>m.ttd!==null&&m.ttd!==void 0)>=0)throw Error("More than one merge hardforks found with ttd specified");let c=a.findIndex(m=>m.block!==null&&m.block>i||o!==void 0&&Number(m.timestamp)>o);if(c===-1)c=a.length;else if(c===0)throw Error("Must have at least one hardfork at block 0");if(o===void 0){const m=a.slice(0,c).reverse().findIndex(g=>g.block!==null||g.ttd!==void 0);c-=m}if(c-=1,a[c].block===null&&a[c].timestamp===void 0)(s==null||BigInt(a[c].ttd)>s)&&(c-=1);else if(u>=0&&s!==void 0&&s!==null){if(c>=u&&BigInt(a[u].ttd)>s)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(c<u&&BigInt(a[u].ttd)<=s)throw Error("HF determined by block number is lower than the minimum total difficulty HF")}const l=c;for(;c<a.length-1&&!(a[c].block!==a[c+1].block||a[c].timestamp!==a[c+1].timestamp);c+=1);if(o){if(a.slice(0,l).reduce((p,y)=>{var b;return Math.max(Number((b=y.timestamp)!==null&&b!==void 0?b:"0"),p)},0)>o)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");if(a.slice(c+1).reduce((p,y)=>{var b;return Math.min(Number((b=y.timestamp)!==null&&b!==void 0?b:o),p)},o)<o)throw Error("Maximum HF determined by block number/ttd is lower than timestamp HF")}return a[c].name}setHardforkByBlockNumber(e,n,r){const i=this.getHardforkByBlockNumber(e,n,r);return this.setHardfork(i),i}_getHardfork(e){const n=this.hardforks();for(const r of n)if(r.name===e)return r;return null}setEIPs(e=[]){for(const n of e){if(!(n in Sn))throw new Error(`${n} not supported`);const r=this.gteHardfork(Sn[n].minimumHardfork);if(!r)throw new Error(`${n} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${r}`);if(Sn[n].requiredEIPs!==void 0){for(const i of Sn[n].requiredEIPs)if(!(e.includes(i)||this.isActivatedEIP(i)))throw new Error(`${n} requires EIP ${i}, but is not included in the EIP list`)}}this._eips=e}param(e,n){let r;for(const i of this._eips)if(r=this.paramByEIP(e,n,i),r!==void 0)return r;return this.paramByHardfork(e,n,this._hardfork)}paramByHardfork(e,n,r){let i=null;for(const s of this.HARDFORK_CHANGES){if("eips"in s[1]){const o=s[1].eips;for(const a of o){const u=this.paramByEIP(e,n,a);i=typeof u=="bigint"?u:i}}else{if(s[1][e]===void 0)throw new Error(`Topic ${e} not defined`);s[1][e][n]!==void 0&&(i=s[1][e][n].v)}if(s[0]===r)break}return BigInt(i??0)}paramByEIP(e,n,r){if(!(r in Sn))throw new Error(`${r} not supported`);const i=Sn[r];if(!(e in i))throw new Error(`Topic ${e} not defined`);if(i[e][n]===void 0)return;const s=i[e][n].v;return BigInt(s)}paramByBlock(e,n,r,i,s){const o=this.getHardforkByBlockNumber(r,i,s);return this.paramByHardfork(e,n,o)}isActivatedEIP(e){if(this.eips().includes(e))return!0;for(const n of this.HARDFORK_CHANGES){const r=n[1];if(this.gteHardfork(r.name)&&"eips"in r&&r.eips.includes(e))return!0}return!1}hardforkIsActiveOnBlock(e,n){const r=In(n,We.BigInt),i=e??this._hardfork,s=this.hardforkBlock(i);return typeof s=="bigint"&&s!==BigInt(0)&&r>=s}activeOnBlock(e){return this.hardforkIsActiveOnBlock(null,e)}hardforkGteHardfork(e,n){const r=e??this._hardfork,i=this.hardforks();let s=-1,o=-1,a=0;for(const u of i)u.name===r&&(s=a),u.name===n&&(o=a),a+=1;return s>=o&&o!==-1}gteHardfork(e){return this.hardforkGteHardfork(null,e)}hardforkBlock(e){var n;const r=e??this._hardfork,i=(n=this._getHardfork(r))===null||n===void 0?void 0:n.block;return i==null?null:BigInt(i)}hardforkTimestamp(e){var n;const r=e??this._hardfork,i=(n=this._getHardfork(r))===null||n===void 0?void 0:n.timestamp;return i==null?null:BigInt(i)}eipBlock(e){for(const n of this.HARDFORK_CHANGES){const r=n[1];if("eips"in r&&r.eips.includes(e))return this.hardforkBlock(typeof n[0]=="number"?String(n[0]):n[0])}return null}hardforkTTD(e){var n;const r=e??this._hardfork,i=(n=this._getHardfork(r))===null||n===void 0?void 0:n.ttd;return i==null?null:BigInt(i)}isHardforkBlock(e,n){const r=In(e,We.BigInt),i=n??this._hardfork,s=this.hardforkBlock(i);return typeof s=="bigint"&&s!==BigInt(0)?s===r:!1}nextHardforkBlockOrTimestamp(e){var n,r;const i=e??this._hardfork,s=this.hardforks();let o=s.findIndex(c=>c.name===i);if(i===he.Merge&&(o-=1),o<0)return null;let a=(n=s[o].timestamp)!==null&&n!==void 0?n:s[o].block;a=a!=null?Number(a):null;const u=s.slice(o+1).find(c=>{var l;let f=(l=c.timestamp)!==null&&l!==void 0?l:c.block;return f=f!=null?Number(f):null,c.name!==he.Merge&&f!==null&&f!==void 0&&f!==a});if(u===void 0)return null;const d=(r=u.timestamp)!==null&&r!==void 0?r:u.block;return d==null?null:BigInt(d)}nextHardforkBlock(e){const n=e??this._hardfork;let r=this.hardforkBlock(n);if(r===null&&n===he.Merge){const s=this.hardforks(),o=s.findIndex(a=>a.ttd!==null&&a.ttd!==void 0);if(o<0)throw Error("Merge hardfork should have been found");r=this.hardforkBlock(s[o-1].name)}return r===null?null:this.hardforks().reduce((s,o)=>{const a=BigInt(o.block===null||o.ttd!==void 0&&o.ttd!==null?0:o.block);return a>r&&s===null?a:s},null)}isNextHardforkBlock(e,n){const r=In(e,We.BigInt),i=n??this._hardfork,s=this.nextHardforkBlock(i);return s===null?!1:s===r}_calcForkHash(e,n){let r=new Uint8Array,i=0;for(const a of this.hardforks()){const{block:u,timestamp:d,name:c}=a;let l=d??u;if(l=l!==null?Number(l):null,typeof l=="number"&&l!==0&&l!==i&&c!==he.Merge){const f=me(l.toString(16).padStart(16,"0"));r=Ne(r,f),i=l}if(a.name===e)break}const s=Ne(n,r);return te(Uv(jb(s)>>>0))}forkHash(e,n){const r=e??this._hardfork,i=this._getHardfork(r);if(i===null||(i==null?void 0:i.block)===null&&(i==null?void 0:i.timestamp)===void 0&&(i==null?void 0:i.ttd)===void 0){const s="No fork hash calculation possible for future hardfork";throw new Error(s)}if((i==null?void 0:i.forkHash)!==null&&(i==null?void 0:i.forkHash)!==void 0)return i.forkHash;if(!n)throw new Error("genesisHash required for forkHash calculation");return this._calcForkHash(r,n)}hardforkForForkHash(e){const n=this.hardforks().filter(r=>r.forkHash===e);return n.length>=1?n[n.length-1]:null}setForkHashes(e){var n;for(const r of this.hardforks()){const i=(n=r.timestamp)!==null&&n!==void 0?n:r.block;(r.forkHash===null||r.forkHash===void 0)&&(i!=null||typeof r.ttd<"u")&&(r.forkHash=this.forkHash(r.name,e))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){const e=this.hardfork();let n;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(n=r[1].consensus.type),r[0]===e)break;return n??this._chainParams.consensus.type}consensusAlgorithm(){const e=this.hardfork();let n;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(n=r[1].consensus.algorithm),r[0]===e)break;return n??this._chainParams.consensus.algorithm}consensusConfig(){var e;const n=this.hardfork();let r;for(const i of this.HARDFORK_CHANGES)if("consensus"in i[1]&&(r=i[1].consensus[i[1].consensus.algorithm]),i[0]===n)break;return(e=r??this._chainParams.consensus[this.consensusAlgorithm()])!==null&&e!==void 0?e:{}}copy(){const e=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return e.removeAllListeners(),e}static _getInitializedChains(e){const n={};for(const[i,s]of Object.entries(Gi))n[s]=i.toLowerCase();const r={mainnet:Xv,goerli:Jv,sepolia:Yv};if(e)for(const i of e){const{name:s}=i;n[i.chainId.toString()]=s,r[s]=i}return r.names=n,r}}var ot;(function(t){t[t.EIP155ReplayProtection=155]="EIP155ReplayProtection",t[t.EIP1559FeeMarket=1559]="EIP1559FeeMarket",t[t.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",t[t.EIP2930AccessLists=2930]="EIP2930AccessLists"})(ot||(ot={}));function Ub(t){if(t.length===0)return!0;const e=t[0];return!!Array.isArray(e)}function Gb(t){return!Ub(t)}class Fn{constructor(e){if(e.length!==20)throw new Error("Invalid address length");this.buf=e}static zero(){return new Fn(Rd(20))}equals(e){return ds(this.buf,e.buf)}isZero(){return this.equals(Fn.zero())}toString(){return te(this.buf)}toArray(){return this.buf}static publicToAddress(e,n=!1){let r=e;if(ga(r),n&&r.length!==64&&(r=Vt.ProjectivePoint.fromHex(r).toRawBytes(!1).slice(1)),r.length!==64)throw new Error("Expected pubKey to be of length 64");return Be(r).slice(-20)}}const qb=(t,e)=>{const n=t.param("vm","maxInitCodeSize");if(n&&BigInt(e)>n)throw new Error(`the initcode size of this transaction is too large: it is ${e} while the max is ${t.param("vm","maxInitCodeSize")}`)},Fd=t=>{let e,n;if(Gb(t)){e=t;const r=[];for(let i=0;i<t.length;i+=1){const s=t[i],o=ge(s.address),a=[];for(let u=0;u<s.storageKeys.length;u+=1)a.push(ge(s.storageKeys[u]));r.push([o,a])}n=r}else{n=t??[];const r=[];for(let i=0;i<n.length;i+=1){const s=n[i],o=te(s[0]),a=[];for(let d=0;d<s[1].length;d+=1)a.push(te(s[1][d]));const u={address:o,storageKeys:a};r.push(u)}e=r}return{AccessListJSON:e,accessList:n}},jd=t=>{for(let e=0;e<t.length;e+=1){const n=t[e],r=n[0],i=n[1];if(n[2]!==void 0)throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(r.length!==20)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(let s=0;s<i.length;s+=1)if(i[s].length!==32)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}},Ud=t=>{const e=[];for(let n=0;n<t.length;n+=1){const r=t[n],i={address:te(xc(r[0],20)),storageKeys:[]},s=r&&r[1];for(let o=0;o<s.length;o+=1){const a=s[o];i.storageKeys.push(te(xc(a,32)))}e.push(i)}return e},Gd=(t,e)=>{const n=e.param("gasPrices","accessListStorageKeyCost"),r=e.param("gasPrices","accessListAddressCost");let i=0;for(let o=0;o<t.length;o+=1){const u=t[o][1];i+=u.length}return t.length*Number(r)+i*Number(n)};class Kn{constructor(e,n){var r,i;this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=Gi.Mainnet,this.DEFAULT_HARDFORK=he.Merge;const{nonce:s,gasLimit:o,to:a,value:u,data:d,v:c,r:l,s:f,type:m}=e;this._type=Number(de(ge(m))),this.txOptions=n;const g=ge(a===""?"0x":a),p=ge(c===""?"0x":c),y=ge(l===""?"0x":l),b=ge(f===""?"0x":f);this.nonce=de(ge(s===""?"0x":s)),this.gasLimit=de(ge(o===""?"0x":o)),this.to=g.length>0?new Fn(g):void 0,this.value=de(ge(u===""?"0x":u)),this.data=ge(d===""?"0x":d),this.v=p.length>0?de(p):void 0,this.r=y.length>0?de(y):void 0,this.s=b.length>0?de(b):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0);const _=this.to===void 0||this.to===null,E=(r=n.allowUnlimitedInitCodeSize)!==null&&r!==void 0?r:!1,T=(i=n.common)!==null&&i!==void 0?i:this._getCommon();_&&T.isActivatedEIP(3860)&&!E&&qb(T,this.data.length)}get type(){return this._type}supports(e){return this.activeCapabilities.includes(e)}validate(e=!1){const n=[];return this.getBaseFee()>this.gasLimit&&n.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`),this.isSigned()&&!this.verifySignature()&&n.push("Invalid Signature"),e?n:n.length===0}_validateYParity(){const{v:e}=this;if(e!==void 0&&e!==BigInt(0)&&e!==BigInt(1)){const n=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(n)}}_validateHighS(){const{s:e}=this;if(this.common.gteHardfork("homestead")&&e!==void 0&&e>Lv){const n=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(n)}}getBaseFee(){const e=this.common.param("gasPrices","tx");let n=this.getDataFee();if(e&&(n+=e),this.common.gteHardfork("homestead")&&this.toCreationAddress()){const r=this.common.param("gasPrices","txCreation");r&&(n+=r)}return n}getDataFee(){const e=this.common.param("gasPrices","txDataZero"),n=this.common.param("gasPrices","txDataNonZero");let r=BigInt(0);for(let i=0;i<this.data.length;i+=1)this.data[i]===0?r+=e:r+=n;if((this.to===void 0||this.to===null)&&this.common.isActivatedEIP(3860)){const i=BigInt(Math.ceil(this.data.length/32)),s=this.common.param("gasPrices","initCodeWordCost")*i;r+=s}return r}toCreationAddress(){return this.to===void 0||this.to.buf.length===0}isSigned(){const{v:e,r:n,s:r}=this;return!(e===void 0||n===void 0||r===void 0)}verifySignature(){try{const e=this.getSenderPublicKey();return qi(e).length!==0}catch{return!1}}getSenderAddress(){return new Fn(Fn.publicToAddress(this.getSenderPublicKey()))}sign(e){if(e.length!==32){const u=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(u)}let n=!1;this.type===0&&this.common.gteHardfork("spuriousDragon")&&!this.supports(ot.EIP155ReplayProtection)&&(this.activeCapabilities.push(ot.EIP155ReplayProtection),n=!0);const r=this.getMessageToSign(!0),{v:i,r:s,s:o}=this._ecsign(r,e),a=this._processSignature(i,s,o);if(n){const u=this.activeCapabilities.indexOf(ot.EIP155ReplayProtection);u>-1&&this.activeCapabilities.splice(u,1)}return a}_getCommon(e,n){var r;if(n!==void 0){const i=de(ge(n));if(e){if(e.chainId()!==i){const s=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(s)}return e.copy()}return xe.isSupportedChainId(i)?new xe({chain:i,hardfork:this.DEFAULT_HARDFORK}):xe.custom({name:"custom-chain",networkId:i,chainId:i},{baseChain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}return(r=e==null?void 0:e.copy())!==null&&r!==void 0?r:new xe({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}_validateCannotExceedMaxInteger(e,n=256,r=!1){for(const[i,s]of Object.entries(e))switch(n){case 64:if(r){if(s!==void 0&&s>=Ac){const o=this._errorMsg(`${i} cannot equal or exceed MAX_UINT64 (2^64-1), given ${s}`);throw new Error(o)}}else if(s!==void 0&&s>Ac){const o=this._errorMsg(`${i} cannot exceed MAX_UINT64 (2^64-1), given ${s}`);throw new Error(o)}break;case 256:if(r){if(s!==void 0&&s>=Lr){const o=this._errorMsg(`${i} cannot equal or exceed MAX_INTEGER (2^256-1), given ${s}`);throw new Error(o)}}else if(s!==void 0&&s>Lr){const o=this._errorMsg(`${i} cannot exceed MAX_INTEGER (2^256-1), given ${s}`);throw new Error(o)}break;default:{const o=this._errorMsg("unimplemented bits value");throw new Error(o)}}}static _validateNotArray(e){const n=["nonce","gasPrice","gasLimit","to","value","data","v","r","s","type","baseFee","maxFeePerGas","chainId"];for(const[r,i]of Object.entries(e))if(n.includes(r)&&Array.isArray(i))throw new Error(`${r} cannot be an array`)}_getSharedErrorPostfix(){let e="";try{e=this.isSigned()?te(this.hash()):"not available (unsigned)"}catch{e="error"}let n="";try{n=this.isSigned().toString()}catch{e="error"}let r="";try{r=this.common.hardfork()}catch{r="error"}let i=`tx type=${this.type} hash=${e} nonce=${this.nonce} value=${this.value} `;return i+=`signed=${n} hf=${r}`,i}_ecsign(e,n,r){const i=Vt.sign(e,n),s=i.toCompactRawBytes(),o=s.subarray(0,32),a=s.subarray(32,64),u=r===void 0?BigInt(i.recovery+27):BigInt(i.recovery+35)+BigInt(r)*BigInt(2);return{r:o,s:a,v:u}}static fromSerializedTx(e,n={}){}static fromTxData(e,n={}){}}const yo=2,Us=me(yo.toString(16).padStart(2,"0"));class Jt extends Kn{constructor(e,n={}){var r;super(Object.assign(Object.assign({},e),{type:yo}),n),this.DEFAULT_HARDFORK="london";const{chainId:i,accessList:s,maxFeePerGas:o,maxPriorityFeePerGas:a}=e;if(this.common=this._getCommon(n.common,i),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const u=Fd(s??[]);if(this.accessList=u.accessList,this.AccessListJSON=u.AccessListJSON,jd(this.accessList),this.maxFeePerGas=de(ge(o===""?"0x":o)),this.maxPriorityFeePerGas=de(ge(a===""?"0x":a)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),Kn._validateNotArray(e),this.gasLimit*this.maxFeePerGas>Lr){const c=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(c)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const c=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(c)}this._validateYParity(),this._validateHighS(),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}static fromTxData(e,n={}){return new Jt(e,n)}static fromSerializedTx(e,n={}){if(!ds(e.subarray(0,1),Us))throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ${yo}, received: ${te(e.subarray(0,1))}`);const r=Fe.decode(e.subarray(1));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Jt.fromValuesArray(r,n)}static fromValuesArray(e,n={}){if(e.length!==9&&e.length!==12)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");const[r,i,s,o,a,u,d,c,l,f,m,g]=e;return this._validateNotArray({chainId:r,v:f}),zo({nonce:i,maxPriorityFeePerGas:s,maxFeePerGas:o,gasLimit:a,value:d,v:f,r:m,s:g}),new Jt({chainId:de(r),nonce:i,maxPriorityFeePerGas:s,maxFeePerGas:o,gasLimit:a,to:u,value:d,data:c,accessList:l??[],v:f!==void 0?de(f):void 0,r:m,s:g},n)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let e=super.getDataFee();return e+=BigInt(Gd(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:e,hardfork:this.common.hardfork()}),e}getUpfrontCost(e=BigInt(0)){const n=this.maxPriorityFeePerGas,r=this.maxFeePerGas-e,s=(n<r?n:r)+e;return this.gasLimit*s+this.value}raw(){return[re(this.chainId),re(this.nonce),re(this.maxPriorityFeePerGas),re(this.maxFeePerGas),re(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),re(this.value),this.data,this.accessList,this.v!==void 0?re(this.v):Uint8Array.from([]),this.r!==void 0?re(this.r):Uint8Array.from([]),this.s!==void 0?re(this.s):Uint8Array.from([])]}serialize(){const e=this.raw();return Ne(Us,Fe.encode(e))}getMessageToSign(e=!0){const n=this.raw().slice(0,9),r=Ne(Us,Fe.encode(n));return e?Be(r):r}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Be(this.serialize())),this.cache.hash):Be(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const s=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(s)}const e=this.getMessageToVerifySignature(),{v:n,r,s:i}=this;this._validateHighS();try{return ya(e,n+BigInt(27),re(r),re(i))}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(e,n,r){const i=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Jt.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:e-BigInt(27),r:de(n),s:de(r)},i)}toJSON(){const e=Ud(this.accessList);return{chainId:ye(this.chainId),nonce:ye(this.nonce),maxPriorityFeePerGas:ye(this.maxPriorityFeePerGas),maxFeePerGas:ye(this.maxFeePerGas),gasLimit:ye(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:ye(this.value),data:te(this.data),accessList:e,v:this.v!==void 0?ye(this.v):void 0,r:this.r!==void 0?ye(this.r):void 0,s:this.s!==void 0?ye(this.s):void 0}}errorStr(){let e=this._getSharedErrorPostfix();return e+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}}const vo=1,Gs=me(vo.toString(16).padStart(2,"0"));class Xt extends Kn{constructor(e,n={}){var r;super(Object.assign(Object.assign({},e),{type:vo}),n),this.DEFAULT_HARDFORK="berlin";const{chainId:i,accessList:s,gasPrice:o}=e;if(this.common=this._getCommon(n.common,i),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);const a=Fd(s??[]);if(this.accessList=a.accessList,this.AccessListJSON=a.AccessListJSON,jd(this.accessList),this.gasPrice=de(ge(o===""?"0x":o)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),Kn._validateNotArray(e),this.gasPrice*this.gasLimit>Lr){const d=this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(d)}this._validateYParity(),this._validateHighS(),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}static fromTxData(e,n={}){return new Xt(e,n)}static fromSerializedTx(e,n={}){if(!ds(e.subarray(0,1),Gs))throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ${vo}, received: ${te(e.subarray(0,1))}`);const r=Fe.decode(Uint8Array.from(e.subarray(1)));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Xt.fromValuesArray(r,n)}static fromValuesArray(e,n={}){if(e.length!==8&&e.length!==11)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");const[r,i,s,o,a,u,d,c,l,f,m]=e;this._validateNotArray({chainId:r,v:l}),zo({nonce:i,gasPrice:s,gasLimit:o,value:u,v:l,r:f,s:m});const g=[];return new Xt({chainId:de(r),nonce:i,gasPrice:s,gasLimit:o,to:a,value:u,data:d,accessList:c??g,v:l!==void 0?de(l):void 0,r:f,s:m},n)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let e=super.getDataFee();return e+=BigInt(Gd(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:e,hardfork:this.common.hardfork()}),e}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}raw(){return[re(this.chainId),re(this.nonce),re(this.gasPrice),re(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),re(this.value),this.data,this.accessList,this.v!==void 0?re(this.v):Uint8Array.from([]),this.r!==void 0?re(this.r):Uint8Array.from([]),this.s!==void 0?re(this.s):Uint8Array.from([])]}serialize(){const e=this.raw();return Ne(Gs,Fe.encode(e))}getMessageToSign(e=!0){const n=this.raw().slice(0,8),r=Ne(Gs,Fe.encode(n));return e?Be(r):r}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Be(this.serialize())),this.cache.hash):Be(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const s=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(s)}const e=this.getMessageToVerifySignature(),{v:n,r,s:i}=this;this._validateHighS();try{return ya(e,n+BigInt(27),re(r),re(i))}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(e,n,r){const i=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Xt.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:e-BigInt(27),r:de(n),s:de(r)},i)}toJSON(){const e=Ud(this.accessList);return{chainId:ye(this.chainId),nonce:ye(this.nonce),gasPrice:ye(this.gasPrice),gasLimit:ye(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:ye(this.value),data:te(this.data),accessList:e,v:this.v!==void 0?ye(this.v):void 0,r:this.r!==void 0?ye(this.r):void 0,s:this.s!==void 0?ye(this.s):void 0}}errorStr(){var e,n;let r=this._getSharedErrorPostfix();return r+=` gasPrice=${this.gasPrice} accessListCount=${(n=(e=this.accessList)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0}`,r}_errorMsg(e){return`${e} (${this.errorStr()})`}}const Vb=0;function Sc(t,e){const n=Number(t),r=Number(e)*2;return n===r+35||n===r+36}class Ot extends Kn{constructor(e,n={}){var r;if(super(Object.assign(Object.assign({},e),{type:Vb}),n),this.common=this._validateTxV(this.v,n.common),this.gasPrice=de(ge(e.gasPrice===""?"0x":e.gasPrice)),this.gasPrice*this.gasLimit>Lr){const s=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(s)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),Kn._validateNotArray(e),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?Sc(this.v,this.common.chainId())&&this.activeCapabilities.push(ot.EIP155ReplayProtection):this.activeCapabilities.push(ot.EIP155ReplayProtection)),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}static fromTxData(e,n={}){return new Ot(e,n)}static fromSerializedTx(e,n={}){const r=Fe.decode(e);if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,n)}static fromValuesArray(e,n={}){if(e.length!==6&&e.length!==9)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");const[r,i,s,o,a,u,d,c,l]=e;return zo({nonce:r,gasPrice:i,gasLimit:s,value:a,v:d,r:c,s:l}),new Ot({nonce:r,gasPrice:i,gasLimit:s,to:o,value:a,data:u,v:d,r:c,s:l},n)}raw(){return[re(this.nonce),re(this.gasPrice),re(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),re(this.value),this.data,this.v!==void 0?re(this.v):Uint8Array.from([]),this.r!==void 0?re(this.r):Uint8Array.from([]),this.s!==void 0?re(this.s):Uint8Array.from([])]}serialize(){return Fe.encode(this.raw())}_getMessageToSign(){const e=[re(this.nonce),re(this.gasPrice),re(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),re(this.value),this.data];return this.supports(ot.EIP155ReplayProtection)&&(e.push(ge(this.common.chainId())),e.push(qi(ge(0))),e.push(qi(ge(0)))),e}getMessageToSign(e=!0){const n=this._getMessageToSign();return e?Be(Fe.encode(n)):n}getDataFee(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:super.getDataFee(),hardfork:this.common.hardfork()}),super.getDataFee())}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=Be(Fe.encode(this.raw()))),this.cache.hash):Be(Fe.encode(this.raw()))}getMessageToVerifySignature(){if(!this.isSigned()){const n=this._errorMsg("This transaction is not signed");throw new Error(n)}const e=this._getMessageToSign();return Be(Fe.encode(e))}getSenderPublicKey(){const e=this.getMessageToVerifySignature(),{v:n,r,s:i}=this;this._validateHighS();try{return ya(e,n,re(r),re(i),this.supports(ot.EIP155ReplayProtection)?this.common.chainId():void 0)}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(e,n,r){let i=e;this.supports(ot.EIP155ReplayProtection)&&(i+=this.common.chainId()*BigInt(2)+BigInt(8));const s=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Ot.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:i,r:de(n),s:de(r)},s)}toJSON(){return{nonce:ye(this.nonce),gasPrice:ye(this.gasPrice),gasLimit:ye(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:ye(this.value),data:te(this.data),v:this.v!==void 0?ye(this.v):void 0,r:this.r!==void 0?ye(this.r):void 0,s:this.s!==void 0?ye(this.s):void 0}}_validateTxV(e,n){let r;const i=e!==void 0?Number(e):void 0;if(i!==void 0&&i<37&&i!==27&&i!==28)throw new Error(`Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ${i}`);if(i!==void 0&&i!==0&&(!n||n.gteHardfork("spuriousDragon"))&&i!==27&&i!==28)if(n){if(!Sc(BigInt(i),n.chainId()))throw new Error(`Incompatible EIP155-based V ${i} and chain id ${n.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.`)}else{let s;(i-35)%2===0?s=35:s=36,r=BigInt(i-s)/BigInt(2)}return this._getCommon(n,r)}errorStr(){let e=this._getSharedErrorPostfix();return e+=` gasPrice=${this.gasPrice}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}}const qs=new Map;class pn{constructor(){}static typeToInt(e){return Number(de(ge(e)))}static registerTransactionType(e,n){const r=pn.typeToInt(e);qs.set(r,n)}static fromTxData(e,n={}){if(!("type"in e)||e.type===void 0)return Ot.fromTxData(e,n);const r=pn.typeToInt(e.type);if(r===0)return Ot.fromTxData(e,n);if(r===1)return Xt.fromTxData(e,n);if(r===2)return Jt.fromTxData(e,n);const i=qs.get(r);if(i!=null&&i.fromTxData)return i.fromTxData(e,n);throw new Error(`Tx instantiation with type ${r} not supported`)}static fromSerializedData(e,n={}){if(e[0]<=127)switch(e[0]){case 1:return Xt.fromSerializedTx(e,n);case 2:return Jt.fromSerializedTx(e,n);default:{const r=qs.get(Number(e[0]));if(r!=null&&r.fromSerializedTx)return r.fromSerializedTx(e,n);throw new Error(`TypedTransaction with ID ${e[0]} unknown`)}}else return Ot.fromSerializedTx(e,n)}static fromBlockBodyData(e,n={}){if(e instanceof Uint8Array)return this.fromSerializedData(e,n);if(Array.isArray(e))return Ot.fromValuesArray(e,n);throw new Error("Cannot decode transaction: unknown type input")}}var vs=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const bs=(t,e)=>{let n;if(!e&&typeof t=="string"&&ae(t)&&t.length!==66)throw new Ua;try{n=t instanceof Uint8Array?t:dt(t)}catch{throw new Fh}if(!e&&n.byteLength!==32)throw new Ua;return n},ba=t=>{const e=ae(t)?t:rt(t),n=me(e),r=me(Ru(`Ethereum Signed Message:
|
9
|
+
${n.byteLength}`)),i=Ne(r,n);return Ge(i)},qd=(t,e)=>{const n=bs(e),r=ba(t),i=Vt.sign(r.substring(2),n),s=i.toCompactRawBytes(),o=i.r.toString(16).padStart(64,"0"),a=i.s.toString(16).padStart(64,"0"),u=i.recovery+27;return{message:t,messageHash:r,v:Ue(u),r:`0x${o}`,s:`0x${a}`,signature:`${te(s)}${u.toString(16)}`}},zb=(t,e)=>vs(void 0,void 0,void 0,function*(){const n=t.sign(me(e));if(A(n.v)||A(n.r)||A(n.s))throw new Xs("Signer Error");const r=n.validate(!0);if(r.length>0){let o="Signer Error ";for(const a of r)o+=`${o} ${a}.`;throw new Xs(o)}const i=te(n.serialize()),s=Ge(i);return{messageHash:te(n.getMessageToSign(!0)),v:`0x${n.v.toString(16)}`,r:`0x${n.r.toString(16).padStart(64,"0")}`,s:`0x${n.s.toString(16).padStart(64,"0")}`,rawTransaction:i,transactionHash:te(s)}}),Qb=t=>{if(A(t))throw new nm;const e=pn.fromSerializedData(me(t));return ft(e.getSenderAddress().toString())},bo=(t,e,n,r,i)=>{if(typeof t=="object"){const l=`${t.r}${t.s.slice(2)}${t.v.slice(2)}`;return bo(t.messageHash,l,n)}if(typeof e=="string"&&typeof n=="string"&&!A(r)){const l=`${n}${r.slice(2)}${e.slice(2)}`;return bo(t,l,i)}if(A(e))throw new jh("signature string undefined");const s=130,o=n?t:ba(t);let a=parseInt(e.substring(s),16);a>26&&(a-=27);const u=Vt.Signature.fromCompact(e.slice(2,s)).addRecoveryBit(a).recoverPublicKey(o.replace("0x","")).toRawBytes(!1),d=Ge(u.subarray(1));return ft(`0x${d.slice(-40)}`)},wa=t=>{const e=bs(t),n=Vt.getPublicKey(e,!1),i=Ge(n.slice(1)).slice(-40);return ft(`0x${i}`)},Vd=(t,e,n)=>vs(void 0,void 0,void 0,function*(){var r,i,s,o,a,u,d;const c=bs(t);let l;if(n!=null&&n.salt?l=typeof n.salt=="string"?me(n.salt):n.salt:l=Nr(32),!(Go(e)||e instanceof Uint8Array))throw new qh;const f=typeof e=="string"?me(rt(e)):e;let m;if(n!=null&&n.iv){if(m=typeof n.iv=="string"?me(n.iv):n.iv,m.length!==16)throw new Vh}else m=Nr(16);const g=(r=n==null?void 0:n.kdf)!==null&&r!==void 0?r:"scrypt";let p,y;if(g==="pbkdf2"){if(y={dklen:(i=n==null?void 0:n.dklen)!==null&&i!==void 0?i:32,salt:te(l).replace("0x",""),c:(s=n==null?void 0:n.c)!==null&&s!==void 0?s:262144,prf:"hmac-sha256"},y.c<1e3)throw new zh;p=wd(f,l,y.c,y.dklen,"sha256")}else if(g==="scrypt")y={n:(o=n==null?void 0:n.n)!==null&&o!==void 0?o:8192,r:(a=n==null?void 0:n.r)!==null&&a!==void 0?a:8,p:(u=n==null?void 0:n.p)!==null&&u!==void 0?u:1,dklen:(d=n==null?void 0:n.dklen)!==null&&d!==void 0?d:32,salt:te(l).replace("0x","")},p=Ad(f,l,y.n,y.p,y.r,y.dklen);else throw new $c;const b=yield ca(c,p.slice(0,16),m,"aes-128-ctr"),_=te(b).slice(2),E=Ge(Ne(p.slice(16,32),b)).replace("0x","");return{version:3,id:na(),address:wa(c).toLowerCase().replace("0x",""),crypto:{ciphertext:_,cipherparams:{iv:te(m).replace("0x","")},cipher:"aes-128-ctr",kdf:g,kdfparams:y,mac:E}}}),Aa=(t,e)=>{const n=bs(t,e);return{address:wa(n),privateKey:te(n),signTransaction:r=>{throw new Xs("Do not have network access to sign the transaction")},sign:r=>qd(typeof r=="string"?r:JSON.stringify(r),n),encrypt:(r,i)=>vs(void 0,void 0,void 0,function*(){return Vd(n,r,i)})}},Zb=()=>{const t=Vt.utils.randomPrivateKey();return Aa(`${te(t)}`)},Wb=(t,e,n)=>vs(void 0,void 0,void 0,function*(){const r=typeof t=="object"?t:JSON.parse(n?t.toLowerCase():t);if(V.validateJSONSchema(Dv,r),r.version!==3)throw new Gh;const i=typeof e=="string"?me(rt(e)):e;V.validate(["bytes"],[i]);let s;if(r.crypto.kdf==="scrypt"){const d=r.crypto.kdfparams,c=typeof d.salt=="string"?me(d.salt):d.salt;s=Ad(i,c,d.n,d.p,d.r,d.dklen)}else if(r.crypto.kdf==="pbkdf2"){const d=r.crypto.kdfparams,c=typeof d.salt=="string"?me(d.salt):d.salt;s=wd(i,c,d.c,d.dklen,"sha256")}else throw new $c;const o=me(r.crypto.ciphertext);if(Ge(Ne(s.slice(16,32),o)).replace("0x","")!==r.crypto.mac)throw new Uh;const u=yield Fy(me(r.crypto.ciphertext),s.slice(0,16),me(r.crypto.cipherparams.iv));return Aa(u)}),kc={type:"object",properties:{accessList:{type:"null"},maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},Bc={type:"object",properties:{maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},Cc={type:"object",properties:{gasPrice:{type:"null"}}},Jr=(t,e,n)=>{try{V.validateJSONSchema(t,e)}catch(r){throw r instanceof Vn?new Sm(r.errors,n):r}},$b=t=>{var e,n;const r=t;if(!A(r.type)){let s;switch(r.type){case"0x0":s=kc;break;case"0x1":s=Bc;break;case"0x2":s=Cc;break;default:return S({format:"uint"},r.type,W)}return Jr(s,r,r.type),S({format:"uint"},r.type,W)}if(!A(r.maxFeePerGas)||!A(r.maxPriorityFeePerGas))return Jr(Cc,r,"0x2"),"0x2";if(!A(r.accessList))return Jr(Bc,r,"0x1"),"0x1";const i=(e=r.hardfork)!==null&&e!==void 0?e:(n=r.common)===null||n===void 0?void 0:n.hardfork;if(!A(i)){const s=Object.keys(mr).indexOf(i);if(s>=Object.keys(mr).indexOf("london"))return A(r.gasPrice)?"0x2":"0x0";if(s===Object.keys(mr).indexOf("berlin"))return"0x0"}if(!A(r.gasPrice))return Jr(kc,r,"0x0"),"0x0"},Kb=(t,e)=>{var n;return((n=e==null?void 0:e.transactionTypeParser)!==null&&n!==void 0?n:$b)(t)},Jb=t=>t[0]>127?"0x0":Ht(t[0]),Xb={type:"object",properties:{address:{format:"address"},storageKeys:{type:"array",items:{format:"bytes32"}}}},_a={type:"array",items:Object.assign({},Xb)},Yb={type:"object",properties:{accessList:Object.assign({},_a),gasUsed:{type:"string"}}},Rc={type:"string",enum:["goerli","kovan","mainnet","rinkeby","ropsten","sepolia"]},Pc={type:"string",enum:["arrowGlacier","berlin","byzantium","chainstart","constantinople","dao","homestead","istanbul","london","merge","muirGlacier","petersburg","shanghai","spuriousDragon","tangerineWhistle"]},ew={type:"object",properties:{name:{format:"string"},networkId:{format:"uint"},chainId:{format:"uint"}}},zd={type:"object",properties:{from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},_a),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},chain:Object.assign({},Rc),hardfork:Object.assign({},Pc),chainId:{format:"uint"},networkId:{format:"uint"},common:{type:"object",properties:{customChain:Object.assign({},ew),baseChain:Object.assign({},Rc),hardfork:Object.assign({},Pc)}},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}}},wo={type:"object",properties:Object.assign(Object.assign({},zd.properties),{blockHash:{format:"bytes32"},blockNumber:{format:"uint"},hash:{format:"bytes32"},transactionIndex:{format:"uint"},from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},_a),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}})},zi={type:"object",properties:{parentHash:{format:"bytes32"},sha3Uncles:{format:"bytes32"},miner:{format:"bytes"},stateRoot:{format:"bytes32"},transactionsRoot:{format:"bytes32"},receiptsRoot:{format:"bytes32"},logsBloom:{format:"bytes256"},difficulty:{format:"uint"},number:{format:"uint"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},timestamp:{format:"uint"},extraData:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},totalDifficulty:{format:"uint"},baseFeePerGas:{format:"uint"},size:{format:"uint"},transactions:{oneOf:[{type:"array",items:Object.assign({},wo)},{type:"array",items:{format:"bytes32"}}]},uncles:{type:"array",items:{format:"bytes32"}},hash:{format:"bytes32"}}},tw={type:"object",properties:{index:{format:"uint"},validatorIndex:{format:"uint"},address:{format:"address"},amount:{format:"uint"}}},nw={type:"object",properties:{author:{format:"bytes32"},hash:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},miner:{format:"bytes"},stateRoot:{format:"bytes32"},transactionsRoot:{format:"bytes32"},withdrawalsRoot:{format:"bytes32"},logsBloom:{format:"bytes256"},difficulty:{format:"uint"},totalDifficulty:{format:"uint"},number:{format:"uint"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},timestamp:{format:"uint"},extraData:{format:"bytes"},nonce:{format:"uint"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},baseFeePerGas:{format:"uint"},excessDataGas:{format:"uint"},mixHash:{format:"bytes32"},transactions:{type:"array",items:{format:"bytes32"}},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},tw)}}},ws={type:"object",properties:{removed:{format:"bool"},logIndex:{format:"uint"},transactionIndex:{format:"uint"},transactionHash:{format:"bytes32"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},address:{format:"address"},data:{format:"bytes"},topics:{type:"array",items:{format:"bytes32"}}}},rw={type:"object",properties:{startingBlock:{format:"string"},currentBlock:{format:"string"},highestBlock:{format:"string"},knownStates:{format:"string"},pulledStates:{format:"string"}}},nr={type:"object",properties:{transactionHash:{format:"bytes32"},transactionIndex:{format:"uint"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},from:{format:"address"},to:{format:"address"},cumulativeGasUsed:{format:"uint"},gasUsed:{format:"uint"},effectiveGasPrice:{format:"uint"},contractAddress:{format:"address"},logs:{type:"array",items:Object.assign({},ws)},logsBloom:{format:"bytes"},root:{format:"bytes"},status:{format:"uint"},type:{format:"uint"}}},iw={type:"object",properties:{messageHash:{format:"bytes"},r:{format:"bytes32"},s:{format:"bytes32"},v:{format:"bytes"},message:{format:"bytes"},signature:{format:"bytes"}}},sw={type:"object",properties:{oldestBlock:{format:"uint"},baseFeePerGas:{type:"array",items:{format:"uint"}},reward:{type:"array",items:{type:"array",items:{format:"uint"}}},gasUsedRatio:{type:"array",items:{type:"number"}}}},ow={type:"object",properties:{key:{format:"bytes32"},value:{format:"uint"},proof:{type:"array",items:{format:"bytes32"}}}},aw={type:"object",properties:{balance:{format:"uint"},codeHash:{format:"bytes32"},nonce:{format:"uint"},storageHash:{format:"bytes32"},accountProof:{type:"array",items:{format:"bytes32"}},storageProof:{type:"array",items:Object.assign({},ow)}}};function De(t,e=j,n={transactionSchema:wo,fillInputAndData:!1}){var r,i;let s=qt({},t);if(A(t==null?void 0:t.common)||(s.common=Object.assign({},t.common),A((r=t.common)===null||r===void 0?void 0:r.customChain)||(s.common.customChain=Object.assign({},t.common.customChain))),s=S((i=n.transactionSchema)!==null&&i!==void 0?i:wo,s,e),!A(s.data)&&!A(s.input)&&Ht(s.data)!==Ht(s.input))throw new eu({data:te(s.data),input:te(s.input)});return n.fillInputAndData&&(A(s.data)?A(s.input)||(s.data=s.input):s.input=s.data),A(s.gasLimit)||(s.gas=s.gasLimit,delete s.gasLimit),s}function cw(t,e,n={fillInputAndData:!1}){return{raw:S({format:"bytes"},t,e),tx:De(Object.assign(Object.assign({},pn.fromSerializedData(me(t)).toJSON()),{hash:te(Pr(me(t))),type:Jb(me(t))}),e,{fillInputAndData:n.fillInputAndData})}}var Ea=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};function xa(t,e){return Ea(this,void 0,void 0,function*(){const n=yield Ty(t.requestManager);return S({format:"uint"},n,e)})}function uw(t,e){return Ea(this,void 0,void 0,function*(){const n=yield Sy(t.requestManager);return S({format:"uint"},n,e)})}const dw=t=>Ea(void 0,void 0,void 0,function*(){return ky(t.requestManager)});var Vs=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class Qd extends lt{getId(e=j){return Vs(this,void 0,void 0,function*(){return xa(this,e)})}getPeerCount(e=j){return Vs(this,void 0,void 0,function*(){return uw(this,e)})}isListening(){return Vs(this,void 0,void 0,function*(){return dw(this)})}}const Jn="ALLEVENTS",Ao={name:Jn,signature:"",type:"event",inputs:[]},As={bytes:xt.HEX,number:$e.NUMBER};var Zd=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};function lw(t,e,n){var r,i,s;return Zd(this,void 0,void 0,function*(){const o=yield xl(e,e.defaultBlock,!1,n);if(A(o.baseFeePerGas))throw new _m;if(!A(t.gasPrice)){const a=S({format:"uint"},t.gasPrice,n);return{maxPriorityFeePerGas:a,maxFeePerGas:a}}return{maxPriorityFeePerGas:S({format:"uint"},(r=t.maxPriorityFeePerGas)!==null&&r!==void 0?r:e.defaultMaxPriorityFeePerGas,n),maxFeePerGas:S({format:"uint"},(i=t.maxFeePerGas)!==null&&i!==void 0?i:BigInt(o.baseFeePerGas)*BigInt(2)+BigInt((s=t.maxPriorityFeePerGas)!==null&&s!==void 0?s:e.defaultMaxPriorityFeePerGas),n)}})}function Wd(t,e,n){return Zd(this,void 0,void 0,function*(){const r=$d(t,e);if(!A(r)){if(r.startsWith("-"))throw new za(r);if(Number(r)<0||Number(r)>127)throw new za(r);if(A(t.gasPrice)&&(r==="0x0"||r==="0x1"))return{gasPrice:yield El(e,n),maxPriorityFeePerGas:void 0,maxFeePerGas:void 0};if(r==="0x2")return Object.assign({gasPrice:void 0},yield lw(t,e,n))}})}var Ia=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const _o=(t,e,n,r)=>{if(n!==void 0&&t in n&&n[t]!==void 0){if(typeof n[t]=="string"&&Ke(n[t]))return n[t];if(!ae(n[t])&&Bu(n[t])){if(e.wallet){const i=e.wallet.get(S({format:"uint"},n[t],As));if(!A(i))return i.address;throw new Qa}throw new Qa}else throw t==="from"?new rm(n.from):new im(n.to)}if(t==="from"){if(!A(r))return wa(r);if(!A(e.defaultAccount))return e.defaultAccount}},fw=(t,e,n=j)=>Ia(void 0,void 0,void 0,function*(){if(A(e))throw new Am;return Tl(t,e,t.defaultBlock,n)}),$d=(t,e)=>{const n=Kb(t,e);if(!A(n))return n;if(!A(e.defaultTransactionType))return S({format:"uint"},e.defaultTransactionType,W)};function hw(t){var e,n;return Ia(this,void 0,void 0,function*(){let r=S(zd,t.transaction,j);if(A(r.from)&&(r.from=_o("from",t.web3Context,void 0,t.privateKey)),A(r.nonce)&&(r.nonce=yield fw(t.web3Context,r.from,W)),A(r.value)&&(r.value="0x0"),A(r.data))A(r.input)?r.input="0x":r.input.startsWith("0x")||(r.input=`0x${r.input}`);else{if(!A(r.input)&&r.data!==r.input)throw new eu({data:te(r.data),input:te(r.input)});r.data.startsWith("0x")||(r.data=`0x${r.data}`)}if(A(r.common)){if(t.web3Context.defaultCommon){const i=t.web3Context.defaultCommon,s=i.customChain.chainId,o=i.customChain.networkId,a=i.customChain.name;r.common=Object.assign(Object.assign({},i),{customChain:{chainId:s,networkId:o,name:a}})}A(r.chain)&&(r.chain=t.web3Context.defaultChain),A(r.hardfork)&&(r.hardfork=t.web3Context.defaultHardfork)}if(A(r.chainId)&&A((e=r.common)===null||e===void 0?void 0:e.customChain.chainId)&&(r.chainId=yield kl(t.web3Context,W)),A(r.networkId)&&(r.networkId=(n=t.web3Context.defaultNetworkId)!==null&&n!==void 0?n:yield xa(t.web3Context,W)),A(r.gasLimit)&&!A(r.gas)&&(r.gasLimit=r.gas),r.type=$d(r,t.web3Context),A(r.accessList)&&(r.type==="0x1"||r.type==="0x2")&&(r.accessList=[]),t.fillGasPrice&&(r=Object.assign(Object.assign({},r),yield Wd(r,t.web3Context,W))),A(r.gas)&&A(r.gasLimit)&&t.fillGasLimit){const i=yield Oa(t.web3Context,r,"latest",W);r=Object.assign(Object.assign({},r),{gas:S({format:"uint"},i,W)})}return r})}const mw=t=>Ia(void 0,void 0,void 0,function*(){var e;return((e=t.web3Context.transactionBuilder)!==null&&e!==void 0?e:hw)(Object.assign(Object.assign({},t),{transaction:t.transaction}))});var Ta=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};function Eo(t,e,n){const r=t.transactionPollingInterval,[i,s]=Ju(()=>Ta(this,void 0,void 0,function*(){let a;try{a=yield Pa(t,As)}catch(d){console.warn("An error happen while trying to get the block number",d);return}const u=a-e;if(u>=t.transactionBlockTimeout)return new nu({starterBlockNumber:e,numberOfBlocks:u,transactionHash:n})}),r);return[s,{clean:()=>{clearInterval(i)}}]}function pw(t,e,n){var r;return Ta(this,void 0,void 0,function*(){let i=!0,s,o;function a(d,c){c&&console.warn("error happened at subscription. So revert to polling...",c),o.clean(),i=!1;const[l,f]=Eo(t,e,n);o.clean=f.clean,l.catch(m=>d(m))}try{s=yield(r=t.subscriptionManager)===null||r===void 0?void 0:r.subscribe("newHeads"),o={clean:()=>{var d;s.id&&((d=t.subscriptionManager)===null||d===void 0||d.removeSubscription(s).then(()=>{}).catch(()=>{}))}}}catch{return Eo(t,e,n)}return[new Promise((d,c)=>{try{s.on("data",l=>{if(i=!1,!(l!=null&&l.number))return;const f=Number(BigInt(l.number)-BigInt(e));f>=t.transactionBlockTimeout&&c(new nu({starterBlockNumber:e,numberOfBlocks:f,transactionHash:n}))}),s.on("error",l=>{a(c,l)})}catch(l){a(c,l)}setTimeout(()=>{i&&a(c)},t.blockHeaderTimeout*1e3)}),o]})}function Kd(t,e){var n,r;return Ta(this,void 0,void 0,function*(){const{provider:i}=t.requestManager;let s;const o=yield Pa(t,As);return!((r=(n=i).supportsSubscriptions)===null||r===void 0)&&r.call(n)&&t.enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout?s=yield pw(t,o,e):s=Eo(t,o,e),s})}var gw=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};function xo(t,e,n){return gw(this,void 0,void 0,function*(){const[r,i]=ta(t.transactionSendTimeout,new Em({numberOfSeconds:t.transactionSendTimeout/1e3,transactionHash:n})),[s,o]=yield Kd(t,n);try{return yield Promise.race([e(),i,s])}finally{clearTimeout(r),o.clean()}})}var Nc=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};function Jd(t,e,n){var r;return Nc(this,void 0,void 0,function*(){const i=(r=t.transactionReceiptPollingInterval)!==null&&r!==void 0?r:t.transactionPollingInterval,[s,o]=ea(()=>Nc(this,void 0,void 0,function*(){try{return Il(t,e,n)}catch(l){console.warn("An error happen while trying to get the transaction receipt",l);return}}),i),[a,u]=ta(t.transactionPollingTimeout,new xm({numberOfSeconds:t.transactionPollingTimeout/1e3,transactionHash:e})),[d,c]=yield Kd(t,e);try{return yield Promise.race([s,u,d])}finally{a&&clearTimeout(a),o&&clearInterval(o),c.clean()}})}var yw=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const ai=({web3Context:t,transactionReceipt:e,transactionPromiEvent:n,returnFormat:r})=>{var i;let s=1;const o=setInterval(()=>{yw(void 0,void 0,void 0,function*(){s>=t.transactionConfirmationBlocks&&clearInterval(o);const a=yield md(t.requestManager,Ue(BigInt(e.blockNumber)+BigInt(s)),!1);a!=null&&a.hash&&(s+=1,n.emit("confirmation",{confirmations:S({format:"uint"},s,r),receipt:S(nr,e,r),latestBlockHash:S({format:"bytes32"},a.hash,r)}))})},(i=t.transactionReceiptPollingInterval)!==null&&i!==void 0?i:t.transactionPollingInterval)};var Oc=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const vw=({web3Context:t,transactionReceipt:e,transactionPromiEvent:n,returnFormat:r})=>{let i=!0,s;setImmediate(()=>{var o;(o=t.subscriptionManager)===null||o===void 0||o.subscribe("newHeads").then(a=>{a.on("data",u=>Oc(void 0,void 0,void 0,function*(){var d;if(i=!1,!(u!=null&&u.number)||s===(u==null?void 0:u.parentHash))return;s=u==null?void 0:u.parentHash;const c=BigInt(u.number)-BigInt(e.blockNumber)+BigInt(1);n.emit("confirmation",{confirmations:S({format:"uint"},c,r),receipt:S(nr,e,r),latestBlockHash:S({format:"bytes32"},u.parentHash,r)}),c>=t.transactionConfirmationBlocks&&(yield(d=t.subscriptionManager)===null||d===void 0?void 0:d.removeSubscription(a))})),a.on("error",()=>Oc(void 0,void 0,void 0,function*(){var u;yield(u=t.subscriptionManager)===null||u===void 0?void 0:u.removeSubscription(a),i=!1,ai({web3Context:t,transactionReceipt:e,transactionPromiEvent:n,returnFormat:r})}))}).catch(()=>{i=!1,ai({web3Context:t,transactionReceipt:e,transactionPromiEvent:n,returnFormat:r})})}),setTimeout(()=>{i&&ai({web3Context:t,transactionReceipt:e,transactionPromiEvent:n,returnFormat:r})},t.blockHeaderTimeout*1e3)};function bw(t,e,n,r,i){if(A(n)||A(n.blockHash))throw new Im({receipt:n,blockHash:S({format:"bytes32"},n==null?void 0:n.blockHash,i),transactionHash:S({format:"bytes32"},r,i)});if(!n.blockNumber)throw new Tm({receipt:n});e.emit("confirmation",{confirmations:S({format:"uint"},1,i),receipt:S(nr,n,i),latestBlockHash:S({format:"bytes32"},n.blockHash,i)});const s=t.requestManager.provider;s&&"supportsSubscriptions"in s&&s.supportsSubscriptions()?vw({web3Context:t,transactionReceipt:n,transactionPromiEvent:e,returnFormat:i}):ai({web3Context:t,transactionReceipt:n,transactionPromiEvent:e,returnFormat:i})}const _s=t=>!Z(t)&&typeof t=="object"&&!Z(t.type)&&t.type==="error",Sa=t=>!Z(t)&&typeof t=="object"&&!Z(t.type)&&t.type==="event",Es=t=>!Z(t)&&typeof t=="object"&&!Z(t.type)&&t.type==="function",ww=t=>!Z(t)&&typeof t=="object"&&!Z(t.type)&&t.type==="constructor",Aw=t=>typeof t=="object"&&typeof t.components>"u"&&typeof t.name>"u",Xd=t=>t.includes("[]")?{type:"tuple[]",name:t.slice(0,-2)}:{type:"tuple",name:t},Yd=t=>{const e=[];for(const n of Object.keys(t)){const r=t[n];typeof r=="object"?e.push(Object.assign(Object.assign({},Xd(n)),{components:Yd(r)})):e.push({name:n,type:t[n]})}return e},Io=(t,e)=>{const n=[];return e.forEach(r=>{if(typeof r.components=="object"){if(!r.type.startsWith("tuple"))throw new ie(`Invalid value given "${r.type}". Error: components found but type is not tuple.`);const i=r.type.indexOf("["),s=i>=0?r.type.substring(i):"",o=Io(t,r.components);Array.isArray(o)&&t?n.push(`tuple(${o.join(",")})${s}`):t?n.push(`(${o.join()})`):n.push(`(${o.join(",")})${s}`)}else n.push(r.type)}),n},gn=t=>{var e,n,r,i;return _s(t)||Sa(t)||Es(t)?!((e=t.name)===null||e===void 0)&&e.includes("(")?t.name:`${(n=t.name)!==null&&n!==void 0?n:""}(${Io(!1,(r=t.inputs)!==null&&r!==void 0?r:[]).join(",")})`:`(${Io(!1,(i=t.inputs)!==null&&i!==void 0?i:[]).join(",")})`},_w=t=>{if(typeof t!="string"&&!_s(t))throw new ie("Invalid parameter value in encodeErrorSignature");let e;return t&&(typeof t=="function"||typeof t=="object")?e=gn(t):e=t,Ge(e)},ka=t=>{if(typeof t!="string"&&!Sa(t))throw new ie("Invalid parameter value in encodeEventSignature");let e;return t&&(typeof t=="function"||typeof t=="object")?e=gn(t):e=t,Ge(e)};function Ba(t,e){const n=t.exec(e);return n==null?void 0:n.groups}var el=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,tl=/^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)?$/,nl=/^\(.+?\).*?$/,Ew=Object.defineProperty,xw=(t,e,n)=>e in t?Ew(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ar=(t,e,n)=>(xw(t,typeof e!="symbol"?e+"":e,n),n),Iw="abitype",Tw="0.7.1",Me=class extends Error{constructor(t,e={}){var s;const n=e.cause instanceof Me?e.cause.details:(s=e.cause)!=null&&s.message?e.cause.message:e.details,r=e.cause instanceof Me&&e.cause.docsPath||e.docsPath,i=[t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...n?[`Details: ${n}`]:[],`Version: ${Iw}@${Tw}`].join(`
|
10
|
+
`);super(i),ar(this,"details"),ar(this,"docsPath"),ar(this,"metaMessages"),ar(this,"shortMessage"),ar(this,"name","AbiTypeError"),e.cause&&(this.cause=e.cause),this.details=n,this.docsPath=r,this.metaMessages=e.metaMessages,this.shortMessage=t}},rl=/^struct (?<name>[a-zA-Z0-9_]+) \{(?<properties>.*?)\}$/;function il(t){return rl.test(t)}function Sw(t){return Ba(rl,t)}var Mc=new Set(["memory","indexed","storage","calldata"]),kw=new Set(["calldata","memory","storage"]);function Bw(t,e){return e?`${e}:${t}`:t}var zs=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}]]),Cw=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,Rw=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,Pw=/^u?int$/;function Qi(t,e){var l,f;const n=Bw(t,e==null?void 0:e.type);if(zs.has(n))return zs.get(n);const r=nl.test(t),i=Ba(r?Rw:Cw,t);if(!i)throw new Me("Invalid ABI parameter.",{details:t});if(i.name&&Ow(i.name))throw new Me("Invalid ABI parameter.",{details:t,metaMessages:[`"${i.name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]});const s=i.name?{name:i.name}:{},o=i.modifier==="indexed"?{indexed:!0}:{},a=(e==null?void 0:e.structs)??{};let u,d={};if(r){u="tuple";const m=Rn(i.type),g=[],p=m.length;for(let y=0;y<p;y++)g.push(Qi(m[y],{structs:a}));d={components:g}}else if(i.type in a)u="tuple",d={components:a[i.type]};else if(Pw.test(i.type))u=`${i.type}256`;else if(u=i.type,(e==null?void 0:e.type)!=="struct"&&!sl(u))throw new Me("Unknown type.",{metaMessages:[`Type "${u}" is not a valid ABI type.`]});if(i.modifier){if(!((f=(l=e==null?void 0:e.modifiers)==null?void 0:l.has)!=null&&f.call(l,i.modifier)))throw new Me("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${i.modifier}" not allowed${e!=null&&e.type?` in "${e.type}" type`:""}.`]});if(kw.has(i.modifier)&&!Mw(u,!!i.array))throw new Me("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${i.modifier}" not allowed${e!=null&&e.type?` in "${e.type}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${i.modifier}" was given.`]})}const c={type:`${u}${i.array??""}`,...s,...o,...d};return zs.set(n,c),c}function Rn(t,e=[],n="",r=0){if(t===""){if(n==="")return e;if(r!==0)throw new Me("Unbalanced parentheses.",{metaMessages:[`"${n.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`});return[...e,n.trim()]}const i=t.length;for(let s=0;s<i;s++){const o=t[s],a=t.slice(s+1);switch(o){case",":return r===0?Rn(a,[...e,n.trim()]):Rn(a,e,`${n}${o}`,r);case"(":return Rn(a,e,`${n}${o}`,r+1);case")":return Rn(a,e,`${n}${o}`,r-1);default:return Rn(a,e,`${n}${o}`,r)}}return[]}function sl(t){return t==="address"||t==="bool"||t==="function"||t==="string"||el.test(t)||tl.test(t)}var Nw=/^(?: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)$/;function Ow(t){return t==="address"||t==="bool"||t==="function"||t==="string"||t==="tuple"||el.test(t)||tl.test(t)||Nw.test(t)}function Mw(t,e){return e||t==="bytes"||t==="string"||t==="tuple"}function Lw(t){const e={},n=t.length;for(let o=0;o<n;o++){const a=t[o];if(!il(a))continue;const u=Sw(a);if(!u)throw new Me("Invalid struct signature.",{details:a});const d=u.properties.split(";"),c=[],l=d.length;for(let f=0;f<l;f++){const g=d[f].trim();if(!g)continue;const p=Qi(g,{type:"struct"});c.push(p)}if(!c.length)throw new Me("Invalid struct signature.",{details:a,metaMessages:["No properties exist."]});e[u.name]=c}const r={},i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[a,u]=i[o];r[a]=ol(u,e)}return r}var Dw=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?$/;function ol(t,e,n=new Set){const r=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];if(nl.test(o.type))r.push(o);else{const u=Ba(Dw,o.type);if(!(u!=null&&u.type))throw new Me("Invalid ABI parameter.",{details:JSON.stringify(o,null,2),metaMessages:["ABI parameter type is invalid."]});const{array:d,type:c}=u;if(c in e){if(n.has(c))throw new Me("Circular reference detected.",{metaMessages:[`Struct "${c}" is a circular reference.`]});r.push({...o,type:`tuple${d??""}`,components:ol(e[c]??[],e,new Set([...n,c]))})}else if(sl(c))r.push(o);else throw new Me("Unknown type.",{metaMessages:[`Type "${c}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]})}}return r}function Hw(t){let e;if(typeof t=="string")e=Qi(t,{modifiers:Mc});else{const n=Lw(t),r=t.length;for(let i=0;i<r;i++){const s=t[i];if(!il(s)){e=Qi(s,{modifiers:Mc,structs:n});break}}}if(!e)throw new Me("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(t,null,2)})`,docsPath:"/api/human.html#parseabiparameter-1"});return e}const be=32;function To(t=0){var e;if(((e=globalThis.Buffer)===null||e===void 0?void 0:e.alloc)!==void 0){const n=globalThis.Buffer.alloc(t);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}return new Uint8Array(t)}function al(t){var e,n;return Object.assign(Object.assign({},t),{name:(e=t.name)!==null&&e!==void 0?e:"",components:(n=t.components)===null||n===void 0?void 0:n.map(r=>al(r))})}function Fw(t){return!Z(t)&&typeof t=="object"&&!Z(t.type)&&typeof t.type=="string"}function cl(t){return t.map(e=>{var n;if(Fw(e))return e;if(typeof e=="string")return al(Hw(e.replace(/tuple/,"")));if(Aw(e)){const r=Object.keys(e)[0],i=Xd(r);return i.name=(n=i.name)!==null&&n!==void 0?n:"",Object.assign(Object.assign({},i),{components:Yd(e[r])})}throw new ie("Invalid abi")})}function Ca(t){const e=t.type.lastIndexOf("["),n=t.type.substring(0,e),r=t.type.substring(e);let i=-1;if(r!=="[]"&&(i=Number(r.slice(1,-1)),isNaN(i)))throw new ie("Invalid fixed array size",{size:r});return{param:{type:n,name:"",components:t.components},size:i}}function Zi(t){var e,n;return t.type==="string"||t.type==="bytes"||t.type.endsWith("[]")?!0:t.type==="tuple"?(n=(e=t.components)===null||e===void 0?void 0:e.some(Zi))!==null&&n!==void 0?n:!1:t.type.endsWith("]")?Zi(Ca(t).param):!1}const ul=20,dl=be-ul;function jw(t,e){if(typeof e!="string")throw new ie("address type expects string as input type",{value:e,name:t.name,type:t.type});let n=e.toLowerCase();if(n.startsWith("0x")||(n=`0x${n}`),!Ke(n))throw new ie("provided input is not valid address",{value:e,name:t.name,type:t.type});const r=bn(n),i=To(be);return i.set(r,dl),{dynamic:!1,encoded:i}}function Uw(t,e){const n=e.subarray(dl,be);if(n.length!==ul)throw new ie("Invalid decoding input, not enough bytes to decode address",{bytes:e});const r=Ut(n);return{result:ft(r),encoded:e.subarray(be),consumed:be}}const Ft=new Map;let Xr=BigInt(256);for(let t=8;t<=256;t+=8)Ft.set(`uint${t}`,{min:BigInt(0),max:Xr-BigInt(1)}),Ft.set(`int${t}`,{min:-Xr/BigInt(2),max:Xr/BigInt(2)-BigInt(1)}),Xr*=BigInt(256);Ft.set("int",Ft.get("int256"));Ft.set("uint",Ft.get("uint256"));const ll=BigInt(1)<<BigInt(256);function Gw(t,e=be){let n;return t<0?n=(ll+t).toString(16):n=t.toString(16),n=zn(n,e*2),bn(n)}function qw(t,e){const n=Ut(t),r=BigInt(n);return r<=e?r:r-ll}function $r(t,e){let n;try{n=$t(e)}catch{throw new ie("provided input is not number value",{type:t.type,value:e,name:t.name})}const r=Ft.get(t.type);if(!r)throw new ie("provided abi contains invalid number datatype",{type:t.type});if(n<r.min)throw new ie("provided input is less then minimum for given type",{type:t.type,value:e,name:t.name,minimum:r.min.toString()});if(n>r.max)throw new ie("provided input is greater then maximum for given type",{type:t.type,value:e,name:t.name,maximum:r.max.toString()});return{dynamic:!1,encoded:Gw(n)}}function Xn(t,e){if(e.length<be)throw new ie("Not enough bytes left to decode",{param:t,bytesLeft:e.length});const n=e.subarray(0,be),r=Ft.get(t.type);if(!r)throw new ie("provided abi contains invalid number datatype",{type:t.type});const i=qw(n,r.max);if(i<r.min)throw new ie("decoded value is less then minimum for given type",{type:t.type,value:i,name:t.name,minimum:r.min.toString()});if(i>r.max)throw new ie("decoded value is greater then maximum for given type",{type:t.type,value:i,name:t.name,maximum:r.max.toString()});return{result:i,encoded:e.subarray(be),consumed:be}}function Vw(t,e){let n;try{n=Ou(e)}catch(r){if(r instanceof jo)throw new ie("provided input is not valid boolean value",{type:t.type,value:e,name:t.name})}return $r({type:"uint8",name:""},Number(n))}function zw(t,e){const n=Xn({type:"uint8",name:""},e);if(n.result>1||n.result<0)throw new ie("Invalid boolean value encoded",{boolBytes:e.subarray(0,be),numberResult:n});return{result:n.result===BigInt(1),encoded:n.encoded,consumed:be}}const Qw=32;function fl(t,e){if(typeof e=="string"&&e.length%2!==0&&(e+="0"),!Gt(e))throw new ie("provided input is not valid bytes value",{type:t.type,value:e,name:t.name});const n=dt(e),[,r]=t.type.split("bytes");if(r){if(Number(r)>Qw||Number(r)<1)throw new ie("invalid bytes type. Static byte type can have between 1 and 32 bytes",{type:t.type});if(Number(r)<n.length)throw new ie("provided input size is different than type size",{type:t.type,value:e,name:t.name});const o=To(be);return o.set(n),{dynamic:!1,encoded:o}}const i=Math.ceil(n.length/be),s=To(be+i*be);return s.set($r({type:"uint32",name:""},n.length).encoded),s.set(n,be),{dynamic:!0,encoded:s}}function hl(t,e){const[,n]=t.type.split("bytes");let r=Number(n),i=e,s=1,o=0;if(!r){const a=Xn({type:"uint32",name:""},i);r=Number(a.result),o+=a.consumed,i=a.encoded,s=Math.ceil(r/be)}if(r>e.length)throw new ie("there is not enough data to decode",{type:t.type,encoded:e,size:r});return{result:te(i.subarray(0,r)),encoded:i.subarray(s*be),consumed:o+s*be}}function Zw(t,e){if(typeof e!="string")throw new ie("invalid input, should be string",{input:e});const n=Ko(e);return fl({type:"bytes",name:""},n)}function Ww(t,e){const n=hl({type:"bytes",name:""},e);return{result:cs(n.result),encoded:n.encoded,consumed:n.consumed}}function ml(t){let e=0,n=0;const r=[],i=[];for(const s of t)s.dynamic?e+=be:e+=s.encoded.length;for(const s of t)s.dynamic?(r.push($r({type:"uint256",name:""},e+n)),i.push(s),n+=s.encoded.length):r.push(s);return Ne(...r.map(s=>s.encoded),...i.map(s=>s.encoded))}function $w(t,e){if(!Array.isArray(e))throw new ie("Expected value to be array",{abi:t,values:e});const{size:n,param:r}=Ca(t),i=e.map(a=>So(r,a)),s=n===-1,o=i.length>0&&i[0].dynamic;if(!s&&e.length!==n)throw new ie("Given arguments count doesn't match array length",{arrayLength:n,argumentsLength:e.length});if(s||o){const a=ml(i);if(s){const u=$r({type:"uint256",name:""},i.length).encoded;return{dynamic:!0,encoded:i.length>0?Ne(u,a):u}}return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:Ne(...i.map(a=>a.encoded))}}function Kw(t,e){let{size:n,param:r}=Ca(t);const i=n===-1;let s=0;const o=[];let a=e;if(i){const d=Xn({type:"uint32",name:""},e);n=Number(d.result),s=d.consumed,a=d.encoded}if(Zi(r)){for(let d=0;d<n;d+=1){const c=Xn({type:"uint32",name:""},a.subarray(d*be));s+=c.consumed;const l=Wi(r,a.subarray(Number(c.result)));s+=l.consumed,o.push(l.result)}return{result:o,encoded:a.subarray(s),consumed:s}}for(let d=0;d<n;d+=1){const c=Wi(r,e.subarray(s));s+=c.consumed,o.push(c.result)}return{result:o,encoded:e.subarray(s),consumed:s}}function So(t,e){if(t.type==="string")return Zw(t,e);if(t.type==="bool")return Vw(t,e);if(t.type==="address")return jw(t,e);if(t.type==="tuple")return pl(t,e);if(t.type.endsWith("]"))return $w(t,e);if(t.type.startsWith("bytes"))return fl(t,e);if(t.type.startsWith("uint")||t.type.startsWith("int"))return $r(t,e);throw new Error("Unsupported")}function Wi(t,e){if(t.type==="string")return Ww(t,e);if(t.type==="bool")return zw(t,e);if(t.type==="address")return Uw(t,e);if(t.type==="tuple")return gl(t,e);if(t.type.endsWith("]"))return Kw(t,e);if(t.type.startsWith("bytes"))return hl(t,e);if(t.type.startsWith("uint")||t.type.startsWith("int"))return Xn(t,e);throw new Error("Unsupported")}function pl(t,e){var n,r,i;let s=!1;if(!Array.isArray(e)&&typeof e!="object")throw new ie("param must be either Array or Object",{param:t,input:e});const o=e,a=[];for(let u=0;u<((r=(n=t.components)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0);u+=1){const d=t.components[u];let c;if(Array.isArray(o)){if(u>=o.length)throw new ie("input param length missmatch",{param:t,input:e});c=So(d,o[u])}else{const l=o[(i=d.name)!==null&&i!==void 0?i:""];if(l==null)throw new ie("missing input defined in abi",{param:t,input:e,paramName:d.name});c=So(d,l)}c.dynamic&&(s=!0),a.push(c)}return s?{dynamic:!0,encoded:ml(a)}:{dynamic:!1,encoded:Ne(...a.map(u=>u.encoded))}}function gl(t,e){const n={__length__:0};let r=0;if(!t.components)return{result:n,encoded:e,consumed:r};let i=0;for(const[s,o]of t.components.entries()){let a;if(Zi(o)){const u=Xn({type:"uint32",name:""},e.subarray(r));a=Wi(o,e.subarray(Number(u.result))),r+=u.consumed,i+=a.consumed}else a=Wi(o,e.subarray(r)),r+=a.consumed;n.__length__+=1,n[s]=a.result,o.name&&o.name!==""&&(n[o.name]=a.result)}return{encoded:e.subarray(r+i),result:n,consumed:r+i}}function Jw(t,e,n){const r=cl(t),i=bn(e);return gl({type:"tuple",name:"",components:r},i).result}function Xw(t,e){if(t.length!==e.length)throw new ie("Invalid number of values received for given ABI",{expected:t.length,received:e.length});const n=cl(t);return Ut(pl({type:"tuple",name:"",components:n},e).encoded)}const xs=(t,e)=>Xw(t,e),ko=(t,e)=>xs([t],[e]),yl=(t,e,n)=>{try{if(t.length>0&&(!e||e==="0x"||e==="0X"))throw new ie("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");return Jw(t,`0x${e.replace(/0x/i,"")}`,n)}catch(r){throw new ie(`Parameter decoding error: ${r.message}`,{internalErr:r})}},Is=(t,e)=>yl(t,e,!1),vl=(t,e)=>Is([t],e)[0],Ts=t=>{if(typeof t!="string"&&!Es(t))throw new ie("Invalid parameter value in encodeFunctionSignature");let e;return t&&(typeof t=="function"||typeof t=="object")?e=gn(t):e=t,Ge(e).slice(0,10)},Yw=(t,e)=>{var n;if(!Es(t))throw new ie("Invalid parameter value in encodeFunctionCall");return`${Ts(t)}${xs((n=t.inputs)!==null&&n!==void 0?n:[],e??[]).replace("0x","")}`},eA=["bool","string","int","uint","address","fixed","ufixed"],tA=(t,e)=>t==="string"?e:vl(t,e),bl=(t,e,n)=>{const r=Array.isArray(n)?n:[n],i={},s={};for(const[f,m]of t.entries())m.indexed?i[f]=m:s[f]=m;const o=e?yl(Object.values(s),e,!0):{__length__:0},a=r.length-Object.keys(i).length,u=Object.values(i).map((f,m)=>eA.some(g=>f.type.startsWith(g))?tA(f.type,r[m+a]):r[m+a]),d={__length__:0};let c=0,l=0;for(const[f,m]of t.entries())d[f]=m.type==="string"?"":void 0,i[f]&&(d[f]=u[c],c+=1),s[f]&&(d[f]=o[String(l)],l+=1),m.name&&(d[m.name]=d[f]),d.__length__+=1;return d},ci=(t,e)=>{if(e!=null&&e.data){let n,r,i;try{const s=e.data.slice(0,10),o=t.find(a=>_w(a).startsWith(s));o!=null&&o.inputs&&(n=o.name,r=gn(o),i=Is([...o.inputs],e.data.substring(10)))}catch(s){console.error(s)}n&&e.setDecodedProperties(n,r,i)}};var nA=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const wl=(t,e)=>{var n,r,i,s;if(t instanceof nn&&t.innerError instanceof ts){if(e!==void 0){const o=e.filter(a=>_s(a));return ci(o,t.innerError),{reason:t.innerError.message,signature:(n=t.innerError.data)===null||n===void 0?void 0:n.slice(0,10),data:(r=t.innerError.data)===null||r===void 0?void 0:r.substring(10),customErrorName:t.innerError.errorName,customErrorDecodedSignature:t.innerError.errorSignature,customErrorArguments:t.innerError.errorArgs}}return{reason:t.innerError.message,signature:(i=t.innerError.data)===null||i===void 0?void 0:i.slice(0,10),data:(s=t.innerError.data)===null||s===void 0?void 0:s.substring(10)}}if(t instanceof yr&&!Array.isArray(t.innerError)&&t.innerError!==void 0)return t.innerError.message;throw t};function Al(t,e,n,r=j){return nA(this,void 0,void 0,function*(){try{yield Na(t,e,t.defaultBlock,r);return}catch(i){return wl(i,n)}})}var rA=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};function Qs(t,e,n,r,i,s){return rA(this,void 0,void 0,function*(){let o=s;o===void 0&&(r!==void 0?o=wl(r):t.handleRevert&&e!==void 0&&(o=yield Al(t,e,i)));let a;if(o===void 0)a=new Xc(n);else if(typeof o=="string")a=new _i(o,void 0,n);else if(o.customErrorName!==void 0&&o.customErrorDecodedSignature!==void 0&&o.customErrorArguments!==void 0){const u=o;a=new Jc(u.reason,u.customErrorName,u.customErrorDecodedSignature,u.customErrorArguments,u.signature,n,u.data)}else a=new _i(o.reason,o.signature,n,o.data);return a})}const Ra=(t,e,n,r=j)=>{var i,s,o,a,u;let d=Object.assign({},t);const c=S(ws,e,r);if([Jn,"allEvents"].includes(d.name)){const f=n.find(m=>m.signature===e.topics[0]);f?d=f:d={anonymous:!0}}if(d.inputs=(s=(i=d.inputs)!==null&&i!==void 0?i:t.inputs)!==null&&s!==void 0?s:[],!d.anonymous){let f=0;((o=d.inputs)!==null&&o!==void 0?o:[]).forEach(m=>{m.indexed&&(f+=1)}),f>0&&(e!=null&&e.topics)&&(e==null?void 0:e.topics.length)!==f+1&&(d=Object.assign(Object.assign({},d),{anonymous:!0,inputs:[]}))}const l=d.anonymous?e.topics:((a=e.topics)!==null&&a!==void 0?a:[]).slice(1);return Object.assign(Object.assign({},c),{returnValues:bl([...(u=d.inputs)!==null&&u!==void 0?u:[]],e.data,l),event:d.name,signature:d.anonymous||!e.topics||e.topics.length===0||!e.topics[0]?void 0:e.topics[0],raw:{data:e.data,topics:e.topics}})};var Qt=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class _l{constructor({options:e,web3Context:n,promiEvent:r,returnFormat:i}){this.options={checkRevertBeforeSending:!0},this.options=e,this.web3Context=n,this.promiEvent=r,this.returnFormat=i}getReceiptWithEvents(e){var n,r;const i=Object.assign({},e??{});if(!((n=this.options)===null||n===void 0)&&n.contractAbi&&i.logs&&i.logs.length>0){i.events={};for(const s of i.logs){const o=Ra(Ao,s,(r=this.options)===null||r===void 0?void 0:r.contractAbi,this.returnFormat);o.event&&(i.events[o.event]=o)}}return i}checkRevertBeforeSending(e){return Qt(this,void 0,void 0,function*(){if(this.options.checkRevertBeforeSending!==!1){const n=yield Al(this.web3Context,e,this.options.contractAbi);if(n!==void 0)throw yield Qs(this.web3Context,e,void 0,void 0,this.options.contractAbi,n)}})}emitSending(e){this.promiEvent.listenerCount("sending")>0&&this.promiEvent.emit("sending",e)}populateGasPrice({transactionFormatted:e,transaction:n}){var r;return Qt(this,void 0,void 0,function*(){let i=e;return!(!((r=this.options)===null||r===void 0)&&r.ignoreGasPricing)&&A(e.gasPrice)&&(A(n.maxPriorityFeePerGas)||A(n.maxFeePerGas))&&(i=Object.assign(Object.assign({},e),yield Wd(e,this.web3Context,W))),i})}signAndSend({wallet:e,tx:n}){return Qt(this,void 0,void 0,function*(){if(e){const r=yield e.signTransaction(n);return xo(this.web3Context,()=>Qt(this,void 0,void 0,function*(){return hd(this.web3Context.requestManager,r.rawTransaction)}),r.transactionHash)}return xo(this.web3Context,()=>Qt(this,void 0,void 0,function*(){return sy(this.web3Context.requestManager,n)}))})}emitSent(e){this.promiEvent.listenerCount("sent")>0&&this.promiEvent.emit("sent",e)}emitTransactionHash(e){this.promiEvent.listenerCount("transactionHash")>0&&this.promiEvent.emit("transactionHash",e)}emitReceipt(e){this.promiEvent.listenerCount("receipt")>0&&this.promiEvent.emit("receipt",e)}handleError({error:e,tx:n}){var r;return Qt(this,void 0,void 0,function*(){let i=e;return i instanceof nn&&this.web3Context.handleRevert&&(i=yield Qs(this.web3Context,n,void 0,void 0,(r=this.options)===null||r===void 0?void 0:r.contractAbi)),(i instanceof yr||i instanceof nn||i instanceof Jc||i instanceof Xc||i instanceof _i)&&this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",i),i})}emitConfirmation({receipt:e,transactionHash:n}){this.promiEvent.listenerCount("confirmation")>0&&bw(this.web3Context,this.promiEvent,e,n,this.returnFormat)}handleResolve({receipt:e,tx:n}){var r,i,s;return Qt(this,void 0,void 0,function*(){if(!((r=this.options)===null||r===void 0)&&r.transactionResolver)return(i=this.options)===null||i===void 0?void 0:i.transactionResolver(e);if(e.status===BigInt(0)){const o=yield Qs(this.web3Context,n,e,void 0,(s=this.options)===null||s===void 0?void 0:s.contractAbi);throw this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",o),o}else return e})}}var ce=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})},iA=globalThis&&globalThis.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const sA=t=>ce(void 0,void 0,void 0,function*(){return fd(t.requestManager)});function oA(t,e){return ce(this,void 0,void 0,function*(){const n=yield zg(t.requestManager);return S({format:"uint"},n,e)})}function El(t,e){return ce(this,void 0,void 0,function*(){const n=yield Qg(t.requestManager);return S({format:"uint"},n,e)})}function Pa(t,e){return ce(this,void 0,void 0,function*(){const n=yield Wg(t.requestManager);return S({format:"uint"},n,e)})}function aA(t,e,n=t.defaultBlock,r){return ce(this,void 0,void 0,function*(){const i=Te(n)?n:S({format:"uint"},n,W),s=yield $g(t.requestManager,e,i);return S({format:"uint"},s,r)})}function cA(t,e,n,r=t.defaultBlock,i){return ce(this,void 0,void 0,function*(){const s=S({format:"uint"},n,W),o=Te(r)?r:S({format:"uint"},r,W),a=yield Kg(t.requestManager,e,s,o);return S({format:"bytes"},a,i)})}function uA(t,e,n=t.defaultBlock,r){return ce(this,void 0,void 0,function*(){const i=Te(n)?n:S({format:"uint"},n,W),s=yield ny(t.requestManager,e,i);return S({format:"bytes"},s,r)})}function xl(t,e=t.defaultBlock,n=!1,r){return ce(this,void 0,void 0,function*(){let i;if(Gt(e)){const s=S({format:"bytes32"},e,W);i=yield cy(t.requestManager,s,n)}else{const s=Te(e)?e:S({format:"uint"},e,W);i=yield md(t.requestManager,s,n)}return S(zi,i,r)})}function dA(t,e=t.defaultBlock,n){return ce(this,void 0,void 0,function*(){let r;if(Gt(e)){const i=S({format:"bytes32"},e,W);r=yield Xg(t.requestManager,i)}else{const i=Te(e)?e:S({format:"uint"},e,W);r=yield Yg(t.requestManager,i)}return S({format:"uint"},r,n)})}function lA(t,e=t.defaultBlock,n){return ce(this,void 0,void 0,function*(){let r;if(Gt(e)){const i=S({format:"bytes32"},e,W);r=yield ey(t.requestManager,i)}else{const i=Te(e)?e:S({format:"uint"},e,W);r=yield ty(t.requestManager,i)}return S({format:"uint"},r,n)})}function fA(t,e=t.defaultBlock,n,r){return ce(this,void 0,void 0,function*(){const i=S({format:"uint"},n,W);let s;if(Gt(e)){const o=S({format:"bytes32"},e,W);s=yield hy(t.requestManager,o,i)}else{const o=Te(e)?e:S({format:"uint"},e,W);s=yield my(t.requestManager,o,i)}return S(zi,s,r)})}function hA(t,e,n){return ce(this,void 0,void 0,function*(){const r=S({format:"bytes32"},e,j),i=yield uy(t.requestManager,r);return A(i)?i:De(i,n,{fillInputAndData:!0})})}function mA(t,e){return ce(this,void 0,void 0,function*(){return(yield by(t.requestManager)).map(r=>De(r,e,{fillInputAndData:!0}))})}function pA(t,e=t.defaultBlock,n,r){return ce(this,void 0,void 0,function*(){const i=S({format:"uint"},n,W);let s;if(Gt(e)){const o=S({format:"bytes32"},e,W);s=yield dy(t.requestManager,o,i)}else{const o=Te(e)?e:S({format:"uint"},e,W);s=yield ly(t.requestManager,o,i)}return A(s)?s:De(s,r,{fillInputAndData:!0})})}function Il(t,e,n){return ce(this,void 0,void 0,function*(){const r=S({format:"bytes32"},e,j),i=yield fy(t.requestManager,r);return A(i)?i:S(nr,i,n)})}function Tl(t,e,n=t.defaultBlock,r){return ce(this,void 0,void 0,function*(){const i=Te(n)?n:S({format:"uint"},n,W),s=yield Jg(t.requestManager,e,i);return S({format:"uint"},s,r)})}function Bo(t,e,n,r={checkRevertBeforeSending:!0}){const i=new ld((s,o)=>{setImmediate(()=>{ce(this,void 0,void 0,function*(){const a=new _l({web3Context:t,promiEvent:i,options:r,returnFormat:n});let u=De(Object.assign(Object.assign({},e),{from:_o("from",t,e),to:_o("to",t,e)}),W);try{u=yield a.populateGasPrice({transaction:e,transactionFormatted:u}),yield a.checkRevertBeforeSending(u),a.emitSending(u);let d;t.wallet&&!A(u.from)&&(d=t.wallet.get(u.from));const c=yield a.signAndSend({wallet:d,tx:u}),l=S({format:"bytes32"},c,n);a.emitSent(u),a.emitTransactionHash(l);const f=yield Jd(t,c,n),m=a.getReceiptWithEvents(S(nr,f,n));a.emitReceipt(m),s(yield a.handleResolve({receipt:m,tx:u})),a.emitConfirmation({receipt:m,transactionHash:c})}catch(d){o(yield a.handleError({error:d,tx:u}))}})})});return i}function gA(t,e,n,r={checkRevertBeforeSending:!0}){const i=new ld((s,o)=>{setImmediate(()=>{ce(this,void 0,void 0,function*(){const a=new _l({web3Context:t,promiEvent:i,options:r,returnFormat:n}),u=S({format:"bytes"},e,W),d=pn.fromSerializedData(dt(me(u))),c=Object.assign(Object.assign({},d.toJSON()),{from:d.getSenderAddress().toString()});try{const{v:l,r:f,s:m}=c,g=iA(c,["v","r","s"]);yield a.checkRevertBeforeSending(g),a.emitSending(u);const p=yield xo(t,()=>ce(this,void 0,void 0,function*(){return hd(t.requestManager,u)}));a.emitSent(u);const y=S({format:"bytes32"},p,n);a.emitTransactionHash(y);const b=yield Jd(t,p,n),_=a.getReceiptWithEvents(S(nr,b,n));a.emitReceipt(_),s(yield a.handleResolve({receipt:_,tx:c})),a.emitConfirmation({receipt:_,transactionHash:p})}catch(l){o(yield a.handleError({error:l,tx:c}))}})})});return i}function yA(t,e,n,r){var i;return ce(this,void 0,void 0,function*(){const s=S({format:"bytes"},e,j);if(!((i=t.wallet)===null||i===void 0)&&i.get(n)){const u=t.wallet.get(n).sign(s);return S(iw,u,r)}if(typeof n=="number")throw new tm(e,'RPC method "eth_sign" does not support index signatures');const o=yield ry(t.requestManager,n,s);return S({format:"bytes"},o,r)})}function vA(t,e,n){return ce(this,void 0,void 0,function*(){const r=yield iy(t.requestManager,De(e,W));return Go(r)?cw(r,n,{fillInputAndData:!0}):{raw:S({format:"bytes"},r.raw,n),tx:De(r.tx,n,{fillInputAndData:!0})}})}function Na(t,e,n=t.defaultBlock,r){return ce(this,void 0,void 0,function*(){const i=Te(n)?n:S({format:"uint"},n,W),s=yield oy(t.requestManager,De(e,W),i);return S({format:"bytes"},s,r)})}function Oa(t,e,n=t.defaultBlock,r){return ce(this,void 0,void 0,function*(){const i=De(e,W),s=Te(n)?n:S({format:"uint"},n,W),o=yield ay(t.requestManager,i,s);return S({format:"uint"},o,r)})}function Sl(t,e,n){return ce(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:i}=e;A(r)||(typeof r=="number"||typeof r=="bigint")&&(r=Ue(r)),A(i)||(typeof i=="number"||typeof i=="bigint")&&(i=Ue(i));const s=Object.assign(Object.assign({},e),{fromBlock:i,toBlock:r});return(yield py(t.requestManager,s)).map(u=>typeof u=="string"?u:S(ws,u,n))})}function kl(t,e){return ce(this,void 0,void 0,function*(){const n=yield Ay(t.requestManager);return S({format:"uint"},n,e)})}function bA(t,e,n,r=t.defaultBlock,i){return ce(this,void 0,void 0,function*(){const s=n.map(u=>S({format:"bytes"},u,W)),o=Te(r)?r:S({format:"uint"},r,W),a=yield _y(t.requestManager,e,s,o);return S(aw,a,i)})}function wA(t,e,n=t.defaultBlock,r,i){return ce(this,void 0,void 0,function*(){const s=S({format:"uint"},e,W),o=Te(n)?n:S({format:"uint"},n,W),a=S({type:"array",items:{format:"uint"}},r,As),u=yield vy(t.requestManager,s,o,a);return S(sw,u,i)})}function Bl(t,e,n=t.defaultBlock,r){return ce(this,void 0,void 0,function*(){const i=Te(n)?n:S({format:"uint"},n,W),s=yield xy(t.requestManager,De(e,W),i);return S(Yb,s,r)})}function AA(t,e,n,r,i){return ce(this,void 0,void 0,function*(){const s=yield Iy(t.requestManager,e,n,r);return S({format:"bytes"},s,i)})}let Cl=class extends Zr{_buildSubscriptionParams(){return["logs",this.args]}formatSubscriptionResult(e){return S(ws,e,super.returnFormat)}};class Lc extends Zr{_buildSubscriptionParams(){return["newPendingTransactions"]}formatSubscriptionResult(e){return S({format:"string"},e,super.returnFormat)}}class $i extends Zr{_buildSubscriptionParams(){return["newHeads"]}formatSubscriptionResult(e){return S(nw,e,super.returnFormat)}}class Rl extends Zr{_buildSubscriptionParams(){return["syncing"]}_processSubscriptionResult(e){if(typeof e=="boolean")this.emit("changed",e);else{const n=Object.fromEntries(Object.entries(e.status).map(([r,i])=>[r.charAt(0).toLowerCase()+r.substring(1),i]));this.emit("changed",e.syncing),this.emit("data",S(rw,n,super.returnFormat))}}}var ne=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const Co={logs:Cl,newPendingTransactions:Lc,newHeads:$i,syncing:Rl,pendingTransactions:Lc,newBlockHeaders:$i};class Ss extends lt{constructor(e){if(typeof e=="string"||ji(e)){super({provider:e,registeredSubscriptions:Co});return}if(e.registeredSubscriptions){super(e);return}super(Object.assign(Object.assign({},e),{registeredSubscriptions:Co}))}getProtocolVersion(){return ne(this,void 0,void 0,function*(){return Gg(this.requestManager)})}isSyncing(){return ne(this,void 0,void 0,function*(){return fd(this.requestManager)})}getCoinbase(){return ne(this,void 0,void 0,function*(){return qg(this.requestManager)})}isMining(){return ne(this,void 0,void 0,function*(){return Vg(this.requestManager)})}getHashrate(e=j){return ne(this,void 0,void 0,function*(){return this.getHashRate(e)})}getHashRate(e=j){return ne(this,void 0,void 0,function*(){return oA(this,e)})}getGasPrice(e=j){return ne(this,void 0,void 0,function*(){return El(this,e)})}getAccounts(){var e;return ne(this,void 0,void 0,function*(){return((e=yield Zg(this.requestManager))!==null&&e!==void 0?e:[]).map(r=>ft(r))})}getBlockNumber(e=j){return ne(this,void 0,void 0,function*(){return Pa(this,e)})}getBalance(e,n=this.defaultBlock,r=j){return ne(this,void 0,void 0,function*(){return aA(this,e,n,r)})}getStorageAt(e,n,r=this.defaultBlock,i=j){return ne(this,void 0,void 0,function*(){return cA(this,e,n,r,i)})}getCode(e,n=this.defaultBlock,r=j){return ne(this,void 0,void 0,function*(){return uA(this,e,n,r)})}getBlock(e=this.defaultBlock,n=!1,r=j){return ne(this,void 0,void 0,function*(){return xl(this,e,n,r)})}getBlockTransactionCount(e=this.defaultBlock,n=j){return ne(this,void 0,void 0,function*(){return dA(this,e,n)})}getBlockUncleCount(e=this.defaultBlock,n=j){return ne(this,void 0,void 0,function*(){return lA(this,e,n)})}getUncle(e=this.defaultBlock,n,r=j){return ne(this,void 0,void 0,function*(){return fA(this,e,n,r)})}getTransaction(e,n=j){return ne(this,void 0,void 0,function*(){const r=yield hA(this,e,n);if(!r)throw new Va;return r})}getPendingTransactions(e=j){return ne(this,void 0,void 0,function*(){return mA(this,e)})}getTransactionFromBlock(e=this.defaultBlock,n,r=j){return ne(this,void 0,void 0,function*(){return pA(this,e,n,r)})}getTransactionReceipt(e,n=j){return ne(this,void 0,void 0,function*(){const r=yield Il(this,e,n);if(!r)throw new Va;return r})}getTransactionCount(e,n=this.defaultBlock,r=j){return ne(this,void 0,void 0,function*(){return Tl(this,e,n,r)})}sendTransaction(e,n=j,r){return Bo(this,e,n,r)}sendSignedTransaction(e,n=j,r){return gA(this,e,n,r)}sign(e,n,r=j){return ne(this,void 0,void 0,function*(){return yA(this,e,n,r)})}signTransaction(e,n=j){return ne(this,void 0,void 0,function*(){return vA(this,e,n)})}call(e,n=this.defaultBlock,r=j){return ne(this,void 0,void 0,function*(){return Na(this,e,n,r)})}estimateGas(e,n=this.defaultBlock,r=j){return ne(this,void 0,void 0,function*(){return Oa(this,e,n,r)})}getPastLogs(e,n=j){return ne(this,void 0,void 0,function*(){return Sl(this,e,n)})}getWork(){return ne(this,void 0,void 0,function*(){return gy(this.requestManager)})}submitWork(e,n,r){return ne(this,void 0,void 0,function*(){return yy(this.requestManager,e,n,r)})}requestAccounts(){return ne(this,void 0,void 0,function*(){return wy(this.requestManager)})}getChainId(e=j){return ne(this,void 0,void 0,function*(){return kl(this,e)})}getNodeInfo(){return ne(this,void 0,void 0,function*(){return Ey(this.requestManager)})}getProof(e,n,r=this.defaultBlock,i=j){return ne(this,void 0,void 0,function*(){return bA(this,e,n,r,i)})}getFeeHistory(e,n=this.defaultBlock,r,i=j){return ne(this,void 0,void 0,function*(){return wA(this,e,n,r,i)})}createAccessList(e,n=this.defaultBlock,r=j){return ne(this,void 0,void 0,function*(){return Bl(this,e,n,r)})}signTypedData(e,n,r=!1,i=j){return ne(this,void 0,void 0,function*(){return AA(this,e,n,r,i)})}subscribe(e,n,r=j){var i;return ne(this,void 0,void 0,function*(){const s=yield(i=this.subscriptionManager)===null||i===void 0?void 0:i.subscribe(e,n,r);return s instanceof Cl&&e==="logs"&&typeof n=="object"&&!Z(n.fromBlock)&&Number.isFinite(Number(n.fromBlock))&&setImmediate(()=>{this.getPastLogs(n).then(o=>{for(const a of o)s._processSubscriptionResult(a)}).catch(o=>{s._processSubscriptionError(o)})}),s})}static shouldClearSubscription({sub:e}){return!(e instanceof Rl)}clearSubscriptions(e=!1){var n;return(n=this.subscriptionManager)===null||n===void 0?void 0:n.unsubscribe(e?Ss.shouldClearSubscription:void 0)}}const _A=t=>{if(!A(t.common)){if(A(t.common.customChain))throw new sm;if(A(t.common.customChain.chainId))throw new om;if(!A(t.chainId)&&t.chainId!==t.common.customChain.chainId)throw new am({txChainId:t.chainId,customChainId:t.common.customChain.chainId})}},EA=t=>{if(!A(t.common)&&!A(t.chain)&&!A(t.hardfork))throw new dm;if(!A(t.chain)&&A(t.hardfork)||!A(t.hardfork)&&A(t.chain))throw new lm({chain:t.chain,hardfork:t.hardfork})},xA=t=>{if(!A(t.common)&&!A(t.common.baseChain)&&!A(t.chain)&&t.chain!==t.common.baseChain)throw new cm({txChain:t.chain,baseChain:t.common.baseChain})},IA=t=>{if(!A(t.common)&&!A(t.common.hardfork)&&!A(t.hardfork)&&t.hardfork!==t.common.hardfork)throw new um({txHardfork:t.hardfork,commonHardfork:t.common.hardfork})},Dc=t=>{if(A(t.gas)||!fn(t.gas)||A(t.gasPrice)||!fn(t.gasPrice))throw new gm({gas:t.gas,gasPrice:t.gasPrice});if(!A(t.maxFeePerGas)||!A(t.maxPriorityFeePerGas))throw new Yc({maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas})},Hc=t=>{if(!A(t.gasPrice)&&t.type==="0x2")throw new vm(t.gasPrice);if(t.type==="0x0"||t.type==="0x1")throw new Yc({maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas});if(A(t.maxFeePerGas)||!fn(t.maxFeePerGas)||A(t.maxPriorityFeePerGas)||!fn(t.maxPriorityFeePerGas))throw new ym({maxPriorityFeePerGas:t.maxPriorityFeePerGas,maxFeePerGas:t.maxFeePerGas})},TA=t=>{const e=!A(t.gas)||!A(t.gasLimit),n=e&&!A(t.gasPrice),r=e&&!A(t.maxPriorityFeePerGas)&&!A(t.maxFeePerGas);if(!n&&!r)throw new hm({gas:t.gas,gasPrice:t.gasPrice,maxPriorityFeePerGas:t.maxPriorityFeePerGas,maxFeePerGas:t.maxFeePerGas});if(n&&r)throw new pm({gas:t.gas,gasPrice:t.gasPrice,maxPriorityFeePerGas:t.maxPriorityFeePerGas,maxFeePerGas:t.maxFeePerGas});(n?Dc:Hc)(t),(!A(t.type)&&t.type>"0x1"?Hc:Dc)(t)},SA=(t,e)=>{if(!A(e)){e(t);return}if(typeof t!="object"||A(t))throw new bm(t);_A(t),EA(t),xA(t),IA(t);const n=De(t,W);if(TA(n),A(n.nonce)||A(n.chainId)||n.nonce.startsWith("-")||n.chainId.startsWith("-"))throw new wm({nonce:t.nonce,chainId:t.chainId})};var kA=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const BA=t=>{var e,n;return{nonce:t.nonce,gasPrice:t.gasPrice,gasLimit:(e=t.gasLimit)!==null&&e!==void 0?e:t.gas,to:t.to,value:t.value,data:(n=t.data)!==null&&n!==void 0?n:t.input,type:t.type,chainId:t.chainId,accessList:t.accessList,maxPriorityFeePerGas:t.maxPriorityFeePerGas,maxFeePerGas:t.maxFeePerGas}},CA=(t,e)=>{var n,r,i,s,o,a,u,d,c,l,f,m,g,p,y,b,_,E;const T=!A(t.chain)&&!A(t.hardfork)||!A(t.common);let x;if(!T)e.defaultCommon?(x=e.defaultCommon,A(x.hardfork)&&(x.hardfork=(n=t.hardfork)!==null&&n!==void 0?n:e.defaultHardfork),A(x.baseChain)&&(x.baseChain=e.defaultChain)):x=xe.custom({name:"custom-network",chainId:Le(t.chainId),networkId:A(t.networkId)?void 0:Le(t.networkId),defaultHardfork:(r=t.hardfork)!==null&&r!==void 0?r:e.defaultHardfork},{baseChain:e.defaultChain});else{const B=(a=(o=(s=(i=t==null?void 0:t.common)===null||i===void 0?void 0:i.customChain)===null||s===void 0?void 0:s.name)!==null&&o!==void 0?o:t.chain)!==null&&a!==void 0?a:"custom-network",R=Le((c=(d=(u=t==null?void 0:t.common)===null||u===void 0?void 0:u.customChain)===null||d===void 0?void 0:d.chainId)!==null&&c!==void 0?c:t==null?void 0:t.chainId),w=Le((m=(f=(l=t==null?void 0:t.common)===null||l===void 0?void 0:l.customChain)===null||f===void 0?void 0:f.networkId)!==null&&m!==void 0?m:t==null?void 0:t.networkId),L=(y=(p=(g=t==null?void 0:t.common)===null||g===void 0?void 0:g.hardfork)!==null&&p!==void 0?p:t==null?void 0:t.hardfork)!==null&&y!==void 0?y:e.defaultHardfork,I=(E=(_=(b=t.common)===null||b===void 0?void 0:b.baseChain)!==null&&_!==void 0?_:t.chain)!==null&&E!==void 0?E:e.defaultChain;R&&w&&B&&(x=xe.custom({name:B,chainId:R,networkId:w,defaultHardfork:L},{baseChain:I}))}return{common:x}},RA=(t,e,n,r=!1,i=!0)=>kA(void 0,void 0,void 0,function*(){const s=yield mw({transaction:t,web3Context:e,privateKey:n,fillGasPrice:r,fillGasLimit:i}),o=De(s,W);return SA(o),pn.fromTxData(BA(o),CA(o,e))}),Fc=({address:t},e,n)=>{var r,i;const s=n==null?void 0:n.topics,o=(r=n==null?void 0:n.filter)!==null&&r!==void 0?r:{},a={};if(Z(n==null?void 0:n.fromBlock)||(a.fromBlock=S(zi.properties.number,n==null?void 0:n.fromBlock,{number:$e.HEX,bytes:xt.HEX})),Z(n==null?void 0:n.toBlock)||(a.toBlock=S(zi.properties.number,n==null?void 0:n.toBlock,{number:$e.HEX,bytes:xt.HEX})),s&&Array.isArray(s))a.topics=[...s];else if(a.topics=[],e&&!e.anonymous&&![Jn,"allEvents"].includes(e.name)&&a.topics.push((i=e.signature)!==null&&i!==void 0?i:ka(gn(e))),![Jn,"allEvents"].includes(e.name)&&e.inputs)for(const u of e.inputs){if(!u.indexed)continue;const d=o[u.name];if(!d){a.topics.push(null);continue}Array.isArray(d)?a.topics.push(d.map(c=>ko(u.type,c))):u.type==="string"?a.topics.push(Pr(d)):a.topics.push(ko(u.type,d))}return a.topics.length||delete a.topics,t&&(a.address=t.toLowerCase()),a},pr=(t,e,n)=>{const r=Array.isArray(t.inputs)?t.inputs.length:0;if(r!==e.length)throw new je(`The number of arguments is not matching the methods required number. You need to pass ${r} arguments.`);const i=xs(Array.isArray(t.inputs)?t.inputs:[],e).replace("0x","");if(ww(t)){if(!n)throw new je("The contract has no contract data option set. This is necessary to append the constructor parameters.");return n.startsWith("0x")?`${n}${i}`:`0x${n}${i}`}return`${Ts(t)}${i}`},PA=(t,e)=>{if(t.type==="constructor")return e;if(!e)return null;const n=e.length>=2?e.slice(2):e;if(!t.outputs)return null;const r=Is([...t.outputs],n);return r.__length__===1?r[0]:r};class Pl extends Zr{constructor(e,n){super(e,n),this.address=e.address,this.topics=e.topics,this.abi=e.abi,this.jsonInterface=e.jsonInterface}_buildSubscriptionParams(){return["logs",{address:this.address,topics:this.topics}]}formatSubscriptionResult(e){return Ra(this.abi,e,this.jsonInterface,super.returnFormat)}}const ks=(t,e,n,r)=>{var i,s;const o={};return(!Z(t.data)||r==="both")&&(o.data=pr(e,n,(i=t.data)!==null&&i!==void 0?i:t.input)),(!Z(t.input)||r==="both")&&(o.input=pr(e,n,(s=t.input)!==null&&s!==void 0?s:t.data)),Z(o.input)&&Z(o.data)&&(o[r]=pr(e,n)),{data:o.data,input:o.input}},jc=({abi:t,params:e,options:n,contractOptions:r})=>{var i,s,o;if(!((o=(s=(i=n==null?void 0:n.input)!==null&&i!==void 0?i:n==null?void 0:n.data)!==null&&s!==void 0?s:r.input)!==null&&o!==void 0?o:r.data)&&!(n!=null&&n.to)&&!r.address)throw new je("Contract address not specified");if(!(n!=null&&n.from)&&!r.from)throw new je('Contract "from" address not specified');let u=qt({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const d=ks(u,t,e,n==null?void 0:n.dataInputFill);return u=Object.assign(Object.assign({},u),{data:d.data,input:d.input}),u},NA=({abi:t,params:e,options:n,contractOptions:r})=>{if(!(n!=null&&n.to)&&!r.address)throw new je("Contract address not specified");let i=qt({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const s=ks(i,t,e,n==null?void 0:n.dataInputFill);return i=Object.assign(Object.assign({},i),{data:s.data,input:s.input}),i},OA=({abi:t,params:e,options:n,contractOptions:r})=>{let i=qt({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,data:r.data},n);const s=ks(i,t,e,n==null?void 0:n.dataInputFill);return i=Object.assign(Object.assign({},i),{data:s.data,input:s.input}),i},Ro=t=>typeof t=="object"&&!Z(t)&&["input","data","from","gas","gasPrice","gasLimit","address","jsonInterface","syncWithContext","dataInputFill"].some(e=>e in t),Uc=t=>typeof t=="object"&&!Z(t)&&!Ro(t),MA=({abi:t,params:e,options:n,contractOptions:r})=>{if(!(n!=null&&n.to)&&!r.address)throw new je("Contract address not specified");if(!(n!=null&&n.from)&&!r.from)throw new je('Contract "from" address not specified');let i=qt({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const s=ks(i,t,e,n==null?void 0:n.dataInputFill);return i=Object.assign(Object.assign({},i),{data:s.data,input:s.input}),i};var Pt=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const LA={logs:Pl,newHeads:$i,newBlockHeaders:$i};class an extends lt{constructor(e,n,r,i,s){var o,a,u;const d=Ro(n)?n:Ro(r)?r:void 0;let c;Uc(n)?c=n:Uc(r)?c=r:c=i;let l;if(typeof n=="object"&&"provider"in n?l=n.provider:typeof r=="object"&&"provider"in r?l=r.provider:typeof i=="object"&&"provider"in i?l=i.provider:l=an.givenProvider,super(Object.assign(Object.assign({},c),{provider:l,registeredSubscriptions:LA})),this.syncWithContext=!1,this._functions={},!A(d)&&!A(d.data)&&!A(d.input)&&this.config.contractDataInputFill!=="both")throw new $h({data:d.data,input:d.input});this._overloadedMethodAbis=new Map;const f=Zt(i)?i:Zt(r)?r:s??j,m=typeof n=="string"?n:void 0;this.config.contractDataInputFill==="both"?this._dataInputFill=this.config.contractDataInputFill:this._dataInputFill=(o=d==null?void 0:d.dataInputFill)!==null&&o!==void 0?o:this.config.contractDataInputFill,this._parseAndSetJsonInterface(e,f),A(m)||this._parseAndSetAddress(m,f),this.options={address:m,jsonInterface:this._jsonInterface,gas:(a=d==null?void 0:d.gas)!==null&&a!==void 0?a:d==null?void 0:d.gasLimit,gasPrice:d==null?void 0:d.gasPrice,from:d==null?void 0:d.from,input:d==null?void 0:d.input,data:d==null?void 0:d.data},this.syncWithContext=(u=d==null?void 0:d.syncWithContext)!==null&&u!==void 0?u:!1,c instanceof lt&&this.subscribeToContextEvents(c),Object.defineProperty(this.options,"address",{set:g=>this._parseAndSetAddress(g,f),get:()=>this._address}),Object.defineProperty(this.options,"jsonInterface",{set:g=>this._parseAndSetJsonInterface(g,f),get:()=>this._jsonInterface})}get events(){return this._events}get methods(){return this._methods}clone(){let e;return this.options.address?e=new an([...this._jsonInterface,...this._errorsInterface],this.options.address,{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this._dataInputFill},this.getContextObject()):e=new an([...this._jsonInterface,...this._errorsInterface],{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this._dataInputFill},this.getContextObject()),this.context&&e.subscribeToContextEvents(this.context),e}deploy(e){var n,r,i;let s=this._jsonInterface.find(l=>l.type==="constructor");s||(s={type:"constructor",inputs:[],stateMutability:""});const o=S({format:"bytes"},(n=e==null?void 0:e.input)!==null&&n!==void 0?n:this.options.input,j),a=S({format:"bytes"},(r=e==null?void 0:e.data)!==null&&r!==void 0?r:this.options.data,j);if((!o||o.trim()==="0x")&&(!a||a.trim()==="0x"))throw new je("contract creation without any data provided.");const u=(i=e==null?void 0:e.arguments)!==null&&i!==void 0?i:[],d=Object.assign(Object.assign({},this.options),{input:o,data:a}),c=o??a;return{arguments:u,send:l=>{const f=Object.assign({},l);return this._contractMethodDeploySend(s,u,f,d)},estimateGas:(l,f=j)=>Pt(this,void 0,void 0,function*(){const m=Object.assign({},l);return this._contractMethodEstimateGas({abi:s,params:u,returnFormat:f,options:m,contractOptions:d})}),encodeABI:()=>pr(s,u,S({format:"bytes"},c,j))}}getPastEvents(e,n,r){var i;return Pt(this,void 0,void 0,function*(){const s=typeof e=="string"?e:Jn,o=typeof e!="string"&&!Zt(e)?e:Zt(n)?{}:n,a=Zt(e)?e:Zt(n)?n:r??j,u=s==="allEvents"||s===Jn?Ao:this._jsonInterface.find(b=>"name"in b&&b.name===s);if(!u)throw new je(`Event ${s} not found.`);const{fromBlock:d,toBlock:c,topics:l,address:f}=Fc(this.options,u,o??{}),g=(yield Sl(this,{fromBlock:d,toBlock:c,topics:l,address:f},a)).map(b=>typeof b=="string"?b:Ra(u,b,this._jsonInterface,a)),p=(i=o==null?void 0:o.filter)!==null&&i!==void 0?i:{},y=Object.keys(p);return y.length>0?g.filter(b=>typeof b=="string"?!0:y.every(_=>{var E;if(Array.isArray(p[_]))return p[_].some(x=>String(b.returnValues[_]).toUpperCase()===String(x).toUpperCase());const T=(E=u.inputs)===null||E===void 0?void 0:E.filter(x=>x.name===_)[0];return T!=null&&T.indexed&&T.type==="string"&&Pr(p[_])===String(b.returnValues[_])?!0:String(b.returnValues[_]).toUpperCase()===String(p[_]).toUpperCase()})):g})}_parseAndSetAddress(e,n=j){this._address=e&&ft(S({format:"address"},e,n))}_parseAndSetJsonInterface(e,n=j){var r,i,s,o,a;this._functions={},this._methods={},this._events={};let u=[];const d=e.filter(l=>l.type!=="error"),c=e.filter(l=>_s(l));for(const l of d){const f=Object.assign(Object.assign({},l),{signature:""});if(Es(f)){const m=gn(f),g=Ts(m);f.signature=g,f.constant=(i=(r=f.stateMutability==="view")!==null&&r!==void 0?r:f.stateMutability==="pure")!==null&&i!==void 0?i:f.constant,f.payable=(s=f.stateMutability==="payable")!==null&&s!==void 0?s:f.payable,this._overloadedMethodAbis.set(f.name,[...(o=this._overloadedMethodAbis.get(f.name))!==null&&o!==void 0?o:[],f]);const p=(a=this._overloadedMethodAbis.get(f.name))!==null&&a!==void 0?a:[],y=this._createContractMethod(p,c);this._functions[m]={signature:g,method:y},this._methods[f.name]=this._functions[m].method,this._methods[m]=this._functions[m].method,this._methods[g]=this._functions[m].method}else if(Sa(f)){const m=gn(f),g=ka(m),p=this._createContractEvent(f,n);f.signature=g,(!(m in this._events)||f.name==="bound")&&(this._events[m]=p),this._events[f.name]=p,this._events[g]=p}u=[...u,f]}this._events.allEvents=this._createContractEvent(Ao,n),this._jsonInterface=[...u],this._errorsInterface=c}_getAbiParams(e,n){var r;try{return hr((r=e.inputs)!==null&&r!==void 0?r:[],n)}catch(i){throw new je(`Invalid parameters for method ${e.name}: ${i.message}`)}}_createContractMethod(e,n){const r=e[e.length-1];return(...i)=>{var s,o;let a;const u=(s=this._overloadedMethodAbis.get(r.name))!==null&&s!==void 0?s:[];let d=u[0];const c=n,l=u.filter(m=>{var g;return((g=m.inputs)!==null&&g!==void 0?g:[]).length===i.length});if(u.length===1||l.length===0)a=this._getAbiParams(d,i),V.validate((o=r.inputs)!==null&&o!==void 0?o:[],a);else{const m=[];for(const g of l)try{a=this._getAbiParams(g,i),V.validate(g.inputs,a),d=g;break}catch(p){m.push(p)}if(m.length===l.length)throw new Vn(m)}const f={arguments:a,call:(m,g)=>Pt(this,void 0,void 0,function*(){return this._contractMethodCall(d,a,c,m,g)}),send:m=>this._contractMethodSend(d,a,c,m),estimateGas:(m,g=j)=>Pt(this,void 0,void 0,function*(){return this._contractMethodEstimateGas({abi:d,params:a,returnFormat:g,options:m})}),encodeABI:()=>pr(d,a),createAccessList:(m,g)=>Pt(this,void 0,void 0,function*(){return this._contractMethodCreateAccessList(d,a,c,m,g)})};return d.stateMutability==="payable",f}}_contractMethodCall(e,n,r,i,s){var o;return Pt(this,void 0,void 0,function*(){const a=NA({abi:e,params:n,options:Object.assign(Object.assign({},i),{dataInputFill:this._dataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(o=this.options.from)!==null&&o!==void 0?o:this.config.defaultAccount})});try{const u=yield Na(this,a,s,j);return PA(e,u)}catch(u){throw u instanceof nn&&ci(r,u.innerError),u}})}_contractMethodCreateAccessList(e,n,r,i,s){var o;return Pt(this,void 0,void 0,function*(){const a=MA({abi:e,params:n,options:Object.assign(Object.assign({},i),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(o=this.options.from)!==null&&o!==void 0?o:this.config.defaultAccount})});try{return Bl(this,a,s,j)}catch(u){throw u instanceof nn&&ci(r,u.innerError),u}})}_contractMethodSend(e,n,r,i,s){var o,a;let u=s??this.options;u=Object.assign(Object.assign({},u),{input:void 0,from:(a=(o=u.from)!==null&&o!==void 0?o:this.defaultAccount)!==null&&a!==void 0?a:void 0});const d=jc({abi:e,params:n,options:Object.assign(Object.assign({},i),{dataInputFill:this.config.contractDataInputFill}),contractOptions:u}),c=Bo(this,d,j,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface});return c.on("error",l=>{l instanceof nn&&ci(r,l.innerError)}),c}_contractMethodDeploySend(e,n,r,i){var s,o;let a=i??this.options;a=Object.assign(Object.assign({},a),{from:(o=(s=a.from)!==null&&s!==void 0?s:this.defaultAccount)!==null&&o!==void 0?o:void 0});const u=jc({abi:e,params:n,options:Object.assign(Object.assign({},r),{dataInputFill:this.config.contractDataInputFill}),contractOptions:a});return Bo(this,u,j,{transactionResolver:d=>{if(d.status===BigInt(0))throw new je("code couldn't be stored",d);const c=this.clone();return c.options.address=d.contractAddress,c},contractAbi:this._jsonInterface,checkRevertBeforeSending:!1})}_contractMethodEstimateGas({abi:e,params:n,returnFormat:r,options:i,contractOptions:s}){return Pt(this,void 0,void 0,function*(){const o=OA({abi:e,params:n,options:Object.assign(Object.assign({},i),{dataInputFill:this.config.contractDataInputFill}),contractOptions:s??this.options});return Oa(this,o,yt.LATEST,r)})}_createContractEvent(e,n=j){return(...r)=>{var i;const{topics:s,fromBlock:o}=Fc(this.options,e,r[0]),a=new Pl({address:this.options.address,topics:s,abi:e,jsonInterface:this._jsonInterface},{subscriptionManager:this.subscriptionManager,returnFormat:n});return A(o)||this.getPastEvents(e.name,{fromBlock:o,topics:s},n).then(u=>{u.forEach(d=>a.emit("data",d))}).catch(u=>{a.emit("error",new Xe("Failed to get past events.",u))}),(i=this.subscriptionManager)===null||i===void 0||i.addSubscription(a).catch(u=>{a.emit("error",new Xe("Failed to subscribe.",u))}),a}}subscribeToContextEvents(e){const n=this;this.context=e,n.syncWithContext&&e.on(Qn.CONFIG_CHANGE,r=>{n.setConfig({[r.name]:r.newValue})})}}const Gc={addr:"0x3b3b57de",name:"0x691f3431",abi:"0x2203ab56",pubkey:"0xc8690233",text:"0x59d1d43c",contenthash:"0xbc1c58d1"},Zs={setAddr:"addr",addr:"addr",setPubkey:"pubkey",pubkey:"pubkey",setContenthash:"contenthash",contenthash:"contenthash"},Ki={main:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",goerli:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},DA={"0x1":"main","0x5":"goerli"},HA=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"resolver",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"ttl",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"}],FA=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"},{indexed:!1,internalType:"bytes",name:"record",type:"bytes"}],name:"DNSRecordChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"}],name:"DNSRecordDeleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"}],name:"DNSZoneCleared",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"lastzonehash",type:"bytes"},{indexed:!1,internalType:"bytes",name:"zonehash",type:"bytes"}],name:"DNSZonehashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"}],name:"TextChanged",type:"event"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint16",name:"resource",type:"uint16"}],name:"dnsRecord",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],name:"hasDNSRecords",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"zonehash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"}];var jA="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUA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ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const qc=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Vc=4;function UA(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,s=[0,1];for(let x=1;x<r;x++)s.push(i+=n());let o=n(),a=e;e+=o;let u=0,d=0;function c(){return u==0&&(d=d<<8|t[e++],u=8),d>>--u&1}const l=31,f=2**l,m=f>>>1,g=m>>1,p=f-1;let y=0;for(let x=0;x<l;x++)y=y<<1|c();let b=[],_=0,E=f;for(;;){let x=Math.floor(((y-_+1)*i-1)/E),B=0,R=r;for(;R-B>1;){let I=B+R>>>1;x<s[I]?R=I:B=I}if(B==0)break;b.push(B);let w=_+Math.floor(E*s[B]/i),L=_+Math.floor(E*s[B+1]/i)-1;for(;!((w^L)&m);)y=y<<1&p|c(),w=w<<1&p,L=L<<1&p|1;for(;w&~L&g;)y=y&m|y<<1&p>>>1|c(),w=w<<1^m,L=(L^m)<<1|m|1;_=w,E=1+L-w}let T=r-4;return b.map(x=>{switch(x-T){case 3:return T+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return T+256+(t[a++]<<8|t[a++]);case 1:return T+t[a++];default:return x-1}})}function GA(t){let e=0;return()=>t[e++]}function Nl(t){return GA(UA(qA(t)))}function qA(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,s=0,o=0,a=0;i<n;i++)a=a<<6|e[t.charCodeAt(i)],o+=6,o>=8&&(r[s++]=a>>(o-=8));return r}function VA(t){return t&1?~t>>1:t>>1}function zA(t,e){let n=Array(t);for(let r=0,i=0;r<t;r++)n[r]=i+=VA(e());return n}function Dr(t,e=0){let n=[];for(;;){let r=t(),i=t();if(!i)break;e+=r;for(let s=0;s<i;s++)n.push(e+s);e+=i+1}return n}function Ol(t){return Hr(()=>{let e=Dr(t);if(e.length)return e})}function Ml(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(QA(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(ZA(n,t))}return e.flat()}function Hr(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function Ll(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;i<e;i++)zA(t,n).forEach((s,o)=>r[o].push(s));return r}function QA(t,e){let n=1+e(),r=e(),i=Hr(e);return Ll(i.length,1+t,e).flatMap((o,a)=>{let[u,...d]=o;return Array(i[a]).fill().map((c,l)=>{let f=l*r;return[u+l*n,d.map(m=>m+f)]})})}function ZA(t,e){let n=1+e();return Ll(n,1+t,e).map(i=>[i[0],i.slice(1)])}function WA(t){let e=[],n=Dr(t);return i(r([]),[]),e;function r(s){let o=t(),a=Hr(()=>{let u=Dr(t).map(d=>n[d]);if(u.length)return r(u)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,u){if(!(s&4&&u===a[a.length-1])){s&2&&(u=a[a.length-1]),s&1&&e.push(a);for(let d of o)for(let c of d.Q)i(d,[...a,c],u)}}}function $A(t){return t.toString(16).toUpperCase().padStart(2,"0")}function Dl(t){return`{${$A(t)}}`}function KA(t){let e=[];for(let n=0,r=t.length;n<r;){let i=t.codePointAt(n);n+=i<65536?1:2,e.push(i)}return e}function Yn(t){let n=t.length;if(n<4096)return String.fromCodePoint(...t);let r=[];for(let i=0;i<n;)r.push(String.fromCodePoint(...t.slice(i,i+=4096)));return r.join("")}function JA(t,e){let n=t.length,r=n-e.length;for(let i=0;r==0&&i<n;i++)r=t[i]-e[i];return r}var XA="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEU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VPwpUC01nhxZuY/63E7g";const Fr=44032,Ji=4352,Xi=4449,Yi=4519,Hl=19,Fl=21,er=28,es=Fl*er,YA=Hl*es,e_=Fr+YA,t_=Ji+Hl,n_=Xi+Fl,r_=Yi+er;function lr(t){return t>>24&255}function jl(t){return t&16777215}let Po,zc,No,ui;function i_(){let t=Nl(XA);Po=new Map(Ol(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),zc=new Set(Dr(t)),No=new Map,ui=new Map;for(let[e,n]of Ml(t)){if(!zc.has(e)&&n.length==2){let[r,i]=n,s=ui.get(r);s||(s=new Map,ui.set(r,s)),s.set(i,e)}No.set(e,n.reverse())}}function Ul(t){return t>=Fr&&t<e_}function s_(t,e){if(t>=Ji&&t<t_&&e>=Xi&&e<n_)return Fr+(t-Ji)*es+(e-Xi)*er;if(Ul(t)&&e>Yi&&e<r_&&(t-Fr)%er==0)return t+(e-Yi);{let n=ui.get(t);return n&&(n=n.get(e),n)?n:-1}}function Gl(t){Po||i_();let e=[],n=[],r=!1;function i(s){let o=Po.get(s);o&&(r=!0,s|=o),e.push(s)}for(let s of t)for(;;){if(s<128)e.push(s);else if(Ul(s)){let o=s-Fr,a=o/es|0,u=o%es/er|0,d=o%er;i(Ji+a),i(Xi+u),d>0&&i(Yi+d)}else{let o=No.get(s);o?n.push(...o):i(s)}if(!n.length)break;s=n.pop()}if(r&&e.length>1){let s=lr(e[0]);for(let o=1;o<e.length;o++){let a=lr(e[o]);if(a==0||s<=a){s=a;continue}let u=o-1;for(;;){let d=e[u+1];if(e[u+1]=e[u],e[u]=d,!u||(s=lr(e[--u]),s<=a))break}s=lr(e[o])}}return e}function o_(t){let e=[],n=[],r=-1,i=0;for(let s of t){let o=lr(s),a=jl(s);if(r==-1)o==0?r=a:e.push(a);else if(i>0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=a):n.push(a),i=o;else{let u=s_(r,a);u>=0?r=u:i==0&&o==0?(e.push(r),r=a):(n.push(a),i=o)}}return r>=0&&e.push(r,...n),e}function ql(t){return Gl(t).map(jl)}function a_(t){return o_(Gl(t))}const Qc=45,Vl=".",zl=65039,Ql=1,On=t=>Array.from(t);function jr(t,e){return t.P.has(e)||t.Q.has(e)}class c_ extends Array{get is_emoji(){return!0}}let Oo,Zl,Yt,Mo,Wl,jn,Ws,Pn,$l,Zc,Lo;function Ma(){if(Oo)return;let t=Nl(jA);const e=()=>Dr(t),n=()=>new Set(e());Oo=new Map(Ml(t)),Zl=n(),Yt=e(),Mo=new Set(e().map(c=>Yt[c])),Yt=new Set(Yt),Wl=n(),n();let r=Ol(t),i=t();const s=()=>new Set(e().flatMap(c=>r[c]).concat(e()));jn=Hr(c=>{let l=Hr(t).map(f=>f+96);if(l.length){let f=c>=i;l[0]-=32,l=Yn(l),f&&(l=`Restricted[${l}]`);let m=s(),g=s(),p=!t();return{N:l,P:m,Q:g,M:p,R:f}}}),Ws=n(),Pn=new Map;let o=e().concat(On(Ws)).sort((c,l)=>c-l);o.forEach((c,l)=>{let f=t(),m=o[l]=f?o[l-f]:{V:[],M:new Map};m.V.push(c),Ws.has(c)||Pn.set(c,m)});for(let{V:c,M:l}of new Set(Pn.values())){let f=[];for(let g of c){let p=jn.filter(b=>jr(b,g)),y=f.find(({G:b})=>p.some(_=>b.has(_)));y||(y={G:new Set,V:[]},f.push(y)),y.V.push(g),p.forEach(b=>y.G.add(b))}let m=f.flatMap(g=>On(g.G));for(let{G:g,V:p}of f){let y=new Set(m.filter(b=>!g.has(b)));for(let b of p)l.set(b,y)}}let a=new Set,u=new Set;const d=c=>a.has(c)?u.add(c):a.add(c);for(let c of jn){for(let l of c.P)d(l);for(let l of c.Q)d(l)}for(let c of a)!Pn.has(c)&&!u.has(c)&&Pn.set(c,Ql);$l=new Set(On(a).concat(On(ql(a)))),Zc=WA(t).map(c=>c_.from(c)).sort(JA),Lo=new Map;for(let c of Zc){let l=[Lo];for(let f of c){let m=l.map(g=>{let p=g.get(f);return p||(p=new Map,g.set(f,p)),p});f===zl?l.push(...m):l=m}for(let f of l)f.V=c}}function La(t){return(Kl(t)?"":`${Da(Bs([t]))} `)+Dl(t)}function Da(t){return`"${t}"`}function u_(t){if(t.length>=4&&t[2]==Qc&&t[3]==Qc)throw new Error(`invalid label extension: "${Yn(t.slice(0,4))}"`)}function d_(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function l_(t){let e=t[0],n=qc.get(e);if(n)throw gr(`leading ${n}`);let r=t.length,i=-1;for(let s=1;s<r;s++){e=t[s];let o=qc.get(e);if(o){if(i==s)throw gr(`${n} + ${o}`);i=s+1,n=o}}if(i==r)throw gr(`trailing ${n}`)}function Bs(t,e=Dl){let n=[];f_(t[0])&&n.push("◌");let r=0,i=t.length;for(let s=0;s<i;s++){let o=t[s];Kl(o)&&(n.push(Yn(t.slice(r,s))),n.push(e(o)),r=s+1)}return n.push(Yn(t.slice(r,i))),n.join("")}function f_(t){return Ma(),Yt.has(t)}function Kl(t){return Ma(),Wl.has(t)}function h_(t){return y_(m_(t,a_,w_))}function m_(t,e,n){if(!t)return[];Ma();let r=0;return t.split(Vl).map(i=>{let s=KA(i),o={input:s,offset:r};r+=s.length+1;try{let a=o.tokens=b_(s,e,n),u=a.length,d;if(!u)throw new Error("empty label");let c=o.output=a.flat();if(d_(c),!(o.emoji=u>1||a[0].is_emoji)&&c.every(f=>f<128))u_(c),d="ASCII";else{let f=a.flatMap(m=>m.is_emoji?[]:m);if(!f.length)d="Emoji";else{if(Yt.has(c[0]))throw gr("leading combining mark");for(let p=1;p<u;p++){let y=a[p];if(!y.is_emoji&&Yt.has(y[0]))throw gr(`emoji + combining mark: "${Yn(a[p-1])} + ${Bs([y[0]])}"`)}l_(c);let m=On(new Set(f)),[g]=g_(m);v_(g,f),p_(g,m),d=g.N}}o.type=d}catch(a){o.error=a}return o})}function p_(t,e){let n,r=[];for(let i of e){let s=Pn.get(i);if(s===Ql)return;if(s){let o=s.M.get(i);if(n=n?n.filter(a=>o.has(a)):On(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(s=>jr(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function g_(t){let e=jn;for(let n of t){let r=e.filter(i=>jr(i,n));if(!r.length)throw jn.some(i=>jr(i,n))?Xl(e[0],n):Jl(n);if(e=r,r.length==1)break}return e}function y_(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${Da(Bs(e))}: ${i}`)}return Yn(r)}).join(Vl)}function Jl(t){return new Error(`disallowed character: ${La(t)}`)}function Xl(t,e){let n=La(e),r=jn.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function gr(t){return new Error(`illegal placement: ${t}`)}function v_(t,e){for(let n of e)if(!jr(t,n))throw Xl(t,n);if(t.M){let n=ql(e);for(let r=1,i=n.length;r<i;r++)if(Mo.has(n[r])){let s=r+1;for(let o;s<i&&Mo.has(o=n[s]);s++)for(let a=r;a<s;a++)if(n[a]==o)throw new Error(`duplicate non-spacing marks: ${La(o)}`);if(s-r>Vc)throw new Error(`excessive non-spacing marks: ${Da(Bs(n.slice(r-1,s)))} (${s-r}/${Vc})`);r=s}}}function b_(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let s=A_(t);if(s)i.length&&(r.push(e(i)),i=[]),r.push(n(s));else{let o=t.pop();if($l.has(o))i.push(o);else{let a=Oo.get(o);if(a)i.push(...a);else if(!Zl.has(o))throw Jl(o)}}}return i.length&&r.push(e(i)),r}function w_(t){return t.filter(e=>e!=zl)}function A_(t,e){let n=Lo,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:s}=n;s&&(r=s,e&&e.push(...t.slice(i).reverse()),t.length=i)}return r}const __=t=>h_(t),en=t=>{let e="";for(let n=0;n<32;n+=1)e+="00";if(t){const r=__(t).split(".");for(let i=r.length-1;i>=0;i-=1){const s=Ge(r[i]).slice(2);e=Ge(`0x${e}${s}`).slice(2)}}return`0x${e}`};var Yr=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class E_{constructor(e,n){this.contract=new an(HA,n??Ki.main,e),this.context=e}getOwner(e){return Yr(this,void 0,void 0,function*(){try{return this.contract.methods.owner(en(e)).call()}catch{throw new Error}})}getTTL(e){return Yr(this,void 0,void 0,function*(){try{return this.contract.methods.ttl(en(e)).call()}catch{throw new Error}})}recordExists(e){return Yr(this,void 0,void 0,function*(){try{return this.contract.methods.recordExists(en(e)).call()}catch{throw new Error}})}getResolver(e){return Yr(this,void 0,void 0,function*(){try{return this.contract.methods.resolver(en(e)).call().then(n=>{if(typeof n=="string")return new an(FA,n,this.context);throw new Error})}catch{throw new Error}})}get events(){return this.contract.events}}var kn=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class x_{constructor(e){this.registry=e}getResolverContractAdapter(e){return kn(this,void 0,void 0,function*(){return this.registry.getResolver(e)})}checkInterfaceSupport(e,n){var r,i;return kn(this,void 0,void 0,function*(){if(Z(Gc[n]))throw new Ga((r=e.options.address)!==null&&r!==void 0?r:"",n);if(!(yield e.methods.supportsInterface(Gc[n]).call()))throw new Ga((i=e.options.address)!==null&&i!==void 0?i:"",n)})}supportsInterface(e,n){var r;return kn(this,void 0,void 0,function*(){const i=yield this.getResolverContractAdapter(e);let s=n;if(!ae(s)){if(s=(r=Qr(n))!==null&&r!==void 0?r:"",n==="")throw new Error("Invalid interface Id");s=s.slice(0,10)}return i.methods.supportsInterface(s).call()})}getAddress(e,n=60){return kn(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(r,Zs.addr),r.methods.addr(en(e),n).call()})}getPubkey(e){return kn(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(n,Zs.pubkey),n.methods.pubkey(en(e)).call()})}getContenthash(e){return kn(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(n,Zs.contenthash),n.methods.contenthash(en(e)).call()})}}var mt=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class Yl extends lt{constructor(e,n){super(n??""),this.registryAddress=e??Ki.main,this._registry=new E_(this.getContextObject(),e),this._resolver=new x_(this._registry)}getResolver(e){return mt(this,void 0,void 0,function*(){return this._registry.getResolver(e)})}recordExists(e){return mt(this,void 0,void 0,function*(){return this._registry.recordExists(e)})}getTTL(e){return mt(this,void 0,void 0,function*(){return this._registry.getTTL(e)})}getOwner(e){return mt(this,void 0,void 0,function*(){return this._registry.getOwner(e)})}getAddress(e,n=60){return mt(this,void 0,void 0,function*(){return this._resolver.getAddress(e,n)})}getPubkey(e){return mt(this,void 0,void 0,function*(){return this._resolver.getPubkey(e)})}getContenthash(e){return mt(this,void 0,void 0,function*(){return this._resolver.getContenthash(e)})}checkNetwork(){return mt(this,void 0,void 0,function*(){const e=Date.now()/1e3;if(!this._lastSyncCheck||e-this._lastSyncCheck>3600){const i=yield sA(this);if(!(typeof i=="boolean"&&!i))throw new Jh;this._lastSyncCheck=e}if(this._detectedAddress)return this._detectedAddress;const n=yield xa(this,Object.assign(Object.assign({},j),{number:$e.HEX})),r=Ki[DA[n]];if(typeof r>"u")throw new Kh(n);return this._detectedAddress=r,this._detectedAddress})}supportsInterface(e,n){return mt(this,void 0,void 0,function*(){return this._resolver.supportsInterface(e,n)})}get events(){return this._registry.events}}var Tt=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const I_=t=>Tt(void 0,void 0,void 0,function*(){return(yield By(t)).map(ft)}),T_=(t,e)=>Tt(void 0,void 0,void 0,function*(){V.validate(["string"],[e]);const n=yield Cy(t,e);return ft(n)}),S_=(t,e,n,r)=>Tt(void 0,void 0,void 0,function*(){return V.validate(["address","string","uint"],[e,n,r]),Ry(t,e,n,r)}),k_=(t,e)=>Tt(void 0,void 0,void 0,function*(){return V.validate(["address"],[e]),Py(t,e)}),B_=(t,e,n)=>Tt(void 0,void 0,void 0,function*(){return V.validate(["string","string"],[e,n]),Ny(t,e,n)}),C_=(t,e,n)=>Tt(void 0,void 0,void 0,function*(){const r=De(e,W);return Oy(t,r,n)}),R_=(t,e,n)=>Tt(void 0,void 0,void 0,function*(){const r=De(e,W);return My(t,r,n)}),P_=(t,e,n,r)=>Tt(void 0,void 0,void 0,function*(){V.validate(["string","address","string"],[e,n,r]);const i=ae(e)?e:rt(e);return Ly(t,i,n,r)}),N_=(t,e,n)=>Tt(void 0,void 0,void 0,function*(){V.validate(["string","string"],[e,n]);const r=ae(e)?e:rt(e);return Dy(t,r,n)});var pt=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};class ef extends lt{getAccounts(){return pt(this,void 0,void 0,function*(){return I_(this.requestManager)})}newAccount(e){return pt(this,void 0,void 0,function*(){return T_(this.requestManager,e)})}unlockAccount(e,n,r){return pt(this,void 0,void 0,function*(){return S_(this.requestManager,e,n,r)})}lockAccount(e){return pt(this,void 0,void 0,function*(){return k_(this.requestManager,e)})}importRawKey(e,n){return pt(this,void 0,void 0,function*(){return B_(this.requestManager,e,n)})}sendTransaction(e,n){return pt(this,void 0,void 0,function*(){return C_(this.requestManager,e,n)})}signTransaction(e,n){return pt(this,void 0,void 0,function*(){return R_(this.requestManager,e,n)})}sign(e,n,r){return pt(this,void 0,void 0,function*(){return P_(this.requestManager,e,n,r)})}ecRecover(e,n){return pt(this,void 0,void 0,function*(){return N_(this.requestManager,e,n)})}}const O_={encodeEventSignature:ka,encodeFunctionCall:Yw,encodeFunctionSignature:Ts,encodeParameter:ko,encodeParameters:xs,decodeParameter:vl,decodeParameters:Is,decodeLog:bl};var cr=globalThis&&globalThis.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{d(r.next(c))}catch(l){o(l)}}function u(c){try{d(r.throw(c))}catch(l){o(l)}}function d(c){c.done?s(c.value):i(c.value).then(a,u)}d((r=r.apply(t,e||[])).next())})};const M_=t=>{const e=(o,a)=>cr(void 0,void 0,void 0,function*(){const u=yield RA(o,t),d=S({format:"bytes"},a,W);return zb(u,d)}),n=o=>{const a=Aa(o);return Object.assign(Object.assign({},a),{signTransaction:u=>cr(void 0,void 0,void 0,function*(){return e(u,a.privateKey)})})},r=(o,a,u)=>cr(void 0,void 0,void 0,function*(){var d;const c=yield Wb(o,a,(d=u==null?void 0:u.nonStrict)!==null&&d!==void 0?d:!0);return Object.assign(Object.assign({},c),{signTransaction:l=>cr(void 0,void 0,void 0,function*(){return e(l,c.privateKey)})})}),i=()=>{const o=Zb();return Object.assign(Object.assign({},o),{signTransaction:a=>cr(void 0,void 0,void 0,function*(){return e(a,o.privateKey)})})},s=new Ui({create:i,privateKeyToAccount:n,decrypt:r});return{signTransaction:e,create:i,privateKeyToAccount:n,decrypt:r,recoverTransaction:Qb,hashMessage:ba,sign:qd,recover:bo,encrypt:Vd,wallet:s}},L_={version:"4.2.2"};class Ur extends lt{constructor(e){var n;(Z(e)||typeof e=="string"&&e.trim()===""||typeof e!="string"&&!ji(e)&&!e.provider)&&console.warn("NOTE: web3.js is running without provider. You need to pass a provider in order to interact with the network!");let r={};typeof e=="string"||ji(e)?r.provider=e:e?r=e:r={},r.registeredSubscriptions=Object.assign(Object.assign({},Co),(n=r.registeredSubscriptions)!==null&&n!==void 0?n:{}),super(r);const i=M_(this);this._wallet=i.wallet,this._accountProvider=i,this.utils=id;const s=this;class o extends an{constructor(d,c,l){if(typeof c=="object"&&typeof l=="object")throw new qa("Should not provide options at both 2nd and 3rd parameters");if(Z(c))super(d,l,s.getContextObject());else if(typeof c=="object")super(d,c,s.getContextObject());else if(typeof c=="string")super(d,c,l??{},s.getContextObject());else throw new qa;super.subscribeToContextEvents(s)}}const a=s.use(Ss);this.eth=Object.assign(a,{ens:s.use(Yl,Ki.main),Iban:_e,net:s.use(Qd),personal:s.use(ef),Contract:o,abi:O_,accounts:i})}}Ur.version=L_.version;Ur.utils=id;Ur.modules={Web3Eth:Ss,Iban:_e,Net:Qd,ENS:Yl,Personal:ef};const D_={class:"pd-big"},H_=U.createElementVNode("h1",{class:"mn-small"}," Your Wallet ",-1),F_=U.createElementVNode("p",{class:"mn-semi p-big"}," Earn Weeder Token Crypto with buying our weed, use it as money when buying our products or withdraw and trade ",-1),j_={class:"mn-semi flex-nowrap flex gap-thin"},U_={key:0,class:"w-100 pd-medium radius-medium t-center bg-grey"},G_=U.createElementVNode("h3",{class:"mn-small"},"Make first order and start earning Weeder Token ",-1),q_=U.createElementVNode("button",{class:"mn-l-auto mn-r-auto bg-main button"},"Explore marketplace",-1),V_=[G_,q_],z_={key:1,class:"w-100 pd-medium radius-medium bg-grey"},Q_=U.createElementVNode("p",{class:"h4 mn-thin"},"You own: ",-1),Z_=U.createElementVNode("h3",{class:"mn-small"},"0.14% of Weeder",-1),W_=U.createElementVNode("button",{class:"w-100 bg-main button"},"Get More",-1),$_=[Q_,Z_,W_],K_={key:2,class:"w-100 pd-medium radius-medium bg-grey"},J_=U.createElementVNode("p",{class:"h4 mn-thin"},"You earn: ",-1),X_=U.createElementVNode("h3",{class:"mn-small"},"245.43 WDT",-1),Y_=U.createElementVNode("button",{class:"w-100 bg-main button"},"Get More",-1),eE=[J_,X_,Y_],tE={class:"w-50 bg-black radius-semi pd-medium t-white"},nE=U.createElementVNode("p",{class:"h4 mn-thin"},"Your Metamask",-1),rE={key:0,class:"mn-small pd-small br-solid br-1px br-white-transp-10 radius-small"},iE={key:1,class:"p-medium t-transp mn-small"},sE=U.createElementVNode("h3",{class:"mn-small"}," Incomes ",-1),oE={class:"cols-4 gap-thin"},aE={class:"pd-medium radius-medium bg-grey"},cE={class:"mn-small"},uE={class:"p-small mn-small"},dE={__name:"Wallet",setup(t){tf.useRoute(),U.ref(!1);const e=new Ur(Ur.givenProvider||"http://localhost:8080"),n=U.ref(null);async function r(){const i=await e.eth.requestAccounts();n.value=i[0]}return U.onMounted(()=>{}),(i,s)=>(U.openBlock(),U.createElementBlock("section",D_,[H_,F_,U.createElementVNode("div",j_,[n.value?U.createCommentVNode("",!0):(U.openBlock(),U.createElementBlock("div",U_,V_)),n.value?(U.openBlock(),U.createElementBlock("div",z_,$_)):U.createCommentVNode("",!0),n.value?(U.openBlock(),U.createElementBlock("div",K_,eE)):U.createCommentVNode("",!0),U.createElementVNode("div",tE,[nE,n.value?(U.openBlock(),U.createElementBlock("div",rE,U.toDisplayString(n.value),1)):U.createCommentVNode("",!0),n.value?U.createCommentVNode("",!0):(U.openBlock(),U.createElementBlock("p",iE,"Connect Metamask to withdrawal your earnings.")),n.value?U.createCommentVNode("",!0):(U.openBlock(),U.createElementBlock("button",{key:2,onClick:r,class:"w-100 button"}," Connect Wallet ")),n.value?(U.openBlock(),U.createElementBlock("button",{key:3,onClick:s[0]||(s[0]=(...o)=>i.disconnectWallet&&i.disconnectWallet(...o)),class:"w-100 bg-red button"}," Disonnect Wallet ")):U.createCommentVNode("",!0)])]),sE,U.createElementVNode("section",oE,[(U.openBlock(!0),U.createElementBlock(U.Fragment,null,U.renderList([{balance:34,type:"income",reason:"order",target:"ef34dsdase4389snjnu (_id)"},{balance:25,type:"income",reason:"post",target:"ef34dsdase4389snjnu (_id)"},{balance:17,type:"income",reason:"comment",target:"ef34dsdase4389snjnu (_id)"},{balance:43,type:"event",reason:"order",target:"ef34dsdase4389snjnu (_id)"}],o=>(U.openBlock(),U.createElementBlock("div",aE,[U.createElementVNode("h3",cE,"+ "+U.toDisplayString(o.balance)+" WDT",1),U.createElementVNode("p",uE,"For "+U.toDisplayString(o.reason)+" "+U.toDisplayString(o.target),1)]))),256))])]))}};exports.default=dE;
|