@kolirt/vue-web3-auth
Version:
Web3 authentication for Vue3 apps based on WalletConnect Web3Modal v2
10 lines • 144 kB
JavaScript
(function(u,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("@wagmi/core"),require("vue"),require("@web3modal/ethereum"),require("@web3modal/html"),require("js-event-bus")):typeof define=="function"&&define.amd?define(["exports","@wagmi/core","vue","@web3modal/ethereum","@web3modal/html","js-event-bus"],k):(u=typeof globalThis<"u"?globalThis:u||self,k(u["vue-web3-auth"]={},u["@wagmi/core"],u.vue,u["@web3modal/ethereum"],u["@web3modal/html"],u["js-event-bus"]))})(this,function(u,k,T,ue,dt,ht){"use strict";function s(e,t={}){const{fees:n=e.fees,formatters:a=e.formatters,serializers:r=e.serializers}=t;return{...e,fees:n,formatters:a,serializers:r}}const bt=s({id:787,name:"Acala",network:"acala",nativeCurrency:{name:"Acala",symbol:"ACA",decimals:18},rpcUrls:{public:{http:["https://eth-rpc-acala.aca-api.network"],webSocket:["wss://eth-rpc-acala.aca-api.network"]},default:{http:["https://eth-rpc-acala.aca-api.network"],webSocket:["wss://eth-rpc-acala.aca-api.network"]}},blockExplorers:{default:{name:"Acala Blockscout",url:"https://blockscout.acala.network"}},testnet:!1}),ft=s({id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),yt=s({id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114}},testnet:!0}),kt=s({id:42170,name:"Arbitrum Nova",network:"arbitrum-nova",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://arbitrum-nova.public.blastapi.io"],webSocket:["wss://arbitrum-nova.public.blastapi.io"]},default:{http:["https://nova.arbitrum.io/rpc"]},public:{http:["https://nova.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://nova.arbiscan.io"},blockScout:{name:"BlockScout",url:"https://nova-explorer.arbitrum.io/"},default:{name:"Arbiscan",url:"https://nova.arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1746963}}}),wt=s({id:592,name:"Astar",network:"astar-mainnet",nativeCurrency:{name:"Astar",symbol:"ASTR",decimals:18},rpcUrls:{public:{http:["https://astar.api.onfinality.io/public"]},default:{http:["https://astar.api.onfinality.io/public"]}},blockExplorers:{default:{name:"Astar Subscan",url:"https://astar.subscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:761794}},testnet:!1}),xt=s({id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-sepolia.g.alchemy.com/v2"],webSocket:["wss://arb-sepolia.g.alchemy.com/v2"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://sepolia.arbiscan.io"},default:{name:"Arbiscan",url:"https://sepolia.arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:81930}},testnet:!0}),gt=s({id:1261120,name:"Astar zkEVM Testnet zKatana",network:"zKatana",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.zkatana.gelato.digital","https://rpc.startale.com/zkatana"]},public:{http:["https://rpc.zkatana.gelato.digital","https://rpc.startale.com/zkatana"]}},blockExplorers:{blockscout:{name:"Blockscout zKatana chain explorer",url:"https://zkatana.blockscout.com"},default:{name:"zKatana Explorer",url:"https://zkatana.explorer.startale.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:31317}},testnet:!0}),vt=s({id:1313161554,name:"Aurora",network:"aurora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{infura:{http:["https://aurora-mainnet.infura.io/v3"]},default:{http:["https://mainnet.aurora.dev"]},public:{http:["https://mainnet.aurora.dev"]}},blockExplorers:{etherscan:{name:"Aurorascan",url:"https://aurorascan.dev"},default:{name:"Aurorascan",url:"https://aurorascan.dev"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:62907816}}}),Et=s({id:1313161555,name:"Aurora Testnet",network:"aurora-testnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{infura:{http:["https://aurora-testnet.infura.io/v3"]},default:{http:["https://testnet.aurora.dev"]},public:{http:["https://testnet.aurora.dev"]}},blockExplorers:{etherscan:{name:"Aurorascan",url:"https://testnet.aurorascan.dev"},default:{name:"Aurorascan",url:"https://testnet.aurorascan.dev"}},testnet:!0}),Ct=s({id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),Tt=s({id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7096959}},testnet:!0}),St=s({id:5165,network:"bahamut",name:"Bahamut",nativeCurrency:{name:"Fasttoken",symbol:"FTN",decimals:18},rpcUrls:{default:{http:["https://rpc1.bahamut.io","https://bahamut.publicnode.com","https://rpc2.bahamut.io"],webSocket:["wss://ws1.sahara.bahamutchain.com","wss://bahamut.publicnode.com","wss://ws2.sahara.bahamutchain.com"]},public:{http:["https://rpc1.bahamut.io","https://bahamut.publicnode.com","https://rpc2.bahamut.io"],webSocket:["wss://ws1.sahara.bahamutchain.com","wss://bahamut.publicnode.com","wss://ws2.sahara.bahamutchain.com"]}},blockExplorers:{default:{name:"Ftnscan",url:"https://www.ftnscan.com"}}}),At="1.21.3",Ut=()=>`viem@${At}`;class d extends Error{constructor(t,n={}){var o;super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:Ut()});const a=n.cause instanceof d?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,r=n.cause instanceof d&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...r?[`Docs: https://viem.sh${r}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...a?[`Details: ${a}`]:[],`Version: ${this.version}`].join(`
`),n.cause&&(this.cause=n.cause),this.details=a,this.docsPath=r,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return Ce(this,t)}}function Ce(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e?Ce(e.cause,t):t?null:e}class Pt extends d{constructor({max:t,min:n,signed:a,size:r,value:o}){super(`Number "${o}" is not in safe ${r?`${r*8}-bit ${a?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class Bt extends d{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}class zt extends d{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function te(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function z(e){return te(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function A(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,a=0;for(let r=0;r<n.length-1&&n[t==="left"?r:n.length-r-1].toString()==="0";r++)a++;return n=t==="left"?n.slice(a):n.slice(0,n.length-a),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}class Te extends d{constructor({offset:t,position:n,size:a}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${a}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class Se extends d{constructor({size:t,targetSize:n,type:a}){super(`${a.charAt(0).toUpperCase()}${a.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}function V(e,{dir:t,size:n=32}={}){return typeof e=="string"?Ft(e,{dir:t,size:n}):It(e,{dir:t,size:n})}function Ft(e,{dir:t,size:n=32}={}){if(n===null)return e;const a=e.replace("0x","");if(a.length>n*2)throw new Se({size:Math.ceil(a.length/2),targetSize:n,type:"hex"});return`0x${a[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function It(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new Se({size:e.length,targetSize:n,type:"bytes"});const a=new Uint8Array(n);for(let r=0;r<n;r++){const o=t==="right";a[o?r:n-r-1]=e[o?r:e.length-r-1]}return a}const Mt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function p(e,t={}){return typeof e=="number"||typeof e=="bigint"?$(e,t):typeof e=="string"?Ot(e,t):typeof e=="boolean"?Lt(e,t):me(e,t)}function Lt(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(j(n,{size:t.size}),V(n,{size:t.size})):n}function me(e,t={}){let n="";for(let r=0;r<e.length;r++)n+=Mt[e[r]];const a=`0x${n}`;return typeof t.size=="number"?(j(a,{size:t.size}),V(a,{dir:"right",size:t.size})):a}function $(e,t={}){const{signed:n,size:a}=t,r=BigInt(e);let o;a?n?o=(1n<<BigInt(a)*8n-1n)-1n:o=2n**(BigInt(a)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof o=="bigint"&&n?-o-1n:0;if(o&&r>o||r<i){const l=typeof e=="bigint"?"n":"";throw new Pt({max:o?`${o}${l}`:void 0,min:`${i}${l}`,signed:n,size:a,value:`${e}${l}`})}const c=`0x${(n&&r<0?(1n<<BigInt(a*8))+BigInt(r):r).toString(16)}`;return a?V(c,{size:a}):c}const Nt=new TextEncoder;function Ot(e,t={}){const n=Nt.encode(e);return me(n,t)}const $t=new TextEncoder;function Ae(e,t={}){return typeof e=="number"||typeof e=="bigint"?Gt(e,t):typeof e=="boolean"?Ht(e,t):te(e)?Q(e,t):Pe(e,t)}function Ht(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(j(n,{size:t.size}),V(n,{size:t.size})):n}const H={zero:48,nine:57,A:65,F:70,a:97,f:102};function Ue(e){if(e>=H.zero&&e<=H.nine)return e-H.zero;if(e>=H.A&&e<=H.F)return e-(H.A-10);if(e>=H.a&&e<=H.f)return e-(H.a-10)}function Q(e,t={}){let n=e;t.size&&(j(n,{size:t.size}),n=V(n,{dir:"right",size:t.size}));let a=n.slice(2);a.length%2&&(a=`0${a}`);const r=a.length/2,o=new Uint8Array(r);for(let i=0,c=0;i<r;i++){const l=Ue(a.charCodeAt(c++)),m=Ue(a.charCodeAt(c++));if(l===void 0||m===void 0)throw new d(`Invalid byte sequence ("${a[c-2]}${a[c-1]}" in "${a}").`);o[i]=l*16+m}return o}function Gt(e,t){const n=$(e,t);return Q(n)}function Pe(e,t={}){const n=$t.encode(e);return typeof t.size=="number"?(j(n,{size:t.size}),V(n,{dir:"right",size:t.size})):n}function j(e,{size:t}){if(z(e)>t)throw new zt({givenSize:z(e),maxSize:t})}function x(e,t={}){const{signed:n}=t;t.size&&j(e,{size:t.size});const a=BigInt(e);if(!n)return a;const r=(e.length-2)/2,o=(1n<<BigInt(r)*8n-1n)-1n;return a<=o?a:a-BigInt(`0x${"f".padStart(r*2,"f")}`)-1n}function jt(e,t={}){let n=e;if(t.size&&(j(n,{size:t.size}),n=A(n)),A(n)==="0x00")return!1;if(A(n)==="0x01")return!0;throw new Bt(n)}function U(e,t={}){return Number(x(e,t))}function Dt(e,t={}){let n=Q(e);return t.size&&(j(n,{size:t.size}),n=A(n,{dir:"right"})),new TextDecoder().decode(n)}function ne(e,t){return({exclude:n,format:a})=>({exclude:n,format:r=>{const o=t(r);if(n)for(const i of n)delete o[i];return{...o,...a(r)}},type:e})}const Be={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559"};function ae(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?U(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?U(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Be[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t}const de=ne("transaction",ae);function Kt(e){var n;const t=(n=e.transactions)==null?void 0:n.map(a=>typeof a=="string"?a:ae(a));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,difficulty:e.difficulty?BigInt(e.difficulty):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const he=ne("block",Kt);function ze(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const Vt={"0x0":"reverted","0x1":"success"};function Rt(e){return{...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(t=>ze(t)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?U(e.transactionIndex):null,status:e.status?Vt[e.status]:null,type:e.type?Be[e.type]||e.type:null}}const Fe=ne("transactionReceipt",Rt),F={block:he({format(e){var n;return{transactions:(n=e.transactions)==null?void 0:n.map(a=>{if(typeof a=="string")return a;const r=ae(a);return r.typeHex==="0x7e"&&(r.isSystemTx=a.isSystemTx,r.mint=a.mint?x(a.mint):void 0,r.sourceHash=a.sourceHash,r.type="deposit"),r}),stateRoot:e.stateRoot}}}),transaction:de({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?x(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Fe({format(e){return{l1GasPrice:e.l1GasPrice?x(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?x(e.l1GasUsed):null,l1Fee:e.l1Fee?x(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})},qt=s({id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://base-mainnet.g.alchemy.com/v2"],webSocket:["wss://base-mainnet.g.alchemy.com/v2"]},infura:{http:["https://base-mainnet.infura.io/v3"],webSocket:["wss://base-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{blockscout:{name:"Basescout",url:"https://base.blockscout.com"},default:{name:"Basescan",url:"https://basescan.org"},etherscan:{name:"Basescan",url:"https://basescan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022}}},{formatters:F}),Xt=s({id:84531,network:"base-goerli",name:"Base Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://base-goerli.g.alchemy.com/v2"],webSocket:["wss://base-goerli.g.alchemy.com/v2"]},default:{http:["https://goerli.base.org"]},public:{http:["https://goerli.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://goerli.basescan.org"},default:{name:"Basescan",url:"https://goerli.basescan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1376988}},testnet:!0,sourceId:5},{formatters:F}),Wt=s({id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://base-sepolia.g.alchemy.com/v2"],webSocket:["wss://base-sepolia.g.alchemy.com/v2"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{blockscout:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"},default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0,sourceId:11155111},{formatters:F}),Zt=s({id:641230,name:"Bear Network Chain Mainnet",network:"BearNetworkChainMainnet",nativeCurrency:{decimals:18,name:"BearNetworkChain",symbol:"BRNKC"},rpcUrls:{public:{http:["https://brnkc-mainnet.bearnetwork.net"]},default:{http:["https://brnkc-mainnet.bearnetwork.net"]}},blockExplorers:{default:{name:"BrnkScan",url:"https://brnkscan.bearnetwork.net"}}}),_t=s({id:751230,name:"Bear Network Chain Testnet",network:"BearNetworkChainTestnet",nativeCurrency:{decimals:18,name:"tBRNKC",symbol:"tBRNKC"},rpcUrls:{public:{http:["https://brnkc-test.bearnetwork.net"]},default:{http:["https://brnkc-test.bearnetwork.net"]}},blockExplorers:{default:{name:"BrnkTestScan",url:"https://brnktest-scan.bearnetwork.net"}},testnet:!0}),Qt=s({id:199,name:"BitTorrent",network:"bittorrent-chain-mainnet",nativeCurrency:{name:"BitTorrent",symbol:"BTT",decimals:18},rpcUrls:{default:{http:["https://rpc.bittorrentchain.io"]},public:{http:["https://rpc.bittorrentchain.io"]}},blockExplorers:{etherscan:{name:"Bttcscan",url:"https://bttcscan.com"},default:{name:"Bttcscan",url:"https://bttcscan.com"}}}),Yt=s({id:1028,name:"BitTorrent Chain Testnet",network:"bittorrent-chain-testnet",nativeCurrency:{name:"BitTorrent",symbol:"BTT",decimals:18},rpcUrls:{default:{http:["https://testrpc.bittorrentchain.io"]},public:{http:["https://testrpc.bittorrentchain.io"]}},blockExplorers:{etherscan:{name:"Bttcscan",url:"https://testnet.bttcscan.com"},default:{name:"Bttcscan",url:"https://testnet.bttcscan.com"}},testnet:!0}),Jt=s({id:288,name:"Boba Network",network:"boba",nativeCurrency:{decimals:18,name:"Boba",symbol:"BOBA"},rpcUrls:{default:{http:["https://mainnet.boba.network"]},public:{http:["https://mainnet.boba.network"]}},blockExplorers:{etherscan:{name:"BOBAScan",url:"https://bobascan.com"},default:{name:"BOBAScan",url:"https://bobascan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:446859}}}),en=s({id:1039,name:"Bronos",network:"bronos",nativeCurrency:{decimals:18,name:"BRO",symbol:"BRO"},rpcUrls:{default:{http:["https://evm.bronos.org"]},public:{http:["https://evm.bronos.org"]}},blockExplorers:{default:{name:"BronoScan",url:"https://broscan.bronos.org"}}}),tn=s({id:1038,name:"Bronos Testnet",network:"bronos-testnet",nativeCurrency:{decimals:18,name:"Bronos Coin",symbol:"tBRO"},rpcUrls:{default:{http:["https://evm-testnet.bronos.org"]},public:{http:["https://evm-testnet.bronos.org"]}},blockExplorers:{default:{name:"BronoScan",url:"https://tbroscan.bronos.org"}},testnet:!0}),nn=s({id:56,name:"BNB Smart Chain",network:"bsc",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://rpc.ankr.com/bsc"]},public:{http:["https://rpc.ankr.com/bsc"]}},blockExplorers:{etherscan:{name:"BscScan",url:"https://bscscan.com"},default:{name:"BscScan",url:"https://bscscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),an=s({id:97,name:"Binance Smart Chain Testnet",network:"bsc-testnet",nativeCurrency:{decimals:18,name:"BNB",symbol:"tBNB"},rpcUrls:{default:{http:["https://data-seed-prebsc-1-s1.bnbchain.org:8545"]},public:{http:["https://data-seed-prebsc-1-s1.bnbchain.org:8545"]}},blockExplorers:{etherscan:{name:"BscScan",url:"https://testnet.bscscan.com"},default:{name:"BscScan",url:"https://testnet.bscscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:17422483}},testnet:!0}),rn=s({id:4999,name:"BlackFort Exchange Network",network:"bxn",nativeCurrency:{name:"BlackFort Token",symbol:"BXN",decimals:18},rpcUrls:{default:{http:["https://mainnet.blackfort.network/rpc"]},public:{http:["https://mainnet.blackfort.network/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.blackfort.network"}}}),sn=s({id:4777,name:"BlackFort Exchange Network Testnet",network:"bxnTestnet",nativeCurrency:{name:"BlackFort Testnet Token",symbol:"TBXN",decimals:18},rpcUrls:{default:{http:["https://testnet.blackfort.network/rpc"]},public:{http:["https://testnet.blackfort.network/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://testnet-explorer.blackfort.network"}}}),on=s({id:7700,name:"Canto",network:"canto",nativeCurrency:{decimals:18,name:"Canto",symbol:"CANTO"},rpcUrls:{default:{http:["https://canto.gravitychain.io"]},public:{http:["https://canto.gravitychain.io"]}},blockExplorers:{default:{name:"Tuber.Build (Blockscout)",url:"https://tuber.build"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2905789}}}),cn={legacy:"0x0",eip2930:"0x1",eip1559:"0x2"};function ln(e){return{...e,gas:typeof e.gas<"u"?$(e.gas):void 0,gasPrice:typeof e.gasPrice<"u"?$(e.gasPrice):void 0,maxFeePerGas:typeof e.maxFeePerGas<"u"?$(e.maxFeePerGas):void 0,maxPriorityFeePerGas:typeof e.maxPriorityFeePerGas<"u"?$(e.maxPriorityFeePerGas):void 0,nonce:typeof e.nonce<"u"?$(e.nonce):void 0,type:typeof e.type<"u"?cn[e.type]:void 0,value:typeof e.value<"u"?$(e.value):void 0}}const Ie=ne("transactionRequest",ln);function D(e){return e===0||e===0n||e===void 0||e===null||e==="0"||e===""||typeof e=="string"&&(A(e).toLowerCase()==="0x"||A(e).toLowerCase()==="0x00")}function C(e){return!D(e)}function Me(e){return C(e.maxFeePerGas)&&C(e.maxPriorityFeePerGas)}function Le(e){return e.type==="cip42"?!0:Me(e)&&(C(e.feeCurrency)||C(e.gatewayFeeRecipient)||C(e.gatewayFee))}function Ne(e){return e.type==="cip64"?!0:Me(e)&&C(e.feeCurrency)&&D(e.gatewayFee)&&D(e.gatewayFeeRecipient)}const be={block:he({exclude:["difficulty","gasLimit","mixHash","nonce","uncles"],format(e){var n;const t=(n=e.transactions)==null?void 0:n.map(a=>typeof a=="string"?a:{...ae(a),feeCurrency:a.feeCurrency,...a.type!=="0x7b"?{gatewayFee:a.gatewayFee?x(a.gatewayFee):null,gatewayFeeRecipient:a.gatewayFeeRecipient||null}:{}});return{randomness:e.randomness,transactions:t}}}),transaction:de({format(e){const t={feeCurrency:e.feeCurrency};return e.type==="0x7b"?t.type="cip64":(e.type==="0x7c"&&(t.type="cip42"),t.gatewayFee=e.gatewayFee?x(e.gatewayFee):null,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}}),transactionRequest:Ie({format(e){const t={feeCurrency:e.feeCurrency};return Ne(e)?t.type="0x7b":(Le(e)&&(t.type="0x7c"),t.gatewayFee=typeof e.gatewayFee<"u"?$(e.gatewayFee):void 0,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}})};class N extends d{constructor({address:t}){super(`Address "${t}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}class R extends d{constructor({chainId:t}){super(`Chain ID "${t}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}const pn={ether:-9,wei:9};function un(e,t){let n=e.toString();const a=n.startsWith("-");a&&(n=n.slice(1)),n=n.padStart(t,"0");let[r,o]=[n.slice(0,n.length-t),n.slice(n.length-t)];return o=o.replace(/(0+)$/,""),`${a?"-":""}${r||"0"}${o?`.${o}`:""}`}function fe(e,t="wei"){return un(e,pn[t])}class q extends d{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${fe(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(q,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class re extends d{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:a}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${fe(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${a?` = ${fe(a)} gwei`:""}).`].join(`
`),{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(re,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});const mn=/^0x[a-fA-F0-9]{40}$/;function B(e){return mn.test(e)}function Y(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function dn(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Oe=/^tuple(?<array>(\[(\d*)\])*)$/;function ye(e){let t=e.type;if(Oe.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){const o=e.components[r];t+=ye(o),r<n-1&&(t+=", ")}const a=dn(Oe,e.type);return t+=`)${(a==null?void 0:a.array)??""}`,ye({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function J(e){let t="";const n=e.length;for(let a=0;a<n;a++){const r=e[a];t+=ye(r),a!==n-1&&(t+=", ")}return t}function hn(e){return e.type==="function"?`function ${e.name}(${J(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs.length?` returns (${J(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${J(e.inputs)})`:e.type==="error"?`error ${e.name}(${J(e.inputs)})`:e.type==="constructor"?`constructor(${J(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?"fallback()":"receive() external payable"}function $e(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new gn(e.type);return`${e.name}(${se(e.inputs,{includeName:t})})`}function se(e,{includeName:t=!1}={}){return e?e.map(n=>bn(n,{includeName:t})).join(t?", ":","):""}function bn(e,{includeName:t}){return e.type.startsWith("tuple")?`(${se(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class ke extends d{constructor({data:t,params:n,size:a}){super([`Data size of ${a} bytes is too small for given parameters.`].join(`
`),{metaMessages:[`Params: (${se(n,{includeName:!0})})`,`Data: ${t} (${a} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=a}}class fn extends d{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class yn extends d{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class kn extends d{constructor(t,{docsPath:n}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class He extends d{constructor({abiItem:t,data:n,params:a,size:r}){super([`Data size of ${r} bytes is too small for non-indexed event parameters.`].join(`
`),{metaMessages:[`Params: (${se(a,{includeName:!0})})`,`Data: ${n} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=a,this.size=r}}class wn extends d{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${$e(t,{includeName:!0})}".`].join(`
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class xn extends d{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class gn extends d{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}function vn(e){let t=!0,n="",a=0,r="",o=!1;for(let i=0;i<e.length;i++){const c=e[i];if(["(",")",","].includes(c)&&(t=!0),c==="("&&a++,c===")"&&a--,!!t){if(a===0){if(c===" "&&["event","function",""].includes(r))r="";else if(r+=c,c===")"){o=!0;break}continue}if(c===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}r+=c,n+=c}}if(!o)throw new d("Unable to normalize signature.");return r}const En=e=>{const t=(()=>typeof e=="string"?e:hn(e))();return vn(t)},Cn=e=>En(e);function Ge(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function je(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function De(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Tn(e,t){je(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const oe=BigInt(2**32-1),Ke=BigInt(32);function Sn(e,t=!1){return t?{h:Number(e&oe),l:Number(e>>Ke&oe)}:{h:Number(e>>Ke&oe)|0,l:Number(e&oe)|0}}function An(e,t=!1){let n=new Uint32Array(e.length),a=new Uint32Array(e.length);for(let r=0;r<e.length;r++){const{h:o,l:i}=Sn(e[r],t);[n[r],a[r]]=[o,i]}return[n,a]}const Un=(e,t,n)=>e<<n|t>>>32-n,Pn=(e,t,n)=>t<<n|e>>>32-n,Bn=(e,t,n)=>t<<n-32|e>>>64-n,zn=(e,t,n)=>e<<n-32|t>>>64-n;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Fn=e=>e instanceof Uint8Array,In=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");function Mn(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Ve(e){if(typeof e=="string"&&(e=Mn(e)),!Fn(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}class Ln{clone(){return this._cloneInto()}}function Nn(e){const t=a=>e().update(Ve(a)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const[Re,qe,Xe]=[[],[],[]],On=BigInt(0),ee=BigInt(1),$n=BigInt(2),Hn=BigInt(7),Gn=BigInt(256),jn=BigInt(113);for(let e=0,t=ee,n=1,a=0;e<24;e++){[n,a]=[a,(2*n+3*a)%5],Re.push(2*(5*a+n)),qe.push((e+1)*(e+2)/2%64);let r=On;for(let o=0;o<7;o++)t=(t<<ee^(t>>Hn)*jn)%Gn,t&$n&&(r^=ee<<(ee<<BigInt(o))-ee);Xe.push(r)}const[Dn,Kn]=An(Xe,!0),We=(e,t,n)=>n>32?Bn(e,t,n):Un(e,t,n),Ze=(e,t,n)=>n>32?zn(e,t,n):Pn(e,t,n);function Vn(e,t=24){const n=new Uint32Array(10);for(let a=24-t;a<24;a++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const c=(i+8)%10,l=(i+2)%10,m=n[l],b=n[l+1],y=We(m,b,1)^n[c],w=Ze(m,b,1)^n[c+1];for(let v=0;v<50;v+=10)e[i+v]^=y,e[i+v+1]^=w}let r=e[2],o=e[3];for(let i=0;i<24;i++){const c=qe[i],l=We(r,o,c),m=Ze(r,o,c),b=Re[i];r=e[b],o=e[b+1],e[b]=l,e[b+1]=m}for(let i=0;i<50;i+=10){for(let c=0;c<10;c++)n[c]=e[i+c];for(let c=0;c<10;c++)e[i+c]^=~n[(c+2)%10]&n[(c+4)%10]}e[0]^=Dn[a],e[1]^=Kn[a]}n.fill(0)}class we extends Ln{constructor(t,n,a,r=!1,o=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=a,this.enableXOF=r,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ge(a),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=In(this.state)}keccak(){Vn(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){De(this);const{blockLen:n,state:a}=this;t=Ve(t);const r=t.length;for(let o=0;o<r;){const i=Math.min(n-this.pos,r-o);for(let c=0;c<i;c++)a[this.pos++]^=t[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:a,blockLen:r}=this;t[a]^=n,n&128&&a===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){De(this,!1),je(t),this.finish();const n=this.state,{blockLen:a}=this;for(let r=0,o=t.length;r<o;){this.posOut>=a&&this.keccak();const i=Math.min(a-this.posOut,o-r);t.set(n.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Ge(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Tn(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:a,outputLen:r,rounds:o,enableXOF:i}=this;return t||(t=new we(n,a,r,i,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=a,t.outputLen=r,t.enableXOF=i,t.destroyed=this.destroyed,t}}const Rn=((e,t,n)=>Nn(()=>new we(t,e,n)))(1,136,256/8);function _e(e,t){const n=t||"hex",a=Rn(te(e,{strict:!1})?Ae(e):e);return n==="bytes"?a:p(a)}const qn=e=>_e(Ae(e)),Xn=e=>qn(Cn(e));function S(e,t,n,{strict:a}={}){return te(e,{strict:!1})?Zn(e,t,n,{strict:a}):Wn(e,t,n,{strict:a})}function Qe(e,t){if(typeof t=="number"&&t>0&&t>z(e)-1)throw new Te({offset:t,position:"start",size:z(e)})}function Ye(e,t,n){if(typeof t=="number"&&typeof n=="number"&&z(e)!==n-t)throw new Te({offset:n,position:"end",size:z(e)})}function Wn(e,t,n,{strict:a}={}){Qe(e,t);const r=e.slice(t,n);return a&&Ye(r,t,n),r}function Zn(e,t,n,{strict:a}={}){Qe(e,t);const r=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return a&&Ye(r,t,n),r}function xe(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function _n(e,t){const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),a=_e(Pe(n),"bytes"),r=(t?n.substring(`${t}0x`.length):n).split("");for(let o=0;o<40;o+=2)a[o>>1]>>4>=8&&r[o]&&(r[o]=r[o].toUpperCase()),(a[o>>1]&15)>=8&&r[o+1]&&(r[o+1]=r[o+1].toUpperCase());return`0x${r.join("")}`}function Je(e,t){if(t==="0x"&&e.length>0)throw new fn;if(z(t)&&z(t)<32)throw new ke({data:t,params:e,size:z(t)});return Qn({data:t,params:e})}function Qn({data:e,params:t}){const n=[];let a=0;for(let r=0;r<t.length;r++){if(a>=z(e))throw new ke({data:e,params:t,size:z(e)});const o=t[r],{consumed:i,value:c}=X({data:e,param:o,position:a});n.push(c),a+=i}return n}function X({data:e,param:t,position:n}){const a=xe(t.type);if(a){const[o,i]=a;return Jn(e,{length:o,param:{...t,type:i},position:n})}if(t.type==="tuple")return ra(e,{param:t,position:n});if(t.type==="string")return aa(e,{position:n});if(t.type.startsWith("bytes"))return ta(e,{param:t,position:n});const r=S(e,n,n+32,{strict:!0});if(t.type.startsWith("uint")||t.type.startsWith("int"))return na(r,{param:t});if(t.type==="address")return Yn(r);if(t.type==="bool")return ea(r);throw new xn(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function Yn(e){return{consumed:32,value:_n(S(e,-20))}}function Jn(e,{param:t,length:n,position:a}){if(!n){const i=U(S(e,a,a+32,{strict:!0})),c=U(S(e,i,i+32,{strict:!0}));let l=0;const m=[];for(let b=0;b<c;++b){const y=X({data:S(e,i+32),param:t,position:l});l+=y.consumed,m.push(y.value)}return{value:m,consumed:32}}if(ie(t)){const i=xe(t.type),c=!(i!=null&&i[0]);let l=0;const m=[];for(let b=0;b<n;++b){const y=U(S(e,a,a+32,{strict:!0})),w=X({data:S(e,y),param:t,position:c?l:b*32});l+=w.consumed,m.push(w.value)}return{value:m,consumed:32}}let r=0;const o=[];for(let i=0;i<n;++i){const c=X({data:e,param:t,position:a+r});r+=c.consumed,o.push(c.value)}return{value:o,consumed:r}}function ea(e){return{consumed:32,value:jt(e)}}function ta(e,{param:t,position:n}){const[a,r]=t.type.split("bytes");if(!r){const i=U(S(e,n,n+32,{strict:!0})),c=U(S(e,i,i+32,{strict:!0}));return c===0?{consumed:32,value:"0x"}:{consumed:32,value:S(e,i+32,i+32+c,{strict:!0})}}return{consumed:32,value:S(e,n,n+parseInt(r),{strict:!0})}}function na(e,{param:t}){const n=t.type.startsWith("int");return{consumed:32,value:parseInt(t.type.split("int")[1]||"256")>48?x(e,{signed:n}):U(e,{signed:n})}}function aa(e,{position:t}){const n=U(S(e,t,t+32,{strict:!0})),a=U(S(e,n,n+32,{strict:!0}));return a===0?{consumed:32,value:""}:{consumed:32,value:Dt(A(S(e,n+32,n+32+a,{strict:!0})))}}function ra(e,{param:t,position:n}){const a=t.components.length===0||t.components.some(({name:i})=>!i),r=a?[]:{};let o=0;if(ie(t)){const i=U(S(e,n,n+32,{strict:!0}));for(let c=0;c<t.components.length;++c){const l=t.components[c],m=X({data:S(e,i),param:l,position:o});o+=m.consumed,r[a?c:l==null?void 0:l.name]=m.value}return{consumed:32,value:r}}for(let i=0;i<t.components.length;++i){const c=t.components[i],l=X({data:e,param:c,position:n+o});o+=l.consumed,r[a?i:c==null?void 0:c.name]=l.value}return{consumed:o,value:r}}function ie(e){var a;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(a=e.components)==null?void 0:a.some(ie);const n=xe(e.type);return!!(n&&ie({...e,type:n[1]}))}function sa(e){const t=Object.entries(e).map(([a,r])=>r===void 0||r===!1?null:[a,r]).filter(Boolean),n=t.reduce((a,[r])=>Math.max(a,r.length),0);return t.map(([a,r])=>` ${`${a}:`.padEnd(n+1)} ${r}`).join(`
`)}class oa extends d{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class ia extends d{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",sa(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class ca extends d{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}function la(e){if(e.type)return e.type;if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new ia({transaction:e})}const et="/docs/contract/decodeEventLog";function pa({abi:e,data:t,strict:n,topics:a}){const r=n??!0,[o,...i]=a;if(!o)throw new yn({docsPath:et});const c=e.find(h=>h.type==="event"&&o===Xn($e(h)));if(!(c&&"name"in c)||c.type!=="event")throw new kn(o,{docsPath:et});const{name:l,inputs:m}=c,b=m==null?void 0:m.some(h=>!("name"in h&&h.name));let y=b?[]:{};const w=m.filter(h=>"indexed"in h&&h.indexed);for(let h=0;h<w.length;h++){const E=w[h],mt=i[h];if(!mt)throw new wn({abiItem:c,param:E});y[E.name||h]=ua({param:E,value:mt})}const v=m.filter(h=>!("indexed"in h&&h.indexed));if(v.length>0){if(t&&t!=="0x")try{const h=Je(v,t);if(h)if(b)y=[...y,...h];else for(let E=0;E<v.length;E++)y[v[E].name]=h[E]}catch(h){if(r)throw h instanceof ke?new He({abiItem:c,data:h.data,params:h.params,size:h.size}):h}else if(r)throw new He({abiItem:c,data:"0x",params:v,size:0})}return{eventName:l,args:Object.values(y).length>0?y:void 0}}function ua({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Je([e],t)||[])[0]}class tt extends d{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class ma extends d{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}const da={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,assertPosition(e){if(e<0||e>this.bytes.length-1)throw new ma({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new tt({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},incrementPosition(e){if(e<0)throw new tt({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){const e=this.inspectByte();return this.position++,e},readBytes(e){const t=this.inspectBytes(e);return this.position+=e,t},readUint8(){const e=this.inspectUint8();return this.position+=1,e},readUint16(){const e=this.inspectUint16();return this.position+=2,e},readUint24(){const e=this.inspectUint24();return this.position+=3,e},readUint32(){const e=this.inspectUint32();return this.position+=4,e},setPosition(e){this.assertPosition(e),this.position=e}};function ha(e){const t=Object.create(da);return t.bytes=e,t.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),t}function ba(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:a,maxFeePerGas:r,to:o}=e;if(t<=0)throw new R({chainId:t});if(o&&!B(o))throw new N({address:o});if(a)throw new d("`gasPrice` is not a valid EIP-1559 Transaction attribute.");if(r&&r>2n**256n-1n)throw new q({maxFeePerGas:r});if(n&&r&&n>r)throw new re({maxFeePerGas:r,maxPriorityFeePerGas:n})}function fa(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:a,maxFeePerGas:r,to:o}=e;if(t<=0)throw new R({chainId:t});if(o&&!B(o))throw new N({address:o});if(n||r)throw new d("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(a&&a>2n**256n-1n)throw new q({maxFeePerGas:a})}function ya(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:a,maxFeePerGas:r,to:o,accessList:i}=e;if(o&&!B(o))throw new N({address:o});if(typeof t<"u"&&t<=0)throw new R({chainId:t});if(n||r)throw new d("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(a&&a>2n**256n-1n)throw new q({maxFeePerGas:a});if(i)throw new d("`accessList` is not a valid Legacy Transaction attribute.")}function ce(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:a,storageKeys:r}=e[n];for(let o=0;o<r.length;o++)if(r[o].length-2!==64)throw new ca({storageKey:r[o]});if(!B(a))throw new N({address:a});t.push([a,r])}return t}function nt(e,t){const n=la(e);return n==="eip1559"?ka(e,t):n==="eip2930"?wa(e,t):xa(e,t)}function ka(e,t){const{chainId:n,gas:a,nonce:r,to:o,value:i,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:m,data:b}=e;ba(e);const y=ce(m),w=[p(n),r?p(r):"0x",l?p(l):"0x",c?p(c):"0x",a?p(a):"0x",o??"0x",i?p(i):"0x",b??"0x",y];if(t){const v=(()=>t.v===0n?"0x":t.v===1n?p(1):t.v===27n?"0x":p(1))();w.push(v,A(t.r),A(t.s))}return Y(["0x02",W(w)])}function wa(e,t){const{chainId:n,gas:a,data:r,nonce:o,to:i,value:c,accessList:l,gasPrice:m}=e;fa(e);const b=ce(l),y=[p(n),o?p(o):"0x",m?p(m):"0x",a?p(a):"0x",i??"0x",c?p(c):"0x",r??"0x",b];if(t){const w=(()=>t.v===0n?"0x":t.v===1n?p(1):t.v===27n?"0x":p(1))();y.push(w,A(t.r),A(t.s))}return Y(["0x01",W(y)])}function xa(e,t){const{chainId:n=0,gas:a,data:r,nonce:o,to:i,value:c,gasPrice:l}=e;ya(e);let m=[o?p(o):"0x",l?p(l):"0x",a?p(a):"0x",i??"0x",c?p(c):"0x",r??"0x"];if(t){const b=(()=>{if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);const y=27n+(t.v===27n?0n:1n);if(t.v!==y)throw new oa({v:t.v});return y})();m=[...m,p(b),t.r,t.s]}else n>0&&(m=[...m,p(n),"0x","0x"]);return W(m)}function W(e,t="hex"){const n=at(e),a=ha(new Uint8Array(n.length));return n.encode(a),t==="hex"?me(a.bytes):a.bytes}function at(e){return Array.isArray(e)?ga(e.map(t=>at(t))):va(e)}function ga(e){const t=e.reduce((r,o)=>r+o.length,0),n=rt(t);return{length:(()=>t<=55?1+t:1+n+t)(),encode(r){t<=55?r.pushByte(192+t):(r.pushByte(192+55+n),n===1?r.pushUint8(t):n===2?r.pushUint16(t):n===3?r.pushUint24(t):r.pushUint32(t));for(const{encode:o}of e)o(r)}}}function va(e){const t=typeof e=="string"?Q(e):e,n=rt(t.length);return{length:(()=>t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length)(),encode(r){t.length===1&&t[0]<128?r.pushBytes(t):t.length<=55?(r.pushByte(128+t.length),r.pushBytes(t)):(r.pushByte(128+55+n),n===1?r.pushUint8(t.length):n===2?r.pushUint16(t.length):n===3?r.pushUint24(t.length):r.pushUint32(t.length),r.pushBytes(t))}}}function rt(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new d("Length is too large.")}const ge={transaction:(e,t)=>Ne(e)?Ca(e,t):Le(e)?Ea(e,t):nt(e,t)};function Ea(e,t){Ta(e);const{chainId:n,gas:a,nonce:r,to:o,value:i,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:m,feeCurrency:b,gatewayFeeRecipient:y,gatewayFee:w,data:v}=e,h=[p(n),r?p(r):"0x",l?p(l):"0x",c?p(c):"0x",a?p(a):"0x",b??"0x",y??"0x",w?p(w):"0x",o??"0x",i?p(i):"0x",v??"0x",ce(m)];return t&&h.push(t.v===27n?"0x":p(1),A(t.r),A(t.s)),Y(["0x7c",W(h)])}function Ca(e,t){Sa(e);const{chainId:n,gas:a,nonce:r,to:o,value:i,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:m,feeCurrency:b,data:y}=e,w=[p(n),