@dodoex/wallet-web3 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/LICENSE +674 -674
  2. package/dist/{alchemy-provider-5870b6fa-0a3b2dbe.js → alchemy-provider-5870b6fa-1d4efe84.js} +1 -1
  3. package/dist/{alchemy-websocket-provider-213da986-d0c3633b.js → alchemy-websocket-provider-213da986-d5cf3f6a.js} +1 -1
  4. package/dist/{blocto-9e74d8d2.js → blocto-25c5c258.js} +1 -1
  5. package/dist/{ccip-96253715.js → ccip-3ac23092.js} +1 -1
  6. package/dist/cjs/{alchemy-provider-5870b6fa-f315bd2e.cjs → alchemy-provider-5870b6fa-5cbe3e31.cjs} +1 -1
  7. package/dist/cjs/{alchemy-websocket-provider-213da986-e564a819.cjs → alchemy-websocket-provider-213da986-7065cb3f.cjs} +1 -1
  8. package/dist/cjs/{blocto-076e6c0b.cjs → blocto-0c1d92db.cjs} +1 -1
  9. package/dist/cjs/{ccip-521cfee8.cjs → ccip-fb501af5.cjs} +1 -1
  10. package/dist/cjs/{draggabilly-2b865eba.cjs → draggabilly-1a578eed.cjs} +1 -1
  11. package/dist/cjs/id-833d54a1.cjs +1 -0
  12. package/dist/cjs/{index-eece89ac.cjs → index-1a823dfc.cjs} +1 -1
  13. package/dist/cjs/{index-4a48412c.cjs → index-49dfe63f.cjs} +1 -1
  14. package/dist/cjs/{index-f52d7a9d.cjs → index-64ab7e4d.cjs} +1 -1
  15. package/dist/cjs/index-75b128c0.cjs +15 -0
  16. package/dist/cjs/{index-799531a3.cjs → index-803e4f67.cjs} +1 -1
  17. package/dist/cjs/{index-b8fa0637.cjs → index-9e59c9f8.cjs} +1 -1
  18. package/dist/cjs/{index-97c1aca0.cjs → index-a4906ebd.cjs} +3 -3
  19. package/dist/cjs/{index-5810e4f1.cjs → index-b13bd062.cjs} +1 -1
  20. package/dist/cjs/{index-9f5b41d0.cjs → index-d78c1ab4.cjs} +1 -1
  21. package/dist/cjs/{index-a0b90815.cjs → index-e103a51b.cjs} +3 -3
  22. package/dist/cjs/index.cjs +1 -1
  23. package/dist/cjs/{index.es-0bd8aeaf.cjs → index.es-cfbd4f15.cjs} +1 -1
  24. package/dist/cjs/{interface-32e74a1d.cjs → interface-ef9016d3.cjs} +1 -1
  25. package/dist/cjs/lib-typedarrays-22e0cfee.cjs +1 -0
  26. package/dist/cjs/{portis-a7f5a490.cjs → portis-265f03df.cjs} +1 -1
  27. package/dist/cjs/{rainbow-48b79e7b.cjs → rainbow-48ed900d.cjs} +1 -1
  28. package/dist/cjs/sha224-ba7123a0.cjs +1 -0
  29. package/dist/cjs/{sha256-25579a6a.cjs → sha256-00be81ad.cjs} +1 -1
  30. package/dist/cjs/{typed-data-bde3a50b.cjs → typed-data-f167a2be.cjs} +1 -1
  31. package/dist/cjs/uAuth-c82eed54.cjs +1 -0
  32. package/dist/cjs/{walletConnect-ddb78a91.cjs → walletConnect-68f635da.cjs} +1 -1
  33. package/dist/cjs/{walletLink-4bf7ba75.cjs → walletLink-77a9287f.cjs} +1 -1
  34. package/dist/{draggabilly-007eb32e.js → draggabilly-ed1ea22f.js} +1 -1
  35. package/dist/id-3ec4567b.js +1 -0
  36. package/dist/{index-2dd0cf11.js → index-113ad8f8.js} +1 -1
  37. package/dist/{index-a89eae14.js → index-61916df2.js} +1 -1
  38. package/dist/{index-804ac0ab.js → index-7152dee7.js} +1 -1
  39. package/dist/{index-ec79cc51.js → index-76297fe2.js} +3 -3
  40. package/dist/index-91b1499d.js +15 -0
  41. package/dist/{index-64cac64c.js → index-9a6126a2.js} +1 -1
  42. package/dist/{index-e18cdf87.js → index-bf37e2d0.js} +1 -1
  43. package/dist/{index-021a379f.js → index-fc1b4c33.js} +3 -3
  44. package/dist/{index-2f5bd9b0.js → index-fe388941.js} +1 -1
  45. package/dist/{index-85af26b3.js → index-ff33ebed.js} +1 -1
  46. package/dist/{index.es-6b1b8ee3.js → index.es-166481e0.js} +1 -1
  47. package/dist/index.js +1 -1
  48. package/dist/{interface-e1ceccbd.js → interface-8965a045.js} +1 -1
  49. package/dist/lib-typedarrays-c5e5759f.js +1 -0
  50. package/dist/{portis-6579bb55.js → portis-174647af.js} +1 -1
  51. package/dist/{rainbow-972f7199.js → rainbow-04d94d50.js} +1 -1
  52. package/dist/sha224-76431e37.js +1 -0
  53. package/dist/{sha256-f271f1bd.js → sha256-b7dd8a5a.js} +1 -1
  54. package/dist/{typed-data-b7769dfc.js → typed-data-d3d4124b.js} +1 -1
  55. package/dist/uAuth-ed5c6c9d.js +1 -0
  56. package/dist/{walletConnect-db769233.js → walletConnect-cd58a591.js} +1 -1
  57. package/dist/{walletLink-f2c079e7.js → walletLink-874673f7.js} +1 -1
  58. package/package.json +102 -102
  59. package/dist/cjs/id-d1b8bb45.cjs +0 -1
  60. package/dist/cjs/index-c46c5dfc.cjs +0 -6
  61. package/dist/cjs/lib-typedarrays-af7a37ac.cjs +0 -1
  62. package/dist/cjs/sha224-157f2666.cjs +0 -1
  63. package/dist/cjs/uAuth-4077d7c6.cjs +0 -1
  64. package/dist/id-8a5cdbd4.js +0 -1
  65. package/dist/index-cc1e2d8c.js +0 -6
  66. package/dist/lib-typedarrays-88b1d513.js +0 -1
  67. package/dist/sha224-133835ea.js +0 -1
  68. package/dist/uAuth-edf28f7b.js +0 -1
@@ -1,5 +1,5 @@
1
- import{JsonRpcProvider as e,StaticJsonRpcProvider as t,Web3Provider as n}from"@ethersproject/providers";import{create as r}from"zustand";import{arrayify as a,isBytesLike as s,hexlify as i,isBytes as o,isHexString as c,hexZeroPad as l,hexStripZeros as u,hexValue as d}from"@ethersproject/bytes";import{shallowCopy as p,deepCopy as h,resolveProperties as m}from"@ethersproject/properties";import{getAddress as f}from"@ethersproject/address";import{Signer as y}from"@ethersproject/abstract-signer";import{Buffer as b}from"buffer";import"@ethersproject/abstract-provider";import{Contract as g}from"@ethersproject/contracts";import"events";import{AddressZero as w}from"@ethersproject/constants";import{serialize as v}from"@ethersproject/transactions";function C(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var E,x;!function(e){e[e.MAINNET=1]="MAINNET",e[e.GOERLI=5]="GOERLI",e[e.BSC=56]="BSC",e[e.POLYGON=137]="POLYGON",e[e.ARBITRUM_ONE=42161]="ARBITRUM_ONE",e[e.AURORA=1313161554]="AURORA",e[e.OKCHAIN=66]="OKCHAIN",e[e.OPTIMISM=10]="OPTIMISM",e[e.AVALANCHE=43114]="AVALANCHE",e[e.CONFLUX=1030]="CONFLUX",e[e.BASE=8453]="BASE",e[e.LINEA=59144]="LINEA",e[e.SCROLL_ALPHA_TESTNET=534353]="SCROLL_ALPHA_TESTNET",e[e.SCROLL=534352]="SCROLL",e[e.MANTLE=5e3]="MANTLE",e[e.MANTA=169]="MANTA",e[e.BTR=200901]="BTR",e[e.OKB=196]="OKB"}(E||(E={})),function(e){e.injected="injected",e.BinanceChain="custom-bsc-injected",e.WalletConnect="walletconnect",e.Portis="portis",e.Gnosis="custom-gnosis",e.WalletLink="custom-walletlink",e.LedgerUSB="custom-ledger-usb",e.Ledger="custom-ledger",e.openBlock="custom-open-block",e.openBlockIframe="custom-open-block-iframe",e.GameStop="custom-game-stop",e.Nabox="custom-nabox",e.Bitkeep="custom-bitkeep",e.OneKey="custom-onekey",e.OKX="custom-okx",e.uAuth="custom-uauth",e.kuCoinWallet="custom-kucoin-wallet",e.frontier="custom-frontier",e.Blocto="custom-blocto",e.Rainbow="custom-rainbow",e.trust="custom-trust",e.tokenPocket="custom-token-pocket",e.Cyber="custom-cyber",e.uniPass="custom-uni-pass",e.Gate="custom-gate",e.Coin98="custom-coin-98",e.FoxWallet="custom-fox-wallet",e.Brave="custom-brave",e.Math="custom-math",e.ImToken="custom-im-token",e.Rabby="custom-rabby",e.SocialLogin="custom-social-login",e.Alchemy="custom-alchemy",e.Bybit="custom-bybit",e.Zerion="custom-zerion",e.Holdstation="custom-holdstation",e.SafePal="custom-safe-pal",e.EIP6963Prefix="custom-eip-6963-"}(x||(x={}));const k=()=>"undefined"!=typeof window&&"undefined"!=typeof navigator&&!!window.navigator?.hid,T=()=>"undefined"!=typeof window&&"undefined"!=typeof navigator&&window.navigator?.userAgent&&/(Android)/i.test(navigator.userAgent);function P(){return"undefined"!=typeof window&&"undefined"!=typeof navigator&&/iPhone|iPod|iOS/.test(navigator.userAgent)}function A(){return"undefined"!=typeof window&&"undefined"!=typeof navigator&&(/iPad/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)}const _=()=>P()||A(),D=()=>T()||_(),F=()=>{if("undefined"!=typeof window)return window},O=r((t=>({chainId:1,account:void 0,accounts:void 0,provider:void 0,walletType:void 0,connectLoading:!1,connectingType:void 0,connected:void 0,connectedWalletSpecial:void 0,disabledWalletKeyList:[],eip6963WalletList:[],startConnecting:e=>{t((()=>({connectLoading:!0,connectingType:e})))},setConnectedSpecial:e=>{t((()=>({connectedWalletSpecial:e})))},connectSuccess:async(e,n,r)=>{t((()=>({provider:e})));const{chainId:a}=await e.getNetwork(),s=await e.listAccounts(),[i]=s,{type:o}=n;let c=o===x.Gnosis;if(!c&&o===x.WalletConnect&&i){const e=await V();c=await e.getAccountIsSafe(a,i)}t((e=>({accounts:s,account:i,chainId:a,walletType:o,connected:{isAutoConnect:r,wallet:n,isSafe:c},connectedWalletSpecial:e.connectedWalletSpecial?.type===o?e.connectedWalletSpecial:void 0,connectLoading:!1,connectingType:void 0})))},connectFailed:()=>{t((()=>({connectLoading:!1,connectingType:void 0,accounts:void 0,account:void 0})))},accountsChanged:e=>{const[n]=e;t((()=>({accounts:e,account:n})))},chainIdChanged:e=>{t((()=>({chainId:e})))},setRpcUrlProvider:async(n,r)=>{const a=new e(n,r);let s=r;if(!s){const e=await a.getNetwork();s=e.chainId}t((()=>({provider:a,chainId:s,accounts:void 0,account:void 0,walletType:void 0,connected:void 0,connectedWalletSpecial:void 0})))},disconnect:async n=>{if(n){const r=new e(n),{chainId:a}=await r.getNetwork();t((()=>({provider:r,chainId:a,accounts:void 0,account:void 0,walletType:void 0,connected:void 0,connectedWalletSpecial:void 0,connectLoading:void 0,connectingType:void 0})))}else t((()=>({provider:void 0,accounts:void 0,account:void 0,walletType:void 0,connected:void 0,connectedWalletSpecial:void 0,connectLoading:void 0,connectingType:void 0})))},setDisabledWalletKeyList:e=>{t((()=>({disabledWalletKeyList:e})))}})));async function S(e){const{Web3Provider:t}=await import("@ethersproject/providers");return new t(e,"any")}async function M(e=null,t){let n=e||window.ethereum;if(n)await n.request({method:"eth_requestAccounts"});else if(window.web3)n=window.web3.currentProvider;else if(window.celo)n=window.celo;else{if(!window.BinanceChain)throw new Error("No Web3 Provider found");n=window.BinanceChain}return n.on("connect",t.connect),n.on("disconnect",t.disconnect),n.on("accountsChanged",t.accountsChanged),n.on("chainChanged",t.chainChanged),n.on("message",t.message),S(n)}function I(e,t){return e.request?e.request(t):e.send(t.method,t.params)}async function N({provider:e,addChainParameters:t}){try{return await I(e,{method:"wallet_addEthereumChain",params:[t]}),{result:!0}}catch(e){console.error(`[failed to add ${t.chainId}]: `,t,e)}return{result:!1}}async function U({addChainDirectly:e,addChainParameters:t,provider:n}){const r=n??O.getState().provider??window.ethereum;if(!r)return{result:!1};if(e)return N({provider:r,addChainParameters:t});const{chainId:a}=t;try{return await I(r,{method:"wallet_switchEthereumChain",params:[{chainId:a}]}),{result:!0}}catch(e){const{code:n}=e;if(4902===n||-32603===n)return N({provider:r,addChainParameters:t});console.error(`[failed to switch ${a}]: `,t,e)}return{result:!1}}const L=[{path:"m/44'/60'/x'/0/0",name:"Ledger Live"},{path:"m/44'/60'/0'/x",name:"Legacy"}];let B=!1,R=1;const j={};let G=!1;F()?.addEventListener("message",(e=>{"openblock-content-integration"===e.data.from&&(B=!0,Object.values(j).map((e=>e())))})),F()?.addEventListener("load",(()=>{setTimeout((()=>{G=!0,Object.values(j).map((e=>e()))}),1e3)}),{once:!0});const H=async()=>new Promise((e=>{B?e(!0):window.parent===window||G?e(!1):(R++,j[R]=()=>{e(B),delete j[R]})})),z=async(e,t)=>{const n=(await import("./provider-037ebaad.js")).default();return n.on("connect",t.connect),n.on("disconnect",t.disconnect),n.on("accountsChanged",t.accountsChanged),n.on("chainChanged",t.chainChanged),n.on("message",t.message),await n.request({method:"eth_requestAccounts"}),S(n)};function $(){return import("./index-2f5bd9b0.js")}function V(){return import("./index-64cac64c.js")}function q(){return import("./uAuth-edf28f7b.js")}function Z(){return import("./portis-6579bb55.js")}function W(){return import("./walletLink-f2c079e7.js")}function K(){return import("./walletConnect-db769233.js")}function J(){return import("./blocto-9e74d8d2.js")}function X(){return import("./rainbow-972f7199.js")}function Y(){return import("./index-2dd0cf11.js")}function Q(){return import("./index-e18cdf87.js")}function ee(){return import("./index-cc1e2d8c.js")}function te(){return import("./index-804ac0ab.js")}function ne(){return import("./index-ec79cc51.js")}function re(){return import("./index-85af26b3.js")}async function ae(e,t){return(await J()).default(e,t)}async function se(e,t){return(await Z()).default(e,t)}async function ie(e,t){return(await W()).default(e,t)}async function oe(e,t){return(await K()).default(e,t)}async function ce(e,t){return(await X()).default(e,t)}async function le(e,t){return(await Y()).default(e,t)}async function ue(e,t){return(await Q()).default(e,t)}async function de(e,t){return(await ee()).default(e,t)}async function pe(e,t){return(await te()).default(e,t)}async function he(e,t){return(await ne()).default(e,t)}async function me(e,t){return(await re()).default(e,t)}var fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function be(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var ge={},we={},ve=Ce;function Ce(e,t){if(!e)throw new Error(t||"Assertion failed")}Ce.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var Ee={exports:{}};"function"==typeof Object.create?Ee.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ee.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var xe=ve,ke=Ee.exports;function Te(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function Pe(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Ae(e){return 1===e.length?"0"+e:e}function _e(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}we.inherits=ke,we.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a<e.length;a+=2)n.push(parseInt(e[a]+e[a+1],16))}else for(var r=0,a=0;a<e.length;a++){var s=e.charCodeAt(a);s<128?n[r++]=s:s<2048?(n[r++]=s>>6|192,n[r++]=63&s|128):Te(e,a)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++a)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(a=0;a<e.length;a++)n[a]=0|e[a];return n},we.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=Ae(e[n].toString(16));return t},we.htonl=Pe,we.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var a=e[r];"little"===t&&(a=Pe(a)),n+=_e(a.toString(16))}return n},we.zero2=Ae,we.zero8=_e,we.join32=function(e,t,n,r){var a=n-t;xe(a%4==0);for(var s=new Array(a/4),i=0,o=t;i<s.length;i++,o+=4){var c;c="big"===r?e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3]:e[o+3]<<24|e[o+2]<<16|e[o+1]<<8|e[o],s[i]=c>>>0}return s},we.split32=function(e,t){for(var n=new Array(4*e.length),r=0,a=0;r<e.length;r++,a+=4){var s=e[r];"big"===t?(n[a]=s>>>24,n[a+1]=s>>>16&255,n[a+2]=s>>>8&255,n[a+3]=255&s):(n[a+3]=s>>>24,n[a+2]=s>>>16&255,n[a+1]=s>>>8&255,n[a]=255&s)}return n},we.rotr32=function(e,t){return e>>>t|e<<32-t},we.rotl32=function(e,t){return e<<t|e>>>32-t},we.sum32=function(e,t){return e+t>>>0},we.sum32_3=function(e,t,n){return e+t+n>>>0},we.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},we.sum32_5=function(e,t,n,r,a){return e+t+n+r+a>>>0},we.sum64=function(e,t,n,r){var a=e[t],s=r+e[t+1]>>>0,i=(s<r?1:0)+n+a;e[t]=i>>>0,e[t+1]=s},we.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},we.sum64_lo=function(e,t,n,r){return t+r>>>0},we.sum64_4_hi=function(e,t,n,r,a,s,i,o){var c=0,l=t;return c+=(l=l+r>>>0)<t?1:0,c+=(l=l+s>>>0)<s?1:0,e+n+a+i+(c+=(l=l+o>>>0)<o?1:0)>>>0},we.sum64_4_lo=function(e,t,n,r,a,s,i,o){return t+r+s+o>>>0},we.sum64_5_hi=function(e,t,n,r,a,s,i,o,c,l){var u=0,d=t;return u+=(d=d+r>>>0)<t?1:0,u+=(d=d+s>>>0)<s?1:0,u+=(d=d+o>>>0)<o?1:0,e+n+a+i+c+(u+=(d=d+l>>>0)<l?1:0)>>>0},we.sum64_5_lo=function(e,t,n,r,a,s,i,o,c,l){return t+r+s+o+l>>>0},we.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},we.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},we.shr64_hi=function(e,t,n){return e>>>n},we.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0};var De={},Fe=we,Oe=ve;function Se(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}De.BlockHash=Se,Se.prototype.update=function(e,t){if(e=Fe.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=Fe.join32(e,0,e.length-n,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},Se.prototype.digest=function(e){return this.update(this._pad()),Oe(null===this.pending),this._digest(e)},Se.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var a=1;a<n;a++)r[a]=0;if(e<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)r[a++]=0;r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=e>>>24&255,r[a++]=e>>>16&255,r[a++]=e>>>8&255,r[a++]=255&e}else for(r[a++]=255&e,r[a++]=e>>>8&255,r[a++]=e>>>16&255,r[a++]=e>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,s=8;s<this.padLength;s++)r[a++]=0;return r};var Me={},Ie={},Ne=we.rotr32;function Ue(e,t,n){return e&t^~e&n}function Le(e,t,n){return e&t^e&n^t&n}function Be(e,t,n){return e^t^n}Ie.ft_1=function(e,t,n,r){return 0===e?Ue(t,n,r):1===e||3===e?Be(t,n,r):2===e?Le(t,n,r):void 0},Ie.ch32=Ue,Ie.maj32=Le,Ie.p32=Be,Ie.s0_256=function(e){return Ne(e,2)^Ne(e,13)^Ne(e,22)},Ie.s1_256=function(e){return Ne(e,6)^Ne(e,11)^Ne(e,25)},Ie.g0_256=function(e){return Ne(e,7)^Ne(e,18)^e>>>3},Ie.g1_256=function(e){return Ne(e,17)^Ne(e,19)^e>>>10};var Re=we,je=De,Ge=Ie,He=Re.rotl32,ze=Re.sum32,$e=Re.sum32_5,Ve=Ge.ft_1,qe=je.BlockHash,Ze=[1518500249,1859775393,2400959708,3395469782];function We(){if(!(this instanceof We))return new We;qe.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Re.inherits(We,qe);var Ke=We;We.blockSize=512,We.outSize=160,We.hmacStrength=80,We.padLength=64,We.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=He(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var a=this.h[0],s=this.h[1],i=this.h[2],o=this.h[3],c=this.h[4];for(r=0;r<n.length;r++){var l=~~(r/20),u=$e(He(a,5),Ve(l,s,i,o),c,n[r],Ze[l]);c=o,o=i,i=He(s,30),s=a,a=u}this.h[0]=ze(this.h[0],a),this.h[1]=ze(this.h[1],s),this.h[2]=ze(this.h[2],i),this.h[3]=ze(this.h[3],o),this.h[4]=ze(this.h[4],c)},We.prototype._digest=function(e){return"hex"===e?Re.toHex32(this.h,"big"):Re.split32(this.h,"big")};var Je=we,Xe=De,Ye=Ie,Qe=ve,et=Je.sum32,tt=Je.sum32_4,nt=Je.sum32_5,rt=Ye.ch32,at=Ye.maj32,st=Ye.s0_256,it=Ye.s1_256,ot=Ye.g0_256,ct=Ye.g1_256,lt=Xe.BlockHash,ut=[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];function dt(){if(!(this instanceof dt))return new dt;lt.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=ut,this.W=new Array(64)}Je.inherits(dt,lt);var pt=dt;dt.blockSize=512,dt.outSize=256,dt.hmacStrength=192,dt.padLength=64,dt.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=tt(ct(n[r-2]),n[r-7],ot(n[r-15]),n[r-16]);var a=this.h[0],s=this.h[1],i=this.h[2],o=this.h[3],c=this.h[4],l=this.h[5],u=this.h[6],d=this.h[7];for(Qe(this.k.length===n.length),r=0;r<n.length;r++){var p=nt(d,it(c),rt(c,l,u),this.k[r],n[r]),h=et(st(a),at(a,s,i));d=u,u=l,l=c,c=et(o,p),o=i,i=s,s=a,a=et(p,h)}this.h[0]=et(this.h[0],a),this.h[1]=et(this.h[1],s),this.h[2]=et(this.h[2],i),this.h[3]=et(this.h[3],o),this.h[4]=et(this.h[4],c),this.h[5]=et(this.h[5],l),this.h[6]=et(this.h[6],u),this.h[7]=et(this.h[7],d)},dt.prototype._digest=function(e){return"hex"===e?Je.toHex32(this.h,"big"):Je.split32(this.h,"big")};var ht=we,mt=pt;function ft(){if(!(this instanceof ft))return new ft;mt.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}ht.inherits(ft,mt);var yt=ft;ft.blockSize=512,ft.outSize=224,ft.hmacStrength=192,ft.padLength=64,ft.prototype._digest=function(e){return"hex"===e?ht.toHex32(this.h.slice(0,7),"big"):ht.split32(this.h.slice(0,7),"big")};var bt=we,gt=De,wt=ve,vt=bt.rotr64_hi,Ct=bt.rotr64_lo,Et=bt.shr64_hi,xt=bt.shr64_lo,kt=bt.sum64,Tt=bt.sum64_hi,Pt=bt.sum64_lo,At=bt.sum64_4_hi,_t=bt.sum64_4_lo,Dt=bt.sum64_5_hi,Ft=bt.sum64_5_lo,Ot=gt.BlockHash,St=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Mt(){if(!(this instanceof Mt))return new Mt;Ot.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=St,this.W=new Array(160)}bt.inherits(Mt,Ot);var It=Mt;function Nt(e,t,n,r,a){var s=e&n^~e&a;return s<0&&(s+=4294967296),s}function Ut(e,t,n,r,a,s){var i=t&r^~t&s;return i<0&&(i+=4294967296),i}function Lt(e,t,n,r,a){var s=e&n^e&a^n&a;return s<0&&(s+=4294967296),s}function Bt(e,t,n,r,a,s){var i=t&r^t&s^r&s;return i<0&&(i+=4294967296),i}function Rt(e,t){var n=vt(e,t,28)^vt(t,e,2)^vt(t,e,7);return n<0&&(n+=4294967296),n}function jt(e,t){var n=Ct(e,t,28)^Ct(t,e,2)^Ct(t,e,7);return n<0&&(n+=4294967296),n}function Gt(e,t){var n=vt(e,t,14)^vt(e,t,18)^vt(t,e,9);return n<0&&(n+=4294967296),n}function Ht(e,t){var n=Ct(e,t,14)^Ct(e,t,18)^Ct(t,e,9);return n<0&&(n+=4294967296),n}function zt(e,t){var n=vt(e,t,1)^vt(e,t,8)^Et(e,t,7);return n<0&&(n+=4294967296),n}function $t(e,t){var n=Ct(e,t,1)^Ct(e,t,8)^xt(e,t,7);return n<0&&(n+=4294967296),n}function Vt(e,t){var n=vt(e,t,19)^vt(t,e,29)^Et(e,t,6);return n<0&&(n+=4294967296),n}function qt(e,t){var n=Ct(e,t,19)^Ct(t,e,29)^xt(e,t,6);return n<0&&(n+=4294967296),n}Mt.blockSize=1024,Mt.outSize=512,Mt.hmacStrength=192,Mt.padLength=128,Mt.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var a=Vt(n[r-4],n[r-3]),s=qt(n[r-4],n[r-3]),i=n[r-14],o=n[r-13],c=zt(n[r-30],n[r-29]),l=$t(n[r-30],n[r-29]),u=n[r-32],d=n[r-31];n[r]=At(a,s,i,o,c,l,u,d),n[r+1]=_t(a,s,i,o,c,l,u,d)}},Mt.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,r=this.h[0],a=this.h[1],s=this.h[2],i=this.h[3],o=this.h[4],c=this.h[5],l=this.h[6],u=this.h[7],d=this.h[8],p=this.h[9],h=this.h[10],m=this.h[11],f=this.h[12],y=this.h[13],b=this.h[14],g=this.h[15];wt(this.k.length===n.length);for(var w=0;w<n.length;w+=2){var v=b,C=g,E=Gt(d,p),x=Ht(d,p),k=Nt(d,p,h,m,f),T=Ut(d,p,h,m,f,y),P=this.k[w],A=this.k[w+1],_=n[w],D=n[w+1],F=Dt(v,C,E,x,k,T,P,A,_,D),O=Ft(v,C,E,x,k,T,P,A,_,D);v=Rt(r,a),C=jt(r,a),E=Lt(r,a,s,i,o),x=Bt(r,a,s,i,o,c);var S=Tt(v,C,E,x),M=Pt(v,C,E,x);b=f,g=y,f=h,y=m,h=d,m=p,d=Tt(l,u,F,O),p=Pt(u,u,F,O),l=o,u=c,o=s,c=i,s=r,i=a,r=Tt(F,O,S,M),a=Pt(F,O,S,M)}kt(this.h,0,r,a),kt(this.h,2,s,i),kt(this.h,4,o,c),kt(this.h,6,l,u),kt(this.h,8,d,p),kt(this.h,10,h,m),kt(this.h,12,f,y),kt(this.h,14,b,g)},Mt.prototype._digest=function(e){return"hex"===e?bt.toHex32(this.h,"big"):bt.split32(this.h,"big")};var Zt=we,Wt=It;function Kt(){if(!(this instanceof Kt))return new Kt;Wt.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Zt.inherits(Kt,Wt);var Jt=Kt;Kt.blockSize=1024,Kt.outSize=384,Kt.hmacStrength=192,Kt.padLength=128,Kt.prototype._digest=function(e){return"hex"===e?Zt.toHex32(this.h.slice(0,12),"big"):Zt.split32(this.h.slice(0,12),"big")},Me.sha1=Ke,Me.sha224=yt,Me.sha256=pt,Me.sha384=Jt,Me.sha512=It;var Xt={},Yt=we,Qt=De,en=Yt.rotl32,tn=Yt.sum32,nn=Yt.sum32_3,rn=Yt.sum32_4,an=Qt.BlockHash;function sn(){if(!(this instanceof sn))return new sn;an.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function on(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function cn(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function ln(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}Yt.inherits(sn,an),Xt.ripemd160=sn,sn.blockSize=512,sn.outSize=160,sn.hmacStrength=192,sn.padLength=64,sn.prototype._update=function(e,t){for(var n=this.h[0],r=this.h[1],a=this.h[2],s=this.h[3],i=this.h[4],o=n,c=r,l=a,u=s,d=i,p=0;p<80;p++){var h=tn(en(rn(n,on(p,r,a,s),e[un[p]+t],cn(p)),pn[p]),i);n=i,i=s,s=en(a,10),a=r,r=h,h=tn(en(rn(o,on(79-p,c,l,u),e[dn[p]+t],ln(p)),hn[p]),d),o=d,d=u,u=en(l,10),l=c,c=h}h=nn(this.h[1],a,u),this.h[1]=nn(this.h[2],s,d),this.h[2]=nn(this.h[3],i,o),this.h[3]=nn(this.h[4],n,c),this.h[4]=nn(this.h[0],r,l),this.h[0]=h},sn.prototype._digest=function(e){return"hex"===e?Yt.toHex32(this.h,"little"):Yt.split32(this.h,"little")};var un=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],dn=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],pn=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],hn=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],mn=we,fn=ve;function yn(e,t,n){if(!(this instanceof yn))return new yn(e,t,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(mn.toArray(t,n))}var bn=yn;yn.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),fn(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},yn.prototype.update=function(e,t){return this.inner.update(e,t),this},yn.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=ge;t.utils=we,t.common=De,t.sha=Me,t.ripemd=Xt,t.hmac=bn,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}();var gn=C({__proto__:null,default:ge},[ge]),wn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,r,s,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new a(r,s||e,i),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],o]:e._events[c].push(o):(e._events[c]=o,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,r,a=[];if(0===this._eventsCount)return a;for(r in e=this._events)t.call(e,r)&&a.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},o.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,s=r.length,i=new Array(s);a<s;a++)i[a]=r[a].fn;return i},o.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},o.prototype.emit=function(e,t,r,a,s,i){var o=n?n+e:e;if(!this._events[o])return!1;var c,l,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,a),!0;case 5:return u.fn.call(u.context,t,r,a,s),!0;case 6:return u.fn.call(u.context,t,r,a,s,i),!0}for(l=1,c=new Array(d-1);l<d;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var p,h=u.length;for(l=0;l<h;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,r);break;case 4:u[l].fn.call(u[l].context,t,r,a);break;default:if(!c)for(p=1,c=new Array(d-1);p<d;p++)c[p-1]=arguments[p];u[l].fn.apply(u[l].context,c)}}return!0},o.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},o.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},o.prototype.removeListener=function(e,t,r,a){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return i(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||a&&!o.once||r&&o.context!==r||i(this,s);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||a&&!o[c].once||r&&o[c].context!==r)&&l.push(o[c]);l.length?this._events[s]=1===l.length?l[0]:l:i(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o}(wn);var vn=wn.exports;const Cn="function"==typeof atob,En="function"==typeof btoa,xn="function"==typeof Buffer,kn="function"==typeof TextDecoder?new TextDecoder:void 0,Tn="function"==typeof TextEncoder?new TextEncoder:void 0,Pn=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),An=(e=>{let t={};return Pn.forEach(((e,n)=>t[e]=n)),t})(),_n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Dn=String.fromCharCode.bind(String),Fn="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),On=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Sn=En?e=>btoa(e):xn?e=>Buffer.from(e,"binary").toString("base64"):e=>{let t,n,r,a,s="";const i=e.length%3;for(let i=0;i<e.length;){if((n=e.charCodeAt(i++))>255||(r=e.charCodeAt(i++))>255||(a=e.charCodeAt(i++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|a,s+=Pn[t>>18&63]+Pn[t>>12&63]+Pn[t>>6&63]+Pn[63&t]}return i?s.slice(0,i-3)+"===".substring(i):s},Mn=xn?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(Dn.apply(null,e.subarray(n,n+4096)));return Sn(t.join(""))},In=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Dn(192|t>>>6)+Dn(128|63&t):Dn(224|t>>>12&15)+Dn(128|t>>>6&63)+Dn(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Dn(240|t>>>18&7)+Dn(128|t>>>12&63)+Dn(128|t>>>6&63)+Dn(128|63&t)},Nn=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Un=xn?e=>Buffer.from(e,"utf8").toString("base64"):Tn?e=>Mn(Tn.encode(e)):e=>Sn((e=>e.replace(Nn,In))(e)),Ln=e=>((e,t=!1)=>t?(e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")))(Un(e)):Un(e))(e,!0),Bn=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Rn=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Dn(55296+(t>>>10))+Dn(56320+(1023&t));case 3:return Dn((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Dn((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},jn=Cn?e=>atob(On(e)):xn?e=>Buffer.from(e,"base64").toString("binary"):e=>{if(e=e.replace(/\s+/g,""),!_n.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n,r,a="";for(let s=0;s<e.length;)t=An[e.charAt(s++)]<<18|An[e.charAt(s++)]<<12|(n=An[e.charAt(s++)])<<6|(r=An[e.charAt(s++)]),a+=64===n?Dn(t>>16&255):64===r?Dn(t>>16&255,t>>8&255):Dn(t>>16&255,t>>8&255,255&t);return a},Gn=xn?e=>Fn(Buffer.from(e,"base64")):e=>Fn(jn(e).split("").map((e=>e.charCodeAt(0)))),Hn=xn?e=>Buffer.from(e,"base64").toString("utf8"):kn?e=>kn.decode(Gn(e)):e=>(e=>e.replace(Bn,Rn))(jn(e)),zn=e=>Hn((e=>On(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))))(e));function $n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vn(e){if(Array.isArray(e))return $n(e)}function qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zn(e,t,n){return Zn=ar()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&Qn(a,n.prototype),a},Zn.apply(null,arguments)}function Wn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Kn(e,t,n){return t&&Wn(e.prototype,t),n&&Wn(e,n),e}function Jn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xn(e){return Xn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xn(e)}function Yn(e,t){return!t||"object"!==tr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Qn(e,t){return Qn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qn(e,t)}function er(e){return Vn(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||nr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tr(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function nr(e,t){if(e){if("string"==typeof e)return $n(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$n(e,t):void 0}}function rr(e){var t="function"==typeof Map?new Map:void 0;return rr=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Zn(e,arguments,Xn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Qn(n,e)},rr(e)}function ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ar=function(){return!!e})()}var sr,ir=Object.defineProperty,or=function(e,t,n){return function(e,t,n){t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!=(void 0===t?"undefined":tr(t))?t+"":t,n),n};function cr(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}function lr(){return function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t}()}function ur(e,t,n){return{id:n||cr(),jsonrpc:"2.0",method:e,params:t||[]}}Jn(sr={},"PARSE_ERROR",{code:-32700,message:"Parse error"}),Jn(sr,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),Jn(sr,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),Jn(sr,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),Jn(sr,"INTERNAL_ERROR",{code:-32603,message:"Internal error"}),Jn(sr,"SERVER_ERROR",{code:-32e3,message:"Server error"});var dr=["eth_requestAccounts","eth_accounts","eth_chainId","eth_signTransaction","eth_sendTransaction","eth_sign","personal_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_watchAsset"];function pr(){return("undefined"==typeof process?"undefined":tr(process))<"u"&&tr(process.versions)<"u"&&tr(process.versions.node)<"u"}var hr="hex",mr="utf8";function fr(e){return e.replace(/^0x/,"")}function yr(e){return gr(Buffer.from(fr(e),hr))}function br(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.toString(hr);return t?function(e){return e.startsWith("0x")?e:"0x".concat(e)}(n):n}(wr(e),t)}function gr(e){return new Uint8Array(e)}function wr(e){return function(e){return ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)}(e)}function vr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=[];return t.forEach((function(e){return r=r.concat(Array.from(e))})),new Uint8Array(er(r))}function Cr(e){return function(e){return e.toString(mr)}(wr(e))}function Er(e){return yr(e).buffer}function xr(e,t){return br(new Uint8Array(e),!t)}function kr(e){return wr(new Uint8Array(e))}function Tr(e){var t="0x0";return"number"==typeof e&&(t="0x".concat(e.toString(16))),"string"==typeof e&&(t=e.startsWith("0x")?e:"0x0"),t}var Pr={16:10,24:12,32:14},Ar=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],_r=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Dr=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Fr=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Or=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Sr=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Mr=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Ir=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Nr=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Ur=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Lr=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Br=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Rr=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],jr=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Gr=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Hr(e){return parseInt("".concat(e))===e}function zr(e){if(!Hr(e.length))return!1;for(var t=0;t<e.length;t++)if(!Hr(e[t])||e[t]<0||e[t]>255)return!1;return!0}function $r(e){return new Uint8Array(e)}function Vr(e){for(var t=[],n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);return t}function qr(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!zr(e))throw new Error("Array contains invalid value");return new Uint8Array(e)}if(Hr(e.length)&&zr(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function Zr(e,t,n,r,a){(null!=r||null!=a)&&(e=e.slice?e.slice(r,a):Array.prototype.slice.call(e,r,a)),t.set(e,n)}var Wr=function(){function e(t){qn(this,e),or(this,"key"),or(this,"_Ke"),or(this,"_Kd"),this.key=qr(t,!0),this._prepare()}return Kn(e,[{key:"_prepare",value:function(){var e=Pr[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var n,r=4*(e+1),a=this.key.length/4,s=Vr(this.key),i=0;i<a;i++)n=i>>2,this._Ke[n][i%4]=s[i],this._Kd[e-n][i%4]=s[i];for(var o,c=0,l=a;l<r;){if(o=s[a-1],s[0]^=_r[o>>16&255]<<24^_r[o>>8&255]<<16^_r[255&o]<<8^_r[o>>24&255]^Ar[c]<<24,c+=1,8!=a)for(var u=1;u<a;u++)s[u]^=s[u-1];else{for(var d=1;d<a/2;d++)s[d]^=s[d-1];o=s[a/2-1],s[a/2]^=_r[255&o]^_r[o>>8&255]<<8^_r[o>>16&255]<<16^_r[o>>24&255]<<24;for(var p=a/2+1;p<a;p++)s[p]^=s[p-1]}for(var h=0,m=void 0,f=void 0;h<a&&l<r;)m=l>>2,f=l%4,this._Ke[m][f]=s[h],this._Kd[e-m][f]=s[h++],l++}for(var y=1;y<e;y++)for(var b=0;b<4;b++)o=this._Kd[y][b],this._Kd[y][b]=Br[o>>24&255]^Rr[o>>16&255]^jr[o>>8&255]^Gr[255&o]}},{key:"encrypt",value:function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,n=[0,0,0,0],r=Vr(e),a=0;a<4;a++)r[a]^=this._Ke[0][a];for(var s=1;s<t;s++){for(var i=0;i<4;i++)n[i]=Fr[r[i]>>24&255]^Or[r[(i+1)%4]>>16&255]^Sr[r[(i+2)%4]>>8&255]^Mr[255&r[(i+3)%4]]^this._Ke[s][i];r=n.slice()}for(var o,c=$r(16),l=0;l<4;l++)o=this._Ke[t][l],c[4*l]=255&(_r[r[l]>>24&255]^o>>24),c[4*l+1]=255&(_r[r[(l+1)%4]>>16&255]^o>>16),c[4*l+2]=255&(_r[r[(l+2)%4]>>8&255]^o>>8),c[4*l+3]=255&(_r[255&r[(l+3)%4]]^o);return c}},{key:"decrypt",value:function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,n=[0,0,0,0],r=Vr(e),a=0;a<4;a++)r[a]^=this._Kd[0][a];for(var s=1;s<t;s++){for(var i=0;i<4;i++)n[i]=Ir[r[i]>>24&255]^Nr[r[(i+3)%4]>>16&255]^Ur[r[(i+2)%4]>>8&255]^Lr[255&r[(i+1)%4]]^this._Kd[s][i];r=n.slice()}for(var o,c=$r(16),l=0;l<4;l++)o=this._Kd[t][l],c[4*l]=255&(Dr[r[l]>>24&255]^o>>24),c[4*l+1]=255&(Dr[r[(l+3)%4]>>16&255]^o>>16),c[4*l+2]=255&(Dr[r[(l+2)%4]>>8&255]^o>>8),c[4*l+3]=255&(Dr[255&r[(l+1)%4]]^o);return c}}]),e}(),Kr=function(){function e(t,n){if(qn(this,e),or(this,"_aes"),or(this,"_lastCipherblock"),n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else n=new Uint8Array(16);this._lastCipherblock=qr(n,!0),this._aes=new Wr(t)}return Kn(e,[{key:"encrypt",value:function(e){if(e=qr(e),e.length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=$r(e.length),n=$r(16),r=0;r<e.length;r+=16){Zr(e,n,0,r,r+16);for(var a=0;a<16;a++)n[a]^=this._lastCipherblock[a];this._lastCipherblock=this._aes.encrypt(n),Zr(this._lastCipherblock,t,r)}return t}},{key:"decrypt",value:function(e){if(e=qr(e),e.length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=$r(e.length),n=$r(16),r=0;r<e.length;r+=16){Zr(e,n,0,r,r+16),n=this._aes.decrypt(n);for(var a=0;a<16;a++)t[r+a]=n[a]^this._lastCipherblock[a];Zr(e,this._lastCipherblock,0,r,r+16)}return t}}]),e}(),Jr=[[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16],[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15],[14,14,14,14,14,14,14,14,14,14,14,14,14,14],[13,13,13,13,13,13,13,13,13,13,13,13,13],[12,12,12,12,12,12,12,12,12,12,12,12],[11,11,11,11,11,11,11,11,11,11,11],[10,10,10,10,10,10,10,10,10,10],[9,9,9,9,9,9,9,9,9],[8,8,8,8,8,8,8,8],[7,7,7,7,7,7,7],[6,6,6,6,6,6],[5,5,5,5,5],[4,4,4,4],[3,3,3],[2,2],[1]],Xr={pad:function(e){var t=Jr[e.byteLength%16||0],n=new Uint8Array(e.byteLength+t.length);return n.set(e),n.set(t,e.byteLength),n},unpad:function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}},Yr="sha256";function Qr(e,t){return yr(ge.hmac(gn[Yr],e).update(t).digest("hex"))}function ea(e){var t=function(e){for(var t=new Uint8Array(e),n=0;n<e;++n)t[n]=Math.floor(256*Math.random());return wr(t)}(e);return gr(t)}function ta(e){return function(e){return gr(e).buffer}(wr(ea((e||256)/8)))}function na(e,t,n){var r=gr(kr(t)),a=gr(kr(n||ta(128))),s=br(a,!1),i=function(e){return gr(Buffer.from(e,mr))}(JSON.stringify(e)),o=function(e,t,n){var r=new Kr(t,e),a=Xr.pad(n),s=r.encrypt(a);return new Uint8Array(s)}(a,r,i);return{data:br(o,!1),hmac:br(Qr(r,vr(o,a)),!1),iv:s}}function ra(e,t){var n=gr(kr(t));if(!n)throw new Error("Missing key: required for decryption");if(!function(e,t){var n=yr(e.data),r=yr(e.iv),a=br(yr(e.hmac),!1),s=br(Qr(t,vr(n,r)),!1);return fr(a)===fr(s)}(e,n))return null;var r,a=yr(e.data),s=function(e,t,n){var r=new Kr(t,e).decrypt(n),a=new Uint8Array(r);return Xr.unpad(a)}(yr(e.iv),n,a),i=Cr(s);try{r=JSON.parse(i)}catch(e){return null}return r}function aa(e){var t=null;try{var n=window.localStorage.getItem(e);n&&(t=JSON.parse(n))}catch(e){t=null}return t}function sa(e){try{window.localStorage.removeItem(e)}catch(e){}}function ia(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}}var oa=function e(){var t=this;qn(this,e),or(this,"events",new vn),or(this,"on",(function(e,n){return t.events.on(e,n)})),or(this,"once",(function(e,n){return t.events.once(e,n)})),or(this,"off",(function(e,n){return t.events.off(e,n)})),or(this,"removeListener",(function(e,n){return t.events.removeListener(e,n)})),or(this,"removeAllListeners",(function(){return t.events.removeAllListeners()}))},ca={error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).error.apply(r,["[ERROR]"].concat(er(t)))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).warn.apply(r,["[WARN]"].concat(er(t)))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).info.apply(r,["[INFO]"].concat(er(t)))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).log.apply(r,["[DEBUG]"].concat(er(t)))}},la=("undefined"==typeof window?"undefined":tr(window))<"u";function ua(){for(var e=function(e){var t=a[e],r=["itemprop","property","name"].map((function(e){return t.getAttribute(e)})).filter((function(e){return!!e&&n.includes(e)}));if(r.length&&r){var s=t.getAttribute("content");if(s)return{v:s}}},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var a=document.getElementsByTagName("meta"),s=0;s<a.length;s++){var i=e(s);if("object"===tr(i))return i.v}return""}function da(){if(la){var e=function(){var e=ua("name","og:site_name","og:title","twitter:title");return e||(e=document.title),e}(),t=ua("description","og:description","twitter:description","keywords"),n=location.origin,r=function(){for(var e=document.getElementsByTagName("link"),t=[],n=0;n<e.length;n++){var r=e[n],a=r.getAttribute("rel");if(a&&a.toLowerCase().indexOf("icon")>-1){var s=r.getAttribute("href");if(s)if(-1===s.toLowerCase().indexOf("https:")&&-1===s.toLowerCase().indexOf("http:")&&0!==s.indexOf("//")){var i=location.protocol+"//"+location.host;if(0===s.indexOf("/"))i+=s;else{var o=location.pathname.split("/");o.pop(),i+=o.join("/")+"/"+s}t.push(i)}else if(0===s.indexOf("//")){var c=location.protocol+s;t.push(c)}else t.push(s)}}return t}();return{description:t,url:n,icons:r,name:e}}}var pa=function(e){function t(e,n){var r;return qn(this,t),r=function(e,t,n){return t=Xn(t),Yn(e,ar()?Reflect.construct(t,n||[],Xn(e).constructor):t.apply(e,n))}(this,t,[n]),or(r,"code"),r.code=e,Object.setPrototypeOf(r,(function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}(this,t)?this.constructor:void 0).prototype),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qn(e,t)}(t,e),Kn(t,[{key:"toString",value:function(){return"".concat(this.message," (").concat(this.code,")")}}]),t}(rr(Error)),ha={CLOSE_MODAL:{code:100001,message:"[binance-w3w] User closed modal"},REJECT_SESSION:{code:100002,message:"[binance-w3w] User rejected connection"},PROVIDER_NOT_READY:{code:100003,message:"[binance-w3w] Provider is not ready"},CONNECTING:{code:100004,message:"[binance-w3w] Already processing session request. Please wait"},CONNECTED:{code:100005,message:"[binance-w3w] Already connected"}},ma={REJECT_ERR:{code:200001,message:"[binance-w3w] User rejected the operation"},METHOD_NOT_SUPPORT:{code:200002,message:"[binance-w3w] Does not support calling method"},MISSING_RESPONSE:{code:200003,message:"[binance-w3w] Missing JSON RPC response"},INVALID_PARAM:{code:200004,message:"[binance-w3w] Invalid request param"}},fa={INTERNAL_ERR:{code:300001,message:"[binance-w3w] Internal error"}},ya=function(){return!!(tr(window.navigator)>"u"?"":navigator.userAgent).match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i)},ba=function(){return!!navigator.userAgent.match(/Android/i)},ga=function(e,t){var n="appId=xoqXxUSMRccLCrZNRebmzj&startPagePath=L3BhZ2VzL2Rhc2hib2FyZC1uZXcvaW5kZXg=";if(t){var r=Ln("wc=".concat(encodeURIComponent(t),"&isDeepLink=true&id=").concat(+new Date));n="".concat(n,"&startPageQuery=").concat(r)}var a="//app.binance.com";return e?"bnc:".concat(a,"/mp/app?").concat(n):"https:".concat(a,"/?_dp=").concat(Ln("/mp/app?".concat(n)))},wa=function(e){var t=ya(),n=ga(!0,e);if(t){var r=document.createElement("a");r.href=n,document.body.appendChild(r),r.click(),document.body.removeChild(r)}},va=function(){try{var e,t;return!0===(null===(t=window)||void 0===t||null===(e=t.ethereum)||void 0===e?void 0:e.isBinance)}catch(e){return!1}};function Ca(e){e=atob(e);const t=[];for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));return a(t)}function Ea(e){e=a(e);let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}let xa=!1,ka=!1;const Ta={debug:1,default:2,info:2,warning:3,error:4,off:5};let Pa=Ta.default,Aa=null;const _a=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var Da,Fa;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(Da||(Da={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(Fa||(Fa={}));const Oa="0123456789abcdef";class Sa{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==Ta[n]&&this.throwArgumentError("invalid log level name","logLevel",e),Pa>Ta[n]||console.log.apply(console,t)}debug(...e){this._log(Sa.levels.DEBUG,e)}info(...e){this._log(Sa.levels.INFO,e)}warn(...e){this._log(Sa.levels.WARNING,e)}makeError(e,t,n){if(ka)return this.makeError("censored error",t,{});t||(t=Sa.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=Oa[t[e]>>4],n+=Oa[15&t[e]];r.push(e+"=Uint8Array(0x"+n+")")}else r.push(e+"="+JSON.stringify(t))}catch(t){r.push(e+"="+JSON.stringify(n[e].toString()))}})),r.push(`code=${t}`),r.push(`version=${this.version}`);const a=e;let s="";switch(t){case Fa.NUMERIC_FAULT:{s="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":s+="-"+t;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case Fa.CALL_EXCEPTION:case Fa.INSUFFICIENT_FUNDS:case Fa.MISSING_NEW:case Fa.NONCE_EXPIRED:case Fa.REPLACEMENT_UNDERPRICED:case Fa.TRANSACTION_REPLACED:case Fa.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const i=new Error(e);return i.reason=a,i.code=t,Object.keys(n).forEach((function(e){i[e]=n[e]})),i}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,Sa.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(e){_a&&this.throwError("platform missing String.prototype.normalize",Sa.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_a})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,Sa.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,Sa.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,Sa.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,Sa.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",Sa.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",Sa.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",Sa.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Aa||(Aa=new Sa("logger/5.7.0")),Aa}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Sa.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),xa){if(!e)return;this.globalLogger().throwError("error censorship permanent",Sa.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ka=!!e,xa=!!t}static setLogLevel(e){const t=Ta[e.toLowerCase()];null!=t?Pa=t:Sa.globalLogger().warn("invalid log level - "+e)}static from(e){return new Sa(e)}}Sa.errors=Fa,Sa.levels=Da;const Ma=new Sa("strings/5.7.0");var Ia,Na;function Ua(e,t,n,r,a){if(e===Na.BAD_PREFIX||e===Na.UNEXPECTED_CONTINUE){let e=0;for(let r=t+1;r<n.length&&n[r]>>6==2;r++)e++;return e}return e===Na.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Ia||(Ia={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(Na||(Na={}));const La=Object.freeze({error:function(e,t,n,r,a){return Ma.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:Ua,replace:function(e,t,n,r,a){return e===Na.OVERLONG?(r.push(a),0):(r.push(65533),Ua(e,t,n))}});function Ba(e,t){null==t&&(t=La.error),e=a(e);const n=[];let r=0;for(;r<e.length;){const a=e[r++];if(a>>7==0){n.push(a);continue}let s=null,i=null;if(192==(224&a))s=1,i=127;else if(224==(240&a))s=2,i=2047;else{if(240!=(248&a)){r+=t(128==(192&a)?Na.UNEXPECTED_CONTINUE:Na.BAD_PREFIX,r-1,e,n);continue}s=3,i=65535}if(r-1+s>=e.length){r+=t(Na.OVERRUN,r-1,e,n);continue}let o=a&(1<<8-s-1)-1;for(let a=0;a<s;a++){let a=e[r];if(128!=(192&a)){r+=t(Na.MISSING_CONTINUE,r,e,n),o=null;break}o=o<<6|63&a,r++}null!==o&&(o>1114111?r+=t(Na.OUT_OF_RANGE,r-1-s,e,n,o):o>=55296&&o<=57343?r+=t(Na.UTF16_SURROGATE,r-1-s,e,n,o):o<=i?r+=t(Na.OVERLONG,r-1-s,e,n,o):n.push(o))}return n}function Ra(e,t=Ia.current){t!=Ia.current&&(Ma.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){t++;const a=e.charCodeAt(t);if(t>=e.length||56320!=(64512&a))throw new Error("invalid utf-8 string");const s=65536+((1023&r)<<10)+(1023&a);n.push(s>>18|240),n.push(s>>12&63|128),n.push(s>>6&63|128),n.push(63&s|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return a(n)}function ja(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Ga(e,t){return'"'+Ba(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?ja(e):ja(55296+((e-=65536)>>10&1023))+ja(56320+(1023&e))})).join("")+'"'}function Ha(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function za(e,t){return Ha(Ba(e,t))}function $a(e,t=Ia.current){return Ba(Ra(e,t))}var Va=function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function o(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}c((r=r.apply(e,t||[])).next())}))};function qa(e,t){return Va(this,void 0,void 0,(function*(){null==t&&(t={});const n={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(n.mode=e.mode),e.cache&&(n.cache=e.cache),e.credentials&&(n.credentials=e.credentials),e.redirect&&(n.redirect=e.redirect),e.referrer&&(n.referrer=e.referrer)}const r=yield fetch(e,n),s=yield r.arrayBuffer(),i={};return r.headers.forEach?r.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):r.headers.keys().forEach((e=>{i[e.toLowerCase()]=r.headers.get(e)})),{headers:i,statusCode:r.status,statusMessage:r.statusText,body:a(new Uint8Array(s))}}))}var Za=function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function o(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}c((r=r.apply(e,t||[])).next())}))};const Wa=new Sa("web/5.7.1");function Ka(e){return new Promise((t=>{setTimeout(t,e)}))}function Ja(e,t){if(null==e)return null;if("string"==typeof e)return e;if(s(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return za(e)}catch(e){}return i(e)}return e}function Xa(e,t,n){const r="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Wa.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const a="object"==typeof e?e.throttleCallback:null,s="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Wa.assertArgument(s>0&&s%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const i="object"==typeof e&&!!e.errorPassThrough,o={};let c=null;const l={method:"GET"};let u=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||Wa.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)o[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Wa.throwError("basic authentication requires a secure https url",Sa.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;o.authorization={key:"Authorization",value:"Basic "+Ea(Ra(t))}}null!=e.skipFetchSetup&&(l.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(l.fetchOptions=p(e.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),m=c?c.match(h):null;if(m)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":m[1]||"text/plain"},body:m[2]?Ca(m[3]):(f=m[3],Ra(f.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return n&&(t=n(e.body,e)),Promise.resolve(t)}catch(e){Wa.throwError("processing response error",Sa.errors.SERVER_ERROR,{body:Ja(m[1],m[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var f;t&&(l.method="POST",l.body=t,null==o["content-type"]&&(o["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==o["content-length"]&&(o["content-length"]={key:"Content-Length",value:String(t.length)}));const y={};Object.keys(o).forEach((e=>{const t=o[e];y[t.key]=t.value})),l.headers=y;const b=function(){let e=null;return{promise:new Promise((function(t,n){d&&(e=setTimeout((()=>{null!=e&&(e=null,n(Wa.makeError("timeout",Sa.errors.TIMEOUT,{requestBody:Ja(l.body,y["content-type"]),requestMethod:l.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),g=function(){return Za(this,void 0,void 0,(function*(){for(let e=0;e<r;e++){let t=null;try{if(t=yield qa(c,l),e<r)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===l.method&&e.match(/^https:/)){c=t.headers.location;continue}}else if(429===t.statusCode){let n=!0;if(a&&(n=yield a(e,c)),n){let n=0;const r=t.headers["retry-after"];n="string"==typeof r&&r.match(/^[1-9][0-9]*$/)?1e3*parseInt(r):s*parseInt(String(Math.random()*Math.pow(2,e))),yield Ka(n);continue}}}catch(e){t=e.response,null==t&&(b.cancel(),Wa.throwError("missing response",Sa.errors.SERVER_ERROR,{requestBody:Ja(l.body,y["content-type"]),requestMethod:l.method,serverError:e,url:c}))}let o=t.body;if(u&&304===t.statusCode?o=null:!i&&(t.statusCode<200||t.statusCode>=300)&&(b.cancel(),Wa.throwError("bad response",Sa.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Ja(o,t.headers?t.headers["content-type"]:null),requestBody:Ja(l.body,y["content-type"]),requestMethod:l.method,url:c})),n)try{const e=yield n(o,t);return b.cancel(),e}catch(n){if(n.throttleRetry&&e<r){let t=!0;if(a&&(t=yield a(e,c)),t){const t=s*parseInt(String(Math.random()*Math.pow(2,e)));yield Ka(t);continue}}b.cancel(),Wa.throwError("processing response error",Sa.errors.SERVER_ERROR,{body:Ja(o,t.headers?t.headers["content-type"]:null),error:n,requestBody:Ja(l.body,y["content-type"]),requestMethod:l.method,url:c})}return b.cancel(),o}return Wa.throwError("failed response",Sa.errors.SERVER_ERROR,{requestBody:Ja(l.body,y["content-type"]),requestMethod:l.method,url:c})}))}();return Promise.race([b.promise,g])}function Ya(e,t,n){let r=null;if(null!=t){r=Ra(t);const n="string"==typeof e?{url:e}:p(e);if(n.headers){const e=0!==Object.keys(n.headers).filter((e=>"content-type"===e.toLowerCase())).length;e||(n.headers=p(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return Xa(e,r,((e,t)=>{let r=null;if(null!=e)try{r=JSON.parse(za(e))}catch(t){Wa.throwError("invalid JSON",Sa.errors.SERVER_ERROR,{body:e,error:t})}return n&&(r=n(r,t)),r}))}function Qa(e,t){return t||(t={}),null==(t=p(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(n,r){let a=null,s=!1;const i=()=>!s&&(s=!0,a&&clearTimeout(a),!0);t.timeout&&(a=setTimeout((()=>{i()&&r(new Error("timeout"))}),t.timeout));const o=t.retryLimit;let c=0;!function a(){return e().then((function(e){if(void 0!==e)i()&&n(e);else if(t.oncePoll)t.oncePoll.once("poll",a);else if(t.onceBlock)t.onceBlock.once("block",a);else if(!s){if(c++,c>o)return void(i()&&r(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(a,e)}return null}),(function(e){i()&&r(e)}))}()}))}function es(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}class ts extends t{getNetwork(){return"object"==typeof this.network&&"number"==typeof this.network.chainId?Promise.resolve(this.network):"number"==typeof this.network&&this.network?Promise.resolve({chainId:this.network,name:"unknown"}):super.getNetwork()}send(e,t){const n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:h(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(r&&this._cache[e])return this._cache[e];const a=Ya({...this.connection,url:this.rpcUrl||this.connection?.url},JSON.stringify(n),es).then((e=>(this.emit("debug",{action:"response",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:n,provider:this}),e}));return r&&(this._cache[e]=a,setTimeout((()=>{this._cache[e]=null}),0)),a}}function ns(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const rs=ns({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",apiUrl:"https://blockscout.acala.network/api"}},testnet:!1}),as=e=>e;class ss extends Error{constructor(e,t={}){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:"viem@2.8.6"});const n=t.cause instanceof ss?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof ss&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://viem.sh${r}${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join("\n"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return is(this,e)}}function is(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?is(e.cause,t):t?null:e}class os extends ss{constructor({max:e,min:t,signed:n,size:r,value:a}){super(`Number "${a}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class cs extends ss{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}}class ls extends ss{constructor(e){super(`Hex value "${e}" 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 us extends ss{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function ds(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function ps(e){return ds(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function hs(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,r=0;for(let e=0;e<n.length-1&&"0"===n["left"===t?e:n.length-e-1].toString();e++)r++;return n="left"===t?n.slice(r):n.slice(0,n.length-r),"string"==typeof e?(1===n.length&&"right"===t&&(n=`${n}0`),`0x${n.length%2==1?`0${n}`:n}`):n}class ms extends ss{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class fs extends ss{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class ys extends ss{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${t} ${n} long, but is ${e} ${n} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}function bs(e,{dir:t,size:n=32}={}){return"string"==typeof e?gs(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new fs({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let a=0;a<n;a++){const s="right"===t;r[s?a:n-a-1]=e[s?a:e.length-a-1]}return r}(e,{dir:t,size:n})}function gs(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new fs({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}const ws=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function vs(e,t={}){return"number"==typeof e||"bigint"==typeof e?xs(e,t):"string"==typeof e?Ts(e,t):"boolean"==typeof e?Cs(e,t):Es(e,t)}function Cs(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(Ss(n,{size:t.size}),bs(n,{size:t.size})):n}function Es(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=ws[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(Ss(r,{size:t.size}),bs(r,{dir:"right",size:t.size})):r}function xs(e,t={}){const{signed:n,size:r}=t,a=BigInt(e);let s;r?s=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i="bigint"==typeof s&&n?-s-1n:0;if(s&&a>s||a<i){const t="bigint"==typeof e?"n":"";throw new os({max:s?`${s}${t}`:void 0,min:`${i}${t}`,signed:n,size:r,value:`${e}${t}`})}const o=`0x${(n&&a<0?(1n<<BigInt(8*r))+BigInt(a):a).toString(16)}`;return r?bs(o,{size:r}):o}const ks=new TextEncoder;function Ts(e,t={}){return Es(ks.encode(e),t)}const Ps=new TextEncoder;function As(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=xs(e,t);return Fs(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return Ss(n,{size:t.size}),bs(n,{size:t.size});return n}(e,t):ds(e)?Fs(e,t):Os(e,t)}const _s={zero:48,nine:57,A:65,F:70,a:97,f:102};function Ds(e){return e>=_s.zero&&e<=_s.nine?e-_s.zero:e>=_s.A&&e<=_s.F?e-(_s.A-10):e>=_s.a&&e<=_s.f?e-(_s.a-10):void 0}function Fs(e,t={}){let n=e;t.size&&(Ss(n,{size:t.size}),n=bs(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const a=r.length/2,s=new Uint8Array(a);for(let e=0,t=0;e<a;e++){const n=Ds(r.charCodeAt(t++)),a=Ds(r.charCodeAt(t++));if(void 0===n||void 0===a)throw new ss(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);s[e]=16*n+a}return s}function Os(e,t={}){const n=Ps.encode(e);return"number"==typeof t.size?(Ss(n,{size:t.size}),bs(n,{dir:"right",size:t.size})):n}function Ss(e,{size:t}){if(ps(e)>t)throw new us({givenSize:ps(e),maxSize:t})}function Ms(e,t){const n="string"==typeof t?{to:t}:t,r=n.to;return"number"===r?Ns(e,n):"bigint"===r?Is(e,n):"string"===r?function(e,t={}){let n=Fs(e);t.size&&(Ss(n,{size:t.size}),n=hs(n,{dir:"right"}));return(new TextDecoder).decode(n)}(e,n):"boolean"===r?function(e,t={}){let n=e;t.size&&(Ss(n,{size:t.size}),n=hs(n));if("0x00"===hs(n))return!1;if("0x01"===hs(n))return!0;throw new ls(n)}(e,n):Fs(e,n)}function Is(e,t={}){const{signed:n}=t;t.size&&Ss(e,{size:t.size});const r=BigInt(e);if(!n)return r;const a=(e.length-2)/2;return r<=(1n<<8n*BigInt(a)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*a,"f")}`)-1n}function Ns(e,t={}){return Number(Is(e,t))}function Us(e,t){return({exclude:n,format:r})=>({exclude:n,format:e=>{const a=t(e);if(n)for(const e of n)delete a[e];return{...a,...r(e)}},type:e})}const Ls={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function Bs(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Ns(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Ns(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Ls[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("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip1559"===t.type&&delete t.maxFeePerBlobGas,t}const Rs=Us("transaction",Bs);function js(e){const t=e.transactions?.map((e=>"string"==typeof e?e:Bs(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):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 Gs=Us("block",js);function Hs(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 zs={"0x0":"reverted","0x1":"success"};function $s(e){const t={...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((e=>Hs(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Ns(e.transactionIndex):null,status:e.status?zs[e.status]:null,type:e.type?Ls[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const Vs=Us("transactionReceipt",$s),qs={block:Gs({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=Bs(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Is(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:Rs({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Is(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Vs({format:e=>({l1GasPrice:e.l1GasPrice?Is(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?Is(e.l1GasUsed):null,l1Fee:e.l1Fee?Is(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})};class Zs extends ss{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}class Ws extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,t){return super.set(e,t),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}function Ks(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Js(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 Xs(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 Ys(e,t){Js(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Qs=BigInt(2**32-1),ei=BigInt(32);function ti(e,t=!1){return t?{h:Number(e&Qs),l:Number(e>>ei&Qs)}:{h:0|Number(e>>ei&Qs),l:0|Number(e&Qs)}}function ni(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let a=0;a<e.length;a++){const{h:s,l:i}=ti(e[a],t);[n[a],r[a]]=[s,i]}return[n,r]}const ri=e=>e instanceof Uint8Array,ai=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),si=(e,t)=>e<<32-t|e>>>t;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function ii(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!ri(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class oi{clone(){return this._cloneInto()}}function ci(e){const t=t=>e().update(ii(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const[li,ui,di]=[[],[],[]],pi=BigInt(0),hi=BigInt(1),mi=BigInt(2),fi=BigInt(7),yi=BigInt(256),bi=BigInt(113);for(let e=0,t=hi,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],li.push(2*(5*r+n)),ui.push((e+1)*(e+2)/2%64);let a=pi;for(let e=0;e<7;e++)t=(t<<hi^(t>>fi)*bi)%yi,t&mi&&(a^=hi<<(hi<<BigInt(e))-hi);di.push(a)}const[gi,wi]=ni(di,!0),vi=(e,t,n)=>n>32?((e,t,n)=>t<<n-32|e>>>64-n)(e,t,n):((e,t,n)=>e<<n|t>>>32-n)(e,t,n),Ci=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)
2
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class Ei extends oi{constructor(e,t,n,r=!1,a=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ks(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}keccak(){!function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,a=(t+2)%10,s=n[a],i=n[a+1],o=vi(s,i,1)^n[r],c=Ci(s,i,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=c}let t=e[2],a=e[3];for(let n=0;n<24;n++){const r=ui[n],s=vi(t,a,r),i=Ci(t,a,r),o=li[n];t=e[o],a=e[o+1],e[o]=s,e[o+1]=i}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=gi[r],e[1]^=wi[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Xs(this);const{blockLen:t,state:n}=this,r=(e=ii(e)).length;for(let a=0;a<r;){const s=Math.min(t-this.pos,r-a);for(let t=0;t<s;t++)n[this.pos++]^=e[a++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,0!=(128&t)&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){Xs(this,!1),Js(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,a=e.length;r<a;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,a-r);e.set(t.subarray(this.posOut,this.posOut+s),r),this.posOut+=s,r+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ks(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Ys(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:t,suffix:n,outputLen:r,rounds:a,enableXOF:s}=this;return e||(e=new Ei(t,n,r,s,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=n,e.outputLen=r,e.enableXOF=s,e.destroyed=this.destroyed,e}}const xi=((e,t,n)=>ci((()=>new Ei(t,e,n))))(1,136,32);function ki(e,t){const n=t||"hex",r=xi(ds(e,{strict:!1})?As(e):e);return"bytes"===n?r:vs(r)}function Ti(e,t){const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=ki(Os(n),"bytes"),a=(t?n.substring(`${t}0x`.length):n).split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&a[e]&&(a[e]=a[e].toUpperCase()),(15&r[e>>1])>=8&&a[e+1]&&(a[e+1]=a[e+1].toUpperCase());return`0x${a.join("")}`}const Pi=/^0x[a-fA-F0-9]{40}$/,Ai=new Ws(8192);function _i(e,{strict:t=!0}={}){if(Ai.has(e))return Ai.get(e);const n=!(!Pi.test(e)||e.toLowerCase()!==e&&t&&Ti(e)!==e);return Ai.set(e,n),n}function Di(e){return"string"==typeof e[0]?Fi(e):function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(e)}function Fi(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}class Oi extends Error{constructor(e,t={}){const n=t.cause instanceof Oi?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof Oi&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...n?[`Details: ${n}`]:[],"Version: abitype@1.0.0"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}}function Si(e,t){const n=e.exec(t);return n?.groups}const Mi=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ii=/^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)?$/,Ni=/^\(.+?\).*?$/,Ui=/^tuple(?<array>(\[(\d*)\])*)$/;function Li(e){let t=e.type;if(Ui.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){t+=Li(e.components[r]),r<n-1&&(t+=", ")}const r=Si(Ui,e.type);return t+=`)${r?.array??""}`,Li({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Bi(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=Li(e[r]),r!==n-1&&(t+=", ")}return t}const Ri=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function ji(e){return Ri.test(e)}function Gi(e){return Si(Ri,e)}const Hi=new Set(["memory","indexed","storage","calldata"]),zi=new Set(["calldata","memory","storage"]);class $i extends Oi{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Vi extends Oi{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class qi extends Oi{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class Zi extends Oi{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Wi extends Oi{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Ki extends Oi{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Ji extends Oi{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class Xi extends Oi{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Yi extends Oi{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Qi extends Oi{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class eo extends Oi{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class to extends Oi{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}const no=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}]]),ro=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,ao=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,so=/^u?int$/;function io(e,t){const n=function(e,t){return t?`${t}:${e}`:e}(e,t?.type);if(no.has(n))return no.get(n);const r=Ni.test(e),a=Si(r?ao:ro,e);if(!a)throw new Zi({param:e});if(a.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||Mi.test(e)||Ii.test(e)||lo.test(e)}(a.name))throw new Wi({param:e,name:a.name});const s=a.name?{name:a.name}:{},i="indexed"===a.modifier?{indexed:!0}:{},o=t?.structs??{};let c,l={};if(r){c="tuple";const e=oo(a.type),t=[],n=e.length;for(let r=0;r<n;r++)t.push(io(e[r],{structs:o}));l={components:t}}else if(a.type in o)c="tuple",l={components:o[a.type]};else if(so.test(a.type))c=`${a.type}256`;else if(c=a.type,"struct"!==t?.type&&!co(c))throw new Vi({type:c});if(a.modifier){if(!t?.modifiers?.has?.(a.modifier))throw new Ki({param:e,type:t?.type,modifier:a.modifier});if(zi.has(a.modifier)&&!function(e,t){return t||"bytes"===e||"string"===e||"tuple"===e}(c,!!a.array))throw new Ji({param:e,type:t?.type,modifier:a.modifier})}const u={type:`${c}${a.array??""}`,...s,...i,...l};return no.set(n,u),u}function oo(e,t=[],n="",r=0){const a=e.trim().length;for(let s=0;s<a;s++){const a=e[s],i=e.slice(s+1);switch(a){case",":return 0===r?oo(i,[...t,n.trim()]):oo(i,t,`${n}${a}`,r);case"(":return oo(i,t,`${n}${a}`,r+1);case")":return oo(i,t,`${n}${a}`,r-1);default:return oo(i,t,`${n}${a}`,r)}}if(""===n)return t;if(0!==r)throw new to({current:n,depth:r});return t.push(n.trim()),t}function co(e){return"address"===e||"bool"===e||"function"===e||"string"===e||Mi.test(e)||Ii.test(e)}const lo=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;const uo=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function po(e,t,n=new Set){const r=[],a=e.length;for(let s=0;s<a;s++){const a=e[s];if(Ni.test(a.type))r.push(a);else{const e=Si(uo,a.type);if(!e?.type)throw new Xi({abiParameter:a});const{array:s,type:i}=e;if(i in t){if(n.has(i))throw new eo({type:i});r.push({...a,type:`tuple${s??""}`,components:po(t[i]??[],t,new Set([...n,i]))})}else{if(!co(i))throw new $i({type:i});r.push(a)}}}return r}function ho(e){const t=[];if("string"==typeof e){const n=oo(e),r=n.length;for(let e=0;e<r;e++)t.push(io(n[e],{modifiers:Hi}))}else{const n=function(e){const t={},n=e.length;for(let r=0;r<n;r++){const n=e[r];if(!ji(n))continue;const a=Gi(n);if(!a)throw new Yi({signature:n,type:"struct"});const s=a.properties.split(";"),i=[],o=s.length;for(let e=0;e<o;e++){const t=s[e].trim();if(!t)continue;const n=io(t,{type:"struct"});i.push(n)}if(!i.length)throw new Qi({signature:n});t[a.name]=i}const r={},a=Object.entries(t),s=a.length;for(let e=0;e<s;e++){const[n,s]=a[e];r[n]=po(s,t)}return r}(e),r=e.length;for(let a=0;a<r;a++){const r=e[a];if(ji(r))continue;const s=oo(r),i=s.length;for(let e=0;e<i;e++)t.push(io(s[e],{modifiers:Hi,structs:n}))}}if(0===t.length)throw new qi({params:e});return t}function mo(e,t,n){return r=>e[t.name||n]?.(r)??t(e,r)}function fo(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new Lo(e.type);return`${e.name}(${yo(e.inputs,{includeName:t})})`}function yo(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${yo(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}class bo extends ss{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class go extends ss{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class wo extends ss{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${yo(t,{includeName:!0})})`,`Data: ${e} (${n} 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=e,this.params=t,this.size=n}}class vo extends ss{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class Co extends ss{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class Eo extends ss{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${ps(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class xo extends ss{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class ko extends ss{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class To extends ss{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class Po extends ss{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" 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=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class Ao extends ss{constructor(e,{docsPath:t}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class _o extends ss{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class Do extends ss{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class Fo extends ss{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${fo(e.abiItem)}\`, and`,`\`${t.type}\` in \`${fo(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class Oo extends ss{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class So extends ss{constructor({abiItem:e,data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for non-indexed event parameters.`].join("\n"),{metaMessages:[`Params: (${yo(n,{includeName:!0})})`,`Data: ${t} (${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=e,this.data=t,this.params=n,this.size=r}}class Mo extends ss{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${fo(e,{includeName:!0})}".`].join("\n")),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=e}}class Io extends ss{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class No extends ss{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class Uo extends ss{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class Lo extends ss{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class Bo extends ss{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const Ro=e=>ki(As(e));const jo=e=>{var t;return function(e){let t=!0,n="",r=0,a="",s=!1;for(let i=0;i<e.length;i++){const o=e[i];if(["(",")",","].includes(o)&&(t=!0),"("===o&&r++,")"===o&&r--,t)if(0!==r)" "!==o?(a+=o,n+=o):","!==e[i-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===o&&["event","function",""].includes(a))a="";else if(a+=o,")"===o){s=!0;break}}if(!s)throw new ss("Unable to normalize signature.");return a}("string"==typeof e?e:"function"===(t=e).type?`function ${t.name}(${Bi(t.inputs)})${t.stateMutability&&"nonpayable"!==t.stateMutability?` ${t.stateMutability}`:""}${t.outputs.length?` returns (${Bi(t.outputs)})`:""}`:"event"===t.type?`event ${t.name}(${Bi(t.inputs)})`:"error"===t.type?`error ${t.name}(${Bi(t.inputs)})`:"constructor"===t.type?`constructor(${Bi(t.inputs)})${"payable"===t.stateMutability?" payable":""}`:"fallback"===t.type?"fallback()":"receive() external payable")};function Go(e){return t=jo(e),Ro(t);var t}const Ho=Go;function zo(e,t,n,{strict:r}={}){return ds(e,{strict:!1})?function(e,t,n,{strict:r}={}){$o(e,t);const a=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&Vo(a,t,n);return a}(e,t,n,{strict:r}):qo(e,t,n,{strict:r})}function $o(e,t){if("number"==typeof t&&t>0&&t>ps(e)-1)throw new ms({offset:t,position:"start",size:ps(e)})}function Vo(e,t,n){if("number"==typeof t&&"number"==typeof n&&ps(e)!==n-t)throw new ms({offset:n,position:"end",size:ps(e)})}function qo(e,t,n,{strict:r}={}){$o(e,t);const a=e.slice(t,n);return r&&Vo(a,t,n),a}function Zo(e,t){if(e.length!==t.length)throw new xo({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Wo({param:e[r],value:t[r]}));return n}({params:e,values:t}),r=Ko(n);return 0===r.length?"0x":r}function Wo({param:e,value:t}){const n=Jo(e.type);if(n){const[r,a]=n;return function(e,{length:t,param:n}){const r=null===t;if(!Array.isArray(e))throw new Uo(e);if(!r&&e.length!==t)throw new Co({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let a=!1;const s=[];for(let t=0;t<e.length;t++){const r=Wo({param:n,value:e[t]});r.dynamic&&(a=!0),s.push(r)}if(r||a){const e=Ko(s);if(r){const t=xs(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?Di([t,e]):t}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:Di(s.map((({encoded:e})=>e)))}}(t,{length:r,param:{...e,type:a}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const r=[];for(let a=0;a<t.components.length;a++){const s=t.components[a],i=Wo({param:s,value:e[Array.isArray(e)?a:s.name]});r.push(i),i.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Ko(r):Di(r.map((({encoded:e})=>e)))}}(t,{param:e});if("address"===e.type)return function(e){if(!_i(e))throw new Zs({address:e});return{dynamic:!1,encoded:gs(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){return{dynamic:!1,encoded:gs(Cs(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:xs(e,{size:32,signed:t})}}(t,{signed:e.type.startsWith("int")})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=ps(e);if(!n){let t=e;return r%32!=0&&(t=gs(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:Di([gs(xs(r,{size:32})),t])}}if(r!==parseInt(n))throw new Eo({expectedSize:parseInt(n),value:e});return{dynamic:!1,encoded:gs(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=Ts(e),n=Math.ceil(ps(t)/32),r=[];for(let e=0;e<n;e++)r.push(gs(zo(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:Di([gs(xs(ps(t),{size:32})),...r])}}(t);throw new Io(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Ko(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:r,encoded:a}=e[n];t+=r?32:ps(a)}const n=[],r=[];let a=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:o}=e[s];i?(n.push(xs(t+a,{size:32})),r.push(o),a+=ps(o)):n.push(o)}return Di([...n,...r])}function Jo(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Xo=e=>zo(Go(e),0,4);function Yo(e){const{abi:t,args:n=[],name:r}=e,a=ds(r,{strict:!1}),s=t.filter((e=>a?"function"===e.type?Xo(e)===r:"event"===e.type&&Ho(e)===r:"name"in e&&e.name===r));if(0===s.length)return;if(1===s.length)return s[0];let i;for(const e of s){if(!("inputs"in e))continue;if(!n||0===n.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==n.length)continue;const t=n.every(((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&Qo(t,r)}));if(t){if(i&&"inputs"in i&&i.inputs){const t=ec(e.inputs,i.inputs,n);if(t)throw new Fo({abiItem:e,type:t[0]},{abiItem:i,type:t[1]})}i=e}}return i||s[0]}function Qo(e,t){const n=typeof e,r=t.type;switch(r){case"address":return _i(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every(((t,n)=>Qo(Object.values(e)[n],t))):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every((e=>Qo(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function ec(e,t,n){for(const r in e){const a=e[r],s=t[r];if("tuple"===a.type&&"tuple"===s.type&&"components"in a&&"components"in s)return ec(a.components,s.components,n[r]);const i=[a.type,s.type];if(!(!i.includes("address")||!i.includes("bytes20"))||(i.includes("address")&&i.includes("string")||!(!i.includes("address")||!i.includes("bytes")))&&_i(n[r],{strict:!1}))return i}}const tc="/docs/contract/encodeEventTopics";function nc(e){const{abi:t,eventName:n,args:r}=e;let a=t[0];if(n){const e=Yo({abi:t,name:n});if(!e)throw new Ao(n,{docsPath:tc});a=e}if("event"!==a.type)throw new Ao(void 0,{docsPath:tc});const s=fo(a),i=Ho(s);let o=[];if(r&&"inputs"in a){const e=a.inputs?.filter((e=>"indexed"in e&&e.indexed)),t=Array.isArray(r)?r:Object.values(r).length>0?e?.map((e=>r[e.name]))??[]:[];t.length>0&&(o=e?.map(((e,n)=>Array.isArray(t[n])?t[n].map(((r,a)=>rc({param:e,value:t[n][a]}))):t[n]?rc({param:e,value:t[n]}):null))??[])}return[i,...o]}function rc({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return ki(As(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Bo(e.type);return Zo([e],[t])}function ac(e,{method:t}){const n={};return"fallback"===e.transport.type&&e.transport.onResponse?.((({method:e,response:r,status:a,transport:s})=>{"success"===a&&t===e&&(n[r]=s.request)})),t=>n[t]||e.request}async function sc(e,t){const{address:n,abi:r,args:a,eventName:s,fromBlock:i,strict:o,toBlock:c}=t,l=ac(e,{method:"eth_newFilter"}),u=s?nc({abi:r,args:a,eventName:s}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:"bigint"==typeof i?xs(i):i,toBlock:"bigint"==typeof c?xs(c):c,topics:u}]});return{abi:r,args:a,eventName:s,id:d,request:l(d),strict:Boolean(o),type:"event"}}function ic(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const oc="/docs/contract/encodeFunctionData";function cc(e){const{abi:t,args:n,functionName:r}=e;let a=t[0];if(r){const e=Yo({abi:t,args:n,name:r});if(!e)throw new _o(r,{docsPath:oc});a=e}if("function"!==a.type)throw new _o(void 0,{docsPath:oc});const s=fo(a);return Fi([Xo(s),("inputs"in a&&a.inputs?Zo(a.inputs,n??[]):void 0)??"0x"])}const lc={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},uc={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},dc={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class pc extends ss{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class hc extends ss{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class mc extends ss{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const fc={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new mc({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new hc({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new pc({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new pc({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===1/0)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function yc(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(fc);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function bc(e,t={}){void 0!==t.size&&Ss(e,{size:t.size});return Is(Es(e,t),t)}function gc(e,t={}){let n=e;if(void 0!==t.size&&(Ss(n,{size:t.size}),n=hs(n)),n.length>1||n[0]>1)throw new cs(n);return Boolean(n[0])}function wc(e,t={}){void 0!==t.size&&Ss(e,{size:t.size});return Ns(Es(e,t),t)}function vc(e,t){const n="string"==typeof t?Fs(t):t,r=yc(n);if(0===ps(n)&&e.length>0)throw new vo;if(ps(t)&&ps(t)<32)throw new wo({data:"string"==typeof t?t:Es(t),params:e,size:ps(t)});let a=0;const s=[];for(let t=0;t<e.length;++t){const n=e[t];r.setPosition(a);const[i,o]=Cc(r,n,{staticPosition:0});a+=o,s.push(i)}return s}function Cc(e,t,{staticPosition:n}){const r=Jo(t.type);if(r){const[a,s]=r;return function(e,t,{length:n,staticPosition:r}){if(!n){const n=r+wc(e.readBytes(xc)),a=n+Ec;e.setPosition(n);const s=wc(e.readBytes(Ec)),i=kc(t);let o=0;const c=[];for(let n=0;n<s;++n){e.setPosition(a+(i?32*n:o));const[r,s]=Cc(e,t,{staticPosition:a});o+=s,c.push(r)}return e.setPosition(r+32),[c,32]}if(kc(t)){const a=r+wc(e.readBytes(xc)),s=[];for(let r=0;r<n;++r){e.setPosition(a+32*r);const[n]=Cc(e,t,{staticPosition:a});s.push(n)}return e.setPosition(r+32),[s,32]}let a=0;const s=[];for(let i=0;i<n;++i){const[n,i]=Cc(e,t,{staticPosition:r+a});a+=i,s.push(n)}return[s,a]}(e,{...t,type:s},{length:a,staticPosition:n})}if("tuple"===t.type)return function(e,t,{staticPosition:n}){const r=0===t.components.length||t.components.some((({name:e})=>!e)),a=r?[]:{};let s=0;if(kc(t)){const i=n+wc(e.readBytes(xc));for(let n=0;n<t.components.length;++n){const o=t.components[n];e.setPosition(i+s);const[c,l]=Cc(e,o,{staticPosition:i});s+=l,a[r?n:o?.name]=c}return e.setPosition(n+32),[a,32]}for(let i=0;i<t.components.length;++i){const o=t.components[i],[c,l]=Cc(e,o,{staticPosition:n});a[r?i:o?.name]=c,s+=l}return[a,s]}(e,t,{staticPosition:n});if("address"===t.type)return function(e){const t=e.readBytes(32);return[Ti(Es(qo(t,-20))),32]}(e);if("bool"===t.type)return function(e){return[gc(e.readBytes(32),{size:32}),32]}(e);if(t.type.startsWith("bytes"))return function(e,t,{staticPosition:n}){const[r,a]=t.type.split("bytes");if(!a){const t=wc(e.readBytes(32));e.setPosition(n+t);const r=wc(e.readBytes(32));if(0===r)return e.setPosition(n+32),["0x",32];const a=e.readBytes(r);return e.setPosition(n+32),[Es(a),32]}const s=Es(e.readBytes(parseInt(a),32));return[s,32]}(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return function(e,t){const n=t.type.startsWith("int"),r=parseInt(t.type.split("int")[1]||"256"),a=e.readBytes(32);return[r>48?bc(a,{signed:n}):wc(a,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=wc(e.readBytes(32)),r=t+n;e.setPosition(r);const a=wc(e.readBytes(32));if(0===a)return e.setPosition(t+32),["",32];const s=e.readBytes(a,32),i=function(e,t={}){let n=e;return void 0!==t.size&&(Ss(n,{size:t.size}),n=hs(n,{dir:"right"})),(new TextDecoder).decode(n)}(hs(s));return e.setPosition(t+32),[i,32]}(e,{staticPosition:n});throw new No(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Ec=32,xc=32;function kc(e){const{type:t}=e;if("string"===t)return!0;if("bytes"===t)return!0;if(t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(kc);const n=Jo(e.type);return!(!n||!kc({...e,type:n[1]}))}function Tc(e){const{abi:t,data:n}=e,r=zo(n,0,4);if("0x"===r)throw new vo;const a=[...t||[],uc,dc].find((e=>"error"===e.type&&r===Xo(fo(e))));if(!a)throw new ko(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?vc(a.inputs,zo(n,4)):void 0,errorName:a.name}}const Pc=(e,t,n)=>JSON.stringify(e,((e,n)=>{const r="bigint"==typeof n?n.toString():n;return"function"==typeof t?t(e,r):r}),n);function Ac({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map(((e,n)=>`${r&&e.name?`${e.name}: `:""}${"object"==typeof t[n]?Pc(t[n]):t[n]}`)).join(", ")})`}const _c={gwei:9,wei:18},Dc={ether:-9,wei:9};function Fc(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[a,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${a||"0"}${s?`.${s}`:""}`}function Oc(e,t="wei"){return Fc(e,_c[t])}function Sc(e,t="wei"){return Fc(e,Dc[t])}class Mc extends ss{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class Ic extends ss{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function Nc(e){return e.reduce(((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`),"")}function Uc(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}class Lc extends ss{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class Bc extends ss{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class Rc extends ss{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Uc(e),"}","","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","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class jc extends ss{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}class Gc extends ss{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:s,gasPrice:i,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=Uc({chain:r&&`${r?.name} (id: ${r?.id})`,from:t?.address,to:u,value:void 0!==d&&`${Oc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${Sc(i)} gwei`,maxFeePerGas:void 0!==o&&`${Sc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Sc(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class Hc extends ss{constructor({blockHash:e,blockNumber:t,blockTag:n,hash:r,index:a}){let s="Transaction";n&&void 0!==a&&(s=`Transaction at block time "${n}" at index "${a}"`),e&&void 0!==a&&(s=`Transaction at block hash "${e}" at index "${a}"`),t&&void 0!==a&&(s=`Transaction at block number "${t}" at index "${a}"`),r&&(s=`Transaction with hash "${r}"`),super(`${s} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class zc extends ss{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class $c extends ss{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}class Vc extends ss{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:s,gasPrice:i,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d,stateOverride:p}){const h=t?ic(t):void 0;let m=Uc({from:h?.address,to:u,value:void 0!==d&&`${Oc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${Sc(i)} gwei`,maxFeePerGas:void 0!==o&&`${Sc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Sc(c)} gwei`,nonce:l});p&&(m+=`\n${function(e){return e.reduce(((e,{address:t,...n})=>{let r=`${e} ${t}:\n`;return n.nonce&&(r+=` nonce: ${n.nonce}\n`),n.balance&&(r+=` balance: ${n.balance}\n`),n.code&&(r+=` code: ${n.code}\n`),n.state&&(r+=" state:\n",r+=Nc(n.state)),n.stateDiff&&(r+=" stateDiff:\n",r+=Nc(n.stateDiff)),r})," State Override:\n").slice(0,-1)}(p)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class qc extends ss{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:a,functionName:s,sender:i}){const o=Yo({abi:t,args:n,name:s}),c=o?Ac({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=Uc({address:r&&r,function:o?fo(o,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(s?.length??0).keys()].map((()=>" ")).join("")}${c}`,sender:i});super(e.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:e,docsPath:a,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",l].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=r,this.functionName=s,this.sender=i}}class Zc extends ss{constructor({abi:e,data:t,functionName:n,message:r}){let a,s,i,o,c;if(t&&"0x"!==t)try{s=Tc({abi:e,data:t});const{abiItem:n,errorName:r,args:a}=s;if("Error"===r)o=a[0];else if("Panic"===r){const[e]=a;o=lc[e]}else{const e=n?fo(n,{includeName:!0}):void 0,t=n&&a?Ac({abiItem:n,args:a,includeFunctionName:!1,includeName:!1}):void 0;i=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(e){a=e}else r&&(o=r);a instanceof ko&&(c=a.signature,i=[`Unable to decode signature "${c}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${c}.`]),super(o&&"execution reverted"!==o||c?[`The contract function "${n}" reverted with the following ${c?"signature":"reason"}:`,o||c].join("\n"):`The contract function "${n}" reverted.`,{cause:a,metaMessages:i}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=s,this.reason=o,this.signature=c}}class Wc extends ss{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class Kc extends ss{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class Jc extends ss{constructor({body:e,details:t,headers:n,status:r,url:a}){super("HTTP request failed.",{details:t,metaMessages:[r&&`Status: ${r}`,`URL: ${a}`,e&&`Request body: ${Pc(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=r,this.url=a}}class Xc extends ss{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${Pc(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}}class Yc extends ss{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${t}`,`Request body: ${Pc(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}class Qc extends ss{constructor(e,{code:t,docsPath:n,metaMessages:r,shortMessage:a}){super(a,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof Xc?e.code:t??-1}}class el extends Qc{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class tl extends Qc{constructor(e){super(e,{code:tl.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(tl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class nl extends Qc{constructor(e){super(e,{code:nl.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(nl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class rl extends Qc{constructor(e){super(e,{code:rl.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(rl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class al extends Qc{constructor(e){super(e,{code:al.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(al,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class sl extends Qc{constructor(e){super(e,{code:sl.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(sl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class il extends Qc{constructor(e){super(e,{code:il.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(il,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ol extends Qc{constructor(e){super(e,{code:ol.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ol,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class cl extends Qc{constructor(e){super(e,{code:cl.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(cl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class ll extends Qc{constructor(e){super(e,{code:ll.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(ll,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class ul extends Qc{constructor(e){super(e,{code:ul.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(ul,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class dl extends Qc{constructor(e){super(e,{code:dl.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(dl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class pl extends Qc{constructor(e){super(e,{code:pl.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(pl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class hl extends el{constructor(e){super(e,{code:hl.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(hl,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class ml extends el{constructor(e){super(e,{code:ml.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(ml,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class fl extends el{constructor(e){super(e,{code:fl.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(fl,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class yl extends el{constructor(e){super(e,{code:yl.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(yl,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class bl extends el{constructor(e){super(e,{code:bl.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(bl,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class gl extends el{constructor(e){super(e,{code:gl.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(gl,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class wl extends Qc{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const vl=3;function Cl(e,{abi:t,address:n,args:r,docsPath:a,functionName:s,sender:i}){const{code:o,data:c,message:l,shortMessage:u}=e instanceof Kc?e:e instanceof ss?e.walk((e=>"data"in e))||e.walk():{},d=e instanceof vo?new Wc({functionName:s}):[vl,sl.code].includes(o)&&(c||l||u)?new Zc({abi:t,data:"object"==typeof c?c.data:c,functionName:s,message:u??l}):e;return new qc(d,{abi:t,args:r,contractAddress:n,docsPath:a,functionName:s,sender:i})}class El extends ss{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:s,gasPrice:i,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=Uc({from:t?.address,to:u,value:void 0!==d&&`${Oc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${Sc(i)} gwei`,maxFeePerGas:void 0!==o&&`${Sc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Sc(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}class xl extends ss{constructor({cause:e,message:t}={}){const n=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(xl,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(xl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class kl extends ss{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Sc(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(kl,"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 Tl extends ss{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Sc(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(Tl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Pl extends ss{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(Pl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Al extends ss{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(Al,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class _l extends ss{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(_l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Dl extends ss{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(Dl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class Fl extends ss{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(Fl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Ol extends ss{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(Ol,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Sl extends ss{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Sl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Ml extends ss{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${Sc(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Sc(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(Ml,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Il extends ss{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function Nl(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof ss?e.walk((e=>e.code===xl.code)):e;return r instanceof ss?new xl({cause:e,message:r.details}):xl.nodeMessage.test(n)?new xl({cause:e,message:e.details}):kl.nodeMessage.test(n)?new kl({cause:e,maxFeePerGas:t?.maxFeePerGas}):Tl.nodeMessage.test(n)?new Tl({cause:e,maxFeePerGas:t?.maxFeePerGas}):Pl.nodeMessage.test(n)?new Pl({cause:e,nonce:t?.nonce}):Al.nodeMessage.test(n)?new Al({cause:e,nonce:t?.nonce}):_l.nodeMessage.test(n)?new _l({cause:e,nonce:t?.nonce}):Dl.nodeMessage.test(n)?new Dl({cause:e}):Fl.nodeMessage.test(n)?new Fl({cause:e,gas:t?.gas}):Ol.nodeMessage.test(n)?new Ol({cause:e,gas:t?.gas}):Sl.nodeMessage.test(n)?new Sl({cause:e}):Ml.nodeMessage.test(n)?new Ml({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new Il({cause:e})}function Ul(e,{format:t}){if(!t)return{};const n={};return function t(r){const a=Object.keys(r);for(const s of a)s in e&&(n[s]=e[s]),r[s]&&"object"==typeof r[s]&&!Array.isArray(r[s])&&t(r[s])}(t(e||{})),n}const Ll={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function Bl(e){const t={...e};return void 0!==e.blobs&&"string"!=typeof e.blobs[0]&&(t.blobs=e.blobs.map((e=>Es(e)))),void 0!==e.gas&&(t.gas=xs(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=xs(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=xs(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=xs(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=xs(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=xs(e.nonce)),void 0!==e.type&&(t.type=Ll[e.type]),void 0!==e.value&&(t.value=xs(e.value)),t}const Rl=Us("transactionRequest",Bl);function jl(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:a,to:s}=e,i=t?ic(t):void 0;if(i&&!_i(i.address))throw new Zs({address:i.address});if(s&&!_i(s))throw new Zs({address:s});if(void 0!==n&&(void 0!==r||void 0!==a))throw new Lc;if(r&&r>2n**256n-1n)throw new kl({maxFeePerGas:r});if(a&&r&&a>r)throw new Ml({maxFeePerGas:r,maxPriorityFeePerGas:a})}class Gl extends ss{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class Hl extends ss{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class zl extends ss{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Sc(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class $l extends ss{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function Vl(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:a}={}){const s=r??"latest",i=a??!1,o=void 0!==n?xs(n):void 0;let c=null;if(c=t?await e.request({method:"eth_getBlockByHash",params:[t,i]}):await e.request({method:"eth_getBlockByNumber",params:[o||s,i]}),!c)throw new $l({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||js)(c)}async function ql(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Zl(e,t){const{block:n,chain:r=e.chain,request:a}=t||{};if("function"==typeof r?.fees?.defaultPriorityFee){const t=n||await mo(e,Vl,"getBlock")({});return r.fees.defaultPriorityFee({block:t,client:e,request:a})}if(void 0!==r?.fees?.defaultPriorityFee)return r?.fees?.defaultPriorityFee;try{return Is(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):mo(e,Vl,"getBlock")({}),mo(e,ql,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new Hl;const a=r-t.baseFeePerGas;return a<0n?0n:a}}async function Wl(e,t){const{block:n,chain:r=e.chain,request:a,type:s="eip1559"}=t||{},i=await(async()=>"function"==typeof r?.fees?.baseFeeMultiplier?r.fees.baseFeeMultiplier({block:n,client:e,request:a}):r?.fees?.baseFeeMultiplier??1.2)();if(i<1)throw new Gl;const o=10**(i.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(i*o))/BigInt(o),l=n||await mo(e,Vl,"getBlock")({});if("function"==typeof r?.fees?.estimateFeesPerGas)return r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:a,type:s});if("eip1559"===s){if("bigint"!=typeof l.baseFeePerGas)throw new Hl;const t="bigint"==typeof a?.maxPriorityFeePerGas?a.maxPriorityFeePerGas:await Zl(e,{block:l,chain:r,request:a}),n=c(l.baseFeePerGas);return{maxFeePerGas:a?.maxFeePerGas??n+t,maxPriorityFeePerGas:t}}return{gasPrice:a?.gasPrice??c(await mo(e,ql,"getGasPrice")({}))}}async function Kl(e,{address:t,blockTag:n="latest",blockNumber:r}){return Ns(await e.request({method:"eth_getTransactionCount",params:[t,r?xs(r):n]}))}class Jl extends ss{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join("\n"),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}function Xl(e){if(e.type)return e.type;if(void 0!==e.blobs||void 0!==e.blobVersionedHashes||void 0!==e.maxFeePerBlobGas||void 0!==e.sidecars)return"eip4844";if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new Rc({transaction:e})}async function Yl(e){return Ns(await e.request({method:"eth_chainId"}))}async function Ql(e,t){const{account:n=e.account,chain:r,chainId:a,gas:s,nonce:i,parameters:o=["chainId","fees","gas","nonce","type"],type:c}=t,l=n?ic(n):void 0,u=await mo(e,Vl,"getBlock")({blockTag:"latest"}),d={...t,...l?{from:l?.address}:{}};if(o.includes("chainId")&&(d.chainId=r?r.id:void 0!==a?a:await mo(e,Yl,"getChainId")({})),o.includes("nonce")&&void 0===i&&l&&(d.nonce=await mo(e,Kl,"getTransactionCount")({address:l.address,blockTag:"pending"})),(o.includes("fees")||o.includes("type"))&&void 0===c)try{d.type=Xl(d)}catch{d.type="bigint"==typeof u.baseFeePerGas?"eip1559":"legacy"}if(o.includes("fees"))if("eip1559"===d.type||"eip4844"===d.type){const{maxFeePerGas:n,maxPriorityFeePerGas:a}=await Wl(e,{block:u,chain:r,request:d});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas<a)throw new zl({maxPriorityFeePerGas:a});d.maxPriorityFeePerGas=a,d.maxFeePerGas=n}else{if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)throw new Hl;const{gasPrice:n}=await Wl(e,{block:u,chain:r,request:d,type:"legacy"});d.gasPrice=n}return o.includes("gas")&&void 0===s&&(d.gas=await mo(e,eu,"estimateGas")({...d,account:l?{address:l.address,type:"json-rpc"}:void 0})),jl(d),delete d.parameters,d}async function eu(e,t){const n=t.account??e.account,r=n?ic(n):void 0;try{const{accessList:n,blobs:a,blockNumber:s,blockTag:i,data:o,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:m,value:f,...y}="local"===r?.type?await Ql(e,t):t,b=(s?xs(s):void 0)||i;jl(t);const g=e.chain?.formatters?.transactionRequest?.format,w=(g||Bl)({...Ul(y,{format:g}),from:r?.address,accessList:n,blobs:a,data:o,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:m,value:f}),v=await e.request({method:"eth_estimateGas",params:b?[w,b]:[w]});return BigInt(v)}catch(n){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=Nl(e,n);return t instanceof Il?e:t})();return new El(r,{docsPath:t,...n})}(n,{...t,account:r,chain:e.chain})}}async function tu(e,t){const{abi:n,address:r,args:a,functionName:s,...i}=t,o=cc({abi:n,args:a,functionName:s});try{return await mo(e,eu,"estimateGas")({data:o,to:r,...i})}catch(e){const t=i.account?ic(i.account):void 0;throw Cl(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:t?.address})}}const nu="/docs/contract/decodeEventLog";function ru(e){const{abi:t,data:n,strict:r,topics:a}=e,s=r??!0,[i,...o]=a;if(!i)throw new To({docsPath:nu});const c=t.find((e=>"event"===e.type&&i===Ho(fo(e))));if(!c||!("name"in c)||"event"!==c.type)throw new Po(i,{docsPath:nu});const{name:l,inputs:u}=c,d=u?.some((e=>!("name"in e&&e.name)));let p=d?[]:{};const h=u.filter((e=>"indexed"in e&&e.indexed));for(let e=0;e<h.length;e++){const t=h[e],n=o[e];if(!n)throw new Mo({abiItem:c,param:t});p[t.name||e]=au({param:t,value:n})}const m=u.filter((e=>!("indexed"in e&&e.indexed)));if(m.length>0)if(n&&"0x"!==n)try{const e=vc(m,n);if(e)if(d)p=[...p,...e];else for(let t=0;t<m.length;t++)p[m[t].name]=e[t]}catch(e){if(s){if(e instanceof wo||e instanceof hc)throw new So({abiItem:c,data:n,params:m,size:ps(n)});throw e}}else if(s)throw new So({abiItem:c,data:"0x",params:m,size:0});return{eventName:l,args:Object.values(p).length>0?p:void 0}}function au({param:e,value:t}){if("string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))return t;return(vc([e],t)||[])[0]}function su({abi:e,eventName:t,logs:n,strict:r=!0}){return n.map((n=>{try{const a=ru({...n,abi:e,strict:r});return t&&!t.includes(a.eventName)?null:{...a,...n}}catch(e){let t,a;if(e instanceof Po)return null;if(e instanceof So||e instanceof Mo){if(r)return null;t=e.abiItem.name,a=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return{...n,args:a?[]:{},eventName:t}}})).filter(Boolean)}async function iu(e,{address:t,blockHash:n,fromBlock:r,toBlock:a,event:s,events:i,args:o,strict:c}={}){const l=c??!1,u=i??(s?[s]:void 0);let d,p=[];u&&(p=[u.flatMap((e=>nc({abi:[e],eventName:e.name,args:o})))],s&&(p=p[0])),d=n?await e.request({method:"eth_getLogs",params:[{address:t,topics:p,blockHash:n}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:p,fromBlock:"bigint"==typeof r?xs(r):r,toBlock:"bigint"==typeof a?xs(a):a}]});const h=d.map((e=>Hs(e)));return u?su({abi:u,logs:h,strict:l}):h}async function ou(e,t){const{abi:n,address:r,args:a,blockHash:s,eventName:i,fromBlock:o,toBlock:c,strict:l}=t,u=i?Yo({abi:n,name:i}):void 0,d=u?void 0:n.filter((e=>"event"===e.type));return mo(e,iu,"getLogs")({address:r,args:a,blockHash:s,event:u,events:d,fromBlock:o,toBlock:c,strict:l})}const cu="/docs/contract/decodeFunctionResult";function lu(e){const{abi:t,args:n,functionName:r,data:a}=e;let s=t[0];if(r){const e=Yo({abi:t,args:n,name:r});if(!e)throw new _o(r,{docsPath:cu});s=e}if("function"!==s.type)throw new _o(void 0,{docsPath:cu});if(!s.outputs)throw new Do(s.name,{docsPath:cu});const i=vc(s.outputs,a);return i&&i.length>1?i:i&&1===i.length?i[0]:void 0}const uu=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],du=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],pu=[...du,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],hu=[...du,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],mu=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],fu=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],yu=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],bu="0x82ad56cb";class gu extends ss{constructor({blockNumber:e,chain:t,contract:n}){super(`Chain "${t.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class wu extends ss{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class vu extends ss{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class Cu extends ss{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class Eu extends ss{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}function xu({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new gu({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new gu({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const ku=new Map;function Tu({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:a}){const s=async()=>{const t=o();i();const n=t.map((({args:e})=>e));0!==n.length&&e(n).then((e=>{a&&Array.isArray(e)&&e.sort(a);for(let n=0;n<t.length;n++){const{pendingPromise:r}=t[n];r.resolve?.([e[n],e])}})).catch((e=>{for(let n=0;n<t.length;n++){const{pendingPromise:r}=t[n];r.reject?.(e)}}))},i=()=>ku.delete(t),o=()=>ku.get(t)||[],c=e=>ku.set(t,[...o(),e]);return{flush:i,async schedule(e){const t={},a=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),i=n?.([...o().map((({args:e})=>e)),e]);i&&s();return o().length>0?(c({args:e,pendingPromise:t}),a):(c({args:e,pendingPromise:t}),setTimeout(s,r),a)}}}async function Pu(e,t){const{account:n=e.account,batch:r=Boolean(e.batch?.multicall),blockNumber:a,blockTag:s="latest",accessList:i,blobs:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,to:f,value:y,stateOverride:b,...g}=t,w=n?ic(n):void 0;try{jl(t);const n=(a?xs(a):void 0)||s,v=function(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!_i(n,{strict:!1}))throw new Zs({address:n});if(t[n])throw new Mc({address:n});t[n]=_u(r)}return t}(b),C=e.chain?.formatters?.transactionRequest?.format,E=(C||Bl)({...Ul(g,{format:C}),from:w?.address,accessList:i,blobs:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,to:f,value:y});if(r&&function({request:e}){const{data:t,to:n,...r}=e;return!!t&&(!t.startsWith(bu)&&(!!n&&!(Object.values(r).filter((e=>void 0!==e)).length>0)))}({request:E})&&!v)try{return await async function(e,t){const{batchSize:n=1024,wait:r=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockNumber:a,blockTag:s="latest",data:i,multicallAddress:o,to:c}=t;let l=o;if(!l){if(!e.chain)throw new Cu;l=xu({blockNumber:a,chain:e.chain,contract:"multicall3"})}const u=a?xs(a):void 0,d=u||s,{schedule:p}=Tu({id:`${e.uid}.${d}`,wait:r,shouldSplitBatch(e){const t=e.reduce(((e,{data:t})=>e+(t.length-2)),0);return t>2*n},fn:async t=>{const n=t.map((e=>({allowFailure:!0,callData:e.data,target:e.to}))),r=cc({abi:uu,args:[n],functionName:"aggregate3"}),a=await e.request({method:"eth_call",params:[{data:r,to:l},d]});return lu({abi:uu,args:[n],functionName:"aggregate3",data:a||"0x"})}}),[{returnData:h,success:m}]=await p({data:i,to:c});if(!m)throw new Kc({data:h});return"0x"===h?{data:void 0}:{data:h}}(e,{...E,blockNumber:a,blockTag:s})}catch(e){if(!(e instanceof Cu||e instanceof gu))throw e}const x=await e.request({method:"eth_call",params:v?[E,n,v]:[E,n]});return"0x"===x?{data:void 0}:{data:x}}catch(n){const r=function(e){if(!(e instanceof ss))return;const t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(n),{offchainLookup:a,offchainLookupSignature:s}=await import("./ccip-96253715.js");if(r?.slice(0,10)===s&&f)return{data:await a(e,{data:r,to:f})};throw function(e,{docsPath:t,...n}){const r=(()=>{const t=Nl(e,n);return t instanceof Il?e:t})();return new Vc(r,{docsPath:t,...n})}(n,{...t,account:w,chain:e.chain})}}function Au(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new ys({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new ys({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function _u(e){const{balance:t,nonce:n,state:r,stateDiff:a,code:s}=e,i={};if(void 0!==s&&(i.code=s),void 0!==t&&(i.balance=xs(t,{size:32})),void 0!==n&&(i.nonce=xs(n,{size:8})),void 0!==r&&(i.state=Au(r)),void 0!==a){if(i.state)throw new Ic;i.stateDiff=Au(a)}return i}async function Du(e,t){const{abi:n,address:r,args:a,functionName:s,...i}=t,o=cc({abi:n,args:a,functionName:s});try{const{data:t}=await mo(e,Pu,"call")({...i,data:o,to:r});return lu({abi:n,args:a,functionName:s,data:t||"0x"})}catch(e){throw Cl(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/readContract",functionName:s})}}async function Fu(e,t){const{abi:n,address:r,args:a,dataSuffix:s,functionName:i,...o}=t,c=o.account?ic(o.account):e.account,l=cc({abi:n,args:a,functionName:i});try{const{data:u}=await mo(e,Pu,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:r,...o,account:c}),d=lu({abi:n,args:a,functionName:i,data:u||"0x"});return{result:d,request:{abi:n.filter((e=>"name"in e&&e.name===t.functionName)),address:r,args:a,dataSuffix:s,functionName:i,...o,account:c}}}catch(e){throw Cl(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/simulateContract",functionName:i,sender:c?.address})}}const Ou=new Map,Su=new Map;let Mu=0;function Iu(e,t,n){const r=++Mu,a=()=>Ou.get(e)||[],s=()=>{const t=Su.get(e);1===a().length&&t&&t(),(()=>{const t=a();Ou.set(e,t.filter((e=>e.id!==r)))})()},i=a();if(Ou.set(e,[...i,{id:r,fns:t}]),i&&i.length>0)return s;const o={};for(const e in t)o[e]=(...t)=>{const n=a();if(0!==n.length)for(const r of n)r.fns[e]?.(...t)};const c=n(o);return"function"==typeof c&&Su.set(e,c),s}async function Nu(e){return new Promise((t=>setTimeout(t,e)))}function Uu(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let a=!0;const s=()=>a=!1;return(async()=>{let i;t&&(i=await e({unpoll:s}));const o=await(n?.(i))??r;await Nu(o);const c=async()=>{a&&(await e({unpoll:s}),await Nu(r),c())};c()})(),s}const Lu=new Map,Bu=new Map;async function Ru(e,{cacheKey:t,cacheTime:n=1/0}){const r=function(e){const t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:n=>t.set(e,n)}),n=t(e,Lu),r=t(e,Bu);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}(t),a=r.response.get();if(a&&n>0){if((new Date).getTime()-a.created.getTime()<n)return a.data}let s=r.promise.get();s||(s=e(),r.promise.set(s));try{const e=await s;return r.response.set({created:new Date,data:e}),e}finally{r.promise.clear()}}const ju=e=>`blockNumber.${e}`;async function Gu(e,{cacheTime:t=e.cacheTime}={}){const n=await Ru((()=>e.request({method:"eth_blockNumber"})),{cacheKey:ju(e.uid),cacheTime:t});return BigInt(n)}async function Hu(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if("string"==typeof r[0])return r;const a=r.map((e=>Hs(e)));return"abi"in t&&t.abi?su({abi:t.abi,logs:a,strict:n}):a}async function zu(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function $u(e,t){const{abi:n,address:r,args:a,batch:s=!0,eventName:i,onError:o,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}=t;return(void 0!==l?l:"webSocket"!==e.transport.type)?(()=>{const t=Pc(["watchContractEvent",r,a,s,e.uid,i,u]),l=d??!1;return Iu(t,{onLogs:c,onError:o},(t=>{let o,c,d=!1;const p=Uu((async()=>{if(d)try{let u;if(c)u=await mo(e,Hu,"getFilterChanges")({filter:c});else{const t=await mo(e,Gu,"getBlockNumber")({});u=o&&o!==t?await mo(e,ou,"getContractEvents")({abi:n,address:r,args:a,eventName:i,fromBlock:o+1n,toBlock:t,strict:l}):[],o=t}if(0===u.length)return;if(s)t.onLogs(u);else for(const e of u)t.onLogs([e])}catch(e){c&&e instanceof il&&(d=!1),t.onError?.(e)}else{try{c=await mo(e,sc,"createContractEventFilter")({abi:n,address:r,args:a,eventName:i,strict:l})}catch{}d=!0}}),{emitOnBegin:!0,interval:u});return async()=>{c&&await mo(e,zu,"uninstallFilter")({filter:c}),p()}}))})():(()=>{let t=!0,s=()=>t=!1;return(async()=>{try{const l=i?nc({abi:n,eventName:i,args:a}):[],{unsubscribe:u}=await e.transport.subscribe({params:["logs",{address:r,topics:l}],onData(e){if(!t)return;const r=e.result;try{const{eventName:e,args:t}=ru({abi:n,data:r.data,topics:r.topics,strict:d}),a=Hs(r,{args:t,eventName:e});c([a])}catch(e){let t,n;if(e instanceof So||e instanceof Mo){if(d)return;t=e.abiItem.name,n=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const a=Hs(r,{args:n?[]:{},eventName:t});c([a])}},onError(e){o?.(e)}});s=u,t||s()}catch(e){o?.(e)}})(),s})()}async function Vu(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}async function qu(e,t){const{account:n=e.account,chain:r=e.chain,accessList:a,blobs:s,data:i,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:h,value:m,...f}=t;if(!n)throw new Jl({docsPath:"/docs/actions/wallet/sendTransaction"});const y=ic(n);try{let n;if(jl(t),null!==r&&(n=await mo(e,Yl,"getChainId")({}),function({chain:e,currentChainId:t}){if(!e)throw new vu;if(t!==e.id)throw new wu({chain:e,currentChainId:t})}({currentChainId:n,chain:r})),"local"===y.type){const t=await mo(e,Ql,"prepareTransactionRequest")({account:y,accessList:a,blobs:s,chain:r,chainId:n,data:i,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:h,value:m,...f}),b=r?.serializers?.transaction,g=await y.signTransaction(t,{serializer:b});return await mo(e,Vu,"sendRawTransaction")({serializedTransaction:g})}const b=e.chain?.formatters?.transactionRequest?.format,g=(b||Bl)({...Ul(f,{format:b}),accessList:a,blobs:s,data:i,from:y.address,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:h,value:m});return await e.request({method:"eth_sendTransaction",params:[g]},{retryCount:0})}catch(e){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=Nl(e,n);return t instanceof Il?e:t})();return new Gc(r,{docsPath:t,...n})}(e,{...t,account:y,chain:t.chain||void 0})}}async function Zu(e,t){const{abi:n,address:r,args:a,dataSuffix:s,functionName:i,...o}=t,c=cc({abi:n,args:a,functionName:i});return mo(e,qu,"sendTransaction")({data:`${c}${s?s.replace("0x",""):""}`,to:r,...o})}function Wu({abi:e,address:t,client:n}){const r=n,[a,s]=r?"public"in r&&"wallet"in r?[r.public,r.wallet]:"public"in r?[r.public,void 0]:"wallet"in r?[void 0,r.wallet]:[r,r]:[void 0,void 0],i=null!=a,o=null!=s,c={};let l=!1,u=!1,d=!1;for(const t of e)if("function"===t.type?"view"===t.stateMutability||"pure"===t.stateMutability?l=!0:u=!0:"event"===t.type&&(d=!0),l&&u&&d)break;return i&&(l&&(c.read=new Proxy({},{get:(n,r)=>(...n)=>{const{args:s,options:i}=Ku(n);return mo(a,Du,"readContract")({abi:e,address:t,functionName:r,args:s,...i})}})),u&&(c.simulate=new Proxy({},{get:(n,r)=>(...n)=>{const{args:s,options:i}=Ku(n);return mo(a,Fu,"simulateContract")({abi:e,address:t,functionName:r,args:s,...i})}})),d&&(c.createEventFilter=new Proxy({},{get:(n,r)=>(...n)=>{const s=e.find((e=>"event"===e.type&&e.name===r)),{args:i,options:o}=Ju(n,s);return mo(a,sc,"createContractEventFilter")({abi:e,address:t,eventName:r,args:i,...o})}}),c.getEvents=new Proxy({},{get:(n,r)=>(...n)=>{const s=e.find((e=>"event"===e.type&&e.name===r)),{args:i,options:o}=Ju(n,s);return mo(a,ou,"getContractEvents")({abi:e,address:t,eventName:r,args:i,...o})}}),c.watchEvent=new Proxy({},{get:(n,r)=>(...n)=>{const s=e.find((e=>"event"===e.type&&e.name===r)),{args:i,options:o}=Ju(n,s);return mo(a,$u,"watchContractEvent")({abi:e,address:t,eventName:r,args:i,...o})}}))),o&&u&&(c.write=new Proxy({},{get:(n,r)=>(...n)=>{const{args:a,options:i}=Ku(n);return mo(s,Zu,"writeContract")({abi:e,address:t,functionName:r,args:a,...i})}})),(i||o)&&u&&(c.estimateGas=new Proxy({},{get:(n,r)=>(...n)=>{const{args:i,options:o}=Ku(n);return mo(a??s,tu,"estimateContractGas")({abi:e,address:t,functionName:r,args:i,...o,account:o.account??s.account})}})),c.address=t,c.abi=e,c}function Ku(e){const t=e.length&&Array.isArray(e[0]);return{args:t?e[0]:[],options:(t?e[1]:e[0])??{}}}function Ju(e,t){let n=!1;Array.isArray(e[0])?n=!0:1===e.length?n=t.inputs.some((e=>e.indexed)):2===e.length&&(n=!0);return{args:n?e[0]:void 0,options:(n?e[1]:e[0])??{}}}const Xu=256;let Yu,Qu=Xu;function ed(e=11){if(!Yu||Qu+e>2*Xu){Yu="",Qu=0;for(let e=0;e<Xu;e++)Yu+=(256+256*Math.random()|0).toString(16).substring(1)}return Yu.substring(Qu,Qu+++e)}function td(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,key:r="base",name:a="Base Client",pollingInterval:s=4e3,type:i="base"}=e,o=e.chain,c=e.account?ic(e.account):void 0,{config:l,request:u,value:d}=e.transport({chain:o,pollingInterval:s}),p={account:c,batch:t,cacheTime:n,chain:o,key:r,name:a,pollingInterval:s,request:u,transport:{...l,...d},type:i,uid:ed()};return Object.assign(p,{extend:function e(t){return n=>{const r=n(t);for(const e in p)delete r[e];const a={...t,...r};return Object.assign(a,{extend:e(a)})}}(p)})}function nd(e,{delay:t=100,retryCount:n=2,shouldRetry:r=(()=>!0)}={}){return new Promise(((a,s)=>{const i=async({count:o=0}={})=>{try{const t=await e();a(t)}catch(e){if(o<n&&await r({count:o,error:e}))return(async({error:e})=>{const n="function"==typeof t?t({count:o,error:e}):t;n&&await Nu(n),i({count:o+1})})({error:e});s(e)}};i()}))}function rd(e,t={}){return async(n,r={})=>{const{retryDelay:a=150,retryCount:s=3}={...t,...r};return nd((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case tl.code:throw new tl(t);case nl.code:throw new nl(t);case rl.code:throw new rl(t);case al.code:throw new al(t);case sl.code:throw new sl(t);case il.code:throw new il(t);case ol.code:throw new ol(t);case cl.code:throw new cl(t);case ll.code:throw new ll(t);case ul.code:throw new ul(t);case dl.code:throw new dl(t);case pl.code:throw new pl(t);case hl.code:throw new hl(t);case ml.code:throw new ml(t);case fl.code:throw new fl(t);case yl.code:throw new yl(t);case bl.code:throw new bl(t);case gl.code:throw new gl(t);case 5e3:throw new hl(t);default:if(e instanceof ss)throw e;throw new wl(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof Jc){const e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*parseInt(e)}return~~(1<<e)*a},retryCount:s,shouldRetry:({error:e})=>function(e){if("code"in e&&"number"==typeof e.code)return-1===e.code||(e.code===dl.code||e.code===sl.code);if(e instanceof Jc&&e.status)return 403===e.status||(408===e.status||(413===e.status||(429===e.status||(500===e.status||(502===e.status||(503===e.status||504===e.status))))));return!0}(e)})}}function ad({key:e,name:t,request:n,retryCount:r=3,retryDelay:a=150,timeout:s,type:i},o){return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:a,timeout:s,type:i},request:rd(n,{retryCount:r,retryDelay:a}),value:o}}function sd(e,t={}){const{key:n="custom",name:r="Custom Provider",retryDelay:a}=t;return({retryCount:s})=>ad({key:n,name:r,request:e.request.bind(e),retryCount:t.retryCount??s,retryDelay:a,type:"custom"})}class id extends ss{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function od(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const cd=od();function ld(e,t={}){return{async request(n){const{body:r,fetchOptions:a={},onResponse:s=t.onResponse,timeout:i=t.timeout??1e4}=n,{headers:o,method:c,signal:l}={...t.fetchOptions,...a};try{const t=await function(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise(((a,s)=>{(async()=>{let i;try{const o=new AbortController;n>0&&(i=setTimeout((()=>{r?o.abort():s(t)}),n)),a(await e({signal:o?.signal}))}catch(e){"AbortError"===e.name&&s(t),s(e)}finally{clearTimeout(i)}})()}))}((async({signal:t})=>await fetch(e,{...a,body:Array.isArray(r)?Pc(r.map((e=>({jsonrpc:"2.0",id:e.id??cd.take(),...e})))):Pc({jsonrpc:"2.0",id:r.id??cd.take(),...r}),headers:{...o,"Content-Type":"application/json"},method:c||"POST",signal:l||(i>0?t:void 0)})),{errorInstance:new Yc({body:r,url:e}),timeout:i,signal:!0});let n;if(s&&await s(t),n=t.headers.get("Content-Type")?.startsWith("application/json")?await t.json():await t.text(),!t.ok)throw new Jc({body:r,details:Pc(n.error)||t.statusText,headers:t.headers,status:t.status,url:e});return n}catch(t){if(t instanceof Jc)throw t;if(t instanceof Yc)throw t;throw new Jc({body:r,details:t.message,url:e})}}}}function ud(e,t={}){const{batch:n,fetchOptions:r,key:a="http",name:s="HTTP JSON-RPC",onFetchResponse:i,retryDelay:o}=t;return({chain:c,retryCount:l,timeout:u})=>{const{batchSize:d=1e3,wait:p=0}="object"==typeof n?n:{},h=t.retryCount??l,m=u??t.timeout??1e4,f=e||c?.rpcUrls.default.http[0];if(!f)throw new id;const y=ld(f,{fetchOptions:r,onResponse:i,timeout:m});return ad({key:a,name:s,async request({method:t,params:r}){const a={method:t,params:r},{schedule:s}=Tu({id:`${e}`,wait:p,shouldSplitBatch:e=>e.length>d,fn:e=>y.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:i,result:o}]=await(async e=>n?s(e):[await y.request({body:e})])(a);if(i)throw new Xc({body:a,error:i,url:f});return o},retryCount:h,retryDelay:o,timeout:m,type:"http"},{fetchOptions:r,url:f})}}function dd(e,t){if(!(e instanceof ss))return!1;const n=e.walk((e=>e instanceof Zc));return n instanceof Zc&&("ResolverNotFound"===n.data?.errorName||("ResolverWildcardNotSupported"===n.data?.errorName||("ResolverNotContract"===n.data?.errorName||("ResolverError"===n.data?.errorName||("HttpError"===n.data?.errorName||(!!n.reason?.includes("Wildcard on non-extended resolvers is not supported")||"reverse"===t&&n.reason===lc[50]))))))}function pd(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const t=`0x${e.slice(1,65)}`;return ds(t)?t:null}function hd(e){let t=new Uint8Array(32).fill(0);if(!e)return Es(t);const n=e.split(".");for(let e=n.length-1;e>=0;e-=1){const r=pd(n[e]),a=r?As(r):ki(Os(n[e]),"bytes");t=ki(Di([t,a]),"bytes")}return Es(t)}function md(e){return`[${e.slice(2)}]`}function fd(e){const t=new Uint8Array(32).fill(0);return e?pd(e)||ki(Os(e)):Es(t)}function yd(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array(Os(t).byteLength+2);let r=0;const a=t.split(".");for(let e=0;e<a.length;e++){let t=Os(a[e]);t.byteLength>255&&(t=Os(md(fd(a[e])))),n[r]=t.length,n.set(t,r+1),r+=t.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}class bd extends ss{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class gd extends ss{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class wd extends ss{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class vd extends ss{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const Cd=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Ed=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,xd=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,kd=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function Td(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Pd({uri:e,gatewayUrls:t}){const n=xd.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=Td(t?.ipfs,"https://ipfs.io"),a=Td(t?.arweave,"https://arweave.net"),s=e.match(Cd),{protocol:i,subpath:o,target:c,subtarget:l=""}=s?.groups||{},u="ipns:/"===i||"ipns/"===o,d="ipfs:/"===i||"ipfs/"===o||Ed.test(e);if(e.startsWith("http")&&!u&&!d){let n=e;return t?.arweave&&(n=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:n,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===i&&c)return{uri:`${a}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let p=e.replace(kd,"");if(p.startsWith("<svg")&&(p=`data:image/svg+xml;base64,${btoa(p)}`),p.startsWith("data:")||p.startsWith("{"))return{uri:p,isOnChain:!0,isEncoded:!1};throw new wd({uri:e})}function Ad(e){if("object"!=typeof e||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new bd({data:e});return e.image||e.image_url||e.image_data}async function _d({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=Pd({uri:t,gatewayUrls:e});if(r)return n;const a=await async function(e){try{const t=await fetch(e,{method:"HEAD"});if(200===t.status){const e=t.headers.get("content-type");return e?.startsWith("image/")}return!1}catch(t){return("object"!=typeof t||void 0===t.response)&&!!globalThis.hasOwnProperty("Image")&&new Promise((t=>{const n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=e}))}}(n);if(a)return n;throw new wd({uri:t})}async function Dd(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?async function(e,{gatewayUrls:t,record:n}){const r=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,a]=t.split("/"),[s,i]=n.split(":"),[o,c]=r.split(":");if(!s||"eip155"!==s.toLowerCase())throw new gd({reason:"Only EIP-155 supported"});if(!i)throw new gd({reason:"Chain ID not found"});if(!c)throw new gd({reason:"Contract address not found"});if(!a)throw new gd({reason:"Token ID not found"});if(!o)throw new gd({reason:"ERC namespace not found"});return{chainID:parseInt(i),namespace:o.toLowerCase(),contractAddress:c,tokenID:a}}(n),a=await async function(e,{nft:t}){if("erc721"===t.namespace)return Du(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return Du(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new vd({namespace:t.namespace})}(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:o}=Pd({uri:a,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const e=o?atob(s.replace("data:application/json;base64,","")):s;return _d({uri:Ad(JSON.parse(e)),gatewayUrls:t})}let c=r.tokenID;"erc1155"===r.namespace&&(c=c.replace("0x","").padStart(64,"0"));return async function({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then((e=>e.json()));return await _d({gatewayUrls:e,uri:Ad(n)})}catch{throw new wd({uri:t})}}({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:n}):_d({uri:n,gatewayUrls:t})}async function Fd(e,{blockNumber:t,blockTag:n,name:r,key:a,gatewayUrls:s,strict:i,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=xu({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const i={address:c,abi:pu,functionName:"resolve",args:[vs(yd(r)),cc({abi:mu,functionName:"text",args:[hd(r),a]})],blockNumber:t,blockTag:n},o=mo(e,Du,"readContract"),l=s?await o({...i,args:[...i.args,s]}):await o(i);if("0x"===l[0])return null;const u=lu({abi:mu,functionName:"text",data:l[0]});return""===u?null:u}catch(e){if(i)throw e;if(dd(e,"resolve"))return null;throw e}}async function Od(e,{address:t,args:n,event:r,events:a,fromBlock:s,strict:i,toBlock:o}={}){const c=a??(r?[r]:void 0),l=ac(e,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap((e=>nc({abi:[e],eventName:e.name,args:n})))],r&&(u=u[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof s?xs(s):s,toBlock:"bigint"==typeof o?xs(o):o,...u.length?{topics:u}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:s,id:d,request:l(d),strict:Boolean(i),toBlock:o,type:"event"}}async function Sd(e){const t=ac(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Md(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:a}){const s=n?xs(n):void 0;return function(e){return{baseFeePerGas:e.baseFeePerGas.map((e=>BigInt(e))),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:e.reward?.map((e=>e.map((e=>BigInt(e)))))}}(await e.request({method:"eth_feeHistory",params:[xs(t),s||r,a]}))}const Id=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Nd=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Ud(e){const{domain:t={},message:n,primaryType:r}=e,a={EIP712Domain:Hd({domain:t}),...e.types};!function(e){const{domain:t,message:n,primaryType:r,types:a}=e,s=(e,t)=>{for(const n of e){const{name:e,type:r}=n,i=t[e],o=r.match(Nd);if(o&&("number"==typeof i||"bigint"==typeof i)){const[e,t,n]=o;xs(i,{signed:"int"===t,size:parseInt(n)/8})}if("address"===r&&"string"==typeof i&&!_i(i))throw new Zs({address:i});const c=r.match(Id);if(c){const[e,t]=c;if(t&&ps(i)!==parseInt(t))throw new Oo({expectedSize:parseInt(t),givenSize:ps(i)})}const l=a[r];l&&s(l,i)}};a.EIP712Domain&&t&&s(a.EIP712Domain,t);if("EIP712Domain"!==r){const e=a[r];s(e,n)}}({domain:t,message:n,primaryType:r,types:a});const s=["0x1901"];return t&&s.push(function({domain:e,types:t}){return Ld({data:e,primaryType:"EIP712Domain",types:t})}({domain:t,types:a})),"EIP712Domain"!==r&&s.push(Ld({data:n,primaryType:r,types:a})),ki(Di(s))}function Ld({data:e,primaryType:t,types:n}){return ki(Bd({data:e,primaryType:t,types:n}))}function Bd({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],a=[Rd({primaryType:t,types:n})];for(const s of n[t]){const[t,i]=Gd({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(t),a.push(i)}return Zo(r,a)}function Rd({primaryType:e,types:t}){const n=vs(function({primaryType:e,types:t}){let n="";const r=jd({primaryType:e,types:t});r.delete(e);const a=[e,...Array.from(r).sort()];for(const e of a)n+=`${e}(${t[e].map((({name:e,type:t})=>`${t} ${e}`)).join(",")})`;return n}({primaryType:e,types:t}));return ki(n)}function jd({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),a=r?.[0];if(n.has(a)||void 0===t[a])return n;n.add(a);for(const e of t[a])jd({primaryType:e.type,types:t},n);return n}function Gd({types:e,name:t,type:n,value:r}){if(void 0!==e[n])return[{type:"bytes32"},ki(Bd({data:r,primaryType:n,types:e}))];if("bytes"===n){return[{type:"bytes32"},ki(r=`0x${(r.length%2?"0":"")+r.slice(2)}`)]}if("string"===n)return[{type:"bytes32"},ki(vs(r))];if(n.lastIndexOf("]")===n.length-1){const a=n.slice(0,n.lastIndexOf("[")),s=r.map((n=>Gd({name:t,type:a,types:e,value:n})));return[{type:"bytes32"},ki(Zo(s.map((([e])=>e)),s.map((([,e])=>e))))]}return[{type:n},r]}function Hd({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},"number"==typeof e?.chainId&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}const zd="/docs/contract/encodeDeployData";function $d(e){const{abi:t,args:n,bytecode:r}=e;if(!n||0===n.length)return r;const a=t.find((e=>"type"in e&&"constructor"===e.type));if(!a)throw new bo({docsPath:zd});if(!("inputs"in a))throw new go({docsPath:zd});if(!a.inputs||0===a.inputs.length)throw new go({docsPath:zd});return Fi([r,Zo(a.inputs,n)])}const Vd="/docs/contract/encodeFunctionResult";class qd extends oi{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ai(this.buffer)}update(e){Xs(this);const{view:t,buffer:n,blockLen:r}=this,a=(e=ii(e)).length;for(let s=0;s<a;){const i=Math.min(r-this.pos,a-s);if(i!==r)n.set(e.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===r&&(this.process(t,0),this.pos=0);else{const t=ai(e);for(;r<=a-s;s+=r)this.process(t,s)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){Xs(this),Ys(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:a}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>r-s&&(this.process(n,0),s=0);for(let e=s;e<r;e++)t[e]=0;!function(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const a=BigInt(32),s=BigInt(4294967295),i=Number(n>>a&s),o=Number(n&s),c=r?4:0,l=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),a),this.process(n,0);const i=ai(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)i.setUint32(4*e,l[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:a,destroyed:s,pos:i}=this;return e.length=r,e.pos=i,e.finished=a,e.destroyed=s,r%t&&e.buffer.set(n),e}}const Zd=(e,t,n)=>e&t^~e&n,Wd=(e,t,n)=>e&t^e&n^t&n,Kd=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]),Jd=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Xd=new Uint32Array(64);class Yd extends qd{constructor(){super(64,32,8,!1),this.A=0|Jd[0],this.B=0|Jd[1],this.C=0|Jd[2],this.D=0|Jd[3],this.E=0|Jd[4],this.F=0|Jd[5],this.G=0|Jd[6],this.H=0|Jd[7]}get(){const{A:e,B:t,C:n,D:r,E:a,F:s,G:i,H:o}=this;return[e,t,n,r,a,s,i,o]}set(e,t,n,r,a,s,i,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|a,this.F=0|s,this.G=0|i,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)Xd[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Xd[e-15],n=Xd[e-2],r=si(t,7)^si(t,18)^t>>>3,a=si(n,17)^si(n,19)^n>>>10;Xd[e]=a+Xd[e-7]+r+Xd[e-16]|0}let{A:n,B:r,C:a,D:s,E:i,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(si(i,6)^si(i,11)^si(i,25))+Zd(i,o,c)+Kd[e]+Xd[e]|0,u=(si(n,2)^si(n,13)^si(n,22))+Wd(n,r,a)|0;l=c,c=o,o=i,i=s+t|0,s=a,a=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,a=a+this.C|0,s=s+this.D|0,i=i+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,a,s,i,o,c,l)}roundClean(){Xd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Qd=ci((()=>new Yd));const ep="Ethereum Signed Message:\n";function tp(e,t){const n="string"==typeof e?Os(e):e.raw instanceof Uint8Array?e.raw:As(e.raw);return ki(Di([Os(`${ep}${n.length}`),n]),t)}const np=1;class rp extends ss{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class ap extends ss{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class sp extends ss{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class ip extends ss{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${np}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}function op(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:s}=e;if(t<=0)throw new Eu({chainId:t});if(s&&!_i(s))throw new Zs({address:s});if(r)throw new ss("`gasPrice` is not a valid EIP-1559 Transaction attribute.");if(a&&a>2n**256n-1n)throw new kl({maxFeePerGas:a});if(n&&a&&n>a)throw new Ml({maxFeePerGas:a,maxPriorityFeePerGas:n})}function cp(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>Fs(e))):e.blobs,a=[];for(const e of r)a.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?a:a.map((e=>Es(e)))}function lp(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>Fs(e))):e.blobs,a="string"==typeof e.commitments[0]?e.commitments.map((e=>Fs(e))):e.commitments,s=[];for(let e=0;e<r.length;e++){const n=r[e],i=a[e];s.push(Uint8Array.from(t.computeBlobKzgProof(n,i)))}return"bytes"===n?s:s.map((e=>Es(e)))}const up=32,dp=4096,pp=up*dp,hp=2*pp-1-1*dp*2;function mp(e){const{data:t,kzg:n,to:r}=e,a=e.blobs??function(e){const t=e.to??("string"==typeof e.data?"hex":"bytes"),n="string"==typeof e.data?Fs(e.data):e.data,r=ps(n);if(!r)throw new ap;if(r>hp)throw new rp({maxSize:hp,size:r});const a=[];let s=!0,i=0;for(;s;){const e=yc(new Uint8Array(pp));let t=0;for(;t<dp;){const r=n.slice(i,i+(up-1));if(e.pushByte(0),e.pushBytes(r),r.length<31){e.pushByte(128),s=!1;break}t++,i+=31}a.push(e)}return"bytes"===t?a.map((e=>e.bytes)):a.map((e=>Es(e.bytes)))}({data:t,to:r}),s=e.commitments??cp({blobs:a,kzg:n,to:r}),i=e.proofs??lp({blobs:a,commitments:s,kzg:n,to:r}),o=[];for(let e=0;e<a.length;e++)o.push({blob:a[e],commitment:s[e],proof:i[e]});return o}function fp(e){const{commitment:t,version:n=1}=e,r=e.to??("string"==typeof t?"hex":"bytes"),a=function(e,t){const n=t||"hex",r=Qd(ds(e,{strict:!1})?As(e):e);return"bytes"===n?r:vs(r)}(t,"bytes");return a.set([n],0),"bytes"===r?a:Es(a)}function yp(e){if(!e||0===e.length)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:a}=e[n];for(let e=0;e<a.length;e++)if(a[e].length-2!=64)throw new jc({storageKey:a[e]});if(!_i(r,{strict:!1}))throw new Zs({address:r});t.push([r,a])}return t}function bp(e,t){const n=Xl(e);return"eip1559"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:s,value:i,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,data:u}=e;op(e);const d=yp(l),p=[vs(n),a?vs(a):"0x",c?vs(c):"0x",o?vs(o):"0x",r?vs(r):"0x",s??"0x",i?vs(i):"0x",u??"0x",d,...gp(e,t)];return Fi(["0x02",Pp(p)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:r,data:a,nonce:s,to:i,value:o,accessList:c,gasPrice:l}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:s}=e;if(t<=0)throw new Eu({chainId:t});if(s&&!_i(s))throw new Zs({address:s});if(n||a)throw new ss("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new kl({maxFeePerGas:r})}(e);const u=yp(c),d=[vs(n),s?vs(s):"0x",l?vs(l):"0x",r?vs(r):"0x",i??"0x",o?vs(o):"0x",a??"0x",u,...gp(e,t)];return Fi(["0x01",Pp(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:s,value:i,maxFeePerBlobGas:o,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{blobVersionedHashes:t}=e;if(t){if(0===t.length)throw new ap;for(const e of t){const t=ps(e),n=Ns(zo(e,0,1));if(32!==t)throw new sp({hash:e,size:t});if(n!==np)throw new ip({hash:e,version:n})}}op(e)}(e);let p=e.blobVersionedHashes,h=e.sidecars;if(e.blobs){const t="string"==typeof e.blobs[0]?e.blobs:e.blobs.map((e=>Es(e))),n=e.kzg,r=cp({blobs:t,kzg:n}),a=lp({blobs:t,commitments:r,kzg:n});p=function(e){const{commitments:t,version:n}=e,r=e.to??("string"==typeof t[0]?"hex":"bytes"),a=[];for(const e of t)a.push(fp({commitment:e,to:r,version:n}));return a}({commitments:r}),!1!==h&&(h=mp({blobs:t,commitments:r,proofs:a}))}const m=yp(u),f=[vs(n),a?vs(a):"0x",l?vs(l):"0x",c?vs(c):"0x",r?vs(r):"0x",s??"0x",i?vs(i):"0x",d??"0x",m,o?vs(o):"0x",p??[],...gp(e,t)],y=[],b=[],g=[];if(h)for(let e=0;e<h.length;e++){const{blob:t,commitment:n,proof:r}=h[e];y.push(t),b.push(n),g.push(r)}return Fi(["0x03",Pp(h?[f,y,b,g]:f)])}(e,t):function(e,t){const{chainId:n=0,gas:r,data:a,nonce:s,to:i,value:o,gasPrice:c}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:s,accessList:i}=e;if(s&&!_i(s))throw new Zs({address:s});if(void 0!==t&&t<=0)throw new Eu({chainId:t});if(n||a)throw new ss("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new kl({maxFeePerGas:r});if(i)throw new ss("`accessList` is not a valid Legacy Transaction attribute.")}(e);let l=[s?vs(s):"0x",c?vs(c):"0x",r?vs(r):"0x",i??"0x",o?vs(o):"0x",a??"0x"];if(t){const e=(()=>{if(t.v>=35n){return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n)}if(n>0)return BigInt(2*n)+BigInt(35n+t.v-27n);const e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new Bc({v:t.v});return e})();l=[...l,vs(e),t.r,t.s]}else n>0&&(l=[...l,vs(n),"0x","0x"]);return Pp(l)}(e,t)}function gp(e,t){const{r:n,s:r,v:a,yParity:s}=t??e;if(void 0===n)return[];if(void 0===r)return[];if(void 0===a&&void 0===s)return[];return["number"==typeof s?s?vs(1):"0x":0n===a?"0x":1n===a?vs(1):27n===a?"0x":vs(1),hs(n),hs(r)]}async function wp(e,{address:t,blockNumber:n,blockTag:r,storageKeys:a}){const s=r??"latest",i=void 0!==n?xs(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Ns(e.nonce):void 0,storageProof:e.storageProof?(t=e.storageProof,t.map((e=>({...e,value:BigInt(e.value)})))):void 0};var t}(await e.request({method:"eth_getProof",params:[t,a,i||s]}))}async function vp(e,{blockHash:t,blockNumber:n,blockTag:r,hash:a,index:s}){const i=r||"latest",o=void 0!==n?xs(n):void 0;let c=null;if(a?c=await e.request({method:"eth_getTransactionByHash",params:[a]}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,xs(s)]}):(o||i)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||i,xs(s)]})),!c)throw new Hc({blockHash:t,blockNumber:n,blockTag:i,hash:a,index:s});return(e.chain?.formatters?.transaction?.format||Bs)(c)}async function Cp(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!n)throw new zc({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||$s)(n)}const Ep="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";
1
+ import{JsonRpcProvider as e,StaticJsonRpcProvider as t,Web3Provider as n}from"@ethersproject/providers";import{create as r}from"zustand";import{arrayify as a,isBytesLike as s,hexlify as i,isBytes as o,isHexString as c,hexZeroPad as l,hexStripZeros as u,hexValue as d}from"@ethersproject/bytes";import{shallowCopy as p,deepCopy as h,resolveProperties as m}from"@ethersproject/properties";import{getAddress as f}from"@ethersproject/address";import{Signer as y}from"@ethersproject/abstract-signer";import{Buffer as b}from"buffer";import"@ethersproject/abstract-provider";import{Contract as g}from"@ethersproject/contracts";import"events";import{AddressZero as w}from"@ethersproject/constants";import{serialize as v}from"@ethersproject/transactions";function C(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var E,x;!function(e){e[e.MAINNET=1]="MAINNET",e[e.GOERLI=5]="GOERLI",e[e.BSC=56]="BSC",e[e.POLYGON=137]="POLYGON",e[e.ARBITRUM_ONE=42161]="ARBITRUM_ONE",e[e.AURORA=1313161554]="AURORA",e[e.OKCHAIN=66]="OKCHAIN",e[e.OPTIMISM=10]="OPTIMISM",e[e.AVALANCHE=43114]="AVALANCHE",e[e.CONFLUX=1030]="CONFLUX",e[e.BASE=8453]="BASE",e[e.LINEA=59144]="LINEA",e[e.SCROLL_ALPHA_TESTNET=534353]="SCROLL_ALPHA_TESTNET",e[e.SCROLL=534352]="SCROLL",e[e.MANTLE=5e3]="MANTLE",e[e.MANTA=169]="MANTA",e[e.BTR=200901]="BTR",e[e.OKB=196]="OKB"}(E||(E={})),function(e){e.injected="injected",e.BinanceChain="custom-bsc-injected",e.WalletConnect="walletconnect",e.Portis="portis",e.Gnosis="custom-gnosis",e.WalletLink="custom-walletlink",e.LedgerUSB="custom-ledger-usb",e.Ledger="custom-ledger",e.openBlock="custom-open-block",e.openBlockIframe="custom-open-block-iframe",e.GameStop="custom-game-stop",e.Nabox="custom-nabox",e.Bitkeep="custom-bitkeep",e.OneKey="custom-onekey",e.OKX="custom-okx",e.uAuth="custom-uauth",e.kuCoinWallet="custom-kucoin-wallet",e.frontier="custom-frontier",e.Blocto="custom-blocto",e.Rainbow="custom-rainbow",e.trust="custom-trust",e.tokenPocket="custom-token-pocket",e.Cyber="custom-cyber",e.uniPass="custom-uni-pass",e.Gate="custom-gate",e.Coin98="custom-coin-98",e.FoxWallet="custom-fox-wallet",e.Brave="custom-brave",e.Math="custom-math",e.ImToken="custom-im-token",e.Rabby="custom-rabby",e.SocialLogin="custom-social-login",e.Alchemy="custom-alchemy",e.Bybit="custom-bybit",e.Zerion="custom-zerion",e.Holdstation="custom-holdstation",e.SafePal="custom-safe-pal",e.EIP6963Prefix="custom-eip-6963-"}(x||(x={}));const k=()=>"undefined"!=typeof window&&"undefined"!=typeof navigator&&!!window.navigator?.hid,T=()=>"undefined"!=typeof window&&"undefined"!=typeof navigator&&window.navigator?.userAgent&&/(Android)/i.test(navigator.userAgent);function P(){return"undefined"!=typeof window&&"undefined"!=typeof navigator&&/iPhone|iPod|iOS/.test(navigator.userAgent)}function A(){return"undefined"!=typeof window&&"undefined"!=typeof navigator&&(/iPad/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)}const _=()=>P()||A(),D=()=>T()||_(),F=()=>{if("undefined"!=typeof window)return window},O=r((t=>({chainId:1,account:void 0,accounts:void 0,provider:void 0,walletType:void 0,connectLoading:!1,connectingType:void 0,connected:void 0,connectedWalletSpecial:void 0,disabledWalletKeyList:[],eip6963WalletList:[],startConnecting:e=>{t((()=>({connectLoading:!0,connectingType:e})))},setConnectedSpecial:e=>{t((()=>({connectedWalletSpecial:e})))},connectSuccess:async(e,n,r)=>{t((()=>({provider:e})));const{chainId:a}=await e.getNetwork(),s=await e.listAccounts(),[i]=s,{type:o}=n;let c=o===x.Gnosis;if(!c&&o===x.WalletConnect&&i){const e=await V();c=await e.getAccountIsSafe(a,i)}t((e=>({accounts:s,account:i,chainId:a,walletType:o,connected:{isAutoConnect:r,wallet:n,isSafe:c},connectedWalletSpecial:e.connectedWalletSpecial?.type===o?e.connectedWalletSpecial:void 0,connectLoading:!1,connectingType:void 0})))},connectFailed:()=>{t((()=>({connectLoading:!1,connectingType:void 0,accounts:void 0,account:void 0})))},accountsChanged:e=>{const[n]=e;t((()=>({accounts:e,account:n})))},chainIdChanged:e=>{t((()=>({chainId:e})))},setRpcUrlProvider:async(n,r)=>{const a=new e(n,r);let s=r;if(!s){const e=await a.getNetwork();s=e.chainId}t((()=>({provider:a,chainId:s,accounts:void 0,account:void 0,walletType:void 0,connected:void 0,connectedWalletSpecial:void 0})))},disconnect:async n=>{if(n){const r=new e(n),{chainId:a}=await r.getNetwork();t((()=>({provider:r,chainId:a,accounts:void 0,account:void 0,walletType:void 0,connected:void 0,connectedWalletSpecial:void 0,connectLoading:void 0,connectingType:void 0})))}else t((()=>({provider:void 0,accounts:void 0,account:void 0,walletType:void 0,connected:void 0,connectedWalletSpecial:void 0,connectLoading:void 0,connectingType:void 0})))},setDisabledWalletKeyList:e=>{t((()=>({disabledWalletKeyList:e})))}})));async function S(e){const{Web3Provider:t}=await import("@ethersproject/providers");return new t(e,"any")}async function M(e=null,t){let n=e||window.ethereum;if(n)await n.request({method:"eth_requestAccounts"});else if(window.web3)n=window.web3.currentProvider;else if(window.celo)n=window.celo;else{if(!window.BinanceChain)throw new Error("No Web3 Provider found");n=window.BinanceChain}return n.on("connect",t.connect),n.on("disconnect",t.disconnect),n.on("accountsChanged",t.accountsChanged),n.on("chainChanged",t.chainChanged),n.on("message",t.message),S(n)}function I(e,t){return e.request?e.request(t):e.send(t.method,t.params)}async function N({provider:e,addChainParameters:t}){try{return await I(e,{method:"wallet_addEthereumChain",params:[t]}),{result:!0}}catch(e){console.error(`[failed to add ${t.chainId}]: `,t,e)}return{result:!1}}async function U({addChainDirectly:e,addChainParameters:t,provider:n}){const r=n??O.getState().provider??window.ethereum;if(!r)return{result:!1};if(e)return N({provider:r,addChainParameters:t});const{chainId:a}=t;try{return await I(r,{method:"wallet_switchEthereumChain",params:[{chainId:a}]}),{result:!0}}catch(e){const{code:n}=e;if(4902===n||-32603===n)return N({provider:r,addChainParameters:t});console.error(`[failed to switch ${a}]: `,t,e)}return{result:!1}}const L=[{path:"m/44'/60'/x'/0/0",name:"Ledger Live"},{path:"m/44'/60'/0'/x",name:"Legacy"}];let B=!1,R=1;const j={};let G=!1;F()?.addEventListener("message",(e=>{"openblock-content-integration"===e.data.from&&(B=!0,Object.values(j).map((e=>e())))})),F()?.addEventListener("load",(()=>{setTimeout((()=>{G=!0,Object.values(j).map((e=>e()))}),1e3)}),{once:!0});const H=async()=>new Promise((e=>{B?e(!0):window.parent===window||G?e(!1):(R++,j[R]=()=>{e(B),delete j[R]})})),z=async(e,t)=>{const n=(await import("./provider-037ebaad.js")).default();return n.on("connect",t.connect),n.on("disconnect",t.disconnect),n.on("accountsChanged",t.accountsChanged),n.on("chainChanged",t.chainChanged),n.on("message",t.message),await n.request({method:"eth_requestAccounts"}),S(n)};function $(){return import("./index-fe388941.js")}function V(){return import("./index-9a6126a2.js")}function q(){return import("./uAuth-ed5c6c9d.js")}function Z(){return import("./portis-174647af.js")}function W(){return import("./walletLink-874673f7.js")}function K(){return import("./walletConnect-cd58a591.js")}function J(){return import("./blocto-25c5c258.js")}function X(){return import("./rainbow-04d94d50.js")}function Y(){return import("./index-113ad8f8.js")}function Q(){return import("./index-bf37e2d0.js")}function ee(){return import("./index-91b1499d.js")}function te(){return import("./index-7152dee7.js")}function ne(){return import("./index-76297fe2.js")}function re(){return import("./index-ff33ebed.js")}async function ae(e,t){return(await J()).default(e,t)}async function se(e,t){return(await Z()).default(e,t)}async function ie(e,t){return(await W()).default(e,t)}async function oe(e,t){return(await K()).default(e,t)}async function ce(e,t){return(await X()).default(e,t)}async function le(e,t){return(await Y()).default(e,t)}async function ue(e,t){return(await Q()).default(e,t)}async function de(e,t){return(await ee()).default(e,t)}async function pe(e,t){return(await te()).default(e,t)}async function he(e,t){return(await ne()).default(e,t)}async function me(e,t){return(await re()).default(e,t)}var fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function be(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var ge={},we={},ve=Ce;function Ce(e,t){if(!e)throw new Error(t||"Assertion failed")}Ce.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var Ee={exports:{}};"function"==typeof Object.create?Ee.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ee.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var xe=ve,ke=Ee.exports;function Te(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function Pe(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Ae(e){return 1===e.length?"0"+e:e}function _e(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}we.inherits=ke,we.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a<e.length;a+=2)n.push(parseInt(e[a]+e[a+1],16))}else for(var r=0,a=0;a<e.length;a++){var s=e.charCodeAt(a);s<128?n[r++]=s:s<2048?(n[r++]=s>>6|192,n[r++]=63&s|128):Te(e,a)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++a)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(a=0;a<e.length;a++)n[a]=0|e[a];return n},we.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=Ae(e[n].toString(16));return t},we.htonl=Pe,we.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var a=e[r];"little"===t&&(a=Pe(a)),n+=_e(a.toString(16))}return n},we.zero2=Ae,we.zero8=_e,we.join32=function(e,t,n,r){var a=n-t;xe(a%4==0);for(var s=new Array(a/4),i=0,o=t;i<s.length;i++,o+=4){var c;c="big"===r?e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3]:e[o+3]<<24|e[o+2]<<16|e[o+1]<<8|e[o],s[i]=c>>>0}return s},we.split32=function(e,t){for(var n=new Array(4*e.length),r=0,a=0;r<e.length;r++,a+=4){var s=e[r];"big"===t?(n[a]=s>>>24,n[a+1]=s>>>16&255,n[a+2]=s>>>8&255,n[a+3]=255&s):(n[a+3]=s>>>24,n[a+2]=s>>>16&255,n[a+1]=s>>>8&255,n[a]=255&s)}return n},we.rotr32=function(e,t){return e>>>t|e<<32-t},we.rotl32=function(e,t){return e<<t|e>>>32-t},we.sum32=function(e,t){return e+t>>>0},we.sum32_3=function(e,t,n){return e+t+n>>>0},we.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},we.sum32_5=function(e,t,n,r,a){return e+t+n+r+a>>>0},we.sum64=function(e,t,n,r){var a=e[t],s=r+e[t+1]>>>0,i=(s<r?1:0)+n+a;e[t]=i>>>0,e[t+1]=s},we.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},we.sum64_lo=function(e,t,n,r){return t+r>>>0},we.sum64_4_hi=function(e,t,n,r,a,s,i,o){var c=0,l=t;return c+=(l=l+r>>>0)<t?1:0,c+=(l=l+s>>>0)<s?1:0,e+n+a+i+(c+=(l=l+o>>>0)<o?1:0)>>>0},we.sum64_4_lo=function(e,t,n,r,a,s,i,o){return t+r+s+o>>>0},we.sum64_5_hi=function(e,t,n,r,a,s,i,o,c,l){var u=0,d=t;return u+=(d=d+r>>>0)<t?1:0,u+=(d=d+s>>>0)<s?1:0,u+=(d=d+o>>>0)<o?1:0,e+n+a+i+c+(u+=(d=d+l>>>0)<l?1:0)>>>0},we.sum64_5_lo=function(e,t,n,r,a,s,i,o,c,l){return t+r+s+o+l>>>0},we.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},we.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},we.shr64_hi=function(e,t,n){return e>>>n},we.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0};var De={},Fe=we,Oe=ve;function Se(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}De.BlockHash=Se,Se.prototype.update=function(e,t){if(e=Fe.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=Fe.join32(e,0,e.length-n,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},Se.prototype.digest=function(e){return this.update(this._pad()),Oe(null===this.pending),this._digest(e)},Se.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var a=1;a<n;a++)r[a]=0;if(e<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)r[a++]=0;r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=e>>>24&255,r[a++]=e>>>16&255,r[a++]=e>>>8&255,r[a++]=255&e}else for(r[a++]=255&e,r[a++]=e>>>8&255,r[a++]=e>>>16&255,r[a++]=e>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,s=8;s<this.padLength;s++)r[a++]=0;return r};var Me={},Ie={},Ne=we.rotr32;function Ue(e,t,n){return e&t^~e&n}function Le(e,t,n){return e&t^e&n^t&n}function Be(e,t,n){return e^t^n}Ie.ft_1=function(e,t,n,r){return 0===e?Ue(t,n,r):1===e||3===e?Be(t,n,r):2===e?Le(t,n,r):void 0},Ie.ch32=Ue,Ie.maj32=Le,Ie.p32=Be,Ie.s0_256=function(e){return Ne(e,2)^Ne(e,13)^Ne(e,22)},Ie.s1_256=function(e){return Ne(e,6)^Ne(e,11)^Ne(e,25)},Ie.g0_256=function(e){return Ne(e,7)^Ne(e,18)^e>>>3},Ie.g1_256=function(e){return Ne(e,17)^Ne(e,19)^e>>>10};var Re=we,je=De,Ge=Ie,He=Re.rotl32,ze=Re.sum32,$e=Re.sum32_5,Ve=Ge.ft_1,qe=je.BlockHash,Ze=[1518500249,1859775393,2400959708,3395469782];function We(){if(!(this instanceof We))return new We;qe.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Re.inherits(We,qe);var Ke=We;We.blockSize=512,We.outSize=160,We.hmacStrength=80,We.padLength=64,We.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=He(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var a=this.h[0],s=this.h[1],i=this.h[2],o=this.h[3],c=this.h[4];for(r=0;r<n.length;r++){var l=~~(r/20),u=$e(He(a,5),Ve(l,s,i,o),c,n[r],Ze[l]);c=o,o=i,i=He(s,30),s=a,a=u}this.h[0]=ze(this.h[0],a),this.h[1]=ze(this.h[1],s),this.h[2]=ze(this.h[2],i),this.h[3]=ze(this.h[3],o),this.h[4]=ze(this.h[4],c)},We.prototype._digest=function(e){return"hex"===e?Re.toHex32(this.h,"big"):Re.split32(this.h,"big")};var Je=we,Xe=De,Ye=Ie,Qe=ve,et=Je.sum32,tt=Je.sum32_4,nt=Je.sum32_5,rt=Ye.ch32,at=Ye.maj32,st=Ye.s0_256,it=Ye.s1_256,ot=Ye.g0_256,ct=Ye.g1_256,lt=Xe.BlockHash,ut=[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];function dt(){if(!(this instanceof dt))return new dt;lt.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=ut,this.W=new Array(64)}Je.inherits(dt,lt);var pt=dt;dt.blockSize=512,dt.outSize=256,dt.hmacStrength=192,dt.padLength=64,dt.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=tt(ct(n[r-2]),n[r-7],ot(n[r-15]),n[r-16]);var a=this.h[0],s=this.h[1],i=this.h[2],o=this.h[3],c=this.h[4],l=this.h[5],u=this.h[6],d=this.h[7];for(Qe(this.k.length===n.length),r=0;r<n.length;r++){var p=nt(d,it(c),rt(c,l,u),this.k[r],n[r]),h=et(st(a),at(a,s,i));d=u,u=l,l=c,c=et(o,p),o=i,i=s,s=a,a=et(p,h)}this.h[0]=et(this.h[0],a),this.h[1]=et(this.h[1],s),this.h[2]=et(this.h[2],i),this.h[3]=et(this.h[3],o),this.h[4]=et(this.h[4],c),this.h[5]=et(this.h[5],l),this.h[6]=et(this.h[6],u),this.h[7]=et(this.h[7],d)},dt.prototype._digest=function(e){return"hex"===e?Je.toHex32(this.h,"big"):Je.split32(this.h,"big")};var ht=we,mt=pt;function ft(){if(!(this instanceof ft))return new ft;mt.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}ht.inherits(ft,mt);var yt=ft;ft.blockSize=512,ft.outSize=224,ft.hmacStrength=192,ft.padLength=64,ft.prototype._digest=function(e){return"hex"===e?ht.toHex32(this.h.slice(0,7),"big"):ht.split32(this.h.slice(0,7),"big")};var bt=we,gt=De,wt=ve,vt=bt.rotr64_hi,Ct=bt.rotr64_lo,Et=bt.shr64_hi,xt=bt.shr64_lo,kt=bt.sum64,Tt=bt.sum64_hi,Pt=bt.sum64_lo,At=bt.sum64_4_hi,_t=bt.sum64_4_lo,Dt=bt.sum64_5_hi,Ft=bt.sum64_5_lo,Ot=gt.BlockHash,St=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Mt(){if(!(this instanceof Mt))return new Mt;Ot.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=St,this.W=new Array(160)}bt.inherits(Mt,Ot);var It=Mt;function Nt(e,t,n,r,a){var s=e&n^~e&a;return s<0&&(s+=4294967296),s}function Ut(e,t,n,r,a,s){var i=t&r^~t&s;return i<0&&(i+=4294967296),i}function Lt(e,t,n,r,a){var s=e&n^e&a^n&a;return s<0&&(s+=4294967296),s}function Bt(e,t,n,r,a,s){var i=t&r^t&s^r&s;return i<0&&(i+=4294967296),i}function Rt(e,t){var n=vt(e,t,28)^vt(t,e,2)^vt(t,e,7);return n<0&&(n+=4294967296),n}function jt(e,t){var n=Ct(e,t,28)^Ct(t,e,2)^Ct(t,e,7);return n<0&&(n+=4294967296),n}function Gt(e,t){var n=vt(e,t,14)^vt(e,t,18)^vt(t,e,9);return n<0&&(n+=4294967296),n}function Ht(e,t){var n=Ct(e,t,14)^Ct(e,t,18)^Ct(t,e,9);return n<0&&(n+=4294967296),n}function zt(e,t){var n=vt(e,t,1)^vt(e,t,8)^Et(e,t,7);return n<0&&(n+=4294967296),n}function $t(e,t){var n=Ct(e,t,1)^Ct(e,t,8)^xt(e,t,7);return n<0&&(n+=4294967296),n}function Vt(e,t){var n=vt(e,t,19)^vt(t,e,29)^Et(e,t,6);return n<0&&(n+=4294967296),n}function qt(e,t){var n=Ct(e,t,19)^Ct(t,e,29)^xt(e,t,6);return n<0&&(n+=4294967296),n}Mt.blockSize=1024,Mt.outSize=512,Mt.hmacStrength=192,Mt.padLength=128,Mt.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var a=Vt(n[r-4],n[r-3]),s=qt(n[r-4],n[r-3]),i=n[r-14],o=n[r-13],c=zt(n[r-30],n[r-29]),l=$t(n[r-30],n[r-29]),u=n[r-32],d=n[r-31];n[r]=At(a,s,i,o,c,l,u,d),n[r+1]=_t(a,s,i,o,c,l,u,d)}},Mt.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,r=this.h[0],a=this.h[1],s=this.h[2],i=this.h[3],o=this.h[4],c=this.h[5],l=this.h[6],u=this.h[7],d=this.h[8],p=this.h[9],h=this.h[10],m=this.h[11],f=this.h[12],y=this.h[13],b=this.h[14],g=this.h[15];wt(this.k.length===n.length);for(var w=0;w<n.length;w+=2){var v=b,C=g,E=Gt(d,p),x=Ht(d,p),k=Nt(d,p,h,m,f),T=Ut(d,p,h,m,f,y),P=this.k[w],A=this.k[w+1],_=n[w],D=n[w+1],F=Dt(v,C,E,x,k,T,P,A,_,D),O=Ft(v,C,E,x,k,T,P,A,_,D);v=Rt(r,a),C=jt(r,a),E=Lt(r,a,s,i,o),x=Bt(r,a,s,i,o,c);var S=Tt(v,C,E,x),M=Pt(v,C,E,x);b=f,g=y,f=h,y=m,h=d,m=p,d=Tt(l,u,F,O),p=Pt(u,u,F,O),l=o,u=c,o=s,c=i,s=r,i=a,r=Tt(F,O,S,M),a=Pt(F,O,S,M)}kt(this.h,0,r,a),kt(this.h,2,s,i),kt(this.h,4,o,c),kt(this.h,6,l,u),kt(this.h,8,d,p),kt(this.h,10,h,m),kt(this.h,12,f,y),kt(this.h,14,b,g)},Mt.prototype._digest=function(e){return"hex"===e?bt.toHex32(this.h,"big"):bt.split32(this.h,"big")};var Zt=we,Wt=It;function Kt(){if(!(this instanceof Kt))return new Kt;Wt.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Zt.inherits(Kt,Wt);var Jt=Kt;Kt.blockSize=1024,Kt.outSize=384,Kt.hmacStrength=192,Kt.padLength=128,Kt.prototype._digest=function(e){return"hex"===e?Zt.toHex32(this.h.slice(0,12),"big"):Zt.split32(this.h.slice(0,12),"big")},Me.sha1=Ke,Me.sha224=yt,Me.sha256=pt,Me.sha384=Jt,Me.sha512=It;var Xt={},Yt=we,Qt=De,en=Yt.rotl32,tn=Yt.sum32,nn=Yt.sum32_3,rn=Yt.sum32_4,an=Qt.BlockHash;function sn(){if(!(this instanceof sn))return new sn;an.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function on(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function cn(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function ln(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}Yt.inherits(sn,an),Xt.ripemd160=sn,sn.blockSize=512,sn.outSize=160,sn.hmacStrength=192,sn.padLength=64,sn.prototype._update=function(e,t){for(var n=this.h[0],r=this.h[1],a=this.h[2],s=this.h[3],i=this.h[4],o=n,c=r,l=a,u=s,d=i,p=0;p<80;p++){var h=tn(en(rn(n,on(p,r,a,s),e[un[p]+t],cn(p)),pn[p]),i);n=i,i=s,s=en(a,10),a=r,r=h,h=tn(en(rn(o,on(79-p,c,l,u),e[dn[p]+t],ln(p)),hn[p]),d),o=d,d=u,u=en(l,10),l=c,c=h}h=nn(this.h[1],a,u),this.h[1]=nn(this.h[2],s,d),this.h[2]=nn(this.h[3],i,o),this.h[3]=nn(this.h[4],n,c),this.h[4]=nn(this.h[0],r,l),this.h[0]=h},sn.prototype._digest=function(e){return"hex"===e?Yt.toHex32(this.h,"little"):Yt.split32(this.h,"little")};var un=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],dn=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],pn=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],hn=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],mn=we,fn=ve;function yn(e,t,n){if(!(this instanceof yn))return new yn(e,t,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(mn.toArray(t,n))}var bn=yn;yn.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),fn(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},yn.prototype.update=function(e,t){return this.inner.update(e,t),this},yn.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=ge;t.utils=we,t.common=De,t.sha=Me,t.ripemd=Xt,t.hmac=bn,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}();var gn=C({__proto__:null,default:ge},[ge]),wn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,r,s,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new a(r,s||e,i),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],o]:e._events[c].push(o):(e._events[c]=o,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,r,a=[];if(0===this._eventsCount)return a;for(r in e=this._events)t.call(e,r)&&a.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},o.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,s=r.length,i=new Array(s);a<s;a++)i[a]=r[a].fn;return i},o.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},o.prototype.emit=function(e,t,r,a,s,i){var o=n?n+e:e;if(!this._events[o])return!1;var c,l,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,a),!0;case 5:return u.fn.call(u.context,t,r,a,s),!0;case 6:return u.fn.call(u.context,t,r,a,s,i),!0}for(l=1,c=new Array(d-1);l<d;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var p,h=u.length;for(l=0;l<h;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,r);break;case 4:u[l].fn.call(u[l].context,t,r,a);break;default:if(!c)for(p=1,c=new Array(d-1);p<d;p++)c[p-1]=arguments[p];u[l].fn.apply(u[l].context,c)}}return!0},o.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},o.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},o.prototype.removeListener=function(e,t,r,a){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return i(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||a&&!o.once||r&&o.context!==r||i(this,s);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||a&&!o[c].once||r&&o[c].context!==r)&&l.push(o[c]);l.length?this._events[s]=1===l.length?l[0]:l:i(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o}(wn);var vn=wn.exports;const Cn="function"==typeof atob,En="function"==typeof btoa,xn="function"==typeof Buffer,kn="function"==typeof TextDecoder?new TextDecoder:void 0,Tn="function"==typeof TextEncoder?new TextEncoder:void 0,Pn=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),An=(e=>{let t={};return Pn.forEach(((e,n)=>t[e]=n)),t})(),_n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Dn=String.fromCharCode.bind(String),Fn="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),On=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Sn=En?e=>btoa(e):xn?e=>Buffer.from(e,"binary").toString("base64"):e=>{let t,n,r,a,s="";const i=e.length%3;for(let i=0;i<e.length;){if((n=e.charCodeAt(i++))>255||(r=e.charCodeAt(i++))>255||(a=e.charCodeAt(i++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|a,s+=Pn[t>>18&63]+Pn[t>>12&63]+Pn[t>>6&63]+Pn[63&t]}return i?s.slice(0,i-3)+"===".substring(i):s},Mn=xn?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(Dn.apply(null,e.subarray(n,n+4096)));return Sn(t.join(""))},In=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Dn(192|t>>>6)+Dn(128|63&t):Dn(224|t>>>12&15)+Dn(128|t>>>6&63)+Dn(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Dn(240|t>>>18&7)+Dn(128|t>>>12&63)+Dn(128|t>>>6&63)+Dn(128|63&t)},Nn=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Un=xn?e=>Buffer.from(e,"utf8").toString("base64"):Tn?e=>Mn(Tn.encode(e)):e=>Sn((e=>e.replace(Nn,In))(e)),Ln=e=>((e,t=!1)=>t?(e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")))(Un(e)):Un(e))(e,!0),Bn=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Rn=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Dn(55296+(t>>>10))+Dn(56320+(1023&t));case 3:return Dn((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Dn((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},jn=Cn?e=>atob(On(e)):xn?e=>Buffer.from(e,"base64").toString("binary"):e=>{if(e=e.replace(/\s+/g,""),!_n.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n,r,a="";for(let s=0;s<e.length;)t=An[e.charAt(s++)]<<18|An[e.charAt(s++)]<<12|(n=An[e.charAt(s++)])<<6|(r=An[e.charAt(s++)]),a+=64===n?Dn(t>>16&255):64===r?Dn(t>>16&255,t>>8&255):Dn(t>>16&255,t>>8&255,255&t);return a},Gn=xn?e=>Fn(Buffer.from(e,"base64")):e=>Fn(jn(e).split("").map((e=>e.charCodeAt(0)))),Hn=xn?e=>Buffer.from(e,"base64").toString("utf8"):kn?e=>kn.decode(Gn(e)):e=>(e=>e.replace(Bn,Rn))(jn(e)),zn=e=>Hn((e=>On(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))))(e));function $n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vn(e){if(Array.isArray(e))return $n(e)}function qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zn(e,t,n){return Zn=ar()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&Qn(a,n.prototype),a},Zn.apply(null,arguments)}function Wn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Kn(e,t,n){return t&&Wn(e.prototype,t),n&&Wn(e,n),e}function Jn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xn(e){return Xn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xn(e)}function Yn(e,t){return!t||"object"!==tr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Qn(e,t){return Qn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qn(e,t)}function er(e){return Vn(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||nr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tr(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function nr(e,t){if(e){if("string"==typeof e)return $n(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$n(e,t):void 0}}function rr(e){var t="function"==typeof Map?new Map:void 0;return rr=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Zn(e,arguments,Xn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Qn(n,e)},rr(e)}function ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ar=function(){return!!e})()}var sr,ir=Object.defineProperty,or=function(e,t,n){return function(e,t,n){t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!=(void 0===t?"undefined":tr(t))?t+"":t,n),n};function cr(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}function lr(){return function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t}()}function ur(e,t,n){return{id:n||cr(),jsonrpc:"2.0",method:e,params:t||[]}}Jn(sr={},"PARSE_ERROR",{code:-32700,message:"Parse error"}),Jn(sr,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),Jn(sr,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),Jn(sr,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),Jn(sr,"INTERNAL_ERROR",{code:-32603,message:"Internal error"}),Jn(sr,"SERVER_ERROR",{code:-32e3,message:"Server error"});var dr=["eth_requestAccounts","eth_accounts","eth_chainId","eth_signTransaction","eth_sendTransaction","eth_sign","personal_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_watchAsset"];function pr(){return("undefined"==typeof process?"undefined":tr(process))<"u"&&tr(process.versions)<"u"&&tr(process.versions.node)<"u"}var hr="hex",mr="utf8";function fr(e){return e.replace(/^0x/,"")}function yr(e){return gr(Buffer.from(fr(e),hr))}function br(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.toString(hr);return t?function(e){return e.startsWith("0x")?e:"0x".concat(e)}(n):n}(wr(e),t)}function gr(e){return new Uint8Array(e)}function wr(e){return function(e){return ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)}(e)}function vr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=[];return t.forEach((function(e){return r=r.concat(Array.from(e))})),new Uint8Array(er(r))}function Cr(e){return function(e){return e.toString(mr)}(wr(e))}function Er(e){return yr(e).buffer}function xr(e,t){return br(new Uint8Array(e),!t)}function kr(e){return wr(new Uint8Array(e))}function Tr(e){var t="0x0";return"number"==typeof e&&(t="0x".concat(e.toString(16))),"string"==typeof e&&(t=e.startsWith("0x")?e:"0x0"),t}var Pr={16:10,24:12,32:14},Ar=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],_r=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Dr=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Fr=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Or=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Sr=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Mr=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Ir=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Nr=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Ur=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Lr=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Br=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Rr=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],jr=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Gr=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Hr(e){return parseInt("".concat(e))===e}function zr(e){if(!Hr(e.length))return!1;for(var t=0;t<e.length;t++)if(!Hr(e[t])||e[t]<0||e[t]>255)return!1;return!0}function $r(e){return new Uint8Array(e)}function Vr(e){for(var t=[],n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);return t}function qr(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!zr(e))throw new Error("Array contains invalid value");return new Uint8Array(e)}if(Hr(e.length)&&zr(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function Zr(e,t,n,r,a){(null!=r||null!=a)&&(e=e.slice?e.slice(r,a):Array.prototype.slice.call(e,r,a)),t.set(e,n)}var Wr=function(){function e(t){qn(this,e),or(this,"key"),or(this,"_Ke"),or(this,"_Kd"),this.key=qr(t,!0),this._prepare()}return Kn(e,[{key:"_prepare",value:function(){var e=Pr[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var n,r=4*(e+1),a=this.key.length/4,s=Vr(this.key),i=0;i<a;i++)n=i>>2,this._Ke[n][i%4]=s[i],this._Kd[e-n][i%4]=s[i];for(var o,c=0,l=a;l<r;){if(o=s[a-1],s[0]^=_r[o>>16&255]<<24^_r[o>>8&255]<<16^_r[255&o]<<8^_r[o>>24&255]^Ar[c]<<24,c+=1,8!=a)for(var u=1;u<a;u++)s[u]^=s[u-1];else{for(var d=1;d<a/2;d++)s[d]^=s[d-1];o=s[a/2-1],s[a/2]^=_r[255&o]^_r[o>>8&255]<<8^_r[o>>16&255]<<16^_r[o>>24&255]<<24;for(var p=a/2+1;p<a;p++)s[p]^=s[p-1]}for(var h=0,m=void 0,f=void 0;h<a&&l<r;)m=l>>2,f=l%4,this._Ke[m][f]=s[h],this._Kd[e-m][f]=s[h++],l++}for(var y=1;y<e;y++)for(var b=0;b<4;b++)o=this._Kd[y][b],this._Kd[y][b]=Br[o>>24&255]^Rr[o>>16&255]^jr[o>>8&255]^Gr[255&o]}},{key:"encrypt",value:function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,n=[0,0,0,0],r=Vr(e),a=0;a<4;a++)r[a]^=this._Ke[0][a];for(var s=1;s<t;s++){for(var i=0;i<4;i++)n[i]=Fr[r[i]>>24&255]^Or[r[(i+1)%4]>>16&255]^Sr[r[(i+2)%4]>>8&255]^Mr[255&r[(i+3)%4]]^this._Ke[s][i];r=n.slice()}for(var o,c=$r(16),l=0;l<4;l++)o=this._Ke[t][l],c[4*l]=255&(_r[r[l]>>24&255]^o>>24),c[4*l+1]=255&(_r[r[(l+1)%4]>>16&255]^o>>16),c[4*l+2]=255&(_r[r[(l+2)%4]>>8&255]^o>>8),c[4*l+3]=255&(_r[255&r[(l+3)%4]]^o);return c}},{key:"decrypt",value:function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,n=[0,0,0,0],r=Vr(e),a=0;a<4;a++)r[a]^=this._Kd[0][a];for(var s=1;s<t;s++){for(var i=0;i<4;i++)n[i]=Ir[r[i]>>24&255]^Nr[r[(i+3)%4]>>16&255]^Ur[r[(i+2)%4]>>8&255]^Lr[255&r[(i+1)%4]]^this._Kd[s][i];r=n.slice()}for(var o,c=$r(16),l=0;l<4;l++)o=this._Kd[t][l],c[4*l]=255&(Dr[r[l]>>24&255]^o>>24),c[4*l+1]=255&(Dr[r[(l+3)%4]>>16&255]^o>>16),c[4*l+2]=255&(Dr[r[(l+2)%4]>>8&255]^o>>8),c[4*l+3]=255&(Dr[255&r[(l+1)%4]]^o);return c}}]),e}(),Kr=function(){function e(t,n){if(qn(this,e),or(this,"_aes"),or(this,"_lastCipherblock"),n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else n=new Uint8Array(16);this._lastCipherblock=qr(n,!0),this._aes=new Wr(t)}return Kn(e,[{key:"encrypt",value:function(e){if(e=qr(e),e.length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=$r(e.length),n=$r(16),r=0;r<e.length;r+=16){Zr(e,n,0,r,r+16);for(var a=0;a<16;a++)n[a]^=this._lastCipherblock[a];this._lastCipherblock=this._aes.encrypt(n),Zr(this._lastCipherblock,t,r)}return t}},{key:"decrypt",value:function(e){if(e=qr(e),e.length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=$r(e.length),n=$r(16),r=0;r<e.length;r+=16){Zr(e,n,0,r,r+16),n=this._aes.decrypt(n);for(var a=0;a<16;a++)t[r+a]=n[a]^this._lastCipherblock[a];Zr(e,this._lastCipherblock,0,r,r+16)}return t}}]),e}(),Jr=[[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16],[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15],[14,14,14,14,14,14,14,14,14,14,14,14,14,14],[13,13,13,13,13,13,13,13,13,13,13,13,13],[12,12,12,12,12,12,12,12,12,12,12,12],[11,11,11,11,11,11,11,11,11,11,11],[10,10,10,10,10,10,10,10,10,10],[9,9,9,9,9,9,9,9,9],[8,8,8,8,8,8,8,8],[7,7,7,7,7,7,7],[6,6,6,6,6,6],[5,5,5,5,5],[4,4,4,4],[3,3,3],[2,2],[1]],Xr={pad:function(e){var t=Jr[e.byteLength%16||0],n=new Uint8Array(e.byteLength+t.length);return n.set(e),n.set(t,e.byteLength),n},unpad:function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}},Yr="sha256";function Qr(e,t){return yr(ge.hmac(gn[Yr],e).update(t).digest("hex"))}function ea(e){var t=function(e){for(var t=new Uint8Array(e),n=0;n<e;++n)t[n]=Math.floor(256*Math.random());return wr(t)}(e);return gr(t)}function ta(e){return function(e){return gr(e).buffer}(wr(ea((e||256)/8)))}function na(e,t,n){var r=gr(kr(t)),a=gr(kr(n||ta(128))),s=br(a,!1),i=function(e){return gr(Buffer.from(e,mr))}(JSON.stringify(e)),o=function(e,t,n){var r=new Kr(t,e),a=Xr.pad(n),s=r.encrypt(a);return new Uint8Array(s)}(a,r,i);return{data:br(o,!1),hmac:br(Qr(r,vr(o,a)),!1),iv:s}}function ra(e,t){var n=gr(kr(t));if(!n)throw new Error("Missing key: required for decryption");if(!function(e,t){var n=yr(e.data),r=yr(e.iv),a=br(yr(e.hmac),!1),s=br(Qr(t,vr(n,r)),!1);return fr(a)===fr(s)}(e,n))return null;var r,a=yr(e.data),s=function(e,t,n){var r=new Kr(t,e).decrypt(n),a=new Uint8Array(r);return Xr.unpad(a)}(yr(e.iv),n,a),i=Cr(s);try{r=JSON.parse(i)}catch(e){return null}return r}function aa(e){var t=null;try{var n=window.localStorage.getItem(e);n&&(t=JSON.parse(n))}catch(e){t=null}return t}function sa(e){try{window.localStorage.removeItem(e)}catch(e){}}function ia(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}}var oa=function e(){var t=this;qn(this,e),or(this,"events",new vn),or(this,"on",(function(e,n){return t.events.on(e,n)})),or(this,"once",(function(e,n){return t.events.once(e,n)})),or(this,"off",(function(e,n){return t.events.off(e,n)})),or(this,"removeListener",(function(e,n){return t.events.removeListener(e,n)})),or(this,"removeAllListeners",(function(){return t.events.removeAllListeners()}))},ca={error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).error.apply(r,["[ERROR]"].concat(er(t)))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).warn.apply(r,["[WARN]"].concat(er(t)))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).info.apply(r,["[INFO]"].concat(er(t)))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).log.apply(r,["[DEBUG]"].concat(er(t)))}},la=("undefined"==typeof window?"undefined":tr(window))<"u";function ua(){for(var e=function(e){var t=a[e],r=["itemprop","property","name"].map((function(e){return t.getAttribute(e)})).filter((function(e){return!!e&&n.includes(e)}));if(r.length&&r){var s=t.getAttribute("content");if(s)return{v:s}}},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var a=document.getElementsByTagName("meta"),s=0;s<a.length;s++){var i=e(s);if("object"===tr(i))return i.v}return""}function da(){if(la){var e=function(){var e=ua("name","og:site_name","og:title","twitter:title");return e||(e=document.title),e}(),t=ua("description","og:description","twitter:description","keywords"),n=location.origin,r=function(){for(var e=document.getElementsByTagName("link"),t=[],n=0;n<e.length;n++){var r=e[n],a=r.getAttribute("rel");if(a&&a.toLowerCase().indexOf("icon")>-1){var s=r.getAttribute("href");if(s)if(-1===s.toLowerCase().indexOf("https:")&&-1===s.toLowerCase().indexOf("http:")&&0!==s.indexOf("//")){var i=location.protocol+"//"+location.host;if(0===s.indexOf("/"))i+=s;else{var o=location.pathname.split("/");o.pop(),i+=o.join("/")+"/"+s}t.push(i)}else if(0===s.indexOf("//")){var c=location.protocol+s;t.push(c)}else t.push(s)}}return t}();return{description:t,url:n,icons:r,name:e}}}var pa=function(e){function t(e,n){var r;return qn(this,t),r=function(e,t,n){return t=Xn(t),Yn(e,ar()?Reflect.construct(t,n||[],Xn(e).constructor):t.apply(e,n))}(this,t,[n]),or(r,"code"),r.code=e,Object.setPrototypeOf(r,(function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}(this,t)?this.constructor:void 0).prototype),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qn(e,t)}(t,e),Kn(t,[{key:"toString",value:function(){return"".concat(this.message," (").concat(this.code,")")}}]),t}(rr(Error)),ha={CLOSE_MODAL:{code:100001,message:"[binance-w3w] User closed modal"},REJECT_SESSION:{code:100002,message:"[binance-w3w] User rejected connection"},PROVIDER_NOT_READY:{code:100003,message:"[binance-w3w] Provider is not ready"},CONNECTING:{code:100004,message:"[binance-w3w] Already processing session request. Please wait"},CONNECTED:{code:100005,message:"[binance-w3w] Already connected"}},ma={REJECT_ERR:{code:200001,message:"[binance-w3w] User rejected the operation"},METHOD_NOT_SUPPORT:{code:200002,message:"[binance-w3w] Does not support calling method"},MISSING_RESPONSE:{code:200003,message:"[binance-w3w] Missing JSON RPC response"},INVALID_PARAM:{code:200004,message:"[binance-w3w] Invalid request param"}},fa={INTERNAL_ERR:{code:300001,message:"[binance-w3w] Internal error"}},ya=function(){return!!(tr(window.navigator)>"u"?"":navigator.userAgent).match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i)},ba=function(){return!!navigator.userAgent.match(/Android/i)},ga=function(e,t){var n="appId=xoqXxUSMRccLCrZNRebmzj&startPagePath=L3BhZ2VzL2Rhc2hib2FyZC1uZXcvaW5kZXg=";if(t){var r=Ln("wc=".concat(encodeURIComponent(t),"&isDeepLink=true&id=").concat(+new Date));n="".concat(n,"&startPageQuery=").concat(r)}var a="//app.binance.com";return e?"bnc:".concat(a,"/mp/app?").concat(n):"https:".concat(a,"/?_dp=").concat(Ln("/mp/app?".concat(n)))},wa=function(e){var t=ya(),n=ga(!0,e);if(t){var r=document.createElement("a");r.href=n,document.body.appendChild(r),r.click(),document.body.removeChild(r)}},va=function(){try{var e,t;return!0===(null===(t=window)||void 0===t||null===(e=t.ethereum)||void 0===e?void 0:e.isBinance)}catch(e){return!1}};function Ca(e){e=atob(e);const t=[];for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));return a(t)}function Ea(e){e=a(e);let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}let xa=!1,ka=!1;const Ta={debug:1,default:2,info:2,warning:3,error:4,off:5};let Pa=Ta.default,Aa=null;const _a=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var Da,Fa;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(Da||(Da={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(Fa||(Fa={}));const Oa="0123456789abcdef";class Sa{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==Ta[n]&&this.throwArgumentError("invalid log level name","logLevel",e),Pa>Ta[n]||console.log.apply(console,t)}debug(...e){this._log(Sa.levels.DEBUG,e)}info(...e){this._log(Sa.levels.INFO,e)}warn(...e){this._log(Sa.levels.WARNING,e)}makeError(e,t,n){if(ka)return this.makeError("censored error",t,{});t||(t=Sa.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=Oa[t[e]>>4],n+=Oa[15&t[e]];r.push(e+"=Uint8Array(0x"+n+")")}else r.push(e+"="+JSON.stringify(t))}catch(t){r.push(e+"="+JSON.stringify(n[e].toString()))}})),r.push(`code=${t}`),r.push(`version=${this.version}`);const a=e;let s="";switch(t){case Fa.NUMERIC_FAULT:{s="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":s+="-"+t;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case Fa.CALL_EXCEPTION:case Fa.INSUFFICIENT_FUNDS:case Fa.MISSING_NEW:case Fa.NONCE_EXPIRED:case Fa.REPLACEMENT_UNDERPRICED:case Fa.TRANSACTION_REPLACED:case Fa.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const i=new Error(e);return i.reason=a,i.code=t,Object.keys(n).forEach((function(e){i[e]=n[e]})),i}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,Sa.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(e){_a&&this.throwError("platform missing String.prototype.normalize",Sa.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_a})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,Sa.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,Sa.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,Sa.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,Sa.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",Sa.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",Sa.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",Sa.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Aa||(Aa=new Sa("logger/5.7.0")),Aa}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Sa.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),xa){if(!e)return;this.globalLogger().throwError("error censorship permanent",Sa.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ka=!!e,xa=!!t}static setLogLevel(e){const t=Ta[e.toLowerCase()];null!=t?Pa=t:Sa.globalLogger().warn("invalid log level - "+e)}static from(e){return new Sa(e)}}Sa.errors=Fa,Sa.levels=Da;const Ma=new Sa("strings/5.7.0");var Ia,Na;function Ua(e,t,n,r,a){if(e===Na.BAD_PREFIX||e===Na.UNEXPECTED_CONTINUE){let e=0;for(let r=t+1;r<n.length&&n[r]>>6==2;r++)e++;return e}return e===Na.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Ia||(Ia={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(Na||(Na={}));const La=Object.freeze({error:function(e,t,n,r,a){return Ma.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:Ua,replace:function(e,t,n,r,a){return e===Na.OVERLONG?(r.push(a),0):(r.push(65533),Ua(e,t,n))}});function Ba(e,t){null==t&&(t=La.error),e=a(e);const n=[];let r=0;for(;r<e.length;){const a=e[r++];if(a>>7==0){n.push(a);continue}let s=null,i=null;if(192==(224&a))s=1,i=127;else if(224==(240&a))s=2,i=2047;else{if(240!=(248&a)){r+=t(128==(192&a)?Na.UNEXPECTED_CONTINUE:Na.BAD_PREFIX,r-1,e,n);continue}s=3,i=65535}if(r-1+s>=e.length){r+=t(Na.OVERRUN,r-1,e,n);continue}let o=a&(1<<8-s-1)-1;for(let a=0;a<s;a++){let a=e[r];if(128!=(192&a)){r+=t(Na.MISSING_CONTINUE,r,e,n),o=null;break}o=o<<6|63&a,r++}null!==o&&(o>1114111?r+=t(Na.OUT_OF_RANGE,r-1-s,e,n,o):o>=55296&&o<=57343?r+=t(Na.UTF16_SURROGATE,r-1-s,e,n,o):o<=i?r+=t(Na.OVERLONG,r-1-s,e,n,o):n.push(o))}return n}function Ra(e,t=Ia.current){t!=Ia.current&&(Ma.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){t++;const a=e.charCodeAt(t);if(t>=e.length||56320!=(64512&a))throw new Error("invalid utf-8 string");const s=65536+((1023&r)<<10)+(1023&a);n.push(s>>18|240),n.push(s>>12&63|128),n.push(s>>6&63|128),n.push(63&s|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return a(n)}function ja(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Ga(e,t){return'"'+Ba(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?ja(e):ja(55296+((e-=65536)>>10&1023))+ja(56320+(1023&e))})).join("")+'"'}function Ha(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function za(e,t){return Ha(Ba(e,t))}function $a(e,t=Ia.current){return Ba(Ra(e,t))}var Va=function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function o(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}c((r=r.apply(e,t||[])).next())}))};function qa(e,t){return Va(this,void 0,void 0,(function*(){null==t&&(t={});const n={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(n.mode=e.mode),e.cache&&(n.cache=e.cache),e.credentials&&(n.credentials=e.credentials),e.redirect&&(n.redirect=e.redirect),e.referrer&&(n.referrer=e.referrer)}const r=yield fetch(e,n),s=yield r.arrayBuffer(),i={};return r.headers.forEach?r.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):r.headers.keys().forEach((e=>{i[e.toLowerCase()]=r.headers.get(e)})),{headers:i,statusCode:r.status,statusMessage:r.statusText,body:a(new Uint8Array(s))}}))}var Za=function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function o(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}c((r=r.apply(e,t||[])).next())}))};const Wa=new Sa("web/5.7.1");function Ka(e){return new Promise((t=>{setTimeout(t,e)}))}function Ja(e,t){if(null==e)return null;if("string"==typeof e)return e;if(s(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return za(e)}catch(e){}return i(e)}return e}function Xa(e,t,n){const r="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Wa.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const a="object"==typeof e?e.throttleCallback:null,s="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Wa.assertArgument(s>0&&s%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const i="object"==typeof e&&!!e.errorPassThrough,o={};let c=null;const l={method:"GET"};let u=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||Wa.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)o[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Wa.throwError("basic authentication requires a secure https url",Sa.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;o.authorization={key:"Authorization",value:"Basic "+Ea(Ra(t))}}null!=e.skipFetchSetup&&(l.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(l.fetchOptions=p(e.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),m=c?c.match(h):null;if(m)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":m[1]||"text/plain"},body:m[2]?Ca(m[3]):(f=m[3],Ra(f.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return n&&(t=n(e.body,e)),Promise.resolve(t)}catch(e){Wa.throwError("processing response error",Sa.errors.SERVER_ERROR,{body:Ja(m[1],m[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var f;t&&(l.method="POST",l.body=t,null==o["content-type"]&&(o["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==o["content-length"]&&(o["content-length"]={key:"Content-Length",value:String(t.length)}));const y={};Object.keys(o).forEach((e=>{const t=o[e];y[t.key]=t.value})),l.headers=y;const b=function(){let e=null;return{promise:new Promise((function(t,n){d&&(e=setTimeout((()=>{null!=e&&(e=null,n(Wa.makeError("timeout",Sa.errors.TIMEOUT,{requestBody:Ja(l.body,y["content-type"]),requestMethod:l.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),g=function(){return Za(this,void 0,void 0,(function*(){for(let e=0;e<r;e++){let t=null;try{if(t=yield qa(c,l),e<r)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===l.method&&e.match(/^https:/)){c=t.headers.location;continue}}else if(429===t.statusCode){let n=!0;if(a&&(n=yield a(e,c)),n){let n=0;const r=t.headers["retry-after"];n="string"==typeof r&&r.match(/^[1-9][0-9]*$/)?1e3*parseInt(r):s*parseInt(String(Math.random()*Math.pow(2,e))),yield Ka(n);continue}}}catch(e){t=e.response,null==t&&(b.cancel(),Wa.throwError("missing response",Sa.errors.SERVER_ERROR,{requestBody:Ja(l.body,y["content-type"]),requestMethod:l.method,serverError:e,url:c}))}let o=t.body;if(u&&304===t.statusCode?o=null:!i&&(t.statusCode<200||t.statusCode>=300)&&(b.cancel(),Wa.throwError("bad response",Sa.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Ja(o,t.headers?t.headers["content-type"]:null),requestBody:Ja(l.body,y["content-type"]),requestMethod:l.method,url:c})),n)try{const e=yield n(o,t);return b.cancel(),e}catch(n){if(n.throttleRetry&&e<r){let t=!0;if(a&&(t=yield a(e,c)),t){const t=s*parseInt(String(Math.random()*Math.pow(2,e)));yield Ka(t);continue}}b.cancel(),Wa.throwError("processing response error",Sa.errors.SERVER_ERROR,{body:Ja(o,t.headers?t.headers["content-type"]:null),error:n,requestBody:Ja(l.body,y["content-type"]),requestMethod:l.method,url:c})}return b.cancel(),o}return Wa.throwError("failed response",Sa.errors.SERVER_ERROR,{requestBody:Ja(l.body,y["content-type"]),requestMethod:l.method,url:c})}))}();return Promise.race([b.promise,g])}function Ya(e,t,n){let r=null;if(null!=t){r=Ra(t);const n="string"==typeof e?{url:e}:p(e);if(n.headers){const e=0!==Object.keys(n.headers).filter((e=>"content-type"===e.toLowerCase())).length;e||(n.headers=p(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return Xa(e,r,((e,t)=>{let r=null;if(null!=e)try{r=JSON.parse(za(e))}catch(t){Wa.throwError("invalid JSON",Sa.errors.SERVER_ERROR,{body:e,error:t})}return n&&(r=n(r,t)),r}))}function Qa(e,t){return t||(t={}),null==(t=p(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(n,r){let a=null,s=!1;const i=()=>!s&&(s=!0,a&&clearTimeout(a),!0);t.timeout&&(a=setTimeout((()=>{i()&&r(new Error("timeout"))}),t.timeout));const o=t.retryLimit;let c=0;!function a(){return e().then((function(e){if(void 0!==e)i()&&n(e);else if(t.oncePoll)t.oncePoll.once("poll",a);else if(t.onceBlock)t.onceBlock.once("block",a);else if(!s){if(c++,c>o)return void(i()&&r(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(a,e)}return null}),(function(e){i()&&r(e)}))}()}))}function es(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}class ts extends t{getNetwork(){return"object"==typeof this.network&&"number"==typeof this.network.chainId?Promise.resolve(this.network):"number"==typeof this.network&&this.network?Promise.resolve({chainId:this.network,name:"unknown"}):super.getNetwork()}send(e,t){const n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:h(n),provider:this});const r=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(r&&this._cache[e])return this._cache[e];const a=Ya({...this.connection,url:this.rpcUrl||this.connection?.url},JSON.stringify(n),es).then((e=>(this.emit("debug",{action:"response",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:n,provider:this}),e}));return r&&(this._cache[e]=a,setTimeout((()=>{this._cache[e]=null}),0)),a}}function ns(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const rs=ns({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",apiUrl:"https://blockscout.acala.network/api"}},testnet:!1}),as=e=>e;class ss extends Error{constructor(e,t={}){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:"viem@2.8.6"});const n=t.cause instanceof ss?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof ss&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://viem.sh${r}${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join("\n"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return is(this,e)}}function is(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?is(e.cause,t):t?null:e}class os extends ss{constructor({max:e,min:t,signed:n,size:r,value:a}){super(`Number "${a}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class cs extends ss{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}}class ls extends ss{constructor(e){super(`Hex value "${e}" 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 us extends ss{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function ds(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function ps(e){return ds(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function hs(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,r=0;for(let e=0;e<n.length-1&&"0"===n["left"===t?e:n.length-e-1].toString();e++)r++;return n="left"===t?n.slice(r):n.slice(0,n.length-r),"string"==typeof e?(1===n.length&&"right"===t&&(n=`${n}0`),`0x${n.length%2==1?`0${n}`:n}`):n}class ms extends ss{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class fs extends ss{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class ys extends ss{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${t} ${n} long, but is ${e} ${n} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}function bs(e,{dir:t,size:n=32}={}){return"string"==typeof e?gs(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new fs({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let a=0;a<n;a++){const s="right"===t;r[s?a:n-a-1]=e[s?a:e.length-a-1]}return r}(e,{dir:t,size:n})}function gs(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new fs({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}const ws=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function vs(e,t={}){return"number"==typeof e||"bigint"==typeof e?xs(e,t):"string"==typeof e?Ts(e,t):"boolean"==typeof e?Cs(e,t):Es(e,t)}function Cs(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(Ss(n,{size:t.size}),bs(n,{size:t.size})):n}function Es(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=ws[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(Ss(r,{size:t.size}),bs(r,{dir:"right",size:t.size})):r}function xs(e,t={}){const{signed:n,size:r}=t,a=BigInt(e);let s;r?s=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i="bigint"==typeof s&&n?-s-1n:0;if(s&&a>s||a<i){const t="bigint"==typeof e?"n":"";throw new os({max:s?`${s}${t}`:void 0,min:`${i}${t}`,signed:n,size:r,value:`${e}${t}`})}const o=`0x${(n&&a<0?(1n<<BigInt(8*r))+BigInt(a):a).toString(16)}`;return r?bs(o,{size:r}):o}const ks=new TextEncoder;function Ts(e,t={}){return Es(ks.encode(e),t)}const Ps=new TextEncoder;function As(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=xs(e,t);return Fs(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return Ss(n,{size:t.size}),bs(n,{size:t.size});return n}(e,t):ds(e)?Fs(e,t):Os(e,t)}const _s={zero:48,nine:57,A:65,F:70,a:97,f:102};function Ds(e){return e>=_s.zero&&e<=_s.nine?e-_s.zero:e>=_s.A&&e<=_s.F?e-(_s.A-10):e>=_s.a&&e<=_s.f?e-(_s.a-10):void 0}function Fs(e,t={}){let n=e;t.size&&(Ss(n,{size:t.size}),n=bs(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const a=r.length/2,s=new Uint8Array(a);for(let e=0,t=0;e<a;e++){const n=Ds(r.charCodeAt(t++)),a=Ds(r.charCodeAt(t++));if(void 0===n||void 0===a)throw new ss(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);s[e]=16*n+a}return s}function Os(e,t={}){const n=Ps.encode(e);return"number"==typeof t.size?(Ss(n,{size:t.size}),bs(n,{dir:"right",size:t.size})):n}function Ss(e,{size:t}){if(ps(e)>t)throw new us({givenSize:ps(e),maxSize:t})}function Ms(e,t){const n="string"==typeof t?{to:t}:t,r=n.to;return"number"===r?Ns(e,n):"bigint"===r?Is(e,n):"string"===r?function(e,t={}){let n=Fs(e);t.size&&(Ss(n,{size:t.size}),n=hs(n,{dir:"right"}));return(new TextDecoder).decode(n)}(e,n):"boolean"===r?function(e,t={}){let n=e;t.size&&(Ss(n,{size:t.size}),n=hs(n));if("0x00"===hs(n))return!1;if("0x01"===hs(n))return!0;throw new ls(n)}(e,n):Fs(e,n)}function Is(e,t={}){const{signed:n}=t;t.size&&Ss(e,{size:t.size});const r=BigInt(e);if(!n)return r;const a=(e.length-2)/2;return r<=(1n<<8n*BigInt(a)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*a,"f")}`)-1n}function Ns(e,t={}){return Number(Is(e,t))}function Us(e,t){return({exclude:n,format:r})=>({exclude:n,format:e=>{const a=t(e);if(n)for(const e of n)delete a[e];return{...a,...r(e)}},type:e})}const Ls={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function Bs(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Ns(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Ns(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Ls[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("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip1559"===t.type&&delete t.maxFeePerBlobGas,t}const Rs=Us("transaction",Bs);function js(e){const t=e.transactions?.map((e=>"string"==typeof e?e:Bs(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):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 Gs=Us("block",js);function Hs(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 zs={"0x0":"reverted","0x1":"success"};function $s(e){const t={...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((e=>Hs(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Ns(e.transactionIndex):null,status:e.status?zs[e.status]:null,type:e.type?Ls[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const Vs=Us("transactionReceipt",$s),qs={block:Gs({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=Bs(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Is(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:Rs({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Is(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Vs({format:e=>({l1GasPrice:e.l1GasPrice?Is(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?Is(e.l1GasUsed):null,l1Fee:e.l1Fee?Is(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})};class Zs extends ss{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}class Ws extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,t){return super.set(e,t),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}function Ks(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Js(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 Xs(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 Ys(e,t){Js(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Qs=BigInt(2**32-1),ei=BigInt(32);function ti(e,t=!1){return t?{h:Number(e&Qs),l:Number(e>>ei&Qs)}:{h:0|Number(e>>ei&Qs),l:0|Number(e&Qs)}}function ni(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let a=0;a<e.length;a++){const{h:s,l:i}=ti(e[a],t);[n[a],r[a]]=[s,i]}return[n,r]}const ri=e=>e instanceof Uint8Array,ai=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),si=(e,t)=>e<<32-t|e>>>t;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function ii(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!ri(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class oi{clone(){return this._cloneInto()}}function ci(e){const t=t=>e().update(ii(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const[li,ui,di]=[[],[],[]],pi=BigInt(0),hi=BigInt(1),mi=BigInt(2),fi=BigInt(7),yi=BigInt(256),bi=BigInt(113);for(let e=0,t=hi,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],li.push(2*(5*r+n)),ui.push((e+1)*(e+2)/2%64);let a=pi;for(let e=0;e<7;e++)t=(t<<hi^(t>>fi)*bi)%yi,t&mi&&(a^=hi<<(hi<<BigInt(e))-hi);di.push(a)}const[gi,wi]=ni(di,!0),vi=(e,t,n)=>n>32?((e,t,n)=>t<<n-32|e>>>64-n)(e,t,n):((e,t,n)=>e<<n|t>>>32-n)(e,t,n),Ci=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)
2
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class Ei extends oi{constructor(e,t,n,r=!1,a=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ks(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}keccak(){!function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,a=(t+2)%10,s=n[a],i=n[a+1],o=vi(s,i,1)^n[r],c=Ci(s,i,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=c}let t=e[2],a=e[3];for(let n=0;n<24;n++){const r=ui[n],s=vi(t,a,r),i=Ci(t,a,r),o=li[n];t=e[o],a=e[o+1],e[o]=s,e[o+1]=i}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=gi[r],e[1]^=wi[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Xs(this);const{blockLen:t,state:n}=this,r=(e=ii(e)).length;for(let a=0;a<r;){const s=Math.min(t-this.pos,r-a);for(let t=0;t<s;t++)n[this.pos++]^=e[a++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,0!=(128&t)&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){Xs(this,!1),Js(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,a=e.length;r<a;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,a-r);e.set(t.subarray(this.posOut,this.posOut+s),r),this.posOut+=s,r+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ks(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Ys(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:t,suffix:n,outputLen:r,rounds:a,enableXOF:s}=this;return e||(e=new Ei(t,n,r,s,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=n,e.outputLen=r,e.enableXOF=s,e.destroyed=this.destroyed,e}}const xi=((e,t,n)=>ci((()=>new Ei(t,e,n))))(1,136,32);function ki(e,t){const n=t||"hex",r=xi(ds(e,{strict:!1})?As(e):e);return"bytes"===n?r:vs(r)}function Ti(e,t){const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=ki(Os(n),"bytes"),a=(t?n.substring(`${t}0x`.length):n).split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&a[e]&&(a[e]=a[e].toUpperCase()),(15&r[e>>1])>=8&&a[e+1]&&(a[e+1]=a[e+1].toUpperCase());return`0x${a.join("")}`}const Pi=/^0x[a-fA-F0-9]{40}$/,Ai=new Ws(8192);function _i(e,{strict:t=!0}={}){if(Ai.has(e))return Ai.get(e);const n=!(!Pi.test(e)||e.toLowerCase()!==e&&t&&Ti(e)!==e);return Ai.set(e,n),n}function Di(e){return"string"==typeof e[0]?Fi(e):function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(e)}function Fi(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}class Oi extends Error{constructor(e,t={}){const n=t.cause instanceof Oi?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof Oi&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...n?[`Details: ${n}`]:[],"Version: abitype@1.0.0"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}}function Si(e,t){const n=e.exec(t);return n?.groups}const Mi=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ii=/^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)?$/,Ni=/^\(.+?\).*?$/,Ui=/^tuple(?<array>(\[(\d*)\])*)$/;function Li(e){let t=e.type;if(Ui.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){t+=Li(e.components[r]),r<n-1&&(t+=", ")}const r=Si(Ui,e.type);return t+=`)${r?.array??""}`,Li({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Bi(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=Li(e[r]),r!==n-1&&(t+=", ")}return t}const Ri=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function ji(e){return Ri.test(e)}function Gi(e){return Si(Ri,e)}const Hi=new Set(["memory","indexed","storage","calldata"]),zi=new Set(["calldata","memory","storage"]);class $i extends Oi{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Vi extends Oi{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class qi extends Oi{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class Zi extends Oi{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Wi extends Oi{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Ki extends Oi{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Ji extends Oi{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class Xi extends Oi{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Yi extends Oi{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Qi extends Oi{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class eo extends Oi{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class to extends Oi{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}const no=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}]]),ro=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,ao=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,so=/^u?int$/;function io(e,t){const n=function(e,t){return t?`${t}:${e}`:e}(e,t?.type);if(no.has(n))return no.get(n);const r=Ni.test(e),a=Si(r?ao:ro,e);if(!a)throw new Zi({param:e});if(a.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||Mi.test(e)||Ii.test(e)||lo.test(e)}(a.name))throw new Wi({param:e,name:a.name});const s=a.name?{name:a.name}:{},i="indexed"===a.modifier?{indexed:!0}:{},o=t?.structs??{};let c,l={};if(r){c="tuple";const e=oo(a.type),t=[],n=e.length;for(let r=0;r<n;r++)t.push(io(e[r],{structs:o}));l={components:t}}else if(a.type in o)c="tuple",l={components:o[a.type]};else if(so.test(a.type))c=`${a.type}256`;else if(c=a.type,"struct"!==t?.type&&!co(c))throw new Vi({type:c});if(a.modifier){if(!t?.modifiers?.has?.(a.modifier))throw new Ki({param:e,type:t?.type,modifier:a.modifier});if(zi.has(a.modifier)&&!function(e,t){return t||"bytes"===e||"string"===e||"tuple"===e}(c,!!a.array))throw new Ji({param:e,type:t?.type,modifier:a.modifier})}const u={type:`${c}${a.array??""}`,...s,...i,...l};return no.set(n,u),u}function oo(e,t=[],n="",r=0){const a=e.trim().length;for(let s=0;s<a;s++){const a=e[s],i=e.slice(s+1);switch(a){case",":return 0===r?oo(i,[...t,n.trim()]):oo(i,t,`${n}${a}`,r);case"(":return oo(i,t,`${n}${a}`,r+1);case")":return oo(i,t,`${n}${a}`,r-1);default:return oo(i,t,`${n}${a}`,r)}}if(""===n)return t;if(0!==r)throw new to({current:n,depth:r});return t.push(n.trim()),t}function co(e){return"address"===e||"bool"===e||"function"===e||"string"===e||Mi.test(e)||Ii.test(e)}const lo=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;const uo=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function po(e,t,n=new Set){const r=[],a=e.length;for(let s=0;s<a;s++){const a=e[s];if(Ni.test(a.type))r.push(a);else{const e=Si(uo,a.type);if(!e?.type)throw new Xi({abiParameter:a});const{array:s,type:i}=e;if(i in t){if(n.has(i))throw new eo({type:i});r.push({...a,type:`tuple${s??""}`,components:po(t[i]??[],t,new Set([...n,i]))})}else{if(!co(i))throw new $i({type:i});r.push(a)}}}return r}function ho(e){const t=[];if("string"==typeof e){const n=oo(e),r=n.length;for(let e=0;e<r;e++)t.push(io(n[e],{modifiers:Hi}))}else{const n=function(e){const t={},n=e.length;for(let r=0;r<n;r++){const n=e[r];if(!ji(n))continue;const a=Gi(n);if(!a)throw new Yi({signature:n,type:"struct"});const s=a.properties.split(";"),i=[],o=s.length;for(let e=0;e<o;e++){const t=s[e].trim();if(!t)continue;const n=io(t,{type:"struct"});i.push(n)}if(!i.length)throw new Qi({signature:n});t[a.name]=i}const r={},a=Object.entries(t),s=a.length;for(let e=0;e<s;e++){const[n,s]=a[e];r[n]=po(s,t)}return r}(e),r=e.length;for(let a=0;a<r;a++){const r=e[a];if(ji(r))continue;const s=oo(r),i=s.length;for(let e=0;e<i;e++)t.push(io(s[e],{modifiers:Hi,structs:n}))}}if(0===t.length)throw new qi({params:e});return t}function mo(e,t,n){return r=>e[t.name||n]?.(r)??t(e,r)}function fo(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new Lo(e.type);return`${e.name}(${yo(e.inputs,{includeName:t})})`}function yo(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${yo(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}class bo extends ss{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class go extends ss{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class wo extends ss{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${yo(t,{includeName:!0})})`,`Data: ${e} (${n} 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=e,this.params=t,this.size=n}}class vo extends ss{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class Co extends ss{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class Eo extends ss{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${ps(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class xo extends ss{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class ko extends ss{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class To extends ss{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class Po extends ss{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" 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=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class Ao extends ss{constructor(e,{docsPath:t}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class _o extends ss{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class Do extends ss{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class Fo extends ss{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${fo(e.abiItem)}\`, and`,`\`${t.type}\` in \`${fo(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class Oo extends ss{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class So extends ss{constructor({abiItem:e,data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for non-indexed event parameters.`].join("\n"),{metaMessages:[`Params: (${yo(n,{includeName:!0})})`,`Data: ${t} (${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=e,this.data=t,this.params=n,this.size=r}}class Mo extends ss{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${fo(e,{includeName:!0})}".`].join("\n")),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=e}}class Io extends ss{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class No extends ss{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class Uo extends ss{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class Lo extends ss{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class Bo extends ss{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const Ro=e=>ki(As(e));const jo=e=>{var t;return function(e){let t=!0,n="",r=0,a="",s=!1;for(let i=0;i<e.length;i++){const o=e[i];if(["(",")",","].includes(o)&&(t=!0),"("===o&&r++,")"===o&&r--,t)if(0!==r)" "!==o?(a+=o,n+=o):","!==e[i-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===o&&["event","function",""].includes(a))a="";else if(a+=o,")"===o){s=!0;break}}if(!s)throw new ss("Unable to normalize signature.");return a}("string"==typeof e?e:"function"===(t=e).type?`function ${t.name}(${Bi(t.inputs)})${t.stateMutability&&"nonpayable"!==t.stateMutability?` ${t.stateMutability}`:""}${t.outputs.length?` returns (${Bi(t.outputs)})`:""}`:"event"===t.type?`event ${t.name}(${Bi(t.inputs)})`:"error"===t.type?`error ${t.name}(${Bi(t.inputs)})`:"constructor"===t.type?`constructor(${Bi(t.inputs)})${"payable"===t.stateMutability?" payable":""}`:"fallback"===t.type?"fallback()":"receive() external payable")};function Go(e){return t=jo(e),Ro(t);var t}const Ho=Go;function zo(e,t,n,{strict:r}={}){return ds(e,{strict:!1})?function(e,t,n,{strict:r}={}){$o(e,t);const a=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&Vo(a,t,n);return a}(e,t,n,{strict:r}):qo(e,t,n,{strict:r})}function $o(e,t){if("number"==typeof t&&t>0&&t>ps(e)-1)throw new ms({offset:t,position:"start",size:ps(e)})}function Vo(e,t,n){if("number"==typeof t&&"number"==typeof n&&ps(e)!==n-t)throw new ms({offset:n,position:"end",size:ps(e)})}function qo(e,t,n,{strict:r}={}){$o(e,t);const a=e.slice(t,n);return r&&Vo(a,t,n),a}function Zo(e,t){if(e.length!==t.length)throw new xo({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Wo({param:e[r],value:t[r]}));return n}({params:e,values:t}),r=Ko(n);return 0===r.length?"0x":r}function Wo({param:e,value:t}){const n=Jo(e.type);if(n){const[r,a]=n;return function(e,{length:t,param:n}){const r=null===t;if(!Array.isArray(e))throw new Uo(e);if(!r&&e.length!==t)throw new Co({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let a=!1;const s=[];for(let t=0;t<e.length;t++){const r=Wo({param:n,value:e[t]});r.dynamic&&(a=!0),s.push(r)}if(r||a){const e=Ko(s);if(r){const t=xs(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?Di([t,e]):t}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:Di(s.map((({encoded:e})=>e)))}}(t,{length:r,param:{...e,type:a}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const r=[];for(let a=0;a<t.components.length;a++){const s=t.components[a],i=Wo({param:s,value:e[Array.isArray(e)?a:s.name]});r.push(i),i.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Ko(r):Di(r.map((({encoded:e})=>e)))}}(t,{param:e});if("address"===e.type)return function(e){if(!_i(e))throw new Zs({address:e});return{dynamic:!1,encoded:gs(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){return{dynamic:!1,encoded:gs(Cs(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:xs(e,{size:32,signed:t})}}(t,{signed:e.type.startsWith("int")})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=ps(e);if(!n){let t=e;return r%32!=0&&(t=gs(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:Di([gs(xs(r,{size:32})),t])}}if(r!==parseInt(n))throw new Eo({expectedSize:parseInt(n),value:e});return{dynamic:!1,encoded:gs(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=Ts(e),n=Math.ceil(ps(t)/32),r=[];for(let e=0;e<n;e++)r.push(gs(zo(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:Di([gs(xs(ps(t),{size:32})),...r])}}(t);throw new Io(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Ko(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:r,encoded:a}=e[n];t+=r?32:ps(a)}const n=[],r=[];let a=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:o}=e[s];i?(n.push(xs(t+a,{size:32})),r.push(o),a+=ps(o)):n.push(o)}return Di([...n,...r])}function Jo(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Xo=e=>zo(Go(e),0,4);function Yo(e){const{abi:t,args:n=[],name:r}=e,a=ds(r,{strict:!1}),s=t.filter((e=>a?"function"===e.type?Xo(e)===r:"event"===e.type&&Ho(e)===r:"name"in e&&e.name===r));if(0===s.length)return;if(1===s.length)return s[0];let i;for(const e of s){if(!("inputs"in e))continue;if(!n||0===n.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==n.length)continue;const t=n.every(((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&Qo(t,r)}));if(t){if(i&&"inputs"in i&&i.inputs){const t=ec(e.inputs,i.inputs,n);if(t)throw new Fo({abiItem:e,type:t[0]},{abiItem:i,type:t[1]})}i=e}}return i||s[0]}function Qo(e,t){const n=typeof e,r=t.type;switch(r){case"address":return _i(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every(((t,n)=>Qo(Object.values(e)[n],t))):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every((e=>Qo(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function ec(e,t,n){for(const r in e){const a=e[r],s=t[r];if("tuple"===a.type&&"tuple"===s.type&&"components"in a&&"components"in s)return ec(a.components,s.components,n[r]);const i=[a.type,s.type];if(!(!i.includes("address")||!i.includes("bytes20"))||(i.includes("address")&&i.includes("string")||!(!i.includes("address")||!i.includes("bytes")))&&_i(n[r],{strict:!1}))return i}}const tc="/docs/contract/encodeEventTopics";function nc(e){const{abi:t,eventName:n,args:r}=e;let a=t[0];if(n){const e=Yo({abi:t,name:n});if(!e)throw new Ao(n,{docsPath:tc});a=e}if("event"!==a.type)throw new Ao(void 0,{docsPath:tc});const s=fo(a),i=Ho(s);let o=[];if(r&&"inputs"in a){const e=a.inputs?.filter((e=>"indexed"in e&&e.indexed)),t=Array.isArray(r)?r:Object.values(r).length>0?e?.map((e=>r[e.name]))??[]:[];t.length>0&&(o=e?.map(((e,n)=>Array.isArray(t[n])?t[n].map(((r,a)=>rc({param:e,value:t[n][a]}))):t[n]?rc({param:e,value:t[n]}):null))??[])}return[i,...o]}function rc({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return ki(As(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Bo(e.type);return Zo([e],[t])}function ac(e,{method:t}){const n={};return"fallback"===e.transport.type&&e.transport.onResponse?.((({method:e,response:r,status:a,transport:s})=>{"success"===a&&t===e&&(n[r]=s.request)})),t=>n[t]||e.request}async function sc(e,t){const{address:n,abi:r,args:a,eventName:s,fromBlock:i,strict:o,toBlock:c}=t,l=ac(e,{method:"eth_newFilter"}),u=s?nc({abi:r,args:a,eventName:s}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:"bigint"==typeof i?xs(i):i,toBlock:"bigint"==typeof c?xs(c):c,topics:u}]});return{abi:r,args:a,eventName:s,id:d,request:l(d),strict:Boolean(o),type:"event"}}function ic(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const oc="/docs/contract/encodeFunctionData";function cc(e){const{abi:t,args:n,functionName:r}=e;let a=t[0];if(r){const e=Yo({abi:t,args:n,name:r});if(!e)throw new _o(r,{docsPath:oc});a=e}if("function"!==a.type)throw new _o(void 0,{docsPath:oc});const s=fo(a);return Fi([Xo(s),("inputs"in a&&a.inputs?Zo(a.inputs,n??[]):void 0)??"0x"])}const lc={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},uc={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},dc={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class pc extends ss{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class hc extends ss{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class mc extends ss{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const fc={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new mc({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new hc({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new pc({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new pc({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===1/0)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function yc(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(fc);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function bc(e,t={}){void 0!==t.size&&Ss(e,{size:t.size});return Is(Es(e,t),t)}function gc(e,t={}){let n=e;if(void 0!==t.size&&(Ss(n,{size:t.size}),n=hs(n)),n.length>1||n[0]>1)throw new cs(n);return Boolean(n[0])}function wc(e,t={}){void 0!==t.size&&Ss(e,{size:t.size});return Ns(Es(e,t),t)}function vc(e,t){const n="string"==typeof t?Fs(t):t,r=yc(n);if(0===ps(n)&&e.length>0)throw new vo;if(ps(t)&&ps(t)<32)throw new wo({data:"string"==typeof t?t:Es(t),params:e,size:ps(t)});let a=0;const s=[];for(let t=0;t<e.length;++t){const n=e[t];r.setPosition(a);const[i,o]=Cc(r,n,{staticPosition:0});a+=o,s.push(i)}return s}function Cc(e,t,{staticPosition:n}){const r=Jo(t.type);if(r){const[a,s]=r;return function(e,t,{length:n,staticPosition:r}){if(!n){const n=r+wc(e.readBytes(xc)),a=n+Ec;e.setPosition(n);const s=wc(e.readBytes(Ec)),i=kc(t);let o=0;const c=[];for(let n=0;n<s;++n){e.setPosition(a+(i?32*n:o));const[r,s]=Cc(e,t,{staticPosition:a});o+=s,c.push(r)}return e.setPosition(r+32),[c,32]}if(kc(t)){const a=r+wc(e.readBytes(xc)),s=[];for(let r=0;r<n;++r){e.setPosition(a+32*r);const[n]=Cc(e,t,{staticPosition:a});s.push(n)}return e.setPosition(r+32),[s,32]}let a=0;const s=[];for(let i=0;i<n;++i){const[n,i]=Cc(e,t,{staticPosition:r+a});a+=i,s.push(n)}return[s,a]}(e,{...t,type:s},{length:a,staticPosition:n})}if("tuple"===t.type)return function(e,t,{staticPosition:n}){const r=0===t.components.length||t.components.some((({name:e})=>!e)),a=r?[]:{};let s=0;if(kc(t)){const i=n+wc(e.readBytes(xc));for(let n=0;n<t.components.length;++n){const o=t.components[n];e.setPosition(i+s);const[c,l]=Cc(e,o,{staticPosition:i});s+=l,a[r?n:o?.name]=c}return e.setPosition(n+32),[a,32]}for(let i=0;i<t.components.length;++i){const o=t.components[i],[c,l]=Cc(e,o,{staticPosition:n});a[r?i:o?.name]=c,s+=l}return[a,s]}(e,t,{staticPosition:n});if("address"===t.type)return function(e){const t=e.readBytes(32);return[Ti(Es(qo(t,-20))),32]}(e);if("bool"===t.type)return function(e){return[gc(e.readBytes(32),{size:32}),32]}(e);if(t.type.startsWith("bytes"))return function(e,t,{staticPosition:n}){const[r,a]=t.type.split("bytes");if(!a){const t=wc(e.readBytes(32));e.setPosition(n+t);const r=wc(e.readBytes(32));if(0===r)return e.setPosition(n+32),["0x",32];const a=e.readBytes(r);return e.setPosition(n+32),[Es(a),32]}const s=Es(e.readBytes(parseInt(a),32));return[s,32]}(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return function(e,t){const n=t.type.startsWith("int"),r=parseInt(t.type.split("int")[1]||"256"),a=e.readBytes(32);return[r>48?bc(a,{signed:n}):wc(a,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=wc(e.readBytes(32)),r=t+n;e.setPosition(r);const a=wc(e.readBytes(32));if(0===a)return e.setPosition(t+32),["",32];const s=e.readBytes(a,32),i=function(e,t={}){let n=e;return void 0!==t.size&&(Ss(n,{size:t.size}),n=hs(n,{dir:"right"})),(new TextDecoder).decode(n)}(hs(s));return e.setPosition(t+32),[i,32]}(e,{staticPosition:n});throw new No(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Ec=32,xc=32;function kc(e){const{type:t}=e;if("string"===t)return!0;if("bytes"===t)return!0;if(t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(kc);const n=Jo(e.type);return!(!n||!kc({...e,type:n[1]}))}function Tc(e){const{abi:t,data:n}=e,r=zo(n,0,4);if("0x"===r)throw new vo;const a=[...t||[],uc,dc].find((e=>"error"===e.type&&r===Xo(fo(e))));if(!a)throw new ko(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?vc(a.inputs,zo(n,4)):void 0,errorName:a.name}}const Pc=(e,t,n)=>JSON.stringify(e,((e,n)=>{const r="bigint"==typeof n?n.toString():n;return"function"==typeof t?t(e,r):r}),n);function Ac({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map(((e,n)=>`${r&&e.name?`${e.name}: `:""}${"object"==typeof t[n]?Pc(t[n]):t[n]}`)).join(", ")})`}const _c={gwei:9,wei:18},Dc={ether:-9,wei:9};function Fc(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[a,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${a||"0"}${s?`.${s}`:""}`}function Oc(e,t="wei"){return Fc(e,_c[t])}function Sc(e,t="wei"){return Fc(e,Dc[t])}class Mc extends ss{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class Ic extends ss{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function Nc(e){return e.reduce(((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`),"")}function Uc(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}class Lc extends ss{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class Bc extends ss{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class Rc extends ss{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Uc(e),"}","","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","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class jc extends ss{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}class Gc extends ss{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:s,gasPrice:i,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=Uc({chain:r&&`${r?.name} (id: ${r?.id})`,from:t?.address,to:u,value:void 0!==d&&`${Oc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${Sc(i)} gwei`,maxFeePerGas:void 0!==o&&`${Sc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Sc(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class Hc extends ss{constructor({blockHash:e,blockNumber:t,blockTag:n,hash:r,index:a}){let s="Transaction";n&&void 0!==a&&(s=`Transaction at block time "${n}" at index "${a}"`),e&&void 0!==a&&(s=`Transaction at block hash "${e}" at index "${a}"`),t&&void 0!==a&&(s=`Transaction at block number "${t}" at index "${a}"`),r&&(s=`Transaction with hash "${r}"`),super(`${s} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class zc extends ss{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class $c extends ss{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}class Vc extends ss{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:s,gasPrice:i,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d,stateOverride:p}){const h=t?ic(t):void 0;let m=Uc({from:h?.address,to:u,value:void 0!==d&&`${Oc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${Sc(i)} gwei`,maxFeePerGas:void 0!==o&&`${Sc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Sc(c)} gwei`,nonce:l});p&&(m+=`\n${function(e){return e.reduce(((e,{address:t,...n})=>{let r=`${e} ${t}:\n`;return n.nonce&&(r+=` nonce: ${n.nonce}\n`),n.balance&&(r+=` balance: ${n.balance}\n`),n.code&&(r+=` code: ${n.code}\n`),n.state&&(r+=" state:\n",r+=Nc(n.state)),n.stateDiff&&(r+=" stateDiff:\n",r+=Nc(n.stateDiff)),r})," State Override:\n").slice(0,-1)}(p)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class qc extends ss{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:a,functionName:s,sender:i}){const o=Yo({abi:t,args:n,name:s}),c=o?Ac({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=Uc({address:r&&r,function:o?fo(o,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(s?.length??0).keys()].map((()=>" ")).join("")}${c}`,sender:i});super(e.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:e,docsPath:a,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",l].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=r,this.functionName=s,this.sender=i}}class Zc extends ss{constructor({abi:e,data:t,functionName:n,message:r}){let a,s,i,o,c;if(t&&"0x"!==t)try{s=Tc({abi:e,data:t});const{abiItem:n,errorName:r,args:a}=s;if("Error"===r)o=a[0];else if("Panic"===r){const[e]=a;o=lc[e]}else{const e=n?fo(n,{includeName:!0}):void 0,t=n&&a?Ac({abiItem:n,args:a,includeFunctionName:!1,includeName:!1}):void 0;i=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(e){a=e}else r&&(o=r);a instanceof ko&&(c=a.signature,i=[`Unable to decode signature "${c}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${c}.`]),super(o&&"execution reverted"!==o||c?[`The contract function "${n}" reverted with the following ${c?"signature":"reason"}:`,o||c].join("\n"):`The contract function "${n}" reverted.`,{cause:a,metaMessages:i}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=s,this.reason=o,this.signature=c}}class Wc extends ss{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class Kc extends ss{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class Jc extends ss{constructor({body:e,details:t,headers:n,status:r,url:a}){super("HTTP request failed.",{details:t,metaMessages:[r&&`Status: ${r}`,`URL: ${a}`,e&&`Request body: ${Pc(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=r,this.url=a}}class Xc extends ss{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${Pc(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}}class Yc extends ss{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${t}`,`Request body: ${Pc(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}class Qc extends ss{constructor(e,{code:t,docsPath:n,metaMessages:r,shortMessage:a}){super(a,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof Xc?e.code:t??-1}}class el extends Qc{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class tl extends Qc{constructor(e){super(e,{code:tl.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(tl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class nl extends Qc{constructor(e){super(e,{code:nl.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(nl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class rl extends Qc{constructor(e){super(e,{code:rl.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(rl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class al extends Qc{constructor(e){super(e,{code:al.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(al,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class sl extends Qc{constructor(e){super(e,{code:sl.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(sl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class il extends Qc{constructor(e){super(e,{code:il.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(il,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ol extends Qc{constructor(e){super(e,{code:ol.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ol,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class cl extends Qc{constructor(e){super(e,{code:cl.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(cl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class ll extends Qc{constructor(e){super(e,{code:ll.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(ll,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class ul extends Qc{constructor(e){super(e,{code:ul.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(ul,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class dl extends Qc{constructor(e){super(e,{code:dl.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(dl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class pl extends Qc{constructor(e){super(e,{code:pl.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(pl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class hl extends el{constructor(e){super(e,{code:hl.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(hl,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class ml extends el{constructor(e){super(e,{code:ml.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(ml,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class fl extends el{constructor(e){super(e,{code:fl.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(fl,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class yl extends el{constructor(e){super(e,{code:yl.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(yl,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class bl extends el{constructor(e){super(e,{code:bl.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(bl,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class gl extends el{constructor(e){super(e,{code:gl.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(gl,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class wl extends Qc{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const vl=3;function Cl(e,{abi:t,address:n,args:r,docsPath:a,functionName:s,sender:i}){const{code:o,data:c,message:l,shortMessage:u}=e instanceof Kc?e:e instanceof ss?e.walk((e=>"data"in e))||e.walk():{},d=e instanceof vo?new Wc({functionName:s}):[vl,sl.code].includes(o)&&(c||l||u)?new Zc({abi:t,data:"object"==typeof c?c.data:c,functionName:s,message:u??l}):e;return new qc(d,{abi:t,args:r,contractAddress:n,docsPath:a,functionName:s,sender:i})}class El extends ss{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:s,gasPrice:i,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=Uc({from:t?.address,to:u,value:void 0!==d&&`${Oc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${Sc(i)} gwei`,maxFeePerGas:void 0!==o&&`${Sc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Sc(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}class xl extends ss{constructor({cause:e,message:t}={}){const n=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(xl,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(xl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class kl extends ss{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Sc(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(kl,"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 Tl extends ss{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Sc(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(Tl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Pl extends ss{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(Pl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Al extends ss{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(Al,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class _l extends ss{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(_l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Dl extends ss{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(Dl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class Fl extends ss{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(Fl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Ol extends ss{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(Ol,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Sl extends ss{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Sl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Ml extends ss{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${Sc(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Sc(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(Ml,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Il extends ss{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function Nl(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof ss?e.walk((e=>e.code===xl.code)):e;return r instanceof ss?new xl({cause:e,message:r.details}):xl.nodeMessage.test(n)?new xl({cause:e,message:e.details}):kl.nodeMessage.test(n)?new kl({cause:e,maxFeePerGas:t?.maxFeePerGas}):Tl.nodeMessage.test(n)?new Tl({cause:e,maxFeePerGas:t?.maxFeePerGas}):Pl.nodeMessage.test(n)?new Pl({cause:e,nonce:t?.nonce}):Al.nodeMessage.test(n)?new Al({cause:e,nonce:t?.nonce}):_l.nodeMessage.test(n)?new _l({cause:e,nonce:t?.nonce}):Dl.nodeMessage.test(n)?new Dl({cause:e}):Fl.nodeMessage.test(n)?new Fl({cause:e,gas:t?.gas}):Ol.nodeMessage.test(n)?new Ol({cause:e,gas:t?.gas}):Sl.nodeMessage.test(n)?new Sl({cause:e}):Ml.nodeMessage.test(n)?new Ml({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new Il({cause:e})}function Ul(e,{format:t}){if(!t)return{};const n={};return function t(r){const a=Object.keys(r);for(const s of a)s in e&&(n[s]=e[s]),r[s]&&"object"==typeof r[s]&&!Array.isArray(r[s])&&t(r[s])}(t(e||{})),n}const Ll={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function Bl(e){const t={...e};return void 0!==e.blobs&&"string"!=typeof e.blobs[0]&&(t.blobs=e.blobs.map((e=>Es(e)))),void 0!==e.gas&&(t.gas=xs(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=xs(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=xs(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=xs(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=xs(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=xs(e.nonce)),void 0!==e.type&&(t.type=Ll[e.type]),void 0!==e.value&&(t.value=xs(e.value)),t}const Rl=Us("transactionRequest",Bl);function jl(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:a,to:s}=e,i=t?ic(t):void 0;if(i&&!_i(i.address))throw new Zs({address:i.address});if(s&&!_i(s))throw new Zs({address:s});if(void 0!==n&&(void 0!==r||void 0!==a))throw new Lc;if(r&&r>2n**256n-1n)throw new kl({maxFeePerGas:r});if(a&&r&&a>r)throw new Ml({maxFeePerGas:r,maxPriorityFeePerGas:a})}class Gl extends ss{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class Hl extends ss{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class zl extends ss{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Sc(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class $l extends ss{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function Vl(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:a}={}){const s=r??"latest",i=a??!1,o=void 0!==n?xs(n):void 0;let c=null;if(c=t?await e.request({method:"eth_getBlockByHash",params:[t,i]}):await e.request({method:"eth_getBlockByNumber",params:[o||s,i]}),!c)throw new $l({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||js)(c)}async function ql(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Zl(e,t){const{block:n,chain:r=e.chain,request:a}=t||{};if("function"==typeof r?.fees?.defaultPriorityFee){const t=n||await mo(e,Vl,"getBlock")({});return r.fees.defaultPriorityFee({block:t,client:e,request:a})}if(void 0!==r?.fees?.defaultPriorityFee)return r?.fees?.defaultPriorityFee;try{return Is(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):mo(e,Vl,"getBlock")({}),mo(e,ql,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new Hl;const a=r-t.baseFeePerGas;return a<0n?0n:a}}async function Wl(e,t){const{block:n,chain:r=e.chain,request:a,type:s="eip1559"}=t||{},i=await(async()=>"function"==typeof r?.fees?.baseFeeMultiplier?r.fees.baseFeeMultiplier({block:n,client:e,request:a}):r?.fees?.baseFeeMultiplier??1.2)();if(i<1)throw new Gl;const o=10**(i.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(i*o))/BigInt(o),l=n||await mo(e,Vl,"getBlock")({});if("function"==typeof r?.fees?.estimateFeesPerGas)return r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:a,type:s});if("eip1559"===s){if("bigint"!=typeof l.baseFeePerGas)throw new Hl;const t="bigint"==typeof a?.maxPriorityFeePerGas?a.maxPriorityFeePerGas:await Zl(e,{block:l,chain:r,request:a}),n=c(l.baseFeePerGas);return{maxFeePerGas:a?.maxFeePerGas??n+t,maxPriorityFeePerGas:t}}return{gasPrice:a?.gasPrice??c(await mo(e,ql,"getGasPrice")({}))}}async function Kl(e,{address:t,blockTag:n="latest",blockNumber:r}){return Ns(await e.request({method:"eth_getTransactionCount",params:[t,r?xs(r):n]}))}class Jl extends ss{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join("\n"),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}function Xl(e){if(e.type)return e.type;if(void 0!==e.blobs||void 0!==e.blobVersionedHashes||void 0!==e.maxFeePerBlobGas||void 0!==e.sidecars)return"eip4844";if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new Rc({transaction:e})}async function Yl(e){return Ns(await e.request({method:"eth_chainId"}))}async function Ql(e,t){const{account:n=e.account,chain:r,chainId:a,gas:s,nonce:i,parameters:o=["chainId","fees","gas","nonce","type"],type:c}=t,l=n?ic(n):void 0,u=await mo(e,Vl,"getBlock")({blockTag:"latest"}),d={...t,...l?{from:l?.address}:{}};if(o.includes("chainId")&&(d.chainId=r?r.id:void 0!==a?a:await mo(e,Yl,"getChainId")({})),o.includes("nonce")&&void 0===i&&l&&(d.nonce=await mo(e,Kl,"getTransactionCount")({address:l.address,blockTag:"pending"})),(o.includes("fees")||o.includes("type"))&&void 0===c)try{d.type=Xl(d)}catch{d.type="bigint"==typeof u.baseFeePerGas?"eip1559":"legacy"}if(o.includes("fees"))if("eip1559"===d.type||"eip4844"===d.type){const{maxFeePerGas:n,maxPriorityFeePerGas:a}=await Wl(e,{block:u,chain:r,request:d});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas<a)throw new zl({maxPriorityFeePerGas:a});d.maxPriorityFeePerGas=a,d.maxFeePerGas=n}else{if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)throw new Hl;const{gasPrice:n}=await Wl(e,{block:u,chain:r,request:d,type:"legacy"});d.gasPrice=n}return o.includes("gas")&&void 0===s&&(d.gas=await mo(e,eu,"estimateGas")({...d,account:l?{address:l.address,type:"json-rpc"}:void 0})),jl(d),delete d.parameters,d}async function eu(e,t){const n=t.account??e.account,r=n?ic(n):void 0;try{const{accessList:n,blobs:a,blockNumber:s,blockTag:i,data:o,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:m,value:f,...y}="local"===r?.type?await Ql(e,t):t,b=(s?xs(s):void 0)||i;jl(t);const g=e.chain?.formatters?.transactionRequest?.format,w=(g||Bl)({...Ul(y,{format:g}),from:r?.address,accessList:n,blobs:a,data:o,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:m,value:f}),v=await e.request({method:"eth_estimateGas",params:b?[w,b]:[w]});return BigInt(v)}catch(n){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=Nl(e,n);return t instanceof Il?e:t})();return new El(r,{docsPath:t,...n})}(n,{...t,account:r,chain:e.chain})}}async function tu(e,t){const{abi:n,address:r,args:a,functionName:s,...i}=t,o=cc({abi:n,args:a,functionName:s});try{return await mo(e,eu,"estimateGas")({data:o,to:r,...i})}catch(e){const t=i.account?ic(i.account):void 0;throw Cl(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:t?.address})}}const nu="/docs/contract/decodeEventLog";function ru(e){const{abi:t,data:n,strict:r,topics:a}=e,s=r??!0,[i,...o]=a;if(!i)throw new To({docsPath:nu});const c=t.find((e=>"event"===e.type&&i===Ho(fo(e))));if(!c||!("name"in c)||"event"!==c.type)throw new Po(i,{docsPath:nu});const{name:l,inputs:u}=c,d=u?.some((e=>!("name"in e&&e.name)));let p=d?[]:{};const h=u.filter((e=>"indexed"in e&&e.indexed));for(let e=0;e<h.length;e++){const t=h[e],n=o[e];if(!n)throw new Mo({abiItem:c,param:t});p[t.name||e]=au({param:t,value:n})}const m=u.filter((e=>!("indexed"in e&&e.indexed)));if(m.length>0)if(n&&"0x"!==n)try{const e=vc(m,n);if(e)if(d)p=[...p,...e];else for(let t=0;t<m.length;t++)p[m[t].name]=e[t]}catch(e){if(s){if(e instanceof wo||e instanceof hc)throw new So({abiItem:c,data:n,params:m,size:ps(n)});throw e}}else if(s)throw new So({abiItem:c,data:"0x",params:m,size:0});return{eventName:l,args:Object.values(p).length>0?p:void 0}}function au({param:e,value:t}){if("string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))return t;return(vc([e],t)||[])[0]}function su({abi:e,eventName:t,logs:n,strict:r=!0}){return n.map((n=>{try{const a=ru({...n,abi:e,strict:r});return t&&!t.includes(a.eventName)?null:{...a,...n}}catch(e){let t,a;if(e instanceof Po)return null;if(e instanceof So||e instanceof Mo){if(r)return null;t=e.abiItem.name,a=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}return{...n,args:a?[]:{},eventName:t}}})).filter(Boolean)}async function iu(e,{address:t,blockHash:n,fromBlock:r,toBlock:a,event:s,events:i,args:o,strict:c}={}){const l=c??!1,u=i??(s?[s]:void 0);let d,p=[];u&&(p=[u.flatMap((e=>nc({abi:[e],eventName:e.name,args:o})))],s&&(p=p[0])),d=n?await e.request({method:"eth_getLogs",params:[{address:t,topics:p,blockHash:n}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:p,fromBlock:"bigint"==typeof r?xs(r):r,toBlock:"bigint"==typeof a?xs(a):a}]});const h=d.map((e=>Hs(e)));return u?su({abi:u,logs:h,strict:l}):h}async function ou(e,t){const{abi:n,address:r,args:a,blockHash:s,eventName:i,fromBlock:o,toBlock:c,strict:l}=t,u=i?Yo({abi:n,name:i}):void 0,d=u?void 0:n.filter((e=>"event"===e.type));return mo(e,iu,"getLogs")({address:r,args:a,blockHash:s,event:u,events:d,fromBlock:o,toBlock:c,strict:l})}const cu="/docs/contract/decodeFunctionResult";function lu(e){const{abi:t,args:n,functionName:r,data:a}=e;let s=t[0];if(r){const e=Yo({abi:t,args:n,name:r});if(!e)throw new _o(r,{docsPath:cu});s=e}if("function"!==s.type)throw new _o(void 0,{docsPath:cu});if(!s.outputs)throw new Do(s.name,{docsPath:cu});const i=vc(s.outputs,a);return i&&i.length>1?i:i&&1===i.length?i[0]:void 0}const uu=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],du=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],pu=[...du,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],hu=[...du,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],mu=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],fu=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],yu=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],bu="0x82ad56cb";class gu extends ss{constructor({blockNumber:e,chain:t,contract:n}){super(`Chain "${t.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class wu extends ss{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class vu extends ss{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class Cu extends ss{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class Eu extends ss{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}function xu({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new gu({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new gu({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const ku=new Map;function Tu({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:a}){const s=async()=>{const t=o();i();const n=t.map((({args:e})=>e));0!==n.length&&e(n).then((e=>{a&&Array.isArray(e)&&e.sort(a);for(let n=0;n<t.length;n++){const{pendingPromise:r}=t[n];r.resolve?.([e[n],e])}})).catch((e=>{for(let n=0;n<t.length;n++){const{pendingPromise:r}=t[n];r.reject?.(e)}}))},i=()=>ku.delete(t),o=()=>ku.get(t)||[],c=e=>ku.set(t,[...o(),e]);return{flush:i,async schedule(e){const t={},a=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),i=n?.([...o().map((({args:e})=>e)),e]);i&&s();return o().length>0?(c({args:e,pendingPromise:t}),a):(c({args:e,pendingPromise:t}),setTimeout(s,r),a)}}}async function Pu(e,t){const{account:n=e.account,batch:r=Boolean(e.batch?.multicall),blockNumber:a,blockTag:s="latest",accessList:i,blobs:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,to:f,value:y,stateOverride:b,...g}=t,w=n?ic(n):void 0;try{jl(t);const n=(a?xs(a):void 0)||s,v=function(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!_i(n,{strict:!1}))throw new Zs({address:n});if(t[n])throw new Mc({address:n});t[n]=_u(r)}return t}(b),C=e.chain?.formatters?.transactionRequest?.format,E=(C||Bl)({...Ul(g,{format:C}),from:w?.address,accessList:i,blobs:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,to:f,value:y});if(r&&function({request:e}){const{data:t,to:n,...r}=e;return!!t&&(!t.startsWith(bu)&&(!!n&&!(Object.values(r).filter((e=>void 0!==e)).length>0)))}({request:E})&&!v)try{return await async function(e,t){const{batchSize:n=1024,wait:r=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockNumber:a,blockTag:s="latest",data:i,multicallAddress:o,to:c}=t;let l=o;if(!l){if(!e.chain)throw new Cu;l=xu({blockNumber:a,chain:e.chain,contract:"multicall3"})}const u=a?xs(a):void 0,d=u||s,{schedule:p}=Tu({id:`${e.uid}.${d}`,wait:r,shouldSplitBatch(e){const t=e.reduce(((e,{data:t})=>e+(t.length-2)),0);return t>2*n},fn:async t=>{const n=t.map((e=>({allowFailure:!0,callData:e.data,target:e.to}))),r=cc({abi:uu,args:[n],functionName:"aggregate3"}),a=await e.request({method:"eth_call",params:[{data:r,to:l},d]});return lu({abi:uu,args:[n],functionName:"aggregate3",data:a||"0x"})}}),[{returnData:h,success:m}]=await p({data:i,to:c});if(!m)throw new Kc({data:h});return"0x"===h?{data:void 0}:{data:h}}(e,{...E,blockNumber:a,blockTag:s})}catch(e){if(!(e instanceof Cu||e instanceof gu))throw e}const x=await e.request({method:"eth_call",params:v?[E,n,v]:[E,n]});return"0x"===x?{data:void 0}:{data:x}}catch(n){const r=function(e){if(!(e instanceof ss))return;const t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(n),{offchainLookup:a,offchainLookupSignature:s}=await import("./ccip-3ac23092.js");if(r?.slice(0,10)===s&&f)return{data:await a(e,{data:r,to:f})};throw function(e,{docsPath:t,...n}){const r=(()=>{const t=Nl(e,n);return t instanceof Il?e:t})();return new Vc(r,{docsPath:t,...n})}(n,{...t,account:w,chain:e.chain})}}function Au(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new ys({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new ys({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function _u(e){const{balance:t,nonce:n,state:r,stateDiff:a,code:s}=e,i={};if(void 0!==s&&(i.code=s),void 0!==t&&(i.balance=xs(t,{size:32})),void 0!==n&&(i.nonce=xs(n,{size:8})),void 0!==r&&(i.state=Au(r)),void 0!==a){if(i.state)throw new Ic;i.stateDiff=Au(a)}return i}async function Du(e,t){const{abi:n,address:r,args:a,functionName:s,...i}=t,o=cc({abi:n,args:a,functionName:s});try{const{data:t}=await mo(e,Pu,"call")({...i,data:o,to:r});return lu({abi:n,args:a,functionName:s,data:t||"0x"})}catch(e){throw Cl(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/readContract",functionName:s})}}async function Fu(e,t){const{abi:n,address:r,args:a,dataSuffix:s,functionName:i,...o}=t,c=o.account?ic(o.account):e.account,l=cc({abi:n,args:a,functionName:i});try{const{data:u}=await mo(e,Pu,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:r,...o,account:c}),d=lu({abi:n,args:a,functionName:i,data:u||"0x"});return{result:d,request:{abi:n.filter((e=>"name"in e&&e.name===t.functionName)),address:r,args:a,dataSuffix:s,functionName:i,...o,account:c}}}catch(e){throw Cl(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/simulateContract",functionName:i,sender:c?.address})}}const Ou=new Map,Su=new Map;let Mu=0;function Iu(e,t,n){const r=++Mu,a=()=>Ou.get(e)||[],s=()=>{const t=Su.get(e);1===a().length&&t&&t(),(()=>{const t=a();Ou.set(e,t.filter((e=>e.id!==r)))})()},i=a();if(Ou.set(e,[...i,{id:r,fns:t}]),i&&i.length>0)return s;const o={};for(const e in t)o[e]=(...t)=>{const n=a();if(0!==n.length)for(const r of n)r.fns[e]?.(...t)};const c=n(o);return"function"==typeof c&&Su.set(e,c),s}async function Nu(e){return new Promise((t=>setTimeout(t,e)))}function Uu(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let a=!0;const s=()=>a=!1;return(async()=>{let i;t&&(i=await e({unpoll:s}));const o=await(n?.(i))??r;await Nu(o);const c=async()=>{a&&(await e({unpoll:s}),await Nu(r),c())};c()})(),s}const Lu=new Map,Bu=new Map;async function Ru(e,{cacheKey:t,cacheTime:n=1/0}){const r=function(e){const t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:n=>t.set(e,n)}),n=t(e,Lu),r=t(e,Bu);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}(t),a=r.response.get();if(a&&n>0){if((new Date).getTime()-a.created.getTime()<n)return a.data}let s=r.promise.get();s||(s=e(),r.promise.set(s));try{const e=await s;return r.response.set({created:new Date,data:e}),e}finally{r.promise.clear()}}const ju=e=>`blockNumber.${e}`;async function Gu(e,{cacheTime:t=e.cacheTime}={}){const n=await Ru((()=>e.request({method:"eth_blockNumber"})),{cacheKey:ju(e.uid),cacheTime:t});return BigInt(n)}async function Hu(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if("string"==typeof r[0])return r;const a=r.map((e=>Hs(e)));return"abi"in t&&t.abi?su({abi:t.abi,logs:a,strict:n}):a}async function zu(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function $u(e,t){const{abi:n,address:r,args:a,batch:s=!0,eventName:i,onError:o,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}=t;return(void 0!==l?l:"webSocket"!==e.transport.type)?(()=>{const t=Pc(["watchContractEvent",r,a,s,e.uid,i,u]),l=d??!1;return Iu(t,{onLogs:c,onError:o},(t=>{let o,c,d=!1;const p=Uu((async()=>{if(d)try{let u;if(c)u=await mo(e,Hu,"getFilterChanges")({filter:c});else{const t=await mo(e,Gu,"getBlockNumber")({});u=o&&o!==t?await mo(e,ou,"getContractEvents")({abi:n,address:r,args:a,eventName:i,fromBlock:o+1n,toBlock:t,strict:l}):[],o=t}if(0===u.length)return;if(s)t.onLogs(u);else for(const e of u)t.onLogs([e])}catch(e){c&&e instanceof il&&(d=!1),t.onError?.(e)}else{try{c=await mo(e,sc,"createContractEventFilter")({abi:n,address:r,args:a,eventName:i,strict:l})}catch{}d=!0}}),{emitOnBegin:!0,interval:u});return async()=>{c&&await mo(e,zu,"uninstallFilter")({filter:c}),p()}}))})():(()=>{let t=!0,s=()=>t=!1;return(async()=>{try{const l=i?nc({abi:n,eventName:i,args:a}):[],{unsubscribe:u}=await e.transport.subscribe({params:["logs",{address:r,topics:l}],onData(e){if(!t)return;const r=e.result;try{const{eventName:e,args:t}=ru({abi:n,data:r.data,topics:r.topics,strict:d}),a=Hs(r,{args:t,eventName:e});c([a])}catch(e){let t,n;if(e instanceof So||e instanceof Mo){if(d)return;t=e.abiItem.name,n=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const a=Hs(r,{args:n?[]:{},eventName:t});c([a])}},onError(e){o?.(e)}});s=u,t||s()}catch(e){o?.(e)}})(),s})()}async function Vu(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}async function qu(e,t){const{account:n=e.account,chain:r=e.chain,accessList:a,blobs:s,data:i,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:h,value:m,...f}=t;if(!n)throw new Jl({docsPath:"/docs/actions/wallet/sendTransaction"});const y=ic(n);try{let n;if(jl(t),null!==r&&(n=await mo(e,Yl,"getChainId")({}),function({chain:e,currentChainId:t}){if(!e)throw new vu;if(t!==e.id)throw new wu({chain:e,currentChainId:t})}({currentChainId:n,chain:r})),"local"===y.type){const t=await mo(e,Ql,"prepareTransactionRequest")({account:y,accessList:a,blobs:s,chain:r,chainId:n,data:i,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:h,value:m,...f}),b=r?.serializers?.transaction,g=await y.signTransaction(t,{serializer:b});return await mo(e,Vu,"sendRawTransaction")({serializedTransaction:g})}const b=e.chain?.formatters?.transactionRequest?.format,g=(b||Bl)({...Ul(f,{format:b}),accessList:a,blobs:s,data:i,from:y.address,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:h,value:m});return await e.request({method:"eth_sendTransaction",params:[g]},{retryCount:0})}catch(e){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=Nl(e,n);return t instanceof Il?e:t})();return new Gc(r,{docsPath:t,...n})}(e,{...t,account:y,chain:t.chain||void 0})}}async function Zu(e,t){const{abi:n,address:r,args:a,dataSuffix:s,functionName:i,...o}=t,c=cc({abi:n,args:a,functionName:i});return mo(e,qu,"sendTransaction")({data:`${c}${s?s.replace("0x",""):""}`,to:r,...o})}function Wu({abi:e,address:t,client:n}){const r=n,[a,s]=r?"public"in r&&"wallet"in r?[r.public,r.wallet]:"public"in r?[r.public,void 0]:"wallet"in r?[void 0,r.wallet]:[r,r]:[void 0,void 0],i=null!=a,o=null!=s,c={};let l=!1,u=!1,d=!1;for(const t of e)if("function"===t.type?"view"===t.stateMutability||"pure"===t.stateMutability?l=!0:u=!0:"event"===t.type&&(d=!0),l&&u&&d)break;return i&&(l&&(c.read=new Proxy({},{get:(n,r)=>(...n)=>{const{args:s,options:i}=Ku(n);return mo(a,Du,"readContract")({abi:e,address:t,functionName:r,args:s,...i})}})),u&&(c.simulate=new Proxy({},{get:(n,r)=>(...n)=>{const{args:s,options:i}=Ku(n);return mo(a,Fu,"simulateContract")({abi:e,address:t,functionName:r,args:s,...i})}})),d&&(c.createEventFilter=new Proxy({},{get:(n,r)=>(...n)=>{const s=e.find((e=>"event"===e.type&&e.name===r)),{args:i,options:o}=Ju(n,s);return mo(a,sc,"createContractEventFilter")({abi:e,address:t,eventName:r,args:i,...o})}}),c.getEvents=new Proxy({},{get:(n,r)=>(...n)=>{const s=e.find((e=>"event"===e.type&&e.name===r)),{args:i,options:o}=Ju(n,s);return mo(a,ou,"getContractEvents")({abi:e,address:t,eventName:r,args:i,...o})}}),c.watchEvent=new Proxy({},{get:(n,r)=>(...n)=>{const s=e.find((e=>"event"===e.type&&e.name===r)),{args:i,options:o}=Ju(n,s);return mo(a,$u,"watchContractEvent")({abi:e,address:t,eventName:r,args:i,...o})}}))),o&&u&&(c.write=new Proxy({},{get:(n,r)=>(...n)=>{const{args:a,options:i}=Ku(n);return mo(s,Zu,"writeContract")({abi:e,address:t,functionName:r,args:a,...i})}})),(i||o)&&u&&(c.estimateGas=new Proxy({},{get:(n,r)=>(...n)=>{const{args:i,options:o}=Ku(n);return mo(a??s,tu,"estimateContractGas")({abi:e,address:t,functionName:r,args:i,...o,account:o.account??s.account})}})),c.address=t,c.abi=e,c}function Ku(e){const t=e.length&&Array.isArray(e[0]);return{args:t?e[0]:[],options:(t?e[1]:e[0])??{}}}function Ju(e,t){let n=!1;Array.isArray(e[0])?n=!0:1===e.length?n=t.inputs.some((e=>e.indexed)):2===e.length&&(n=!0);return{args:n?e[0]:void 0,options:(n?e[1]:e[0])??{}}}const Xu=256;let Yu,Qu=Xu;function ed(e=11){if(!Yu||Qu+e>2*Xu){Yu="",Qu=0;for(let e=0;e<Xu;e++)Yu+=(256+256*Math.random()|0).toString(16).substring(1)}return Yu.substring(Qu,Qu+++e)}function td(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,key:r="base",name:a="Base Client",pollingInterval:s=4e3,type:i="base"}=e,o=e.chain,c=e.account?ic(e.account):void 0,{config:l,request:u,value:d}=e.transport({chain:o,pollingInterval:s}),p={account:c,batch:t,cacheTime:n,chain:o,key:r,name:a,pollingInterval:s,request:u,transport:{...l,...d},type:i,uid:ed()};return Object.assign(p,{extend:function e(t){return n=>{const r=n(t);for(const e in p)delete r[e];const a={...t,...r};return Object.assign(a,{extend:e(a)})}}(p)})}function nd(e,{delay:t=100,retryCount:n=2,shouldRetry:r=(()=>!0)}={}){return new Promise(((a,s)=>{const i=async({count:o=0}={})=>{try{const t=await e();a(t)}catch(e){if(o<n&&await r({count:o,error:e}))return(async({error:e})=>{const n="function"==typeof t?t({count:o,error:e}):t;n&&await Nu(n),i({count:o+1})})({error:e});s(e)}};i()}))}function rd(e,t={}){return async(n,r={})=>{const{retryDelay:a=150,retryCount:s=3}={...t,...r};return nd((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case tl.code:throw new tl(t);case nl.code:throw new nl(t);case rl.code:throw new rl(t);case al.code:throw new al(t);case sl.code:throw new sl(t);case il.code:throw new il(t);case ol.code:throw new ol(t);case cl.code:throw new cl(t);case ll.code:throw new ll(t);case ul.code:throw new ul(t);case dl.code:throw new dl(t);case pl.code:throw new pl(t);case hl.code:throw new hl(t);case ml.code:throw new ml(t);case fl.code:throw new fl(t);case yl.code:throw new yl(t);case bl.code:throw new bl(t);case gl.code:throw new gl(t);case 5e3:throw new hl(t);default:if(e instanceof ss)throw e;throw new wl(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof Jc){const e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*parseInt(e)}return~~(1<<e)*a},retryCount:s,shouldRetry:({error:e})=>function(e){if("code"in e&&"number"==typeof e.code)return-1===e.code||(e.code===dl.code||e.code===sl.code);if(e instanceof Jc&&e.status)return 403===e.status||(408===e.status||(413===e.status||(429===e.status||(500===e.status||(502===e.status||(503===e.status||504===e.status))))));return!0}(e)})}}function ad({key:e,name:t,request:n,retryCount:r=3,retryDelay:a=150,timeout:s,type:i},o){return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:a,timeout:s,type:i},request:rd(n,{retryCount:r,retryDelay:a}),value:o}}function sd(e,t={}){const{key:n="custom",name:r="Custom Provider",retryDelay:a}=t;return({retryCount:s})=>ad({key:n,name:r,request:e.request.bind(e),retryCount:t.retryCount??s,retryDelay:a,type:"custom"})}class id extends ss{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function od(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const cd=od();function ld(e,t={}){return{async request(n){const{body:r,fetchOptions:a={},onResponse:s=t.onResponse,timeout:i=t.timeout??1e4}=n,{headers:o,method:c,signal:l}={...t.fetchOptions,...a};try{const t=await function(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise(((a,s)=>{(async()=>{let i;try{const o=new AbortController;n>0&&(i=setTimeout((()=>{r?o.abort():s(t)}),n)),a(await e({signal:o?.signal}))}catch(e){"AbortError"===e.name&&s(t),s(e)}finally{clearTimeout(i)}})()}))}((async({signal:t})=>await fetch(e,{...a,body:Array.isArray(r)?Pc(r.map((e=>({jsonrpc:"2.0",id:e.id??cd.take(),...e})))):Pc({jsonrpc:"2.0",id:r.id??cd.take(),...r}),headers:{...o,"Content-Type":"application/json"},method:c||"POST",signal:l||(i>0?t:void 0)})),{errorInstance:new Yc({body:r,url:e}),timeout:i,signal:!0});let n;if(s&&await s(t),n=t.headers.get("Content-Type")?.startsWith("application/json")?await t.json():await t.text(),!t.ok)throw new Jc({body:r,details:Pc(n.error)||t.statusText,headers:t.headers,status:t.status,url:e});return n}catch(t){if(t instanceof Jc)throw t;if(t instanceof Yc)throw t;throw new Jc({body:r,details:t.message,url:e})}}}}function ud(e,t={}){const{batch:n,fetchOptions:r,key:a="http",name:s="HTTP JSON-RPC",onFetchResponse:i,retryDelay:o}=t;return({chain:c,retryCount:l,timeout:u})=>{const{batchSize:d=1e3,wait:p=0}="object"==typeof n?n:{},h=t.retryCount??l,m=u??t.timeout??1e4,f=e||c?.rpcUrls.default.http[0];if(!f)throw new id;const y=ld(f,{fetchOptions:r,onResponse:i,timeout:m});return ad({key:a,name:s,async request({method:t,params:r}){const a={method:t,params:r},{schedule:s}=Tu({id:`${e}`,wait:p,shouldSplitBatch:e=>e.length>d,fn:e=>y.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:i,result:o}]=await(async e=>n?s(e):[await y.request({body:e})])(a);if(i)throw new Xc({body:a,error:i,url:f});return o},retryCount:h,retryDelay:o,timeout:m,type:"http"},{fetchOptions:r,url:f})}}function dd(e,t){if(!(e instanceof ss))return!1;const n=e.walk((e=>e instanceof Zc));return n instanceof Zc&&("ResolverNotFound"===n.data?.errorName||("ResolverWildcardNotSupported"===n.data?.errorName||("ResolverNotContract"===n.data?.errorName||("ResolverError"===n.data?.errorName||("HttpError"===n.data?.errorName||(!!n.reason?.includes("Wildcard on non-extended resolvers is not supported")||"reverse"===t&&n.reason===lc[50]))))))}function pd(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const t=`0x${e.slice(1,65)}`;return ds(t)?t:null}function hd(e){let t=new Uint8Array(32).fill(0);if(!e)return Es(t);const n=e.split(".");for(let e=n.length-1;e>=0;e-=1){const r=pd(n[e]),a=r?As(r):ki(Os(n[e]),"bytes");t=ki(Di([t,a]),"bytes")}return Es(t)}function md(e){return`[${e.slice(2)}]`}function fd(e){const t=new Uint8Array(32).fill(0);return e?pd(e)||ki(Os(e)):Es(t)}function yd(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array(Os(t).byteLength+2);let r=0;const a=t.split(".");for(let e=0;e<a.length;e++){let t=Os(a[e]);t.byteLength>255&&(t=Os(md(fd(a[e])))),n[r]=t.length,n.set(t,r+1),r+=t.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}class bd extends ss{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class gd extends ss{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class wd extends ss{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class vd extends ss{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const Cd=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Ed=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,xd=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,kd=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function Td(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Pd({uri:e,gatewayUrls:t}){const n=xd.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=Td(t?.ipfs,"https://ipfs.io"),a=Td(t?.arweave,"https://arweave.net"),s=e.match(Cd),{protocol:i,subpath:o,target:c,subtarget:l=""}=s?.groups||{},u="ipns:/"===i||"ipns/"===o,d="ipfs:/"===i||"ipfs/"===o||Ed.test(e);if(e.startsWith("http")&&!u&&!d){let n=e;return t?.arweave&&(n=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:n,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===i&&c)return{uri:`${a}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let p=e.replace(kd,"");if(p.startsWith("<svg")&&(p=`data:image/svg+xml;base64,${btoa(p)}`),p.startsWith("data:")||p.startsWith("{"))return{uri:p,isOnChain:!0,isEncoded:!1};throw new wd({uri:e})}function Ad(e){if("object"!=typeof e||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new bd({data:e});return e.image||e.image_url||e.image_data}async function _d({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=Pd({uri:t,gatewayUrls:e});if(r)return n;const a=await async function(e){try{const t=await fetch(e,{method:"HEAD"});if(200===t.status){const e=t.headers.get("content-type");return e?.startsWith("image/")}return!1}catch(t){return("object"!=typeof t||void 0===t.response)&&!!globalThis.hasOwnProperty("Image")&&new Promise((t=>{const n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=e}))}}(n);if(a)return n;throw new wd({uri:t})}async function Dd(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?async function(e,{gatewayUrls:t,record:n}){const r=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,a]=t.split("/"),[s,i]=n.split(":"),[o,c]=r.split(":");if(!s||"eip155"!==s.toLowerCase())throw new gd({reason:"Only EIP-155 supported"});if(!i)throw new gd({reason:"Chain ID not found"});if(!c)throw new gd({reason:"Contract address not found"});if(!a)throw new gd({reason:"Token ID not found"});if(!o)throw new gd({reason:"ERC namespace not found"});return{chainID:parseInt(i),namespace:o.toLowerCase(),contractAddress:c,tokenID:a}}(n),a=await async function(e,{nft:t}){if("erc721"===t.namespace)return Du(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return Du(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new vd({namespace:t.namespace})}(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:o}=Pd({uri:a,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const e=o?atob(s.replace("data:application/json;base64,","")):s;return _d({uri:Ad(JSON.parse(e)),gatewayUrls:t})}let c=r.tokenID;"erc1155"===r.namespace&&(c=c.replace("0x","").padStart(64,"0"));return async function({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then((e=>e.json()));return await _d({gatewayUrls:e,uri:Ad(n)})}catch{throw new wd({uri:t})}}({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:n}):_d({uri:n,gatewayUrls:t})}async function Fd(e,{blockNumber:t,blockTag:n,name:r,key:a,gatewayUrls:s,strict:i,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=xu({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const i={address:c,abi:pu,functionName:"resolve",args:[vs(yd(r)),cc({abi:mu,functionName:"text",args:[hd(r),a]})],blockNumber:t,blockTag:n},o=mo(e,Du,"readContract"),l=s?await o({...i,args:[...i.args,s]}):await o(i);if("0x"===l[0])return null;const u=lu({abi:mu,functionName:"text",data:l[0]});return""===u?null:u}catch(e){if(i)throw e;if(dd(e,"resolve"))return null;throw e}}async function Od(e,{address:t,args:n,event:r,events:a,fromBlock:s,strict:i,toBlock:o}={}){const c=a??(r?[r]:void 0),l=ac(e,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap((e=>nc({abi:[e],eventName:e.name,args:n})))],r&&(u=u[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof s?xs(s):s,toBlock:"bigint"==typeof o?xs(o):o,...u.length?{topics:u}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:s,id:d,request:l(d),strict:Boolean(i),toBlock:o,type:"event"}}async function Sd(e){const t=ac(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Md(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:a}){const s=n?xs(n):void 0;return function(e){return{baseFeePerGas:e.baseFeePerGas.map((e=>BigInt(e))),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:e.reward?.map((e=>e.map((e=>BigInt(e)))))}}(await e.request({method:"eth_feeHistory",params:[xs(t),s||r,a]}))}const Id=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Nd=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Ud(e){const{domain:t={},message:n,primaryType:r}=e,a={EIP712Domain:Hd({domain:t}),...e.types};!function(e){const{domain:t,message:n,primaryType:r,types:a}=e,s=(e,t)=>{for(const n of e){const{name:e,type:r}=n,i=t[e],o=r.match(Nd);if(o&&("number"==typeof i||"bigint"==typeof i)){const[e,t,n]=o;xs(i,{signed:"int"===t,size:parseInt(n)/8})}if("address"===r&&"string"==typeof i&&!_i(i))throw new Zs({address:i});const c=r.match(Id);if(c){const[e,t]=c;if(t&&ps(i)!==parseInt(t))throw new Oo({expectedSize:parseInt(t),givenSize:ps(i)})}const l=a[r];l&&s(l,i)}};a.EIP712Domain&&t&&s(a.EIP712Domain,t);if("EIP712Domain"!==r){const e=a[r];s(e,n)}}({domain:t,message:n,primaryType:r,types:a});const s=["0x1901"];return t&&s.push(function({domain:e,types:t}){return Ld({data:e,primaryType:"EIP712Domain",types:t})}({domain:t,types:a})),"EIP712Domain"!==r&&s.push(Ld({data:n,primaryType:r,types:a})),ki(Di(s))}function Ld({data:e,primaryType:t,types:n}){return ki(Bd({data:e,primaryType:t,types:n}))}function Bd({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],a=[Rd({primaryType:t,types:n})];for(const s of n[t]){const[t,i]=Gd({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(t),a.push(i)}return Zo(r,a)}function Rd({primaryType:e,types:t}){const n=vs(function({primaryType:e,types:t}){let n="";const r=jd({primaryType:e,types:t});r.delete(e);const a=[e,...Array.from(r).sort()];for(const e of a)n+=`${e}(${t[e].map((({name:e,type:t})=>`${t} ${e}`)).join(",")})`;return n}({primaryType:e,types:t}));return ki(n)}function jd({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),a=r?.[0];if(n.has(a)||void 0===t[a])return n;n.add(a);for(const e of t[a])jd({primaryType:e.type,types:t},n);return n}function Gd({types:e,name:t,type:n,value:r}){if(void 0!==e[n])return[{type:"bytes32"},ki(Bd({data:r,primaryType:n,types:e}))];if("bytes"===n){return[{type:"bytes32"},ki(r=`0x${(r.length%2?"0":"")+r.slice(2)}`)]}if("string"===n)return[{type:"bytes32"},ki(vs(r))];if(n.lastIndexOf("]")===n.length-1){const a=n.slice(0,n.lastIndexOf("[")),s=r.map((n=>Gd({name:t,type:a,types:e,value:n})));return[{type:"bytes32"},ki(Zo(s.map((([e])=>e)),s.map((([,e])=>e))))]}return[{type:n},r]}function Hd({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},"number"==typeof e?.chainId&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}const zd="/docs/contract/encodeDeployData";function $d(e){const{abi:t,args:n,bytecode:r}=e;if(!n||0===n.length)return r;const a=t.find((e=>"type"in e&&"constructor"===e.type));if(!a)throw new bo({docsPath:zd});if(!("inputs"in a))throw new go({docsPath:zd});if(!a.inputs||0===a.inputs.length)throw new go({docsPath:zd});return Fi([r,Zo(a.inputs,n)])}const Vd="/docs/contract/encodeFunctionResult";class qd extends oi{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ai(this.buffer)}update(e){Xs(this);const{view:t,buffer:n,blockLen:r}=this,a=(e=ii(e)).length;for(let s=0;s<a;){const i=Math.min(r-this.pos,a-s);if(i!==r)n.set(e.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===r&&(this.process(t,0),this.pos=0);else{const t=ai(e);for(;r<=a-s;s+=r)this.process(t,s)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){Xs(this),Ys(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:a}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>r-s&&(this.process(n,0),s=0);for(let e=s;e<r;e++)t[e]=0;!function(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const a=BigInt(32),s=BigInt(4294967295),i=Number(n>>a&s),o=Number(n&s),c=r?4:0,l=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),a),this.process(n,0);const i=ai(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)i.setUint32(4*e,l[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:a,destroyed:s,pos:i}=this;return e.length=r,e.pos=i,e.finished=a,e.destroyed=s,r%t&&e.buffer.set(n),e}}const Zd=(e,t,n)=>e&t^~e&n,Wd=(e,t,n)=>e&t^e&n^t&n,Kd=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]),Jd=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Xd=new Uint32Array(64);class Yd extends qd{constructor(){super(64,32,8,!1),this.A=0|Jd[0],this.B=0|Jd[1],this.C=0|Jd[2],this.D=0|Jd[3],this.E=0|Jd[4],this.F=0|Jd[5],this.G=0|Jd[6],this.H=0|Jd[7]}get(){const{A:e,B:t,C:n,D:r,E:a,F:s,G:i,H:o}=this;return[e,t,n,r,a,s,i,o]}set(e,t,n,r,a,s,i,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|a,this.F=0|s,this.G=0|i,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)Xd[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Xd[e-15],n=Xd[e-2],r=si(t,7)^si(t,18)^t>>>3,a=si(n,17)^si(n,19)^n>>>10;Xd[e]=a+Xd[e-7]+r+Xd[e-16]|0}let{A:n,B:r,C:a,D:s,E:i,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(si(i,6)^si(i,11)^si(i,25))+Zd(i,o,c)+Kd[e]+Xd[e]|0,u=(si(n,2)^si(n,13)^si(n,22))+Wd(n,r,a)|0;l=c,c=o,o=i,i=s+t|0,s=a,a=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,a=a+this.C|0,s=s+this.D|0,i=i+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,a,s,i,o,c,l)}roundClean(){Xd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Qd=ci((()=>new Yd));const ep="Ethereum Signed Message:\n";function tp(e,t){const n="string"==typeof e?Os(e):e.raw instanceof Uint8Array?e.raw:As(e.raw);return ki(Di([Os(`${ep}${n.length}`),n]),t)}const np=1;class rp extends ss{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class ap extends ss{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class sp extends ss{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class ip extends ss{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${np}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}function op(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:s}=e;if(t<=0)throw new Eu({chainId:t});if(s&&!_i(s))throw new Zs({address:s});if(r)throw new ss("`gasPrice` is not a valid EIP-1559 Transaction attribute.");if(a&&a>2n**256n-1n)throw new kl({maxFeePerGas:a});if(n&&a&&n>a)throw new Ml({maxFeePerGas:a,maxPriorityFeePerGas:n})}function cp(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>Fs(e))):e.blobs,a=[];for(const e of r)a.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?a:a.map((e=>Es(e)))}function lp(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>Fs(e))):e.blobs,a="string"==typeof e.commitments[0]?e.commitments.map((e=>Fs(e))):e.commitments,s=[];for(let e=0;e<r.length;e++){const n=r[e],i=a[e];s.push(Uint8Array.from(t.computeBlobKzgProof(n,i)))}return"bytes"===n?s:s.map((e=>Es(e)))}const up=32,dp=4096,pp=up*dp,hp=2*pp-1-1*dp*2;function mp(e){const{data:t,kzg:n,to:r}=e,a=e.blobs??function(e){const t=e.to??("string"==typeof e.data?"hex":"bytes"),n="string"==typeof e.data?Fs(e.data):e.data,r=ps(n);if(!r)throw new ap;if(r>hp)throw new rp({maxSize:hp,size:r});const a=[];let s=!0,i=0;for(;s;){const e=yc(new Uint8Array(pp));let t=0;for(;t<dp;){const r=n.slice(i,i+(up-1));if(e.pushByte(0),e.pushBytes(r),r.length<31){e.pushByte(128),s=!1;break}t++,i+=31}a.push(e)}return"bytes"===t?a.map((e=>e.bytes)):a.map((e=>Es(e.bytes)))}({data:t,to:r}),s=e.commitments??cp({blobs:a,kzg:n,to:r}),i=e.proofs??lp({blobs:a,commitments:s,kzg:n,to:r}),o=[];for(let e=0;e<a.length;e++)o.push({blob:a[e],commitment:s[e],proof:i[e]});return o}function fp(e){const{commitment:t,version:n=1}=e,r=e.to??("string"==typeof t?"hex":"bytes"),a=function(e,t){const n=t||"hex",r=Qd(ds(e,{strict:!1})?As(e):e);return"bytes"===n?r:vs(r)}(t,"bytes");return a.set([n],0),"bytes"===r?a:Es(a)}function yp(e){if(!e||0===e.length)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:a}=e[n];for(let e=0;e<a.length;e++)if(a[e].length-2!=64)throw new jc({storageKey:a[e]});if(!_i(r,{strict:!1}))throw new Zs({address:r});t.push([r,a])}return t}function bp(e,t){const n=Xl(e);return"eip1559"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:s,value:i,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,data:u}=e;op(e);const d=yp(l),p=[vs(n),a?vs(a):"0x",c?vs(c):"0x",o?vs(o):"0x",r?vs(r):"0x",s??"0x",i?vs(i):"0x",u??"0x",d,...gp(e,t)];return Fi(["0x02",Pp(p)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:r,data:a,nonce:s,to:i,value:o,accessList:c,gasPrice:l}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:s}=e;if(t<=0)throw new Eu({chainId:t});if(s&&!_i(s))throw new Zs({address:s});if(n||a)throw new ss("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new kl({maxFeePerGas:r})}(e);const u=yp(c),d=[vs(n),s?vs(s):"0x",l?vs(l):"0x",r?vs(r):"0x",i??"0x",o?vs(o):"0x",a??"0x",u,...gp(e,t)];return Fi(["0x01",Pp(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:s,value:i,maxFeePerBlobGas:o,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{blobVersionedHashes:t}=e;if(t){if(0===t.length)throw new ap;for(const e of t){const t=ps(e),n=Ns(zo(e,0,1));if(32!==t)throw new sp({hash:e,size:t});if(n!==np)throw new ip({hash:e,version:n})}}op(e)}(e);let p=e.blobVersionedHashes,h=e.sidecars;if(e.blobs){const t="string"==typeof e.blobs[0]?e.blobs:e.blobs.map((e=>Es(e))),n=e.kzg,r=cp({blobs:t,kzg:n}),a=lp({blobs:t,commitments:r,kzg:n});p=function(e){const{commitments:t,version:n}=e,r=e.to??("string"==typeof t[0]?"hex":"bytes"),a=[];for(const e of t)a.push(fp({commitment:e,to:r,version:n}));return a}({commitments:r}),!1!==h&&(h=mp({blobs:t,commitments:r,proofs:a}))}const m=yp(u),f=[vs(n),a?vs(a):"0x",l?vs(l):"0x",c?vs(c):"0x",r?vs(r):"0x",s??"0x",i?vs(i):"0x",d??"0x",m,o?vs(o):"0x",p??[],...gp(e,t)],y=[],b=[],g=[];if(h)for(let e=0;e<h.length;e++){const{blob:t,commitment:n,proof:r}=h[e];y.push(t),b.push(n),g.push(r)}return Fi(["0x03",Pp(h?[f,y,b,g]:f)])}(e,t):function(e,t){const{chainId:n=0,gas:r,data:a,nonce:s,to:i,value:o,gasPrice:c}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:s,accessList:i}=e;if(s&&!_i(s))throw new Zs({address:s});if(void 0!==t&&t<=0)throw new Eu({chainId:t});if(n||a)throw new ss("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new kl({maxFeePerGas:r});if(i)throw new ss("`accessList` is not a valid Legacy Transaction attribute.")}(e);let l=[s?vs(s):"0x",c?vs(c):"0x",r?vs(r):"0x",i??"0x",o?vs(o):"0x",a??"0x"];if(t){const e=(()=>{if(t.v>=35n){return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n)}if(n>0)return BigInt(2*n)+BigInt(35n+t.v-27n);const e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new Bc({v:t.v});return e})();l=[...l,vs(e),t.r,t.s]}else n>0&&(l=[...l,vs(n),"0x","0x"]);return Pp(l)}(e,t)}function gp(e,t){const{r:n,s:r,v:a,yParity:s}=t??e;if(void 0===n)return[];if(void 0===r)return[];if(void 0===a&&void 0===s)return[];return["number"==typeof s?s?vs(1):"0x":0n===a?"0x":1n===a?vs(1):27n===a?"0x":vs(1),hs(n),hs(r)]}async function wp(e,{address:t,blockNumber:n,blockTag:r,storageKeys:a}){const s=r??"latest",i=void 0!==n?xs(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Ns(e.nonce):void 0,storageProof:e.storageProof?(t=e.storageProof,t.map((e=>({...e,value:BigInt(e.value)})))):void 0};var t}(await e.request({method:"eth_getProof",params:[t,a,i||s]}))}async function vp(e,{blockHash:t,blockNumber:n,blockTag:r,hash:a,index:s}){const i=r||"latest",o=void 0!==n?xs(n):void 0;let c=null;if(a?c=await e.request({method:"eth_getTransactionByHash",params:[a]}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,xs(s)]}):(o||i)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||i,xs(s)]})),!c)throw new Hc({blockHash:t,blockNumber:n,blockTag:i,hash:a,index:s});return(e.chain?.formatters?.transaction?.format||Bs)(c)}async function Cp(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!n)throw new zc({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||$s)(n)}const Ep="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";
3
3
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */async function xp(e,{address:t,hash:n,signature:r,...a}){const s=ds(r)?r:vs(r);try{const{data:r}=await mo(e,Pu,"call")({data:$d({abi:yu,args:[t,n,s],bytecode:Ep}),...a});return o="0x1",function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(ds(i=r??"0x0")?As(i):i,ds(o)?As(o):o)}catch(e){if(e instanceof Vc)return!1;throw e}var i,o}function kp(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:a,poll:s,pollingInterval:i=e.pollingInterval}){let o;return(void 0!==s?s:"webSocket"!==e.transport.type)?Iu(Pc(["watchBlockNumber",e.uid,t,n,i]),{onBlockNumber:r,onError:a},(r=>Uu((async()=>{try{const t=await mo(e,Gu,"getBlockNumber")({cacheTime:0});if(o){if(t===o)return;if(t-o>1&&n)for(let e=o+1n;e<t;e++)r.onBlockNumber(e,o),o=e}(!o||t>o)&&(r.onBlockNumber(t,o),o=t)}catch(e){r.onError?.(e)}}),{emitOnBegin:t,interval:i}))):Iu(Pc(["watchBlockNumber",e.uid,t,n]),{onBlockNumber:r,onError:a},(t=>{let n=!0,r=()=>n=!1;return(async()=>{try{const{unsubscribe:a}=await e.transport.subscribe({params:["newHeads"],onData(e){if(!n)return;const r=Is(e.result?.number);t.onBlockNumber(r,o),o=r},onError(e){t.onError?.(e)}});r=a,n||r()}catch(e){a?.(e)}})(),r}))}function Tp(e){return{call:t=>Pu(e,t),createBlockFilter:()=>async function(e){const t=ac(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>sc(e,t),createEventFilter:t=>Od(e,t),createPendingTransactionFilter:()=>Sd(e),estimateContractGas:t=>tu(e,t),estimateGas:t=>eu(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const a=n?xs(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,a||r]});return BigInt(s)}(e,t),getBlock:t=>Vl(e,t),getBlockNumber:t=>Gu(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const a=void 0!==n?xs(n):void 0;let s;return s=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[a||r]}),Ns(s)}(e,t),getBytecode:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const a=void 0!==n?xs(n):void 0,s=await e.request({method:"eth_getCode",params:[t,a||r]});if("0x"!==s)return s}(e,t),getChainId:()=>Yl(e),getContractEvents:t=>ou(e,t),getEnsAddress:t=>async function(e,{blockNumber:t,blockTag:n,coinType:r,name:a,gatewayUrls:s,strict:i,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=xu({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const i=cc({abi:fu,functionName:"addr",...null!=r?{args:[hd(a),BigInt(r)]}:{args:[hd(a)]}}),o={address:c,abi:pu,functionName:"resolve",args:[vs(yd(a)),i],blockNumber:t,blockTag:n},l=mo(e,Du,"readContract"),u=s?await l({...o,args:[...o.args,s]}):await l(o);if("0x"===u[0])return null;const d=lu({abi:fu,args:null!=r?[hd(a),BigInt(r)]:void 0,functionName:"addr",data:u[0]});return"0x"===d||"0x00"===hs(d)?null:d}catch(e){if(i)throw e;if(dd(e,"resolve"))return null;throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:a,gatewayUrls:s,strict:i,universalResolverAddress:o}){const c=await mo(e,Fd,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:a,universalResolverAddress:o,gatewayUrls:s,strict:i});if(!c)return null;try{return await Dd(e,{record:c,gatewayUrls:r})}catch{return null}}(e,t),getEnsName:t=>async function(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:a,strict:s,universalResolverAddress:i}){let o=i;if(!o){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=xu({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const s={address:o,abi:hu,functionName:"reverse",args:[vs(yd(c))],blockNumber:n,blockTag:r},i=mo(e,Du,"readContract"),[l,u]=a?await i({...s,args:[...s.args,a]}):await i(s);return t.toLowerCase()!==u.toLowerCase()?null:l}catch(e){if(s)throw e;if(dd(e,"reverse"))return null;throw e}}(e,t),getEnsResolver:t=>async function(e,{blockNumber:t,blockTag:n,name:r,universalResolverAddress:a}){let s=a;if(!s){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=xu({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[i]=await mo(e,Du,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[vs(yd(r))],blockNumber:t,blockTag:n});return i}(e,t),getEnsText:t=>Fd(e,t),getFeeHistory:t=>Md(e,t),estimateFeesPerGas:t=>async function(e,t){return Wl(e,t)}(e,t),getFilterChanges:e=>Hu(0,e),getFilterLogs:e=>async function(e,{filter:t}){const n=t.strict??!1,r=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map((e=>Hs(e)));return t.abi?su({abi:t.abi,logs:r,strict:n}):r}(0,e),getGasPrice:()=>ql(e),getLogs:t=>iu(e,t),getProof:t=>wp(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return Zl(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:a}){const s=void 0!==n?xs(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,a,s||r]})}(e,t),getTransaction:t=>vp(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,a]=await Promise.all([mo(e,Gu,"getBlockNumber")({}),t?mo(e,vp,"getBlockNumber")({hash:t}):void 0]),s=n?.blockNumber||a?.blockNumber;return s?r-s+1n:0n}(e,t),getTransactionCount:t=>Kl(e,t),getTransactionReceipt:t=>Cp(e,t),multicall:t=>async function(e,t){const{allowFailure:n=!0,batchSize:r,blockNumber:a,blockTag:s,multicallAddress:i,stateOverride:o}=t,c=t.contracts,l=r??("object"==typeof e.batch?.multicall&&e.batch.multicall.batchSize||1024);let u=i;if(!u){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");u=xu({blockNumber:a,chain:e.chain,contract:"multicall3"})}const d=[[]];let p=0,h=0;for(let e=0;e<c.length;e++){const{abi:t,address:r,args:a,functionName:s}=c[e];try{const e=cc({abi:t,args:a,functionName:s});h+=(e.length-2)/2,l>0&&h>l&&d[p].length>0&&(p++,h=(e.length-2)/2,d[p]=[]),d[p]=[...d[p],{allowFailure:!0,callData:e,target:r}]}catch(e){const i=Cl(e,{abi:t,address:r,args:a,docsPath:"/docs/contract/multicall",functionName:s});if(!n)throw i;d[p]=[...d[p],{allowFailure:!0,callData:"0x",target:r}]}}const m=await Promise.allSettled(d.map((t=>mo(e,Du,"readContract")({abi:uu,address:u,args:[t],blockNumber:a,blockTag:s,functionName:"aggregate3",stateOverride:o})))),f=[];for(let e=0;e<m.length;e++){const t=m[e];if("rejected"===t.status){if(!n)throw t.reason;for(let n=0;n<d[e].length;n++)f.push({status:"failure",error:t.reason,result:void 0});continue}const r=t.value;for(let t=0;t<r.length;t++){const{returnData:a,success:s}=r[t],{callData:i}=d[e][t],{abi:o,address:l,functionName:u,args:p}=c[f.length];try{if("0x"===i)throw new vo;if(!s)throw new Kc({data:a});const e=lu({abi:o,args:p,data:a,functionName:u});f.push(n?{result:e,status:"success"}:e)}catch(e){const t=Cl(e,{abi:o,address:l,args:p,docsPath:"/docs/contract/multicall",functionName:u});if(!n)throw t;f.push({error:t,result:void 0,status:"failure"})}}}if(f.length!==c.length)throw new ss("multicall results mismatch");return f}(e,t),prepareTransactionRequest:t=>Ql(e,t),readContract:t=>Du(e,t),sendRawTransaction:t=>Vu(e,t),simulateContract:t=>Fu(e,t),verifyMessage:t=>async function(e,{address:t,message:n,signature:r,...a}){return xp(e,{address:t,hash:tp(n),signature:r,...a})}(e,t),verifyTypedData:t=>async function(e,t){const{address:n,signature:r,message:a,primaryType:s,types:i,domain:o,...c}=t;return xp(e,{address:n,hash:Ud({message:a,primaryType:s,types:i,domain:o}),signature:r,...c})}(e,t),uninstallFilter:e=>zu(0,e),waitForTransactionReceipt:t=>async function(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:a=e.pollingInterval,retryCount:s=6,retryDelay:i=(({count:e})=>200*~~(1<<e)),timeout:o}){const c=Pc(["waitForTransactionReceipt",e.uid,n]);let l,u,d,p=!1;return new Promise(((h,m)=>{o&&setTimeout((()=>m(new $c({hash:n}))),o);const f=Iu(c,{onReplaced:r,resolve:h,reject:m},(r=>{const o=mo(e,kp,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:a,async onBlockNumber(a){if(p)return;let c=a;const h=e=>{o(),e(),f()};try{if(d){if(t>1&&(!d.blockNumber||c-d.blockNumber+1n<t))return;return void h((()=>r.resolve(d)))}if(l||(p=!0,await nd((async()=>{l=await mo(e,vp,"getTransaction")({hash:n}),l.blockNumber&&(c=l.blockNumber)}),{delay:i,retryCount:s}),p=!1),d=await mo(e,Cp,"getTransactionReceipt")({hash:n}),t>1&&(!d.blockNumber||c-d.blockNumber+1n<t))return;h((()=>r.resolve(d)))}catch(n){if(n instanceof Hc||n instanceof zc){if(!l)return void(p=!1);try{u=l,p=!0;const n=await nd((()=>mo(e,Vl,"getBlock")({blockNumber:c,includeTransactions:!0})),{delay:i,retryCount:s,shouldRetry:({error:e})=>e instanceof $l});p=!1;const a=n.transactions.find((({from:e,nonce:t})=>e===u.from&&t===u.nonce));if(!a)return;if(d=await mo(e,Cp,"getTransactionReceipt")({hash:a.hash}),t>1&&(!d.blockNumber||c-d.blockNumber+1n<t))return;let o="replaced";a.to===u.to&&a.value===u.value?o="repriced":a.from===a.to&&0n===a.value&&(o="cancelled"),h((()=>{r.onReplaced?.({reason:o,replacedTransaction:u,transaction:a,transactionReceipt:d}),r.resolve(d)}))}catch(e){h((()=>r.reject(e)))}}else h((()=>r.reject(n)))}}})}))}))}(e,t),watchBlocks:t=>function(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:a,onError:s,includeTransactions:i,poll:o,pollingInterval:c=e.pollingInterval}){const l=void 0!==o?o:"webSocket"!==e.transport.type,u=i??!1;let d;return l?Iu(Pc(["watchBlocks",e.uid,n,r,u,c]),{onBlock:a,onError:s},(a=>Uu((async()=>{try{const r=await mo(e,Vl,"getBlock")({blockTag:t,includeTransactions:u});if(r.number&&d?.number){if(r.number===d.number)return;if(r.number-d.number>1&&n)for(let t=d?.number+1n;t<r.number;t++){const n=await mo(e,Vl,"getBlock")({blockNumber:t,includeTransactions:u});a.onBlock(n,d),d=n}}(!d?.number||"pending"===t&&!r?.number||r.number&&r.number>d.number)&&(a.onBlock(r,d),d=r)}catch(e){a.onError?.(e)}}),{emitOnBegin:r,interval:c}))):(()=>{let t=!0,n=()=>t=!1;return(async()=>{try{const{unsubscribe:r}=await e.transport.subscribe({params:["newHeads"],onData(n){if(!t)return;const r=(e.chain?.formatters?.block?.format||js)(n.result);a(r,d),d=r},onError(e){s?.(e)}});n=r,t||n()}catch(e){s?.(e)}})(),n})()}(e,t),watchBlockNumber:t=>kp(e,t),watchContractEvent:t=>$u(e,t),watchEvent:t=>function(e,{address:t,args:n,batch:r=!0,event:a,events:s,onError:i,onLogs:o,poll:c,pollingInterval:l=e.pollingInterval,strict:u}){const d=void 0!==c?c:"webSocket"!==e.transport.type,p=u??!1;return d?Iu(Pc(["watchEvent",t,n,r,e.uid,a,l]),{onLogs:o,onError:i},(i=>{let o,c,u=!1;const d=Uu((async()=>{if(u)try{let l;if(c)l=await mo(e,Hu,"getFilterChanges")({filter:c});else{const r=await mo(e,Gu,"getBlockNumber")({});l=o&&o!==r?await mo(e,iu,"getLogs")({address:t,args:n,event:a,events:s,fromBlock:o+1n,toBlock:r}):[],o=r}if(0===l.length)return;if(r)i.onLogs(l);else for(const e of l)i.onLogs([e])}catch(e){c&&e instanceof il&&(u=!1),i.onError?.(e)}else{try{c=await mo(e,Od,"createEventFilter")({address:t,args:n,event:a,events:s,strict:p})}catch{}u=!0}}),{emitOnBegin:!0,interval:l});return async()=>{c&&await mo(e,zu,"uninstallFilter")({filter:c}),d()}})):(()=>{let r=!0,c=()=>r=!1;return(async()=>{try{const l=s??(a?[a]:void 0);let d=[];l&&(d=[l.flatMap((e=>nc({abi:[e],eventName:e.name,args:n})))],a&&(d=d[0]));const{unsubscribe:h}=await e.transport.subscribe({params:["logs",{address:t,topics:d}],onData(e){if(!r)return;const t=e.result;try{const{eventName:e,args:n}=ru({abi:l??[],data:t.data,topics:t.topics,strict:p}),r=Hs(t,{args:n,eventName:e});o([r])}catch(e){let n,r;if(e instanceof So||e instanceof Mo){if(u)return;n=e.abiItem.name,r=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const a=Hs(t,{args:r?[]:{},eventName:n});o([a])}},onError(e){i?.(e)}});c=h,r||c()}catch(e){i?.(e)}})(),c})()}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:n,onTransactions:r,poll:a,pollingInterval:s=e.pollingInterval}){return(void 0!==a?a:"webSocket"!==e.transport.type)?Iu(Pc(["watchPendingTransactions",e.uid,t,s]),{onTransactions:r,onError:n},(n=>{let r;const a=Uu((async()=>{try{if(!r)try{return void(r=await mo(e,Sd,"createPendingTransactionFilter")({}))}catch(e){throw a(),e}const s=await mo(e,Hu,"getFilterChanges")({filter:r});if(0===s.length)return;if(t)n.onTransactions(s);else for(const e of s)n.onTransactions([e])}catch(e){n.onError?.(e)}}),{emitOnBegin:!0,interval:s});return async()=>{r&&await mo(e,zu,"uninstallFilter")({filter:r}),a()}})):(()=>{let t=!0,a=()=>t=!1;return(async()=>{try{const{unsubscribe:s}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const n=e.result;r([n])},onError(e){n?.(e)}});a=s,t||a()}catch(e){n?.(e)}})(),a})()}(e,t)}}function Pp(e,t="hex"){const n=Ap(e),r=yc(new Uint8Array(n.length));return n.encode(r),"hex"===t?Es(r.bytes):r.bytes}function Ap(e){return Array.isArray(e)?function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=_p(t);return{length:t<=55?1+t:1+n+t,encode(r){t<=55?r.pushByte(192+t):(r.pushByte(247+n),1===n?r.pushUint8(t):2===n?r.pushUint16(t):3===n?r.pushUint24(t):r.pushUint32(t));for(const{encode:t}of e)t(r)}}}(e.map((e=>Ap(e)))):function(e){const t="string"==typeof e?Fs(e):e,n=_p(t.length),r=1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length;return{length:r,encode(e){1===t.length&&t[0]<128?e.pushBytes(t):t.length<=55?(e.pushByte(128+t.length),e.pushBytes(t)):(e.pushByte(183+n),1===n?e.pushUint8(t.length):2===n?e.pushUint16(t.length):3===n?e.pushUint24(t.length):e.pushUint32(t.length),e.pushBytes(t))}}}(e)}function _p(e){if(e<256)return 1;if(e<65536)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new ss("Length is too large.")}BigInt(0),BigInt(1),BigInt(2);const Dp={contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:qs,serializers:{transaction:function(e,t){return function(e){return"deposit"===e.type||void 0!==e.sourceHash}(e)?function(e){!function(e){const{from:t,to:n}=e;if(t&&!_i(t))throw new Zs({address:t});if(n&&!_i(n))throw new Zs({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:a,isSystemTx:s,mint:i,to:o,value:c}=e;return Fi(["0x7e",Pp([t,r,o??"0x",i?vs(i):"0x",c?vs(c):"0x",a?vs(a):"0x",s?"0x1":"0x",n??"0x"])])}(e):bp(e,t)}}},Fp=ns({...Dp,id:888888888,name:"Ancient8",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ancient8.gg"]}},blockExplorers:{default:{name:"Ancient8 explorer",url:"https://scan.ancient8.gg",apiUrl:"https://scan.ancient8.gg/api"}},contracts:{...Dp.contracts,l2OutputOracle:{1:{address:"0xB09DC08428C8b4EFB4ff9C0827386CDF34277996"}},portal:{1:{address:"0x639F2AECE398Aa76b07e59eF6abe2cFe32bacb68",blockCreated:19070571}},l1StandardBridge:{1:{address:"0xd5e3eDf5b68135D559D572E26bF863FBC1950033",blockCreated:19070571}}},sourceId:1}),Op=11155111,Sp=ns({...Dp,id:28122024,name:"Ancient8 Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpcv2-testnet.ancient8.gg"]}},blockExplorers:{default:{name:"Ancient8 Celestia Testnet explorer",url:"https://scanv2-testnet.ancient8.gg",apiUrl:"https://scanv2-testnet.ancient8.gg/api"}},contracts:{...Dp.contracts,l2OutputOracle:{[Op]:{address:"0x942fD5017c0F60575930D8574Eaca13BEcD6e1bB"}},portal:{[Op]:{address:"0xfa1d9E26A6aCD7b22115D27572c1221B9803c960",blockCreated:4972908}},l1StandardBridge:{[Op]:{address:"0xF6Bc0146d3c74D48306e79Ae134A260E418C9335",blockCreated:4972908}}},sourceId:Op}),Mp=ns({id:31337,name:"Anvil",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}}),Ip=ns({id:3993,name:"APEX Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet.apexlayer.xyz"]}},blockExplorers:{default:{name:"Blockscout",url:"https://exp-testnet.apexlayer.xyz",apiUrl:"https://exp-testnet.apexlayer.xyz/api"}},contracts:{multicall3:{address:"0xf7642be33a6b18D16a995657adb5a68CD0438aE2",blockCreated:283775}},testnet:!0}),Np=ns({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),Up=ns({id:421613,name:"Arbitrum Goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114}},testnet:!0}),Lp=ns({id:42170,name:"Arbitrum Nova",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://nova.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://nova.arbiscan.io",apiUrl:"https://api-nova.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1746963}}}),Bp=ns({id:592,name:"Astar",network:"astar-mainnet",nativeCurrency:{name:"Astar",symbol:"ASTR",decimals:18},rpcUrls:{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}),Rp=ns({id:3776,name:"Astar zkEVM",network:"AstarZkEVM",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.startale.com/astar-zkevm"]}},blockExplorers:{default:{name:"Astar zkEVM Explorer",url:"https://astar-zkevm.explorer.startale.com"}},contracts:{multicall3:{address:"0x36eabf148272BA81A5225C6a3637972F0EE17771",blockCreated:93528}},testnet:!1}),jp=ns({id:6038361,name:"Astar zkEVM Testnet zKyoto",network:"zKyoto",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.startale.com/zkyoto"]}},blockExplorers:{default:{name:"zKyoto Explorer",url:"https://astar-zkyoto.blockscout.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:196153}},testnet:!0}),Gp=ns({id:421614,name:"Arbitrum Sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://sepolia.arbiscan.io",apiUrl:"https://sepolia.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:81930}},testnet:!0}),Hp=ns({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"]}},blockExplorers:{default:{name:"zKatana Explorer",url:"https://zkatana.explorer.startale.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:31317}},testnet:!0}),zp=ns({id:1313161554,name:"Aurora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.aurora.dev"]}},blockExplorers:{default:{name:"Aurorascan",url:"https://aurorascan.dev",apiUrl:"https://aurorascan.dev/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:62907816}}}),$p=ns({id:1313161555,name:"Aurora Testnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.aurora.dev"]}},blockExplorers:{default:{name:"Aurorascan",url:"https://testnet.aurorascan.dev",apiUrl:"https://testnet.aurorascan.dev/api"}},testnet:!0}),Vp=ns({id:205205,name:"Auroria Testnet",network:"auroria",nativeCurrency:{name:"Auroria Stratis",symbol:"tSTRAX",decimals:18},rpcUrls:{default:{http:["https://auroria.rpc.stratisevm.com"]}},blockExplorers:{default:{name:"Auroria Testnet Explorer",url:"https://auroria.explorer.stratisevm.com"}},testnet:!0}),qp=ns({id:43114,name:"Avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowScan",url:"https://snowscan.xyz",apiUrl:"https://api.snowscan.xyz/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),Zp=ns({id:43113,name:"Avalanche Fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowScan",url:"https://testnet.snowscan.xyz",apiUrl:"https://api-testnet.snowscan.xyz"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7096959}},testnet:!0}),Wp=ns({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",apiUrl:"https://www.ftnscan.com/api"}}}),Kp=ns({...Dp,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...Dp.contracts,l2OutputOracle:{1:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{1:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{1:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),Jp=ns({...Dp,id:84531,name:"Base Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org",apiUrl:"https://goerli.basescan.org/api"}},contracts:{...Dp.contracts,l2OutputOracle:{5:{address:"0x2A35891ff30313CcFa6CE88dcf3858bb075A2298"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1376988},portal:{5:{address:"0xe93c8cD0D409341205A592f8c4Ac1A5fe5585cfA"}},l1StandardBridge:{5:{address:"0xfA6D8Ee5BE770F84FC001D098C4bD604Fe01284a"}}},testnet:!0,sourceId:5}),Xp=11155111,Yp=ns({...Dp,id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://sepolia.basescan.org",apiUrl:"https://api-sepolia.basescan.org/api"}},contracts:{...Dp.contracts,l2OutputOracle:{[Xp]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[Xp]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[Xp]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:Xp}),Qp=ns({id:4337,name:"Beam",network:"beam",nativeCurrency:{decimals:18,name:"Beam",symbol:"BEAM"},rpcUrls:{public:{http:["https://build.onbeam.com/rpc"]},default:{http:["https://build.onbeam.com/rpc"]}},blockExplorers:{default:{name:"Beam Explorer",url:"https://subnets.avax.network/beam"}},contracts:{multicall3:{address:"0x4956f15efdc3dc16645e90cc356eafa65ffc65ec",blockCreated:1}}}),eh=ns({id:13337,name:"Beam Testnet",network:"beam",nativeCurrency:{decimals:18,name:"Beam",symbol:"BEAM"},rpcUrls:{public:{http:["https://build.onbeam.com/rpc/testnet"]},default:{http:["https://build.onbeam.com/rpc/testnet"]}},blockExplorers:{default:{name:"Beam Explorer",url:"https://subnets-test.avax.network/beam"}},contracts:{multicall3:{address:"0x9bf49b704ee2a095b95c1f2d4eb9010510c41c9e",blockCreated:3}},testnet:!0}),th=ns({id:641230,name:"Bear Network Chain Mainnet",nativeCurrency:{decimals:18,name:"BearNetworkChain",symbol:"BRNKC"},rpcUrls:{default:{http:["https://brnkc-mainnet.bearnetwork.net"]}},blockExplorers:{default:{name:"BrnkScan",url:"https://brnkscan.bearnetwork.net",apiUrl:"https://brnkscan.bearnetwork.net/api"}}}),nh=ns({id:751230,name:"Bear Network Chain Testnet",nativeCurrency:{decimals:18,name:"tBRNKC",symbol:"tBRNKC"},rpcUrls:{default:{http:["https://brnkc-test.bearnetwork.net"]}},blockExplorers:{default:{name:"BrnkTestScan",url:"https://brnktest-scan.bearnetwork.net",apiUrl:"https://brnktest-scan.bearnetwork.net/api"}},testnet:!0}),rh=ns({id:80085,name:"Berachain Artio",nativeCurrency:{decimals:18,name:"BERA Token",symbol:"BERA"},rpcUrls:{default:{http:["https://artio.rpc.berachain.com"]}},blockExplorers:{default:{name:"Berachain",url:"https://artio.beratrail.io"}},testnet:!0}),ah=ns({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:{default:{name:"Bttcscan",url:"https://bttcscan.com",apiUrl:"https://api.bttcscan.com/api"}}}),sh=ns({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:{default:{name:"Bttcscan",url:"https://testnet.bttcscan.com",apiUrl:"https://testnet.bttcscan.com/api"}},testnet:!0}),ih=ns({id:81457,name:"Blast",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.blast.io"]}},blockExplorers:{default:{name:"Blastscan",url:"https://blastscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:212929}},sourceId:1}),oh=ns({id:168587773,name:"Blast Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.blast.io"]}},blockExplorers:{default:{name:"Blastscan",url:"https://testnet.blastscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:756690}},testnet:!0,sourceId:11155111}),ch=ns({id:288,name:"Boba Network",nativeCurrency:{decimals:18,name:"Boba",symbol:"BOBA"},rpcUrls:{default:{http:["https://mainnet.boba.network"]}},blockExplorers:{default:{name:"BOBAScan",url:"https://bobascan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:446859}}}),lh=ns({id:1039,name:"Bronos",nativeCurrency:{decimals:18,name:"BRO",symbol:"BRO"},rpcUrls:{default:{http:["https://evm.bronos.org"]}},blockExplorers:{default:{name:"BronoScan",url:"https://broscan.bronos.org"}}}),uh=ns({id:1038,name:"Bronos Testnet",nativeCurrency:{decimals:18,name:"Bronos Coin",symbol:"tBRO"},rpcUrls:{default:{http:["https://evm-testnet.bronos.org"]}},blockExplorers:{default:{name:"BronoScan",url:"https://tbroscan.bronos.org"}},testnet:!0}),dh=ns({id:56,name:"BNB Smart Chain",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://rpc.ankr.com/bsc"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),ph=ns({id:97,name:"Binance Smart Chain Testnet",nativeCurrency:{decimals:18,name:"BNB",symbol:"tBNB"},rpcUrls:{default:{http:["https://data-seed-prebsc-1-s1.bnbchain.org:8545"]}},blockExplorers:{default:{name:"BscScan",url:"https://testnet.bscscan.com",apiUrl:"https://testnet.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:17422483}},testnet:!0}),hh=ns({id:1017,name:"BNB Greenfield Chain",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://greenfield-chain.bnbchain.org"]}},blockExplorers:{default:{name:"BNB Greenfield Mainnet Scan",url:"https://greenfieldscan.com"}},testnet:!1}),mh=ns({id:4999,name:"BlackFort Exchange Network",nativeCurrency:{name:"BlackFort Token",symbol:"BXN",decimals:18},rpcUrls:{default:{http:["https://mainnet.blackfort.network/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.blackfort.network",apiUrl:"https://explorer.blackfort.network/api"}}}),fh=ns({id:4777,name:"BlackFort Exchange Network Testnet",nativeCurrency:{name:"BlackFort Testnet Token",symbol:"TBXN",decimals:18},rpcUrls:{default:{http:["https://testnet.blackfort.network/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://testnet-explorer.blackfort.network",apiUrl:"https://testnet-explorer.blackfort.network/api"}}}),yh=ns({id:7700,name:"Canto",nativeCurrency:{decimals:18,name:"Canto",symbol:"CANTO"},rpcUrls:{default:{http:["https://canto.gravitychain.io"]}},blockExplorers:{default:{name:"Tuber.Build (Blockscout)",url:"https://tuber.build"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2905789}}});function bh(e){return 0===e||0n===e||null==e||"0"===e||""===e||"string"==typeof e&&("0x"===hs(e).toLowerCase()||"0x00"===hs(e).toLowerCase())}function gh(e){return!bh(e)}function wh(e){return void 0!==e.maxFeePerGas&&void 0!==e.maxPriorityFeePerGas}function vh(e){return"cip42"===e.type||wh(e)&&(gh(e.feeCurrency)||gh(e.gatewayFeeRecipient)||gh(e.gatewayFee))}function Ch(e){return"cip64"===e.type||wh(e)&&gh(e.feeCurrency)&&bh(e.gatewayFee)&&bh(e.gatewayFeeRecipient)}const Eh={transaction:function(e,t){return Ch(e)?function(e,t){!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:s,feeCurrency:i}=e;if(t<=0)throw new Eu({chainId:t});if(s&&!_i(s))throw new Zs({address:s});if(r)throw new ss("`gasPrice` is not a valid CIP-64 Transaction attribute.");if(gh(a)&&a>xh)throw new kl({maxFeePerGas:a});if(gh(n)&&gh(a)&&n>a)throw new Ml({maxFeePerGas:a,maxPriorityFeePerGas:n});if(gh(i)&&!_i(i))throw new ss("`feeCurrency` MUST be a token address for CIP-64 transactions.");if(bh(i))throw new ss("`feeCurrency` must be provided for CIP-64 transactions.")}(e);const{chainId:n,gas:r,nonce:a,to:s,value:i,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,feeCurrency:u,data:d}=e,p=[vs(n),a?vs(a):"0x",c?vs(c):"0x",o?vs(o):"0x",r?vs(r):"0x",s??"0x",i?vs(i):"0x",d??"0x",yp(l),u,...gp(e,t)];return Fi(["0x7b",Pp(p)])}(e,t):vh(e)?function(e,t){!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:s,feeCurrency:i,gatewayFee:o,gatewayFeeRecipient:c}=e;if(t<=0)throw new Eu({chainId:t});if(s&&!_i(s))throw new Zs({address:s});if(r)throw new ss("`gasPrice` is not a valid CIP-42 Transaction attribute.");if(gh(a)&&a>xh)throw new kl({maxFeePerGas:a});if(gh(n)&&gh(a)&&n>a)throw new Ml({maxFeePerGas:a,maxPriorityFeePerGas:n});if(gh(o)&&bh(c)||gh(c)&&bh(o))throw new ss("`gatewayFee` and `gatewayFeeRecipient` must be provided together.");if(gh(i)&&!_i(i))throw new ss("`feeCurrency` MUST be a token address for CIP-42 transactions.");if(gh(c)&&!_i(c))throw new Zs(c);if(bh(i)&&bh(c))throw new ss("Either `feeCurrency` or `gatewayFeeRecipient` must be provided for CIP-42 transactions.")}(e);const{chainId:n,gas:r,nonce:a,to:s,value:i,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,feeCurrency:u,gatewayFeeRecipient:d,gatewayFee:p,data:h}=e,m=[vs(n),a?vs(a):"0x",c?vs(c):"0x",o?vs(o):"0x",r?vs(r):"0x",u??"0x",d??"0x",p?vs(p):"0x",s??"0x",i?vs(i):"0x",h??"0x",yp(l),...gp(e,t)];return Fi(["0x7c",Pp(m)])}(e,t):bp(e,t)}};const xh=2n**256n-1n;const kh={formatters:{block:Gs({exclude:["difficulty","gasLimit","mixHash","nonce","uncles"],format(e){const t=e.transactions?.map((e=>"string"==typeof e?e:{...Bs(e),feeCurrency:e.feeCurrency,..."0x7b"!==e.type?{gatewayFee:e.gatewayFee?Is(e.gatewayFee):null,gatewayFeeRecipient:e.gatewayFeeRecipient||null}:{}}));return{randomness:e.randomness,transactions:t}}}),transaction:Rs({format(e){const t={feeCurrency:e.feeCurrency};return"0x7b"===e.type?t.type="cip64":("0x7c"===e.type&&(t.type="cip42"),t.gatewayFee=e.gatewayFee?Is(e.gatewayFee):null,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}}),transactionRequest:Rl({format(e){const t={feeCurrency:e.feeCurrency};return Ch(e)?t.type="0x7b":(vh(e)&&(t.type="0x7c"),t.gatewayFee=void 0!==e.gatewayFee?xs(e.gatewayFee):void 0,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}})},serializers:Eh},Th=ns({...kh,id:42220,name:"Celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet",apiUrl:"https://explorer.celo.org/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:13112599}},testnet:!1}),Ph=ns({...kh,id:44787,name:"Alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"A-CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores",apiUrl:"https://explorer.celo.org/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:14569001}},testnet:!0}),Ah=ns({id:88888,name:"Chiliz Chain",network:"chiliz-chain",nativeCurrency:{decimals:18,name:"CHZ",symbol:"CHZ"},rpcUrls:{default:{http:["https://rpc.ankr.com/chiliz","https://chiliz.publicnode.com"]}},blockExplorers:{default:{name:"Chiliz Explorer",url:"https://scan.chiliz.com",apiUrl:"https://scan.chiliz.com/api"}}}),_h=ns({id:61,name:"Ethereum Classic",nativeCurrency:{decimals:18,name:"ETC",symbol:"ETC"},rpcUrls:{default:{http:["https://etc.rivet.link"]}},blockExplorers:{default:{name:"Blockscout",url:"https://blockscout.com/etc/mainnet"}}}),Dh=ns({id:1030,name:"Conflux eSpace",nativeCurrency:{name:"Conflux",symbol:"CFX",decimals:18},rpcUrls:{default:{http:["https://evm.confluxrpc.org"],webSocket:["wss://evm.confluxrpc.org/ws"]}},blockExplorers:{default:{name:"ConfluxScan",url:"https://evm.confluxscan.io"}},contracts:{multicall3:{address:"0xEFf0078910f638cd81996cc117bccD3eDf2B072F",blockCreated:68602935}}}),Fh=ns({id:71,name:"Conflux eSpace Testnet",network:"cfx-espace-testnet",testnet:!0,nativeCurrency:{name:"Conflux",symbol:"CFX",decimals:18},rpcUrls:{default:{http:["https://evmtestnet.confluxrpc.org"],webSocket:["wss://evmtestnet.confluxrpc.org/ws"]}},blockExplorers:{default:{name:"ConfluxScan",url:"https://evmtestnet.confluxscan.io"}},contracts:{multicall3:{address:"0xEFf0078910f638cd81996cc117bccD3eDf2B072F",blockCreated:117499050}}}),Oh=ns({id:1116,name:"Core Dao",nativeCurrency:{decimals:18,name:"Core",symbol:"CORE"},rpcUrls:{default:{http:["https://rpc.coredao.org"]}},blockExplorers:{default:{name:"CoreDao",url:"https://scan.coredao.org"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:11907934}},testnet:!1}),Sh=ns({id:25,name:"Cronos Mainnet",nativeCurrency:{decimals:18,name:"Cronos",symbol:"CRO"},rpcUrls:{default:{http:["https://evm.cronos.org"]}},blockExplorers:{default:{name:"Cronoscan",url:"https://cronoscan.com",apiUrl:"https://api.cronoscan.com/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1963112}}}),Mh=ns({id:338,name:"Cronos Testnet",nativeCurrency:{decimals:18,name:"CRO",symbol:"tCRO"},rpcUrls:{default:{http:["https://evm-t3.cronos.org"]}},blockExplorers:{default:{name:"Cronos Explorer",url:"https://cronos.org/explorer/testnet3"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:10191251}},testnet:!0}),Ih=ns({id:3737,name:"Crossbell",nativeCurrency:{decimals:18,name:"CSB",symbol:"CSB"},rpcUrls:{default:{http:["https://rpc.crossbell.io"]}},blockExplorers:{default:{name:"CrossScan",url:"https://scan.crossbell.io",apiUrl:"https://scan.crossbell.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:38246031}}}),Nh=ns({id:1130,network:"defichain-evm",name:"DeFiChain EVM Mainnet",nativeCurrency:{name:"DeFiChain",symbol:"DFI",decimals:8},rpcUrls:{default:{http:["https://eth.mainnet.ocean.jellyfishsdk.com"]},public:{http:["https://eth.mainnet.ocean.jellyfishsdk.com"]}},blockExplorers:{default:{name:"DeFiScan",url:"https://meta.defiscan.live"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:137852}}}),Uh=ns({id:1131,network:"defichain-evm-testnet",name:"DeFiChain EVM Testnet",nativeCurrency:{name:"DeFiChain",symbol:"DFI",decimals:8},rpcUrls:{default:{http:["https://eth.testnet.ocean.jellyfishsdk.com"]},public:{http:["https://eth.testnet.ocean.jellyfishsdk.com"]}},blockExplorers:{default:{name:"DeFiScan",url:"https://meta.defiscan.live/?network=TestNet"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:156462}},testnet:!0}),Lh=ns({id:53935,name:"DFK Chain",nativeCurrency:{decimals:18,name:"Jewel",symbol:"JEWEL"},rpcUrls:{default:{http:["https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"]}},blockExplorers:{default:{name:"DFKSubnetScan",url:"https://subnets.avax.network/defi-kingdoms"}}}),Bh=ns({id:2e3,name:"Dogechain",nativeCurrency:{decimals:18,name:"Dogechain",symbol:"DC"},rpcUrls:{default:{http:["https://rpc.dogechain.dog"]}},blockExplorers:{default:{name:"DogeChainExplorer",url:"https://explorer.dogechain.dog",apiUrl:"https://explorer.dogechain.dog/api"}}}),Rh=ns({id:2021,name:"Edgeware EdgeEVM Mainnet",nativeCurrency:{decimals:18,name:"Edgeware",symbol:"EDG"},rpcUrls:{default:{http:["https://edgeware-evm.jelliedowl.net"]}},blockExplorers:{default:{name:"Edgscan by Bharathcoorg",url:"https://edgscan.live",apiUrl:"https://edgscan.live/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:18117872}}}),jh=ns({id:2022,name:"Beresheet BereEVM Testnet",nativeCurrency:{decimals:18,name:"Testnet EDG",symbol:"tEDG"},rpcUrls:{default:{http:["https://beresheet-evm.jelliedowl.net"]}},blockExplorers:{default:{name:"Edgscan by Bharathcoorg",url:"https://testnet.edgscan.live",apiUrl:"https://testnet.edgscan.live/api"}}}),Gh=ns({id:17777,name:"EOS EVM",nativeCurrency:{decimals:18,name:"EOS",symbol:"EOS"},rpcUrls:{default:{http:["https://api.evm.eosnetwork.com"]}},blockExplorers:{default:{name:"EOS EVM Explorer",url:"https://explorer.evm.eosnetwork.com",apiUrl:"https://explorer.evm.eosnetwork.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7943933}}}),Hh=ns({id:15557,name:"EOS EVM Testnet",nativeCurrency:{decimals:18,name:"EOS",symbol:"EOS"},rpcUrls:{default:{http:["https://api.testnet.evm.eosnetwork.com"]}},blockExplorers:{default:{name:"EOS EVM Testnet Explorer",url:"https://explorer.testnet.evm.eosnetwork.com",apiUrl:"https://explorer.testnet.evm.eosnetwork.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:9067940}},testnet:!0}),zh=ns({id:128123,name:"Etherlink Testnet",nativeCurrency:{decimals:18,name:"Tez",symbol:"XTZ"},rpcUrls:{default:{http:["https://node.ghostnet.etherlink.com"]}},blockExplorers:{default:{name:"Etherlink Testnet",url:"https://testnet-explorer.etherlink.com"}},testnet:!0}),$h=ns({id:9001,name:"Evmos",nativeCurrency:{decimals:18,name:"Evmos",symbol:"EVMOS"},rpcUrls:{default:{http:["https://eth.bd.evmos.org:8545"]}},blockExplorers:{default:{name:"Evmos Block Explorer",url:"https://escan.live"}}}),Vh=ns({id:9e3,name:"Evmos Testnet",nativeCurrency:{decimals:18,name:"Evmos",symbol:"EVMOS"},rpcUrls:{default:{http:["https://eth.bd.evmos.dev:8545"]}},blockExplorers:{default:{name:"Evmos Testnet Block Explorer",url:"https://evm.evmos.dev/"}}}),qh=ns({id:1994,name:"Ekta",nativeCurrency:{decimals:18,name:"EKTA",symbol:"EKTA"},rpcUrls:{default:{http:["https://main.ekta.io"]}},blockExplorers:{default:{name:"Ektascan",url:"https://ektascan.io",apiUrl:"https://ektascan.io/api"}}}),Zh=ns({id:1004,name:"Ekta Testnet",nativeCurrency:{decimals:18,name:"EKTA",symbol:"EKTA"},rpcUrls:{default:{http:["https://test.ekta.io:8545"]}},blockExplorers:{default:{name:"Test Ektascan",url:"https://test.ektascan.io",apiUrl:"https://test.ektascan.io/api"}},testnet:!0}),Wh=ns({id:250,name:"Fantom",nativeCurrency:{decimals:18,name:"Fantom",symbol:"FTM"},rpcUrls:{default:{http:["https://rpc.ankr.com/fantom"]}},blockExplorers:{default:{name:"FTMScan",url:"https://ftmscan.com",apiUrl:"https://api.ftmscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:33001987}}}),Kh=ns({id:64240,name:"Fantom Sonic Open Testnet",network:"fantom-sonic-testnet",nativeCurrency:{decimals:18,name:"Fantom",symbol:"FTM"},rpcUrls:{default:{http:["https://rpcapi.sonic.fantom.network"]}},blockExplorers:{default:{name:"Fantom Sonic Open Testnet Explorer",url:"https://public-sonic.fantom.network"}},testnet:!0}),Jh=ns({id:4002,name:"Fantom Testnet",nativeCurrency:{decimals:18,name:"Fantom",symbol:"FTM"},rpcUrls:{default:{http:["https://rpc.testnet.fantom.network"]}},blockExplorers:{default:{name:"FTMScan",url:"https://testnet.ftmscan.com",apiUrl:"https://testnet.ftmscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:8328688}}}),Xh=ns({id:12306,name:"Fibo Chain",nativeCurrency:{decimals:18,name:"fibo",symbol:"FIBO"},rpcUrls:{default:{http:["https://network.hzroc.art"]}},blockExplorers:{default:{name:"FiboScan",url:"https://scan.fibochain.org"}}}),Yh=ns({id:314,name:"Filecoin Mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3328594}}}),Qh=ns({id:314159,name:"Filecoin Calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}}),em=ns({id:3141,name:"Filecoin Hyperspace",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.hyperspace.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://hyperspace.filfox.info/en"}}}),tm=ns({id:14,name:"Flare Mainnet",nativeCurrency:{decimals:18,name:"flare",symbol:"FLR"},rpcUrls:{default:{http:["https://flare-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Flare Explorer",url:"https://flare-explorer.flare.network",apiUrl:"https://flare-explorer.flare.network/api"}}}),nm=ns({id:114,name:"Coston2",nativeCurrency:{decimals:18,name:"coston2flare",symbol:"C2FLR"},rpcUrls:{default:{http:["https://coston2-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Coston2 Explorer",url:"https://coston2-explorer.flare.network",apiUrl:"https://coston2-explorer.flare.network/api"}},testnet:!0}),rm=ns({id:31337,name:"Foundry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}}),am=ns({...Dp,id:252,name:"Fraxtal",nativeCurrency:{name:"Frax Ether",symbol:"frxETH",decimals:18},rpcUrls:{default:{http:["https://rpc.frax.com"]}},blockExplorers:{default:{name:"fraxscan",url:"https://fraxscan.com",apiUrl:"https://api.fraxscan.com/api"}},contracts:{...Dp.contracts,l2OutputOracle:{1:{address:"0x66CC916Ed5C6C2FA97014f7D1cD141528Ae171e4"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{1:{address:"0x36cb65c1967A0Fb0EEE11569C51C2f2aA1Ca6f6D",blockCreated:19135323}},l1StandardBridge:{1:{address:"0x34C0bD5877A5Ee7099D0f5688D65F4bB9158BDE2",blockCreated:19135323}}},sourceId:1}),sm=17e3,im=ns({...Dp,id:2522,name:"Fraxtal Testnet",nativeCurrency:{name:"Frax Ether",symbol:"frxETH",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.frax.com"]}},blockExplorers:{default:{name:"fraxscan testnet",url:"https://holesky.fraxscan.com",apiUrl:"https://api-holesky.fraxscan.com/api"}},contracts:{...Dp.contracts,l2OutputOracle:{[sm]:{address:"0x715EA64DA13F4d0831ece4Ad3E8c1aa013167F32"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[sm]:{address:"0xB9c64BfA498d5b9a8398Ed6f46eb76d90dE5505d",blockCreated:318416}},l1StandardBridge:{[sm]:{address:"0x0BaafC217162f64930909aD9f2B27125121d6332",blockCreated:318416}}},sourceId:sm}),om=ns({id:122,name:"Fuse",nativeCurrency:{name:"Fuse",symbol:"FUSE",decimals:18},rpcUrls:{default:{http:["https://rpc.fuse.io"]}},blockExplorers:{default:{name:"Fuse Explorer",url:"https://explorer.fuse.io",apiUrl:"https://explorer.fuse.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:16146628}}}),cm=ns({id:123,name:"Fuse Sparknet",nativeCurrency:{name:"Spark",symbol:"SPARK",decimals:18},rpcUrls:{default:{http:["https://rpc.fusespark.io"]}},blockExplorers:{default:{name:"Sparkent Explorer",url:"https://explorer.fusespark.io",apiUrl:"https://explorer.fusespark.io/api"}}}),lm=ns({id:4689,name:"IoTeX",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.mainnet.iotex.io"],webSocket:["wss://babel-api.mainnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://iotexscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:22163670}}}),um=ns({id:4690,name:"IoTeX Testnet",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.testnet.iotex.io"],webSocket:["wss://babel-api.testnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://testnet.iotexscan.io"}},testnet:!0}),dm=ns({id:8899,name:"JIBCHAIN L1",network:"jbc",nativeCurrency:{name:"JBC",symbol:"JBC",decimals:18},rpcUrls:{default:{http:["https://rpc-l1.jibchain.net"]},public:{http:["https://rpc-l1.jibchain.net"]}},blockExplorers:{default:{name:"Blockscout",url:"https://exp-l1.jibchain.net",apiUrl:"https://exp-l1.jibchain.net/api"}},contracts:{multicall3:{address:"0xc0C8C486D1466C57Efe13C2bf000d4c56F47CBdC",blockCreated:2299048}},testnet:!1}),pm=ns({id:686,name:"Karura",network:"karura",nativeCurrency:{name:"Karura",symbol:"KAR",decimals:18},rpcUrls:{public:{http:["https://eth-rpc-karura.aca-api.network"],webSocket:["wss://eth-rpc-karura.aca-api.network"]},default:{http:["https://eth-rpc-karura.aca-api.network"],webSocket:["wss://eth-rpc-karura.aca-api.network"]}},blockExplorers:{default:{name:"Karura Blockscout",url:"https://blockscout.karura.network",apiUrl:"https://blockscout.karura.network/api"}},testnet:!1}),hm=ns({id:1663,name:"Horizen Gobi Testnet",nativeCurrency:{decimals:18,name:"Test ZEN",symbol:"tZEN"},rpcUrls:{default:{http:["https://gobi-testnet.horizenlabs.io/ethv1"]}},blockExplorers:{default:{name:"Gobi Explorer",url:"https://gobi-explorer.horizen.io"}},contracts:{},testnet:!0}),mm=ns({id:5,name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io",apiUrl:"https://api-goerli.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xfc4AC75C46C914aF5892d6d3eFFcebD7917293F1",blockCreated:10339206},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}),fm=ns({id:100,name:"Gnosis",nativeCurrency:{decimals:18,name:"Gnosis",symbol:"xDAI"},rpcUrls:{default:{http:["https://rpc.gnosischain.com"],webSocket:["wss://rpc.gnosischain.com/wss"]}},blockExplorers:{default:{name:"Gnosisscan",url:"https://gnosisscan.io",apiUrl:"https://api.gnosisscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:21022491}}}),ym=ns({id:10200,name:"Gnosis Chiado",nativeCurrency:{decimals:18,name:"Gnosis",symbol:"xDAI"},rpcUrls:{default:{http:["https://rpc.chiadochain.net"],webSocket:["wss://rpc.chiadochain.net/wss"]}},blockExplorers:{default:{name:"Blockscout",url:"https://blockscout.chiadochain.net",apiUrl:"https://blockscout.chiadochain.net/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:4967313}},testnet:!0}),bm=ns({id:31337,name:"Hardhat",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}}),gm=ns({id:16666e5,name:"Harmony One",nativeCurrency:{name:"Harmony",symbol:"ONE",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/harmony"]}},blockExplorers:{default:{name:"Harmony Explorer",url:"https://explorer.harmony.one"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:24185753}}}),wm=ns({id:11235,name:"HAQQ Mainnet",nativeCurrency:{decimals:18,name:"Islamic Coin",symbol:"ISLM"},rpcUrls:{default:{http:["https://rpc.eth.haqq.network"]}},blockExplorers:{default:{name:"HAQQ Explorer",url:"https://explorer.haqq.network",apiUrl:"https://explorer.haqq.network/api"}}}),vm=ns({id:54211,name:"HAQQ Testedge 2",nativeCurrency:{decimals:18,name:"Islamic Coin",symbol:"ISLMT"},rpcUrls:{default:{http:["https://rpc.eth.testedge2.haqq.network"]}},blockExplorers:{default:{name:"HAQQ Explorer",url:"https://explorer.testedge2.haqq.network",apiUrl:"https://explorer.testedge2.haqq.network/api"}}}),Cm=ns({id:295,name:"Hedera Mainnet",network:"hedera-mainnet",nativeCurrency:{symbol:"HBAR",name:"HBAR",decimals:18},rpcUrls:{default:{http:["https://mainnet.hashio.io/api"]}},blockExplorers:{default:{name:"Hashscan",url:"https://hashscan.io/mainnet"}},testnet:!1}),Em=ns({id:296,name:"Hedera Testnet",network:"hedera-testnet",nativeCurrency:{symbol:"HBAR",name:"HBAR",decimals:18},rpcUrls:{default:{http:["https://testnet.hashio.io/api"]}},blockExplorers:{default:{name:"Hashscan",url:"https://hashscan.io/testnet"}},testnet:!0}),xm=ns({id:297,name:"Hedera Previewnet",network:"hedera-previewnet",nativeCurrency:{symbol:"HBAR",name:"HBAR",decimals:18},rpcUrls:{default:{http:["https://previewnet.hashio.io/api"]}},blockExplorers:{default:{name:"Hashscan",url:"https://hashscan.io/previewnet"}},testnet:!0}),km=ns({id:17e3,name:"Holesky",nativeCurrency:{name:"Holesky Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://holesky.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:77},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",blockCreated:801613},ensUniversalResolver:{address:"0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b",blockCreated:973484}},testnet:!0}),Tm=ns({id:107107114116,name:"Kakarot Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rpc.kakarot.org"]}},blockExplorers:{default:{name:"Kakarot Scan",url:"https://sepolia.kakarotscan.org"}},testnet:!0}),Pm=ns({id:2222,name:"Kava EVM",network:"kava-mainnet",nativeCurrency:{name:"Kava",symbol:"KAVA",decimals:18},rpcUrls:{default:{http:["https://evm.kava.io"]}},blockExplorers:{default:{name:"Kava EVM Explorer",url:"https://kavascan.com",apiUrl:"https://kavascan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3661165}},testnet:!1}),Am=ns({id:2221,name:"Kava EVM Testnet",network:"kava-testnet",nativeCurrency:{name:"Kava",symbol:"KAVA",decimals:18},rpcUrls:{default:{http:["https://evm.testnet.kava.io"]}},blockExplorers:{default:{name:"Kava EVM Testnet Explorer",url:"https://testnet.kavascan.com/",apiUrl:"https://testnet.kavascan.com/api"}},contracts:{multicall3:{address:"0xDf1D724A7166261eEB015418fe8c7679BBEa7fd6",blockCreated:7242179}},testnet:!0}),_m=ns({id:321,name:"KCC Mainnet",network:"KCC Mainnet",nativeCurrency:{decimals:18,name:"KCS",symbol:"KCS"},rpcUrls:{default:{http:["https://kcc-rpc.com"]},public:{http:["https://kcc-rpc.com"]}},blockExplorers:{default:{name:"KCC Explorer",url:"https://explorer.kcc.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11760430}},testnet:!1}),Dm=ns({id:8217,name:"Klaytn",nativeCurrency:{decimals:18,name:"Klaytn",symbol:"KLAY"},rpcUrls:{default:{http:["https://public-en-cypress.klaytn.net"]}},blockExplorers:{default:{name:"KlaytnScope",url:"https://scope.klaytn.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:96002415}}}),Fm=ns({id:1001,name:"Klaytn Baobab Testnet",network:"klaytn-baobab",nativeCurrency:{decimals:18,name:"Baobab Klaytn",symbol:"KLAY"},rpcUrls:{default:{http:["https://public-en-baobab.klaytn.net"]}},blockExplorers:{default:{name:"KlaytnScope",url:"https://baobab.klaytnscope.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:123390593}},testnet:!0}),Om=ns({id:255,name:"Kroma",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://api.kroma.network"]}},blockExplorers:{default:{name:"Kroma Explorer",url:"https://blockscout.kroma.network",apiUrl:"https://blockscout.kroma.network/api"}},testnet:!1}),Sm=ns({id:2358,name:"Kroma Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://api.sepolia.kroma.network"]}},blockExplorers:{default:{name:"Kroma Sepolia Explorer",url:"https://blockscout.sepolia.kroma.network",apiUrl:"https://blockscout.sepolia.kroma.network/api"}},testnet:!0}),Mm=ns({id:1891,name:"LightLink Pegasus Testnet",network:"lightlink-pegasus",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://replicator.pegasus.lightlink.io/rpc/v1"]}},blockExplorers:{default:{name:"LightLink Pegasus Explorer",url:"https://pegasus.lightlink.io"}},testnet:!0}),Im=ns({id:1890,name:"LightLink Phoenix Mainnet",network:"lightlink-phoenix",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://replicator.phoenix.lightlink.io/rpc/v1"]}},blockExplorers:{default:{name:"LightLink Phoenix Explorer",url:"https://phoenix.lightlink.io"}},testnet:!1}),Nm=ns({id:59144,name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build",apiUrl:"https://api.lineascan.build/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:42}},testnet:!1}),Um=ns({id:59140,name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build",apiUrl:"https://goerli.lineascan.build/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:498623}},testnet:!0}),Lm=11155111,Bm=ns({...Dp,id:4202,network:"lisk-sepolia",name:"Lisk Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia-api.lisk.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-blockscout.lisk.com",apiUrl:"https://sepolia-blockscout.lisk.com/api"}},contracts:{...Dp.contracts,l2OutputOracle:{[Lm]:{address:"0xA0E35F56C318DE1bD5D9ca6A94Fe7e37C5663348"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[Lm]:{address:"0xe3d90F21490686Ec7eF37BE788E02dfC12787264"}},l1StandardBridge:{[Lm]:{address:"0x1Fb30e446eA791cd1f011675E5F3f5311b70faF5"}}},testnet:!0,sourceId:Lm}),Rm=ns({id:1337,name:"Localhost",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}}),jm=ns({id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network",apiUrl:"https://api.explorer.execution.mainnet.lukso.network/api"}}}),Gm=ns({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Hm=ns({id:595,name:"Mandala TC9",network:"mandala",nativeCurrency:{name:"Mandala",symbol:"mACA",decimals:18},rpcUrls:{public:{http:["https://eth-rpc-tc9.aca-staging.network"],webSocket:["wss://eth-rpc-tc9.aca-staging.network"]},default:{http:["https://eth-rpc-tc9.aca-staging.network"],webSocket:["wss://eth-rpc-tc9.aca-staging.network"]}},blockExplorers:{default:{name:"Mandala Blockscout",url:"https://blockscout.mandala.aca-staging.network",apiUrl:"https://blockscout.mandala.aca-staging.network/api"}},testnet:!0}),zm=ns({id:169,name:"Manta Pacific Mainnet",network:"manta",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://pacific-rpc.manta.network/http"]}},blockExplorers:{default:{name:"Manta Explorer",url:"https://pacific-explorer.manta.network",apiUrl:"https://pacific-explorer.manta.network/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:332890}}}),$m=ns({id:3441005,name:"Manta Pacific Testnet",network:"manta-testnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://manta-testnet.calderachain.xyz/http"]}},blockExplorers:{default:{name:"Manta Testnet Explorer",url:"https://pacific-explorer.testnet.manta.network",apiUrl:"https://pacific-explorer.testnet.manta.network/api"}},contracts:{multicall3:{address:"0x211B1643b95Fe76f11eD8880EE810ABD9A4cf56C",blockCreated:419915}},testnet:!0}),Vm=ns({id:5e3,name:"Mantle",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.mantle.xyz"]}},blockExplorers:{default:{name:"Mantle Explorer",url:"https://explorer.mantle.xyz",apiUrl:"https://explorer.mantle.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:304717}}}),qm=ns({id:5001,name:"Mantle Testnet",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.testnet.mantle.xyz"]}},blockExplorers:{default:{name:"Mantle Testnet Explorer",url:"https://explorer.testnet.mantle.xyz",apiUrl:"https://explorer.testnet.mantle.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:561333}},testnet:!0}),Zm=ns({id:4200,name:"Merlin",nativeCurrency:{name:"BTC",symbol:"BTC",decimals:18},rpcUrls:{default:{http:["https://rpc.merlinchain.io"]}},blockExplorers:{default:{name:"blockscout",url:"https://scan.merlinchain.io",apiUrl:"https://scan.merlinchain.io/api"}}}),Wm=ns({id:571,name:"MetaChain Mainnet",nativeCurrency:{name:"Metatime Coin",symbol:"MTC",decimals:18},rpcUrls:{default:{http:["https://rpc.metatime.com"]}},blockExplorers:{default:{name:"MetaExplorer",url:"https://explorer.metatime.com"}},contracts:{multicall3:{address:"0x0000000000000000000000000000000000003001",blockCreated:0}}}),Km=ns({id:1453,name:"MetaChain Istanbul",nativeCurrency:{name:"Metatime Coin",symbol:"MTC",decimals:18},rpcUrls:{default:{http:["https://istanbul-rpc.metachain.dev"]}},blockExplorers:{default:{name:"MetaExplorer",url:"https://istanbul-explorer.metachain.dev"}},contracts:{multicall3:{address:"0x0000000000000000000000000000000000003001",blockCreated:0}},testnet:!0}),Jm=ns({id:82,name:"Meter",nativeCurrency:{decimals:18,name:"MTR",symbol:"MTR"},rpcUrls:{default:{http:["https://rpc.meter.io"]}},blockExplorers:{default:{name:"MeterScan",url:"https://scan.meter.io"}}}),Xm=ns({id:83,name:"Meter Testnet",nativeCurrency:{decimals:18,name:"MTR",symbol:"MTR"},rpcUrls:{default:{http:["https://rpctest.meter.io"]}},blockExplorers:{default:{name:"MeterTestnetScan",url:"https://scan-warringstakes.meter.io"}}}),Ym=ns({id:1088,name:"Metis",nativeCurrency:{decimals:18,name:"Metis",symbol:"METIS"},rpcUrls:{default:{http:["https://andromeda.metis.io/?owner=1088"]}},blockExplorers:{default:{name:"Andromeda Explorer",url:"https://andromeda-explorer.metis.io",apiUrl:"https://andromeda-explorer.metis.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2338552}}}),Qm=ns({id:599,name:"Metis Goerli",nativeCurrency:{decimals:18,name:"Metis Goerli",symbol:"METIS"},rpcUrls:{default:{http:["https://goerli.gateway.metisdevops.link"]}},blockExplorers:{default:{name:"Metis Goerli Explorer",url:"https://goerli.explorer.metisdevops.link",apiUrl:"https://goerli.explorer.metisdevops.link/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1006207}}}),ef=ns({id:7518,name:"MEVerse Chain Mainnet",nativeCurrency:{decimals:18,name:"MEVerse",symbol:"MEV"},rpcUrls:{default:{http:["https://rpc.meversemainnet.io"]}},blockExplorers:{default:{name:"Explorer",url:"https://www.meversescan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:86881340}}}),tf=ns({id:4759,name:"MEVerse Chain Testnet",nativeCurrency:{decimals:18,name:"MEVerse",symbol:"MEV"},rpcUrls:{default:{http:["https://rpc.meversetestnet.io"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.meversescan.io/"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:64371115}},testnet:!0}),nf=ns({id:1686,name:"Mint Sepolia Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet-rpc.mintchain.io"]}},blockExplorers:{default:{name:"Mintchain Testnet explorer",url:"https://testnet-explorer.mintchain.io"}},testnet:!0}),rf=ns({id:34443,name:"Mode Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.mode.network"]}},blockExplorers:{default:{name:"Mode Explorer",url:"https://explorer.mode.network"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2465882}}}),af=ns({id:919,name:"Mode Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.mode.network"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia.explorer.mode.network",apiUrl:"https://sepolia.explorer.mode.network/api"}},contracts:{multicall3:{address:"0xBAba8373113Fb7a68f195deF18732e01aF8eDfCF",blockCreated:3019007}},testnet:!0}),sf=ns({id:1287,name:"Moonbase Alpha",nativeCurrency:{decimals:18,name:"DEV",symbol:"DEV"},rpcUrls:{default:{http:["https://rpc.api.moonbase.moonbeam.network"],webSocket:["wss://wss.api.moonbase.moonbeam.network"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonbase.moonscan.io",apiUrl:"https://moonbase.moonscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1850686}},testnet:!0}),of=ns({id:1284,name:"Moonbeam",nativeCurrency:{decimals:18,name:"GLMR",symbol:"GLMR"},rpcUrls:{default:{http:["https://moonbeam.public.blastapi.io"],webSocket:["wss://moonbeam.public.blastapi.io"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonscan.io",apiUrl:"https://api-moonbeam.moonscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:609002}},testnet:!1}),cf=ns({id:1281,name:"Moonbeam Development Node",nativeCurrency:{decimals:18,name:"DEV",symbol:"DEV"},rpcUrls:{default:{http:["http://127.0.0.1:9944"],webSocket:["wss://127.0.0.1:9944"]}}}),lf=ns({id:1285,name:"Moonriver",nativeCurrency:{decimals:18,name:"MOVR",symbol:"MOVR"},rpcUrls:{default:{http:["https://moonriver.public.blastapi.io"],webSocket:["wss://moonriver.public.blastapi.io"]}},blockExplorers:{default:{name:"Moonscan",url:"https://moonriver.moonscan.io",apiUrl:"https://api-moonriver.moonscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1597904}},testnet:!1}),uf=ns({id:245022926,name:"Neon EVM DevNet",nativeCurrency:{name:"NEON",symbol:"NEON",decimals:18},rpcUrls:{default:{http:["https://devnet.neonevm.org"]}},blockExplorers:{default:{name:"Neonscan",url:"https://devnet.neonscan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:205206112}},testnet:!0}),df=ns({id:245022934,network:"neonMainnet",name:"Neon EVM MainNet",nativeCurrency:{name:"NEON",symbol:"NEON",decimals:18},rpcUrls:{default:{http:["https://neon-proxy-mainnet.solana.p2p.org"]}},blockExplorers:{default:{name:"Neonscan",url:"https://neonscan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:206545524}},testnet:!1}),pf=ns({id:4242,name:"Nexi",nativeCurrency:{name:"Nexi",symbol:"NEXI",decimals:18},rpcUrls:{default:{http:["https://rpc.chain.nexi.technology"]}},blockExplorers:{default:{name:"NexiScan",url:"https://www.nexiscan.com",apiUrl:"https://www.nexiscan.com/api"}},contracts:{multicall3:{address:"0x0277A46Cc69A57eE3A6C8c158bA874832F718B8E",blockCreated:25770160}}}),hf=ns({id:240,name:"Nexilix Smart Chain",nativeCurrency:{decimals:18,name:"Nexilix",symbol:"NEXILIX"},rpcUrls:{default:{http:["https://rpcurl.pos.nexilix.com"]}},blockExplorers:{default:{name:"NexilixScan",url:"https://scan.nexilix.com"}},contracts:{multicall3:{address:"0x58381c8e2BF9d0C2C4259cA14BdA9Afe02831244",blockCreated:74448}}}),mf=ns({id:248,name:"Oasys",nativeCurrency:{name:"Oasys",symbol:"OAS",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.oasys.games"]}},blockExplorers:{default:{name:"OasysScan",url:"https://scan.oasys.games",apiUrl:"https://scan.oasys.games/api"}}}),ff=ns({id:4090,network:"oasis-testnet",name:"Oasis Testnet",nativeCurrency:{name:"Fasttoken",symbol:"FTN",decimals:18},rpcUrls:{default:{http:["https://rpc1.oasis.bahamutchain.com"]},public:{http:["https://rpc1.oasis.bahamutchain.com"]}},blockExplorers:{default:{name:"Ftnscan",url:"https://oasis.ftnscan.com",apiUrl:"https://oasis.ftnscan.com/api"}},testnet:!0}),yf=ns({id:66,name:"OKC",nativeCurrency:{decimals:18,name:"OKT",symbol:"OKT"},rpcUrls:{default:{http:["https://exchainrpc.okex.org"]}},blockExplorers:{default:{name:"oklink",url:"https://www.oklink.com/okc"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10364792}}}),bf=ns({...Dp,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...Dp.contracts,l2OutputOracle:{1:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{1:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{1:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:1}),gf=ns({...Dp,id:420,name:"Optimism Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io",apiUrl:"https://goerli-optimism.etherscan.io/api"}},contracts:{...Dp.contracts,l2OutputOracle:{5:{address:"0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461},portal:{5:{address:"0x5b47E1A08Ea6d985D6649300584e6722Ec4B1383"}},l1StandardBridge:{5:{address:"0x636Af16bf2f682dD3109e60102b8E1A089FedAa8"}}},testnet:!0,sourceId:5}),wf=11155111,vf=ns({...Dp,id:11155420,name:"OP Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.optimism.io"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com",apiUrl:"https://optimism-sepolia.blockscout.com/api"}},contracts:{...Dp.contracts,l2OutputOracle:{[wf]:{address:"0x90E9c4f8a994a250F6aEfd61CAFb4F2e895D458F"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1620204},portal:{[wf]:{address:"0x16Fc5058F25648194471939df75CF27A2fdC48BC"}},l1StandardBridge:{[wf]:{address:"0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1"}}},testnet:!0,sourceId:wf}),Cf=ns({id:204,name:"opBNB",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{default:{http:["https://opbnb-mainnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opbnbscan",url:"https://mainnet.opbnbscan.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:512881}}}),Ef=ns({id:5611,name:"opBNB Testnet",nativeCurrency:{decimals:18,name:"tBNB",symbol:"tBNB"},rpcUrls:{default:{http:["https://opbnb-testnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opbnbscan",url:"https://testnet.opbnbscan.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3705108}},testnet:!0}),xf=ns({id:9700,name:"OORT MainnetDev",nativeCurrency:{decimals:18,name:"OORT",symbol:"OORT"},rpcUrls:{default:{http:["https://dev-rpc.oortech.com"]}},blockExplorers:{oort:{name:"OORT MainnetDev Explorer",url:"https://dev-scan.oortech.com"},default:{name:"OORT MainnetDev Explorer",url:"https://dev-scan.oortech.com"}}}),kf=ns({id:11297108109,name:"Palm",nativeCurrency:{decimals:18,name:"PALM",symbol:"PALM"},rpcUrls:{default:{http:["https://palm-mainnet.public.blastapi.io"],webSocket:["wss://palm-mainnet.public.blastapi.io"]}},blockExplorers:{default:{name:"Chainlens",url:"https://palm.chainlens.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15429248}}}),Tf=ns({id:11297108099,name:"Palm Testnet",nativeCurrency:{decimals:18,name:"PALM",symbol:"PALM"},rpcUrls:{default:{http:["https://palm-mainnet.public.blastapi.io"],webSocket:["wss://palm-mainnet.public.blastapi.io"]}},blockExplorers:{default:{name:"Chainlens",url:"https://palm.chainlens.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15429248}},testnet:!0}),Pf=ns({id:424,network:"pgn",name:"PGN",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.publicgoods.network"]}},blockExplorers:{default:{name:"PGN Explorer",url:"https://explorer.publicgoods.network",apiUrl:"https://explorer.publicgoods.network/api"},blocksout:{name:"PGN Explorer",url:"https://explorer.publicgoods.network",apiUrl:"https://explorer.publicgoods.network/api"}},contracts:{l2OutputOracle:{1:{address:"0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3380209},portal:{1:{address:"0xb26Fd985c5959bBB382BAFdD0b879E149e48116c"}},l1StandardBridge:{1:{address:"0xD0204B9527C1bA7bD765Fa5CCD9355d38338272b"}}},formatters:qs,sourceId:1}),Af=11155111,_f=ns({id:58008,network:"pgn-testnet",name:"PGN ",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.publicgoods.network"]}},blockExplorers:{default:{name:"PGN Testnet Explorer",url:"https://explorer.sepolia.publicgoods.network",apiUrl:"https://explorer.sepolia.publicgoods.network/api"},blocksout:{name:"PGN Testnet Explorer",url:"https://explorer.sepolia.publicgoods.network",apiUrl:"https://explorer.sepolia.publicgoods.network/api"}},contracts:{l2OutputOracle:{[Af]:{address:"0xD5bAc3152ffC25318F848B3DD5dA6C85171BaEEe"}},portal:{[Af]:{address:"0xF04BdD5353Bb0EFF6CA60CfcC78594278eBfE179"}},l1StandardBridge:{[Af]:{address:"0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3754925}},formatters:qs,sourceId:Af,testnet:!0}),Df=ns({id:13381,name:"Phoenix Blockchain",nativeCurrency:{name:"Phoenix",symbol:"PHX",decimals:18},rpcUrls:{default:{http:["https://rpc.phoenixplorer.com"]}},blockExplorers:{default:{name:"Phoenixplorer",url:"https://phoenixplorer.com",apiUrl:"https://phoenixplorer.com/api"}},contracts:{multicall3:{address:"0x498cF757a575cFF2c2Ed9f532f56Efa797f86442",blockCreated:5620192}}}),Ff=ns({id:242,name:"Plinga",nativeCurrency:{name:"Plinga",symbol:"PLINGA",decimals:18},rpcUrls:{default:{http:["https://rpcurl.mainnet.plgchain.com"]}},blockExplorers:{default:{name:"Plgscan",url:"https://www.plgscan.com"}},contracts:{multicall3:{address:"0x0989576160f2e7092908BB9479631b901060b6e4",blockCreated:204489}}}),Of=ns({id:161221135,name:"Plume Testnet",nativeCurrency:{name:"Plume Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://plume-testnet.rpc.caldera.xyz/http"],webSocket:["wss://plume-testnet.rpc.caldera.xyz/ws"]}},blockExplorers:{default:{name:"Blockscout",url:"https://plume-testnet.explorer.caldera.xyz",apiUrl:"https://plume-testnet.explorer.caldera.xyz/api"}},testnet:!0,sourceId:11155111}),Sf=ns({id:137,name:"Polygon",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),Mf=ns({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0}),If=ns({id:80001,name:"Polygon Mumbai",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/polygon_mumbai"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com",apiUrl:"https://mumbai.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}},testnet:!0}),Nf=ns({id:1442,name:"Polygon zkEVM Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.public.zkevm-test.net"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://testnet-zkevm.polygonscan.com",apiUrl:"https://testnet-zkevm.polygonscan.com/api"}},testnet:!0,contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:525686}}}),Uf=ns({id:1101,name:"Polygon zkEVM",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://zkevm-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://zkevm.polygonscan.com",apiUrl:"https://api-zkevm.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:57746}}}),Lf=ns({id:369,name:"PulseChain",nativeCurrency:{name:"Pulse",symbol:"PLS",decimals:18},testnet:!1,rpcUrls:{default:{http:["https://rpc.pulsechain.com"],webSocket:["wss://ws.pulsechain.com"]}},blockExplorers:{default:{name:"PulseScan",url:"https://scan.pulsechain.com",apiUrl:"https://api.scan.pulsechain.com/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Bf=ns({id:943,name:"PulseChain V4",testnet:!0,nativeCurrency:{name:"V4 Pulse",symbol:"v4PLS",decimals:18},rpcUrls:{default:{http:["https://rpc.v4.testnet.pulsechain.com"],webSocket:["wss://ws.v4.testnet.pulsechain.com"]}},blockExplorers:{default:{name:"PulseScan",url:"https://scan.v4.testnet.pulsechain.com",apiUrl:"https://scan.v4.testnet.pulsechain.com/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Rf=ns({id:35441,name:"Q Mainnet",nativeCurrency:{decimals:18,name:"Q",symbol:"Q"},rpcUrls:{default:{http:["https://rpc.q.org"]}},blockExplorers:{default:{name:"Q Mainnet Explorer",url:"https://explorer.q.org",apiUrl:"https://explorer.q.org/api"}}}),jf=ns({id:35443,name:"Q Testnet",nativeCurrency:{decimals:18,name:"Q",symbol:"Q"},rpcUrls:{default:{http:["https://rpc.qtestnet.org"]}},blockExplorers:{default:{name:"Q Testnet Explorer",url:"https://explorer.qtestnet.org",apiUrl:"https://explorer.qtestnet.org/api"}},testnet:!0}),Gf=ns({id:570,name:"Rollux Mainnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.rollux.com"],webSocket:["wss://rpc.rollux.com/wss"]}},blockExplorers:{default:{name:"RolluxExplorer",url:"https://explorer.rollux.com",apiUrl:"https://explorer.rollux.com/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:119222}}}),Hf=ns({id:57e3,name:"Rollux Testnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc-tanenbaum.rollux.com/"],webSocket:["wss://rpc-tanenbaum.rollux.com/wss"]}},blockExplorers:{default:{name:"RolluxTestnetExplorer",url:"https://rollux.tanenbaum.io",apiUrl:"https://rollux.tanenbaum.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1813675}}}),zf=ns({id:2020,name:"Ronin",nativeCurrency:{name:"RON",symbol:"RON",decimals:18},rpcUrls:{default:{http:["https://api.roninchain.com/rpc"]}},blockExplorers:{default:{name:"Ronin Explorer",url:"https://app.roninchain.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:26023535}}}),$f=ns({id:30,name:"Rootstock Mainnet",network:"rootstock",nativeCurrency:{decimals:18,name:"Rootstock Bitcoin",symbol:"RBTC"},rpcUrls:{default:{http:["https://public-node.rsk.co"]}},blockExplorers:{default:{name:"RSK Explorer",url:"https://explorer.rsk.co"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:4249540}}}),Vf=ns({...Dp,id:12553,name:"RSS3 VSL Mainnet",nativeCurrency:{name:"RSS3",symbol:"RSS3",decimals:18},rpcUrls:{default:{http:["https://rpc.rss3.io"]}},blockExplorers:{default:{name:"RSS3 VSL Mainnet Scan",url:"https://scan.rss3.io",apiUrl:"https://scan.rss3.io/api"}},contracts:{...Dp.contracts,l2OutputOracle:{1:{address:"0xE6f24d2C32B3109B18ed33cF08eFb490b1e09C10"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14193},portal:{1:{address:"0x6A12432491bbbE8d3babf75F759766774C778Db4",blockCreated:19387057}},l1StandardBridge:{1:{address:"0x4cbab69108Aa72151EDa5A3c164eA86845f18438"}}},sourceId:1}),qf=11155111,Zf=ns({...Dp,id:2331,name:"RSS3 VSL Sepolia Testnet",nativeCurrency:{name:"RSS3",symbol:"RSS3",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.rss3.io"]}},blockExplorers:{default:{name:"RSS3 VSL Sepolia Testnet Scan",url:"https://scan.testnet.rss3.io",apiUrl:"https://scan.testnet.rss3.io/api"}},contracts:{...Dp.contracts,l2OutputOracle:{[qf]:{address:"0xDb5c46C3Eaa6Ed6aE8b2379785DF7dd029C0dC81"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:55697},portal:{[qf]:{address:"0xcBD77E8E1E7F06B25baDe67142cdE82652Da7b57",blockCreated:5345035}},l1StandardBridge:{[qf]:{address:"0xdDD29bb63B0839FB1cE0eE439Ff027738595D07B"}}},testnet:!0,sourceId:qf}),Wf=ns({id:2021,name:"Saigon Testnet",nativeCurrency:{name:"RON",symbol:"RON",decimals:18},rpcUrls:{default:{http:["https://saigon-testnet.roninchain.com/rpc"]}},blockExplorers:{default:{name:"Saigon Explorer",url:"https://saigon-app.roninchain.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:18736871}},testnet:!0}),Kf=ns({id:23294,name:"Oasis Sapphire",network:"sapphire",nativeCurrency:{name:"Sapphire Rose",symbol:"ROSE",decimals:18},rpcUrls:{default:{http:["https://sapphire.oasis.io"],webSocket:["wss://sapphire.oasis.io/ws"]}},blockExplorers:{default:{name:"Oasis Sapphire Explorer",url:"https://explorer.sapphire.oasis.io",apiUrl:"https://explorer.sapphire.oasis.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:734531}}}),Jf=ns({id:23295,name:"Oasis Sapphire Testnet",network:"sapphire-testnet",nativeCurrency:{name:"Sapphire Test Rose",symbol:"TEST",decimals:18},rpcUrls:{default:{http:["https://testnet.sapphire.oasis.dev"],webSocket:["wss://testnet.sapphire.oasis.dev/ws"]}},blockExplorers:{default:{name:"Oasis Sapphire Testnet Explorer",url:"https://testnet.explorer.sapphire.oasis.dev",apiUrl:"https://testnet.explorer.sapphire.oasis.dev/api"}},testnet:!0}),Xf=ns({id:534352,name:"Scroll",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.scroll.io"],webSocket:["wss://wss-rpc.scroll.io/ws"]}},blockExplorers:{default:{name:"Scrollscan",url:"https://scrollscan.com",apiUrl:"https://api.scrollscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14}},testnet:!1}),Yf=ns({id:534351,name:"Scroll Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rpc.scroll.io"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-blockscout.scroll.io",apiUrl:"https://sepolia-blockscout.scroll.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:9473}},testnet:!0}),Qf=ns({id:534353,name:"Scroll Testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://alpha-rpc.scroll.io/l2"],webSocket:["wss://alpha-rpc.scroll.io/l2/ws"]}},blockExplorers:{default:{name:"Blockscout",url:"https://blockscout.scroll.io",apiUrl:"https://blockscout.scroll.io/api"}},testnet:!0}),ey=ns({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{default:{http:["https://rpc.sepolia.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0}),ty=ns({id:148,name:"Shimmer",network:"shimmer",nativeCurrency:{decimals:18,name:"Shimmer",symbol:"SMR"},rpcUrls:{default:{http:["https://json-rpc.evm.shimmer.network"]}},blockExplorers:{default:{name:"Shimmer Network Explorer",url:"https://explorer.evm.shimmer.network",apiUrl:"https://explorer.evm.shimmer.network/api"}}}),ny=ns({id:1073,name:"Shimmer Testnet",network:"shimmer-testnet",nativeCurrency:{decimals:18,name:"Shimmer",symbol:"SMR"},rpcUrls:{default:{http:["https://json-rpc.evm.testnet.shimmer.network"]}},blockExplorers:{default:{name:"Shimmer Network Explorer",url:"https://explorer.evm.testnet.shimmer.network",apiUrl:"https://explorer.evm.testnet.shimmer.network/api"}},testnet:!0}),ry=ns({id:391845894,name:"SKALE | Block Brawlers",nativeCurrency:{name:"BRAWL",symbol:"BRAWL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/frayed-decent-antares"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/frayed-decent-antares"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://frayed-decent-antares.explorer.mainnet.skalenodes.com"}},contracts:{}}),ay=ns({id:1564830818,name:"SKALE | Calypso NFT Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/honorable-steel-rasalhague"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3107626}}}),sy=ns({id:974399131,name:"SKALE Calypso Testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/giant-half-dual-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/giant-half-dual-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://giant-half-dual-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:103220}},testnet:!0}),iy=ns({id:1026062157,name:"SKALE | CryptoBlades",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/affectionate-immediate-pollux"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/affectionate-immediate-pollux"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://affectionate-immediate-pollux.explorer.mainnet.skalenodes.com"}},contracts:{}}),oy=ns({id:2046399126,name:"SKALE | Crypto Colosseum",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/haunting-devoted-deneb"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/haunting-devoted-deneb"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://haunting-devoted-deneb.explorer.mainnet.skalenodes.com"}},contracts:{}}),cy=ns({id:2046399126,name:"SKALE | Europa Liquidity Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/elated-tan-skat"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/elated-tan-skat"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://elated-tan-skat.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3113495}}}),ly=ns({id:1444673419,name:"SKALE Europa Testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/juicy-low-small-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/juicy-low-small-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://juicy-low-small-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:110858}},testnet:!0}),uy=ns({id:2139927552,name:"SKALE | Exorde",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/light-vast-diphda"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/light-vast-diphda"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://light-vast-diphda.explorer.mainnet.skalenodes.com"}},contracts:{}}),dy=ns({id:1273227453,name:"SKALE | Human Protocol",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/wan-red-ain"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/wan-red-ain"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://wan-red-ain.explorer.mainnet.skalenodes.com"}},contracts:{}}),py=ns({id:1482601649,name:"SKALE | Nebula Gaming Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/green-giddy-denebola"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/green-giddy-denebola"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://green-giddy-denebola.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2372986}}}),hy=ns({id:37084624,name:"SKALE Nebula Testnet",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/lanky-ill-funny-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/lanky-ill-funny-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://lanky-ill-funny-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:105141}},testnet:!0}),my=ns({id:278611351,name:"SKALE | Razor Network",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/turbulent-unique-scheat"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/turbulent-unique-scheat"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://turbulent-unique-scheat.explorer.mainnet.skalenodes.com"}},contracts:{}}),fy=ns({id:1350216234,name:"SKALE | Titan Community Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://mainnet.skalenodes.com/v1/parallel-stormy-spica"],webSocket:["wss://mainnet.skalenodes.com/v1/ws/parallel-stormy-spica"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:2076458}}}),yy=ns({id:1020352220,name:"SKALE Titan Hub",nativeCurrency:{name:"sFUEL",symbol:"sFUEL",decimals:18},rpcUrls:{default:{http:["https://testnet.skalenodes.com/v1/aware-fake-trim-testnet"],webSocket:["wss://testnet.skalenodes.com/v1/ws/aware-fake-trim-testnet"]}},blockExplorers:{default:{name:"SKALE Explorer",url:"https://aware-fake-trim-testnet.explorer.testnet.skalenodes.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:104072}},testnet:!0}),by=ns({id:19,name:"Songbird Mainnet",nativeCurrency:{decimals:18,name:"songbird",symbol:"SGB"},rpcUrls:{default:{http:["https://songbird-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Songbird Explorer",url:"https://songbird-explorer.flare.network",apiUrl:"https://songbird-explorer.flare.network/api"}}}),gy=ns({id:16,name:"Coston",nativeCurrency:{decimals:18,name:"costonflare",symbol:"CFLR"},rpcUrls:{default:{http:["https://coston-api.flare.network/ext/C/rpc"]}},blockExplorers:{default:{name:"Coston Explorer",url:"https://coston-explorer.flare.network",apiUrl:"https://coston-explorer.flare.network/api"}},testnet:!0}),wy=ns({id:88882,name:"Chiliz Spicy Testnet",network:"chiliz-spicy-Testnet",nativeCurrency:{decimals:18,name:"CHZ",symbol:"CHZ"},rpcUrls:{default:{http:["https://spicy-rpc.chiliz.com","https://chiliz-spicy.publicnode.com"],webSocket:["wss://spicy-rpc-ws.chiliz.com","wss://chiliz-spicy.publicnode.com"]}},blockExplorers:{default:{name:"Chiliz Explorer",url:"http://spicy-explorer.chiliz.com",apiUrl:"http://spicy-explorer.chiliz.com/api"}},testnet:!0}),vy=ns({id:8082,name:"Shardeum Sphinx",nativeCurrency:{name:"SHARDEUM",symbol:"SHM",decimals:18},rpcUrls:{default:{http:["https://sphinx.shardeum.org"]}},blockExplorers:{default:{name:"Shardeum Explorer",url:"https://explorer-sphinx.shardeum.org"}},testnet:!0}),Cy=ns({id:109,name:"Shibarium",network:"shibarium",nativeCurrency:{name:"Bone",symbol:"BONE",decimals:18},rpcUrls:{default:{http:["https://rpc.shibrpc.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://shibariumscan.io"}},contracts:{multicall3:{address:"0x864Bf681ADD6052395188A89101A1B37d3B4C961",blockCreated:265900}}}),Ey=ns({id:57,name:"Syscoin Mainnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.syscoin.org"],webSocket:["wss://rpc.syscoin.org/wss"]}},blockExplorers:{default:{name:"SyscoinExplorer",url:"https://explorer.syscoin.org",apiUrl:"https://explorer.syscoin.org/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:287139}}}),xy=ns({id:5700,name:"Syscoin Tanenbaum Testnet",nativeCurrency:{decimals:18,name:"Syscoin",symbol:"SYS"},rpcUrls:{default:{http:["https://rpc.tanenbaum.io"],webSocket:["wss://rpc.tanenbaum.io/wss"]}},blockExplorers:{default:{name:"SyscoinTestnetExplorer",url:"https://tanenbaum.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:271288}}}),ky=ns({id:841,name:"Taraxa Mainnet",nativeCurrency:{name:"Tara",symbol:"TARA",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.taraxa.io"]}},blockExplorers:{default:{name:"Taraxa Explorer",url:"https://explorer.mainnet.taraxa.io"}}}),Ty=ns({id:167007,name:"Taiko Jolnir (Alpha-5 Testnet)",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.jolnir.taiko.xyz"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.jolnir.taiko.xyz"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:732706}},testnet:!0}),Py=ns({id:167008,name:"Taiko Katla (Alpha-6 Testnet)",network:"tko-katla",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.katla.taiko.xyz"]},public:{http:["https://rpc.katla.taiko.xyz"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.katla.taiko.xyz"}}}),Ay=ns({id:167005,name:"Taiko (Alpha-3 Testnet)",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.test.taiko.xyz"]}},blockExplorers:{default:{name:"blockscout",url:"https://explorer.test.taiko.xyz"}}}),_y=ns({id:842,name:"Taraxa Testnet",nativeCurrency:{name:"Tara",symbol:"TARA",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet.taraxa.io"]}},blockExplorers:{default:{name:"Taraxa Explorer",url:"https://explorer.testnet.taraxa.io"}},testnet:!0}),Dy=ns({id:40,name:"Telos",nativeCurrency:{decimals:18,name:"Telos",symbol:"TLOS"},rpcUrls:{default:{http:["https://mainnet.telos.net/evm"]}},blockExplorers:{default:{name:"Teloscan",url:"https://www.teloscan.io/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:246530709}}}),Fy=ns({id:41,name:"Telos",nativeCurrency:{decimals:18,name:"Telos",symbol:"TLOS"},rpcUrls:{default:{http:["https://testnet.telos.net/evm"]}},blockExplorers:{default:{name:"Teloscan (testnet)",url:"https://testnet.teloscan.io/"}},testnet:!0}),Oy=ns({id:1559,name:"Tenet",network:"tenet-mainnet",nativeCurrency:{name:"TENET",symbol:"TENET",decimals:18},rpcUrls:{default:{http:["https://rpc.tenet.org"]}},blockExplorers:{default:{name:"TenetScan Mainnet",url:"https://tenetscan.io",apiUrl:"https://tenetscan.io/api"}},testnet:!1}),Sy=ns({id:997,name:"5ireChain Thunder Testnet",nativeCurrency:{name:"5ire Token",symbol:"5IRE",decimals:18},rpcUrls:{default:{http:["https://rpc-testnet.5ire.network"]}},blockExplorers:{default:{name:"5ireChain Explorer",url:"https://explorer.5ire.network"}},testnet:!0}),My=ns({id:100009,name:"Vechain",nativeCurrency:{name:"VeChain",symbol:"VET",decimals:18},rpcUrls:{default:{http:["https://mainnet.vechain.org"]}},blockExplorers:{default:{name:"Vechain Explorer",url:"https://explore.vechain.org"},vechainStats:{name:"Vechain Stats",url:"https://vechainstats.com"}}}),Iy=ns({id:888,name:"Wanchain",nativeCurrency:{name:"WANCHAIN",symbol:"WAN",decimals:18},rpcUrls:{default:{http:["https://gwan-ssl.wandevs.org:56891","https://gwan2-ssl.wandevs.org"]}},blockExplorers:{default:{name:"WanScan",url:"https://wanscan.org"}},contracts:{multicall3:{address:"0xcDF6A1566e78EB4594c86Fe73Fcdc82429e97fbB",blockCreated:25312390}}}),Ny=ns({id:999,name:"Wanchain Testnet",nativeCurrency:{name:"WANCHAIN",symbol:"WANt",decimals:18},rpcUrls:{default:{http:["https://gwan-ssl.wandevs.org:46891"]}},blockExplorers:{default:{name:"WanScanTest",url:"https://wanscan.org"}},contracts:{multicall3:{address:"0x11c89bF4496c39FB80535Ffb4c92715839CC5324",blockCreated:24743448}},testnet:!0}),Uy=ns({id:1111,name:"WEMIX",network:"wemix-mainnet",nativeCurrency:{name:"WEMIX",symbol:"WEMIX",decimals:18},rpcUrls:{default:{http:["https://api.wemix.com"]},public:{http:["https://api.wemix.com"]}},blockExplorers:{default:{name:"wemixExplorer",url:"https://explorer.wemix.com"}}}),Ly=ns({id:1112,name:"WEMIX Testnet",network:"wemix-testnet",nativeCurrency:{name:"WEMIX",symbol:"tWEMIX",decimals:18},rpcUrls:{default:{http:["https://api.test.wemix.com"]},public:{http:["https://api.test.wemix.com"]}},blockExplorers:{default:{name:"wemixExplorer",url:"https://testnet.wemixscan.com",apiUrl:"https://testnet.wemixscan.com/api"}},testnet:!0}),By=ns({id:195,name:"X1 Testnet",nativeCurrency:{decimals:18,name:"OKB",symbol:"OKB"},rpcUrls:{default:{http:["https://x1testrpc.okx.com"]}},blockExplorers:{default:{name:"OKLink",url:"https://www.oklink.com/x1-test"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:624344}},testnet:!0}),Ry=ns({id:50,name:"XinFin Network",nativeCurrency:{decimals:18,name:"XDC",symbol:"XDC"},rpcUrls:{default:{http:["https://rpc.xinfin.network"]}},blockExplorers:{xinfin:{name:"XinFin",url:"https://explorer.xinfin.network"},default:{name:"Blocksscan",url:"https://xdc.blocksscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:71542788}}}),jy=ns({id:51,name:"Apothem Network",nativeCurrency:{decimals:18,name:"TXDC",symbol:"TXDC"},rpcUrls:{default:{http:["https://erpc.apothem.network"]}},blockExplorers:{default:{name:"Blocksscan",url:"https://apothem.blocksscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:59765389}}}),Gy=ns({id:1337803,name:"Zhejiang",nativeCurrency:{name:"Zhejiang Ether",symbol:"ZhejETH",decimals:18},rpcUrls:{default:{http:["https://rpc.zhejiang.ethpandaops.io"]}},blockExplorers:{default:{name:"Beaconchain",url:"https://zhejiang.beaconcha.in"}},testnet:!0}),Hy=ns({id:42766,name:"ZKFair Mainnet",network:"zkfair-mainnet",nativeCurrency:{decimals:18,name:"USD Coin",symbol:"USDC"},rpcUrls:{default:{http:["https://rpc.zkfair.io"]},public:{http:["https://rpc.zkfair.io"]}},blockExplorers:{default:{name:"zkFair Explorer",url:"https://scan.zkfair.io",apiUrl:"https://scan.zkfair.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6090959}},testnet:!1}),zy=ns({id:43851,name:"ZKFair Testnet",network:"zkfair-testnet",nativeCurrency:{decimals:18,name:"USD Coin",symbol:"USDC"},rpcUrls:{default:{http:["https://testnet-rpc.zkfair.io"]},public:{http:["https://testnet-rpc.zkfair.io"]}},blockExplorers:{default:{name:"zkFair Explorer",url:"https://testnet-scan.zkfair.io"}},testnet:!0}),$y={block:Gs({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=$y.transaction?.format(e);return"0x71"===t.typeHex?t.type="eip712":"0xff"===t.typeHex&&(t.type="priority"),t}));return{l1BatchNumber:e.l1BatchNumber?Is(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?Is(e.l1BatchTimestamp):null,transactions:t}}}),transaction:Rs({format(e){const t={};return"0x71"===e.type?t.type="eip712":"0xff"===e.type&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?Is(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?Is(e.l1BatchTxIndex):null}}}),transactionReceipt:Vs({format:e=>({l1BatchNumber:e.l1BatchNumber?Is(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?Is(e.l1BatchTxIndex):null,logs:e.logs.map((e=>({...Hs(e),l1BatchNumber:e.l1BatchNumber?Is(e.l1BatchNumber):null,transactionLogIndex:Ns(e.transactionLogIndex),logType:e.logType}))),l2ToL1Logs:e.l2ToL1Logs.map((e=>({blockNumber:Is(e.blockHash),blockHash:e.blockHash,l1BatchNumber:Is(e.l1BatchNumber),transactionIndex:Is(e.transactionIndex),shardId:Is(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:Is(e.logIndex)})))})}),transactionRequest:Rl({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format:e=>e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:vs(e.gasPerPubdata)}:{},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(Fs(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps}:{},...e.customSignature?{customSignature:Array.from(Fs(e.customSignature))}:{}},type:"0x71"}:{}})};class Vy extends ss{constructor(){super(["Transaction is not an EIP712 transaction.","","Transaction must:",' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidEip712TransactionError"})}}function qy(e){return"eip712"===e.type||!!("customSignature"in e&&e.customSignature||"paymaster"in e&&e.paymaster||"paymasterInput"in e&&e.paymasterInput||"gasPerPubdata"in e&&"bigint"==typeof e.gasPerPubdata||"factoryDeps"in e&&e.factoryDeps)}function Zy(e){const{chainId:t,to:n,from:r,paymaster:a,paymasterInput:s}=e;if(!qy(e))throw new Vy;if(!t||t<=0)throw new Eu({chainId:t});if(n&&!_i(n))throw new Zs({address:n});if(r&&!_i(r))throw new Zs({address:r});if(a&&!_i(a))throw new Zs({address:a});if(a&&!s)throw new ss("`paymasterInput` must be provided when `paymaster` is defined");if(!a&&s)throw new ss("`paymaster` must be provided when `paymasterInput` is defined")}const Wy={formatters:$y,serializers:{transaction:function(e,t){return qy(e)?function(e){const{chainId:t,gas:n,nonce:r,to:a,from:s,value:i,maxFeePerGas:o,maxPriorityFeePerGas:c,customSignature:l,factoryDeps:u,paymaster:d,paymasterInput:p,gasPerPubdata:h,data:m}=e;Zy(e);return Fi(["0x71",Pp([r?vs(r):"0x",c?vs(c):"0x",o?vs(o):"0x",n?vs(n):"0x",a??"0x",i?vs(i):"0x",m??"0x0",vs(t),vs(""),vs(""),vs(t),s??"0x",h?vs(h):"0x",u??[],l??"0x",d&&p?[d,p]:[]])])}(e):bp(e,t)}},custom:{getEip712Domain:e=>{Zy(e);const t=function(e){const{gas:t,nonce:n,to:r,from:a,value:s,maxFeePerGas:i,maxPriorityFeePerGas:o,factoryDeps:c,paymaster:l,paymasterInput:u,gasPerPubdata:d,data:p}=e;return{txType:113n,from:BigInt(a),to:r?BigInt(r):0n,gasLimit:t??0n,gasPerPubdataByteLimit:d??0n,maxFeePerGas:i??0n,maxPriorityFeePerGas:o??0n,paymaster:l?BigInt(l):0n,nonce:n?BigInt(n):0n,value:s??0n,data:p||"0x0",factoryDeps:c??[],paymasterInput:u||"0x0"}}(e);return{domain:{name:"zkSync",version:"2",chainId:e.chainId},types:{Transaction:[{name:"txType",type:"uint256"},{name:"from",type:"uint256"},{name:"to",type:"uint256"},{name:"gasLimit",type:"uint256"},{name:"gasPerPubdataByteLimit",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymaster",type:"uint256"},{name:"nonce",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"factoryDeps",type:"bytes32[]"},{name:"paymasterInput",type:"bytes"}]},primaryType:"Transaction",message:t}}}},Ky=ns({...Wy,id:324,name:"zkSync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://era.zksync.network/",apiUrl:"https://api-era.zksync.network/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}}}),Jy=ns({...Wy,id:280,name:"zkSync Era Testnet",network:"zksync-era-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://testnet.era.zksync.dev"],webSocket:["wss://testnet.era.zksync.dev/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://goerli.explorer.zksync.io"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}},testnet:!0}),Xy=ns({...Wy,id:300,name:"zkSync Sepolia Testnet",network:"zksync-sepolia-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.era.zksync.dev"],webSocket:["wss://sepolia.era.zksync.dev/ws"]}},blockExplorers:{default:{name:"zkExplorer",url:"https://sepolia.explorer.zksync.io/"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"}},testnet:!0}),Yy=ns({id:7e3,name:"ZetaChain",nativeCurrency:{decimals:18,name:"Zeta",symbol:"ZETA"},rpcUrls:{default:{http:["https://zetachain-evm.blockpi.network/v1/rpc/public"]}},blockExplorers:{default:{name:"ZetaScan",url:"https://explorer.zetachain.com"}},testnet:!1}),Qy=ns({id:7001,name:"ZetaChain Athens Testnet",nativeCurrency:{decimals:18,name:"Zeta",symbol:"aZETA"},rpcUrls:{default:{http:["https://zetachain-athens-evm.blockpi.network/v1/rpc/public"]}},blockExplorers:{default:{name:"ZetaScan",url:"https://athens3.explorer.zetachain.com"}},testnet:!0}),eb=ns({id:32769,name:"Zilliqa",network:"zilliqa",nativeCurrency:{name:"Zilliqa",symbol:"ZIL",decimals:18},rpcUrls:{default:{http:["https://api.zilliqa.com"]}},blockExplorers:{default:{name:"Ethernal",url:"https://evmx.zilliqa.com"}},testnet:!1}),tb=ns({id:33101,name:"Zilliqa Testnet",network:"zilliqa-testnet",nativeCurrency:{name:"Zilliqa",symbol:"ZIL",decimals:18},rpcUrls:{default:{http:["https://dev-api.zilliqa.com"]}},blockExplorers:{default:{name:"Ethernal",url:"https://evmx.testnet.zilliqa.com"}},testnet:!0}),nb=ns({...Dp,id:7777777,name:"Zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy",apiUrl:"https://explorer.zora.energy/api"}},contracts:{...Dp.contracts,l2OutputOracle:{1:{address:"0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:5882},portal:{1:{address:"0x1a0ad011913A150f69f6A19DF447A0CfD9551054"}},l1StandardBridge:{1:{address:"0x3e2Ea9B92B7E48A52296fD261dc26fd995284631"}}},sourceId:1}),rb=11155111,ab=ns({...Dp,id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/",apiUrl:"https://sepolia.explorer.zora.energy/api"}},contracts:{...Dp.contracts,l2OutputOracle:{[rb]:{address:"0x2615B481Bd3E5A1C0C7Ca3Da1bdc663E8615Ade9"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:83160},portal:{[rb]:{address:"0xeffE2C6cA9Ab797D418f0D91eA60807713f3536f"}},l1StandardBridge:{[rb]:{address:"0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB"}}},sourceId:rb,testnet:!0}),sb=ns({...Dp,id:999,name:"Zora Goerli Testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy",apiUrl:"https://testnet.explorer.zora.energy/api"}},contracts:{...Dp.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:189123},portal:{5:{address:"0xDb9F51790365e7dc196e7D072728df39Be958ACe"}}},sourceId:5,testnet:!0});var ib=Object.freeze({__proto__:null,acala:rs,ancient8:Fp,ancient8Sepolia:Sp,anvil:Mp,apexTestnet:Ip,arbitrum:Np,arbitrumGoerli:Up,arbitrumNova:Lp,astar:Bp,astarZkEVM:Rp,astarZkyoto:jp,arbitrumSepolia:Gp,astarZkatana:Hp,aurora:zp,auroraTestnet:$p,auroria:Vp,avalanche:qp,avalancheFuji:Zp,bahamut:Wp,base:Kp,baseGoerli:Jp,baseSepolia:Yp,beam:Qp,beamTestnet:eh,bearNetworkChainMainnet:th,bearNetworkChainTestnet:nh,berachainTestnet:rh,bitTorrent:ah,bitTorrentTestnet:sh,blast:ih,blastSepolia:oh,boba:ch,bronos:lh,bronosTestnet:uh,bsc:dh,bscTestnet:ph,bscGreenfield:hh,bxn:mh,bxnTestnet:fh,canto:yh,celo:Th,celoAlfajores:Ph,chiliz:Ah,classic:_h,confluxESpace:Dh,confluxESpaceTestnet:Fh,coreDao:Oh,cronos:Sh,cronosTestnet:Mh,crossbell:Ih,defichainEvm:Nh,defichainEvmTestnet:Uh,dfk:Lh,dogechain:Bh,edgeware:Rh,edgewareTestnet:jh,eos:Gh,eosTestnet:Hh,etherlinkTestnet:zh,evmos:$h,evmosTestnet:Vh,ekta:qh,ektaTestnet:Zh,fantom:Wh,fantomSonicTestnet:Kh,fantomTestnet:Jh,fibo:Xh,filecoin:Yh,filecoinCalibration:Qh,filecoinHyperspace:em,flare:tm,flareTestnet:nm,foundry:rm,fraxtal:am,fraxtalTestnet:im,fuse:om,fuseSparknet:cm,iotex:lm,iotexTestnet:um,jbc:dm,karura:pm,gobi:hm,goerli:mm,gnosis:fm,gnosisChiado:ym,hardhat:bm,harmonyOne:gm,haqqMainnet:wm,haqqTestedge2:vm,hedera:Cm,hederaTestnet:Em,hederaPreviewnet:xm,holesky:km,kakarotSepolia:Tm,kava:Pm,kavaTestnet:Am,kcc:_m,klaytn:Dm,klaytnBaobab:Fm,kroma:Om,kromaSepolia:Sm,lightlinkPegasus:Mm,lightlinkPhoenix:Im,linea:Nm,lineaTestnet:Um,liskSepolia:Bm,localhost:Rm,lukso:jm,mainnet:Gm,mandala:Hm,manta:zm,mantaTestnet:$m,mantle:Vm,mantleTestnet:qm,merlin:Zm,metachain:Wm,metachainIstanbul:Km,meter:Jm,meterTestnet:Xm,metis:Ym,metisGoerli:Qm,mev:ef,mevTestnet:tf,mintSepoliaTestnet:nf,mode:rf,modeTestnet:af,moonbaseAlpha:sf,moonbeam:of,moonbeamDev:cf,moonriver:lf,neonDevnet:uf,neonMainnet:df,nexi:pf,nexilix:hf,oasys:mf,oasisTestnet:ff,okc:yf,optimism:bf,optimismGoerli:gf,optimismSepolia:vf,opBNB:Cf,opBNBTestnet:Ef,oortMainnetDev:xf,palm:kf,palmTestnet:Tf,pgn:Pf,pgnTestnet:_f,phoenix:Df,plinga:Ff,plumeTestnet:Of,polygon:Sf,polygonAmoy:Mf,polygonMumbai:If,polygonZkEvmTestnet:Nf,polygonZkEvm:Uf,pulsechain:Lf,pulsechainV4:Bf,qMainnet:Rf,qTestnet:jf,rollux:Gf,rolluxTestnet:Hf,ronin:zf,rootstock:$f,rss3:Vf,rss3Sepolia:Zf,saigon:Wf,sapphire:Kf,sapphireTestnet:Jf,scroll:Xf,scrollSepolia:Yf,scrollTestnet:Qf,sepolia:ey,shimmer:ty,shimmerTestnet:ny,skaleBlockBrawlers:ry,skaleCalypso:ay,skaleCalypsoTestnet:sy,skaleCryptoBlades:iy,skaleCryptoColosseum:oy,skaleEuropa:cy,skaleEuropaTestnet:ly,skaleExorde:uy,skaleHumanProtocol:dy,skaleNebula:py,skaleNebulaTestnet:hy,skaleRazor:my,skaleTitan:fy,skaleTitanTestnet:yy,songbird:by,songbirdTestnet:gy,spicy:wy,shardeumSphinx:vy,shibarium:Cy,syscoin:Ey,syscoinTestnet:xy,taraxa:ky,taikoJolnir:Ty,taikoKatla:Py,taikoTestnetSepolia:Ay,taraxaTestnet:_y,telos:Dy,telosTestnet:Fy,tenet:Oy,thunderTestnet:Sy,vechain:My,wanchain:Iy,wanchainTestnet:Ny,wemix:Uy,wemixTestnet:Ly,x1Testnet:By,xdc:Ry,xdcTestnet:jy,zhejiang:Gy,zkFair:Hy,zkFairTestnet:zy,zkSync:Ky,zkSyncTestnet:Jy,zkSyncSepoliaTestnet:Xy,zetachain:Yy,zetachainAthensTestnet:Qy,zilliqa:eb,zilliqaTestnet:tb,zora:nb,zoraSepolia:ab,zoraTestnet:sb});const ob="3.18.2";class cb extends ss{constructor(e,t={}){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AASDKError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:ob});const n=t.cause instanceof cb&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...n?[`Docs: https://accountkit.alchemy.com${n}${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...this.details?[`Details: ${this.details}`]:[],`Version: ${this.version}`].join("\n")}}class lb extends cb{constructor(e,t,n){super([`Client of type (${n.type}) is not a ${e}.`,`Create one with \`createSmartAccountClient\` first before using \`${t}\``].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IncompatibleClientError"})}}class ub extends cb{constructor(e){super(`Invalid RPC URL ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRpcUrlError"})}}class db extends cb{constructor(){super("No chain supplied to the client"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}const pb=e=>({estimateUserOperationGas:async(t,n,r)=>(async(e,t)=>e.request({method:"eth_estimateUserOperationGas",params:null!=t.stateOverride?[t.request,t.entryPoint,t.stateOverride]:[t.request,t.entryPoint]}))(e,{request:t,entryPoint:n,stateOverride:r}),sendRawUserOperation:async(t,n)=>(async(e,t)=>e.request({method:"eth_sendUserOperation",params:[t.request,t.entryPoint]}))(e,{request:t,entryPoint:n}),getUserOperationByHash:async t=>(async(e,t)=>e.request({method:"eth_getUserOperationByHash",params:[t.hash]}))(e,{hash:t}),getSupportedEntryPoints:async()=>(async e=>e.request({method:"eth_supportedEntryPoints",params:[]}))(e),getUserOperationReceipt:async t=>(async(e,t)=>e.request({method:"eth_getUserOperationReceipt",params:[t.hash]}))(e,{hash:t})});function hb(e){if(!e.chain)throw new db;const{key:t="bundler-public",name:n="Public Bundler Client",type:r="bundlerClient"}=e,{transport:a,...s}=e,i=a({chain:e.chain,pollingInterval:s.pollingInterval}),o={...e,key:t,name:n,type:r};return(()=>{if("http"===i.config.type){const{url:e,fetchOptions:t}=i.value,n=t??{};return e.toLowerCase().indexOf("alchemy")>-1&&(n.headers={...n.headers,"Alchemy-AA-Sdk-Version":ob}),td({...o,transport:ud(e,{...i.config,fetchOptions:n})})}return td(o)})().extend(Tp).extend(pb)}class mb extends cb{constructor(e,t){super([`No default entry point v${t} exists for ${e.name}.`,"Supply an override."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EntryPointNotFoundError"})}}class fb extends cb{constructor(e,t){super(`Invalid entry point: unexpected version ${t} for ${e.name}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidEntryPointError"})}}const yb=e=>{const t=ki(e.initCode),n=ki(e.callData),r=ki(e.paymasterAndData);return Zo([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"bytes32"}],[e.sender,Is(e.nonce),t,n,Is(e.callGasLimit),Is(e.verificationGasLimit),Is(e.preVerificationGas),Is(e.maxFeePerGas),Is(e.maxPriorityFeePerGas),r])};const bb=e=>{const t=e.factory&&e.factoryData?Di([e.factory,e.factoryData]):"0x",n=gb((({verificationGasLimit:e,callGasLimit:t})=>({verificationGasLimit:e,callGasLimit:t}))(e)),r=gb((({maxPriorityFeePerGas:e,maxFeePerGas:t})=>({maxPriorityFeePerGas:e,maxFeePerGas:t}))(e)),a=e.paymaster&&_i(e.paymaster)?function({paymaster:e,paymasterVerificationGasLimit:t,paymasterPostOpGasLimit:n,paymasterData:r}){if(!(e&&t&&n&&r))return"0x";return Di([e,bs(t,{size:16}),bs(n,{size:16}),r])}((({paymaster:e,paymasterVerificationGasLimit:t,paymasterPostOpGasLimit:n,paymasterData:r})=>({paymaster:e,paymasterVerificationGasLimit:t,paymasterPostOpGasLimit:n,paymasterData:r}))(e)):"0x";return Zo([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"}],[e.sender,Is(e.nonce),ki(t),ki(e.callData),n,Is(e.preVerificationGas),r,ki(a)])};function gb(e){return Di(Object.values(e).map((e=>bs(e,{size:16}))))}const wb="0.6.0",vb={"0.6.0":{version:"0.6.0",address:{default:"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"},abi:[{inputs:[{internalType:"uint256",name:"preOpGas",type:"uint256"},{internalType:"uint256",name:"paid",type:"uint256"},{internalType:"uint48",name:"validAfter",type:"uint48"},{internalType:"uint48",name:"validUntil",type:"uint48"},{internalType:"bool",name:"targetSuccess",type:"bool"},{internalType:"bytes",name:"targetResult",type:"bytes"}],name:"ExecutionResult",type:"error"},{inputs:[{internalType:"uint256",name:"opIndex",type:"uint256"},{internalType:"string",name:"reason",type:"string"}],name:"FailedOp",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"},{inputs:[{internalType:"address",name:"aggregator",type:"address"}],name:"SignatureValidationFailed",type:"error"},{inputs:[{components:[{internalType:"uint256",name:"preOpGas",type:"uint256"},{internalType:"uint256",name:"prefund",type:"uint256"},{internalType:"bool",name:"sigFailed",type:"bool"},{internalType:"uint48",name:"validAfter",type:"uint48"},{internalType:"uint48",name:"validUntil",type:"uint48"},{internalType:"bytes",name:"paymasterContext",type:"bytes"}],internalType:"struct IEntryPoint.ReturnInfo",name:"returnInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"senderInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"factoryInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"paymasterInfo",type:"tuple"}],name:"ValidationResult",type:"error"},{inputs:[{components:[{internalType:"uint256",name:"preOpGas",type:"uint256"},{internalType:"uint256",name:"prefund",type:"uint256"},{internalType:"bool",name:"sigFailed",type:"bool"},{internalType:"uint48",name:"validAfter",type:"uint48"},{internalType:"uint48",name:"validUntil",type:"uint48"},{internalType:"bytes",name:"paymasterContext",type:"bytes"}],internalType:"struct IEntryPoint.ReturnInfo",name:"returnInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"senderInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"factoryInfo",type:"tuple"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"paymasterInfo",type:"tuple"},{components:[{internalType:"address",name:"aggregator",type:"address"},{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],internalType:"struct IStakeManager.StakeInfo",name:"stakeInfo",type:"tuple"}],internalType:"struct IEntryPoint.AggregatorStakeInfo",name:"aggregatorInfo",type:"tuple"}],name:"ValidationResultWithAggregation",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"address",name:"factory",type:"address"},{indexed:!1,internalType:"address",name:"paymaster",type:"address"}],name:"AccountDeployed",type:"event"},{anonymous:!1,inputs:[],name:"BeforeExecution",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"totalDeposit",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"aggregator",type:"address"}],name:"SignatureAggregatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"totalStaked",type:"uint256"},{indexed:!1,internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],name:"StakeLocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"withdrawTime",type:"uint256"}],name:"StakeUnlocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"address",name:"withdrawAddress",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"StakeWithdrawn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!0,internalType:"address",name:"paymaster",type:"address"},{indexed:!1,internalType:"uint256",name:"nonce",type:"uint256"},{indexed:!1,internalType:"bool",name:"success",type:"bool"},{indexed:!1,internalType:"uint256",name:"actualGasCost",type:"uint256"},{indexed:!1,internalType:"uint256",name:"actualGasUsed",type:"uint256"}],name:"UserOperationEvent",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"nonce",type:"uint256"},{indexed:!1,internalType:"bytes",name:"revertReason",type:"bytes"}],name:"UserOperationRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"address",name:"withdrawAddress",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[],name:"SIG_VALIDATION_FAILED",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"address",name:"sender",type:"address"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"}],name:"_validateSenderAndPaymaster",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"depositTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"deposits",outputs:[{internalType:"uint112",name:"deposit",type:"uint112"},{internalType:"bool",name:"staked",type:"bool"},{internalType:"uint112",name:"stake",type:"uint112"},{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"},{internalType:"uint48",name:"withdrawTime",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getDepositInfo",outputs:[{components:[{internalType:"uint112",name:"deposit",type:"uint112"},{internalType:"bool",name:"staked",type:"bool"},{internalType:"uint112",name:"stake",type:"uint112"},{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"},{internalType:"uint48",name:"withdrawTime",type:"uint48"}],internalType:"struct IStakeManager.DepositInfo",name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint192",name:"key",type:"uint192"}],name:"getNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"initCode",type:"bytes"}],name:"getSenderAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"userOp",type:"tuple"}],name:"getUserOpHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation[]",name:"userOps",type:"tuple[]"},{internalType:"contract IAggregator",name:"aggregator",type:"address"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct IEntryPoint.UserOpsPerAggregator[]",name:"opsPerAggregator",type:"tuple[]"},{internalType:"address payable",name:"beneficiary",type:"address"}],name:"handleAggregatedOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation[]",name:"ops",type:"tuple[]"},{internalType:"address payable",name:"beneficiary",type:"address"}],name:"handleOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint192",name:"key",type:"uint192"}],name:"incrementNonce",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"callData",type:"bytes"},{components:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"address",name:"paymaster",type:"address"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"}],internalType:"struct EntryPoint.MemoryUserOp",name:"mUserOp",type:"tuple"},{internalType:"bytes32",name:"userOpHash",type:"bytes32"},{internalType:"uint256",name:"prefund",type:"uint256"},{internalType:"uint256",name:"contextOffset",type:"uint256"},{internalType:"uint256",name:"preOpGas",type:"uint256"}],internalType:"struct EntryPoint.UserOpInfo",name:"opInfo",type:"tuple"},{internalType:"bytes",name:"context",type:"bytes"}],name:"innerHandleOp",outputs:[{internalType:"uint256",name:"actualGasCost",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint192",name:"",type:"uint192"}],name:"nonceSequenceNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"op",type:"tuple"},{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"targetCallData",type:"bytes"}],name:"simulateHandleOp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"userOp",type:"tuple"}],name:"simulateValidation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"},{internalType:"uint256",name:"withdrawAmount",type:"uint256"}],name:"withdrawTo",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],getUserOperationHash:(e,t,n)=>{const r=Zo([{type:"bytes32"},{type:"address"},{type:"uint256"}],[ki(yb(e)),t,BigInt(n)]);return ki(r)},packUserOperation:yb},"0.7.0":{version:"0.7.0",address:{default:"0x0000000071727De22E5E9d8BAf0edAc6f37da032"},abi:[{inputs:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"ret",type:"bytes"}],name:"DelegateAndRevert",type:"error"},{inputs:[{internalType:"uint256",name:"opIndex",type:"uint256"},{internalType:"string",name:"reason",type:"string"}],name:"FailedOp",type:"error"},{inputs:[{internalType:"uint256",name:"opIndex",type:"uint256"},{internalType:"string",name:"reason",type:"string"},{internalType:"bytes",name:"inner",type:"bytes"}],name:"FailedOpWithRevert",type:"error"},{inputs:[{internalType:"bytes",name:"returnData",type:"bytes"}],name:"PostOpReverted",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"},{inputs:[{internalType:"address",name:"aggregator",type:"address"}],name:"SignatureValidationFailed",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"address",name:"factory",type:"address"},{indexed:!1,internalType:"address",name:"paymaster",type:"address"}],name:"AccountDeployed",type:"event"},{anonymous:!1,inputs:[],name:"BeforeExecution",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"totalDeposit",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"nonce",type:"uint256"},{indexed:!1,internalType:"bytes",name:"revertReason",type:"bytes"}],name:"PostOpRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"aggregator",type:"address"}],name:"SignatureAggregatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"totalStaked",type:"uint256"},{indexed:!1,internalType:"uint256",name:"unstakeDelaySec",type:"uint256"}],name:"StakeLocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"uint256",name:"withdrawTime",type:"uint256"}],name:"StakeUnlocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"address",name:"withdrawAddress",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"StakeWithdrawn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!0,internalType:"address",name:"paymaster",type:"address"},{indexed:!1,internalType:"uint256",name:"nonce",type:"uint256"},{indexed:!1,internalType:"bool",name:"success",type:"bool"},{indexed:!1,internalType:"uint256",name:"actualGasCost",type:"uint256"},{indexed:!1,internalType:"uint256",name:"actualGasUsed",type:"uint256"}],name:"UserOperationEvent",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"nonce",type:"uint256"}],name:"UserOperationPrefundTooLow",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"userOpHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"nonce",type:"uint256"},{indexed:!1,internalType:"bytes",name:"revertReason",type:"bytes"}],name:"UserOperationRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!1,internalType:"address",name:"withdrawAddress",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"delegateAndRevert",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"depositTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"deposits",outputs:[{internalType:"uint256",name:"deposit",type:"uint256"},{internalType:"bool",name:"staked",type:"bool"},{internalType:"uint112",name:"stake",type:"uint112"},{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"},{internalType:"uint48",name:"withdrawTime",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"getDepositInfo",outputs:[{components:[{internalType:"uint256",name:"deposit",type:"uint256"},{internalType:"bool",name:"staked",type:"bool"},{internalType:"uint112",name:"stake",type:"uint112"},{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"},{internalType:"uint48",name:"withdrawTime",type:"uint48"}],internalType:"struct IStakeManager.DepositInfo",name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint192",name:"key",type:"uint192"}],name:"getNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"initCode",type:"bytes"}],name:"getSenderAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"bytes32",name:"accountGasLimits",type:"bytes32"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"bytes32",name:"gasFees",type:"bytes32"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct PackedUserOperation",name:"userOp",type:"tuple"}],name:"getUserOpHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"bytes32",name:"accountGasLimits",type:"bytes32"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"bytes32",name:"gasFees",type:"bytes32"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct PackedUserOperation[]",name:"userOps",type:"tuple[]"},{internalType:"contract IAggregator",name:"aggregator",type:"address"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct IEntryPoint.UserOpsPerAggregator[]",name:"opsPerAggregator",type:"tuple[]"},{internalType:"address payable",name:"beneficiary",type:"address"}],name:"handleAggregatedOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"bytes32",name:"accountGasLimits",type:"bytes32"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"bytes32",name:"gasFees",type:"bytes32"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct PackedUserOperation[]",name:"ops",type:"tuple[]"},{internalType:"address payable",name:"beneficiary",type:"address"}],name:"handleOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint192",name:"key",type:"uint192"}],name:"incrementNonce",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"callData",type:"bytes"},{components:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"paymasterVerificationGasLimit",type:"uint256"},{internalType:"uint256",name:"paymasterPostOpGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"address",name:"paymaster",type:"address"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"}],internalType:"struct EntryPoint.MemoryUserOp",name:"mUserOp",type:"tuple"},{internalType:"bytes32",name:"userOpHash",type:"bytes32"},{internalType:"uint256",name:"prefund",type:"uint256"},{internalType:"uint256",name:"contextOffset",type:"uint256"},{internalType:"uint256",name:"preOpGas",type:"uint256"}],internalType:"struct EntryPoint.UserOpInfo",name:"opInfo",type:"tuple"},{internalType:"bytes",name:"context",type:"bytes"}],name:"innerHandleOp",outputs:[{internalType:"uint256",name:"actualGasCost",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint192",name:"",type:"uint192"}],name:"nonceSequenceNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"},{internalType:"uint256",name:"withdrawAmount",type:"uint256"}],name:"withdrawTo",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],getUserOperationHash:(e,t,n)=>{const r=Zo([{type:"bytes32"},{type:"address"},{type:"uint256"}],[ki(bb(e)),t,BigInt(n)]);return ki(r)},packUserOperation:bb}};function Cb(e,t){const{version:n=wb,addressOverride:r}=t??{version:wb},a=vb[n??wb],s=r??a.address[e.id]??a.address.default;if(!s)throw new mb(e,n);if("0.6.0"===a.version)return{version:a.version,address:s,chain:e,abi:a.abi,getUserOperationHash:t=>a.getUserOperationHash(t,s,e.id),packUserOperation:a.packUserOperation};if("0.7.0"===a.version)return{version:a.version,address:s,chain:e,abi:a.abi,getUserOperationHash:t=>a.getUserOperationHash(t,s,e.id),packUserOperation:a.packUserOperation};throw new mb(e,n)}class Eb extends cb{constructor(){super("Could not find an Account to execute with this Action."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class xb extends cb{constructor(){super("getCounterFactualAddress failed"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"GetCounterFactualAddressError"})}}class kb extends cb{constructor(e){super(`Upgrades are not supported by ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UpgradesNotSupported"})}}class Tb extends cb{constructor(){super("SignTransaction is not supported by smart contracts"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignTransactionNotSupported"})}}class Pb extends cb{constructor(e,t){super(`Failed to get storage slot ${e} (${t})`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FailedToGetStorageSlotError"})}}class Ab extends cb{constructor(e){super(`Batch execution is not supported by ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BatchExecutionNotSupportedError"})}}var _b;!function(e){e[e.VERBOSE=5]="VERBOSE",e[e.DEBUG=4]="DEBUG",e[e.INFO=3]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=1]="ERROR",e[e.NONE=0]="NONE"}(_b||(_b={}));class Db{static setLogLevel(e){this.logLevel=e}static setLogFilter(e){this.logFilter=e}static error(e,...t){this.shouldLog(e,_b.ERROR)&&console.error(e,...t)}static warn(e,...t){this.shouldLog(e,_b.WARN)&&console.warn(e,...t)}static debug(e,...t){this.shouldLog(e,_b.DEBUG)&&console.debug(e,...t)}static info(e,...t){this.shouldLog(e,_b.INFO)&&console.info(e,...t)}static verbose(e,...t){this.shouldLog(e,_b.VERBOSE)&&console.log(e,...t)}static shouldLog(e,t){return!(this.logLevel<t)&&!(this.logFilter&&!e.includes(this.logFilter))}}Object.defineProperty(Db,"logLevel",{enumerable:!0,configurable:!0,writable:!0,value:_b.INFO});const Fb=({factoryAddress:e,factoryCalldata:t,signature:n})=>Di([Zo(ho("address, bytes, bytes"),[e,t,n]),"0x6492649264926492649264926492649264926492649264926492649264926492"]);var Ob,Sb;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Ob||(Ob={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Sb||(Sb={}));const Mb=Ob.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ib=e=>{switch(typeof e){case"undefined":return Mb.undefined;case"string":return Mb.string;case"number":return isNaN(e)?Mb.nan:Mb.number;case"boolean":return Mb.boolean;case"function":return Mb.function;case"bigint":return Mb.bigint;case"symbol":return Mb.symbol;case"object":return Array.isArray(e)?Mb.array:null===e?Mb.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Mb.promise:"undefined"!=typeof Map&&e instanceof Map?Mb.map:"undefined"!=typeof Set&&e instanceof Set?Mb.set:"undefined"!=typeof Date&&e instanceof Date?Mb.date:Mb.object;default:return Mb.unknown}},Nb=Ob.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"]);class Ub extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ob.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Ub.create=e=>new Ub(e);const Lb=(e,t)=>{let n;switch(e.code){case Nb.invalid_type:n=e.received===Mb.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Nb.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ob.jsonStringifyReplacer)}`;break;case Nb.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ob.joinValues(e.keys,", ")}`;break;case Nb.invalid_union:n="Invalid input";break;case Nb.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ob.joinValues(e.options)}`;break;case Nb.invalid_enum_value:n=`Invalid enum value. Expected ${Ob.joinValues(e.options)}, received '${e.received}'`;break;case Nb.invalid_arguments:n="Invalid function arguments";break;case Nb.invalid_return_type:n="Invalid function return type";break;case Nb.invalid_date:n="Invalid date";break;case Nb.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ob.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Nb.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Nb.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Nb.custom:n="Invalid input";break;case Nb.invalid_intersection_types:n="Intersection results could not be merged";break;case Nb.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Nb.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ob.assertNever(e)}return{message:n}};let Bb=Lb;function Rb(){return Bb}const jb=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,s=[...n,...a.path||[]],i={...a,path:s};let o="";const c=r.filter((e=>!!e)).slice().reverse();for(const e of c)o=e(i,{data:t,defaultError:o}).message;return{...a,path:s,message:a.message||o}};function Gb(e,t){const n=jb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Rb(),Lb].filter((e=>!!e))});e.common.issues.push(n)}class Hb{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return zb;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return Hb.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:a}=r;if("aborted"===t.status)return zb;if("aborted"===a.status)return zb;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!r.alwaysSet||(n[t.value]=a.value)}return{status:e.value,value:n}}}const zb=Object.freeze({status:"aborted"}),$b=e=>({status:"dirty",value:e}),Vb=e=>({status:"valid",value:e}),qb=e=>"aborted"===e.status,Zb=e=>"dirty"===e.status,Wb=e=>"valid"===e.status,Kb=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Jb;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Jb||(Jb={}));class Xb{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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 Yb=(e,t)=>{if(Wb(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Ub(e.common.issues);return this._error=t,this._error}}};function Qb(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:a}}class eg{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 Ib(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ib(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Hb,ctx:{common:e.parent.common,data:e.data,parsedType:Ib(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Kb(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ib(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Yb(r,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ib(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(Kb(r)?r:Promise.resolve(r));return Yb(n,a)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const a=e(t),s=()=>r.addIssue({code:Nb.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Hg({schema:this,typeName:ew.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return zg.create(this,this._def)}nullable(){return $g.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xg.create(this,this._def)}promise(){return Gg.create(this,this._def)}or(e){return Pg.create([this,e],this._def)}and(e){return Fg.create(this,e,this._def)}transform(e){return new Hg({...Qb(this._def),schema:this,typeName:ew.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Vg({...Qb(this._def),innerType:this,defaultValue:t,typeName:ew.ZodDefault})}brand(){return new Kg({typeName:ew.ZodBranded,type:this,...Qb(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new qg({...Qb(this._def),innerType:this,catchValue:t,typeName:ew.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Jg.create(this,e)}readonly(){return Xg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tg=/^c[^\s-]{8,}$/i,ng=/^[a-z][a-z0-9]*$/,rg=/^[0-9A-HJKMNP-TV-Z]{26}$/,ag=/^[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,sg=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let ig;const og=/^(((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}))$/,cg=/^(([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})))$/;function lg(e,t){return!("v4"!==t&&t||!og.test(e))||!("v6"!==t&&t||!cg.test(e))}class ug extends eg{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Mb.string){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.string,received:t.parsedType}),zb}const t=new Hb;let n;for(const a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),Gb(n,{code:Nb.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("max"===a.kind)e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),Gb(n,{code:Nb.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){const r=e.data.length>a.value,s=e.data.length<a.value;(r||s)&&(n=this._getOrReturnCtx(e,n),r?Gb(n,{code:Nb.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&Gb(n,{code:Nb.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)sg.test(e.data)||(n=this._getOrReturnCtx(e,n),Gb(n,{validation:"email",code:Nb.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)ig||(ig=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ig.test(e.data)||(n=this._getOrReturnCtx(e,n),Gb(n,{validation:"emoji",code:Nb.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)ag.test(e.data)||(n=this._getOrReturnCtx(e,n),Gb(n,{validation:"uuid",code:Nb.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)tg.test(e.data)||(n=this._getOrReturnCtx(e,n),Gb(n,{validation:"cuid",code:Nb.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)ng.test(e.data)||(n=this._getOrReturnCtx(e,n),Gb(n,{validation:"cuid2",code:Nb.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)rg.test(e.data)||(n=this._getOrReturnCtx(e,n),Gb(n,{validation:"ulid",code:Nb.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Gb(n,{validation:"url",code:Nb.invalid_string,message:a.message}),t.dirty()}else if("regex"===a.kind){a.regex.lastIndex=0;a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Gb(n,{validation:"regex",code:Nb.invalid_string,message:a.message}),t.dirty())}else if("trim"===a.kind)e.data=e.data.trim();else if("includes"===a.kind)e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),Gb(n,{code:Nb.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),t.dirty());else if("toLowerCase"===a.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===a.kind)e.data=e.data.toUpperCase();else if("startsWith"===a.kind)e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),Gb(n,{code:Nb.invalid_string,validation:{startsWith:a.value},message:a.message}),t.dirty());else if("endsWith"===a.kind)e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),Gb(n,{code:Nb.invalid_string,validation:{endsWith:a.value},message:a.message}),t.dirty());else if("datetime"===a.kind){((r=a).precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):0===r.precision?r.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$"):r.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$")).test(e.data)||(n=this._getOrReturnCtx(e,n),Gb(n,{code:Nb.invalid_string,validation:"datetime",message:a.message}),t.dirty())}else"ip"===a.kind?lg(e.data,a.version)||(n=this._getOrReturnCtx(e,n),Gb(n,{validation:"ip",code:Nb.invalid_string,message:a.message}),t.dirty()):Ob.assertNever(a);var r;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:Nb.invalid_string,...Jb.errToObj(n)})}_addCheck(e){return new ug({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Jb.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Jb.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Jb.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Jb.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Jb.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Jb.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Jb.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Jb.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...Jb.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Jb.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...Jb.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Jb.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Jb.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Jb.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Jb.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Jb.errToObj(t)})}nonempty(e){return this.min(1,Jb.errToObj(e))}trim(){return new ug({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ug({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ug({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function dg(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}ug.create=e=>{var t;return new ug({checks:[],typeName:ew.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Qb(e)})};class pg extends eg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==Mb.number){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.number,received:t.parsedType}),zb}let t;const n=new Hb;for(const r of this._def.checks)if("int"===r.kind)Ob.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Gb(t,{code:Nb.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Gb(t,{code:Nb.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Gb(t,{code:Nb.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==dg(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Gb(t,{code:Nb.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Gb(t,{code:Nb.not_finite,message:r.message}),n.dirty()):Ob.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Jb.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Jb.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Jb.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Jb.toString(t))}setLimit(e,t,n,r){return new pg({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Jb.toString(r)}]})}_addCheck(e){return new pg({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Jb.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Jb.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Jb.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Jb.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Jb.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Jb.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Jb.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Jb.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Jb.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&Ob.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}pg.create=e=>new pg({checks:[],typeName:ew.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Qb(e)});class hg extends eg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Mb.bigint){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.bigint,received:t.parsedType}),zb}let t;const n=new Hb;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Gb(t,{code:Nb.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Gb(t,{code:Nb.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty())}else"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Gb(t,{code:Nb.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Ob.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Jb.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Jb.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Jb.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Jb.toString(t))}setLimit(e,t,n,r){return new hg({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Jb.toString(r)}]})}_addCheck(e){return new hg({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Jb.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Jb.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Jb.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Jb.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Jb.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}hg.create=e=>{var t;return new hg({checks:[],typeName:ew.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Qb(e)})};class mg extends eg{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Mb.boolean){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.boolean,received:t.parsedType}),zb}return Vb(e.data)}}mg.create=e=>new mg({typeName:ew.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Qb(e)});class fg extends eg{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Mb.date){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.date,received:t.parsedType}),zb}if(isNaN(e.data.getTime())){return Gb(this._getOrReturnCtx(e),{code:Nb.invalid_date}),zb}const t=new Hb;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Gb(n,{code:Nb.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Gb(n,{code:Nb.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Ob.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new fg({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Jb.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Jb.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}fg.create=e=>new fg({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ew.ZodDate,...Qb(e)});class yg extends eg{_parse(e){if(this._getType(e)!==Mb.symbol){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.symbol,received:t.parsedType}),zb}return Vb(e.data)}}yg.create=e=>new yg({typeName:ew.ZodSymbol,...Qb(e)});class bg extends eg{_parse(e){if(this._getType(e)!==Mb.undefined){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.undefined,received:t.parsedType}),zb}return Vb(e.data)}}bg.create=e=>new bg({typeName:ew.ZodUndefined,...Qb(e)});class gg extends eg{_parse(e){if(this._getType(e)!==Mb.null){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.null,received:t.parsedType}),zb}return Vb(e.data)}}gg.create=e=>new gg({typeName:ew.ZodNull,...Qb(e)});class wg extends eg{constructor(){super(...arguments),this._any=!0}_parse(e){return Vb(e.data)}}wg.create=e=>new wg({typeName:ew.ZodAny,...Qb(e)});class vg extends eg{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Vb(e.data)}}vg.create=e=>new vg({typeName:ew.ZodUnknown,...Qb(e)});class Cg extends eg{_parse(e){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.never,received:t.parsedType}),zb}}Cg.create=e=>new Cg({typeName:ew.ZodNever,...Qb(e)});class Eg extends eg{_parse(e){if(this._getType(e)!==Mb.undefined){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.void,received:t.parsedType}),zb}return Vb(e.data)}}Eg.create=e=>new Eg({typeName:ew.ZodVoid,...Qb(e)});class xg extends eg{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Mb.array)return Gb(t,{code:Nb.invalid_type,expected:Mb.array,received:t.parsedType}),zb;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(Gb(t,{code:e?Nb.too_big:Nb.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(Gb(t,{code:Nb.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(Gb(t,{code:Nb.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new Xb(t,e,t.path,n))))).then((e=>Hb.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>r.type._parseSync(new Xb(t,e,t.path,n))));return Hb.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new xg({...this._def,minLength:{value:e,message:Jb.toString(t)}})}max(e,t){return new xg({...this._def,maxLength:{value:e,message:Jb.toString(t)}})}length(e,t){return new xg({...this._def,exactLength:{value:e,message:Jb.toString(t)}})}nonempty(e){return this.min(1,e)}}function kg(e){if(e instanceof Tg){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=zg.create(kg(r))}return new Tg({...e._def,shape:()=>t})}return e instanceof xg?new xg({...e._def,type:kg(e.element)}):e instanceof zg?zg.create(kg(e.unwrap())):e instanceof $g?$g.create(kg(e.unwrap())):e instanceof Og?Og.create(e.items.map((e=>kg(e)))):e}xg.create=(e,t)=>new xg({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ew.ZodArray,...Qb(t)});class Tg extends eg{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Ob.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Mb.object){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.object,received:t.parsedType}),zb}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Cg&&"strip"===this._def.unknownKeys))for(const e in n.data)a.includes(e)||s.push(e);const i=[];for(const e of a){const t=r[e],a=n.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new Xb(n,a,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Cg){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)i.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)s.length>0&&(Gb(n,{code:Nb.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const r=n.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new Xb(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>Hb.mergeObjectSync(t,e))):Hb.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return Jb.errToObj,new Tg({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,a,s,i;const o=null!==(s=null===(a=(r=this._def).errorMap)||void 0===a?void 0:a.call(r,t,n).message)&&void 0!==s?s:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=Jb.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new Tg({...this._def,unknownKeys:"strip"})}passthrough(){return new Tg({...this._def,unknownKeys:"passthrough"})}extend(e){return new Tg({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Tg({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ew.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Tg({...this._def,catchall:e})}pick(e){const t={};return Ob.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Tg({...this._def,shape:()=>t})}omit(e){const t={};return Ob.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Tg({...this._def,shape:()=>t})}deepPartial(){return kg(this)}partial(e){const t={};return Ob.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new Tg({...this._def,shape:()=>t})}required(e){const t={};return Ob.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof zg;)e=e._def.innerType;t[n]=e}})),new Tg({...this._def,shape:()=>t})}keyof(){return Bg(Ob.objectKeys(this.shape))}}Tg.create=(e,t)=>new Tg({shape:()=>e,unknownKeys:"strip",catchall:Cg.create(),typeName:ew.ZodObject,...Qb(t)}),Tg.strictCreate=(e,t)=>new Tg({shape:()=>e,unknownKeys:"strict",catchall:Cg.create(),typeName:ew.ZodObject,...Qb(t)}),Tg.lazycreate=(e,t)=>new Tg({shape:e,unknownKeys:"strip",catchall:Cg.create(),typeName:ew.ZodObject,...Qb(t)});class Pg extends eg{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new Ub(e.ctx.common.issues)));return Gb(t,{code:Nb.invalid_union,unionErrors:n}),zb}));{let e;const r=[];for(const a of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=r.map((e=>new Ub(e)));return Gb(t,{code:Nb.invalid_union,unionErrors:a}),zb}}get options(){return this._def.options}}Pg.create=(e,t)=>new Pg({options:e,typeName:ew.ZodUnion,...Qb(t)});const Ag=e=>e instanceof Ug?Ag(e.schema):e instanceof Hg?Ag(e.innerType()):e instanceof Lg?[e.value]:e instanceof Rg?e.options:e instanceof jg?Object.keys(e.enum):e instanceof Vg?Ag(e._def.innerType):e instanceof bg?[void 0]:e instanceof gg?[null]:null;class _g extends eg{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Mb.object)return Gb(t,{code:Nb.invalid_type,expected:Mb.object,received:t.parsedType}),zb;const n=this.discriminator,r=t.data[n],a=this.optionsMap.get(r);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(Gb(t,{code:Nb.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),zb)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=Ag(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,n)}}return new _g({typeName:ew.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Qb(n)})}}function Dg(e,t){const n=Ib(e),r=Ib(t);if(e===t)return{valid:!0,data:e};if(n===Mb.object&&r===Mb.object){const n=Ob.objectKeys(t),r=Ob.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const n of r){const r=Dg(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}if(n===Mb.array&&r===Mb.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const a=Dg(e[r],t[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return n===Mb.date&&r===Mb.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Fg extends eg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(qb(e)||qb(r))return zb;const a=Dg(e.value,r.value);return a.valid?((Zb(e)||Zb(r))&&t.dirty(),{status:t.value,value:a.data}):(Gb(n,{code:Nb.invalid_intersection_types}),zb)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Fg.create=(e,t,n)=>new Fg({left:e,right:t,typeName:ew.ZodIntersection,...Qb(n)});class Og extends eg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Mb.array)return Gb(n,{code:Nb.invalid_type,expected:Mb.array,received:n.parsedType}),zb;if(n.data.length<this._def.items.length)return Gb(n,{code:Nb.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),zb;!this._def.rest&&n.data.length>this._def.items.length&&(Gb(n,{code:Nb.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new Xb(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Hb.mergeArray(t,e))):Hb.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Og({...this._def,rest:e})}}Og.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Og({items:e,typeName:ew.ZodTuple,rest:null,...Qb(t)})};class Sg extends eg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Mb.object)return Gb(n,{code:Nb.invalid_type,expected:Mb.object,received:n.parsedType}),zb;const r=[],a=this._def.keyType,s=this._def.valueType;for(const e in n.data)r.push({key:a._parse(new Xb(n,e,n.path,e)),value:s._parse(new Xb(n,n.data[e],n.path,e))});return n.common.async?Hb.mergeObjectAsync(t,r):Hb.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Sg(t instanceof eg?{keyType:e,valueType:t,typeName:ew.ZodRecord,...Qb(n)}:{keyType:ug.create(),valueType:e,typeName:ew.ZodRecord,...Qb(t)})}}class Mg extends eg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Mb.map)return Gb(n,{code:Nb.invalid_type,expected:Mb.map,received:n.parsedType}),zb;const r=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map((([e,t],s)=>({key:r._parse(new Xb(n,e,n.path,[s,"key"])),value:a._parse(new Xb(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of s){const r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return zb;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of s){const r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return zb;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}Mg.create=(e,t,n)=>new Mg({valueType:t,keyType:e,typeName:ew.ZodMap,...Qb(n)});class Ig extends eg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Mb.set)return Gb(n,{code:Nb.invalid_type,expected:Mb.set,received:n.parsedType}),zb;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Gb(n,{code:Nb.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(Gb(n,{code:Nb.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const a=this._def.valueType;function s(e){const n=new Set;for(const r of e){if("aborted"===r.status)return zb;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const i=[...n.data.values()].map(((e,t)=>a._parse(new Xb(n,e,n.path,t))));return n.common.async?Promise.all(i).then((e=>s(e))):s(i)}min(e,t){return new Ig({...this._def,minSize:{value:e,message:Jb.toString(t)}})}max(e,t){return new Ig({...this._def,maxSize:{value:e,message:Jb.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ig.create=(e,t)=>new Ig({valueType:e,minSize:null,maxSize:null,typeName:ew.ZodSet,...Qb(t)});class Ng extends eg{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Mb.function)return Gb(t,{code:Nb.invalid_type,expected:Mb.function,received:t.parsedType}),zb;function n(e,n){return jb({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Rb(),Lb].filter((e=>!!e)),issueData:{code:Nb.invalid_arguments,argumentsError:n}})}function r(e,n){return jb({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Rb(),Lb].filter((e=>!!e)),issueData:{code:Nb.invalid_return_type,returnTypeError:n}})}const a={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Gg){const e=this;return Vb((async function(...t){const i=new Ub([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw i.addIssue(n(t,e)),i})),c=await Reflect.apply(s,this,o),l=await e._def.returns._def.type.parseAsync(c,a).catch((e=>{throw i.addIssue(r(c,e)),i}));return l}))}{const e=this;return Vb((function(...t){const i=e._def.args.safeParse(t,a);if(!i.success)throw new Ub([n(t,i.error)]);const o=Reflect.apply(s,this,i.data),c=e._def.returns.safeParse(o,a);if(!c.success)throw new Ub([r(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ng({...this._def,args:Og.create(e).rest(vg.create())})}returns(e){return new Ng({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ng({args:e||Og.create([]).rest(vg.create()),returns:t||vg.create(),typeName:ew.ZodFunction,...Qb(n)})}}class Ug extends eg{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ug.create=(e,t)=>new Ug({getter:e,typeName:ew.ZodLazy,...Qb(t)});class Lg extends eg{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Gb(t,{received:t.data,code:Nb.invalid_literal,expected:this._def.value}),zb}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Bg(e,t){return new Rg({values:e,typeName:ew.ZodEnum,...Qb(t)})}Lg.create=(e,t)=>new Lg({value:e,typeName:ew.ZodLiteral,...Qb(t)});class Rg extends eg{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Gb(t,{expected:Ob.joinValues(n),received:t.parsedType,code:Nb.invalid_type}),zb}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Gb(t,{received:t.data,code:Nb.invalid_enum_value,options:n}),zb}return Vb(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Rg.create(e)}exclude(e){return Rg.create(this.options.filter((t=>!e.includes(t))))}}Rg.create=Bg;class jg extends eg{_parse(e){const t=Ob.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Mb.string&&n.parsedType!==Mb.number){const e=Ob.objectValues(t);return Gb(n,{expected:Ob.joinValues(e),received:n.parsedType,code:Nb.invalid_type}),zb}if(-1===t.indexOf(e.data)){const e=Ob.objectValues(t);return Gb(n,{received:n.data,code:Nb.invalid_enum_value,options:e}),zb}return Vb(e.data)}get enum(){return this._def.values}}jg.create=(e,t)=>new jg({values:e,typeName:ew.ZodNativeEnum,...Qb(t)});class Gg extends eg{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Mb.promise&&!1===t.common.async)return Gb(t,{code:Nb.invalid_type,expected:Mb.promise,received:t.parsedType}),zb;const n=t.parsedType===Mb.promise?t.data:Promise.resolve(t.data);return Vb(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Gg.create=(e,t)=>new Gg({type:e,typeName:ew.ZodPromise,...Qb(t)});class Hg extends eg{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ew.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{Gb(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){const e=r.transform(n.data,a);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?zb:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?zb:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Wb(e))return e;const s=r.transform(e.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>Wb(e)?Promise.resolve(r.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}Ob.assertNever(r)}}Hg.create=(e,t,n)=>new Hg({schema:e,typeName:ew.ZodEffects,effect:t,...Qb(n)}),Hg.createWithPreprocess=(e,t,n)=>new Hg({schema:t,effect:{type:"preprocess",transform:e},typeName:ew.ZodEffects,...Qb(n)});class zg extends eg{_parse(e){return this._getType(e)===Mb.undefined?Vb(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}zg.create=(e,t)=>new zg({innerType:e,typeName:ew.ZodOptional,...Qb(t)});class $g extends eg{_parse(e){return this._getType(e)===Mb.null?Vb(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$g.create=(e,t)=>new $g({innerType:e,typeName:ew.ZodNullable,...Qb(t)});class Vg extends eg{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Mb.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Vg.create=(e,t)=>new Vg({innerType:e,typeName:ew.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Qb(t)});class qg extends eg{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Kb(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new Ub(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new Ub(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}qg.create=(e,t)=>new qg({innerType:e,typeName:ew.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Qb(t)});class Zg extends eg{_parse(e){if(this._getType(e)!==Mb.nan){const t=this._getOrReturnCtx(e);return Gb(t,{code:Nb.invalid_type,expected:Mb.nan,received:t.parsedType}),zb}return{status:"valid",value:e.data}}}Zg.create=e=>new Zg({typeName:ew.ZodNaN,...Qb(e)});const Wg=Symbol("zod_brand");class Kg extends eg{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Jg extends eg{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?zb:"dirty"===e.status?(t.dirty(),$b(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?zb:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Jg({in:e,out:t,typeName:ew.ZodPipeline})}}class Xg extends eg{_parse(e){const t=this._def.innerType._parse(e);return Wb(t)&&(t.value=Object.freeze(t.value)),t}}Xg.create=(e,t)=>new Xg({innerType:e,typeName:ew.ZodReadonly,...Qb(t)});const Yg=(e,t={},n)=>e?wg.create().superRefine(((r,a)=>{var s,i;if(!e(r)){const e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i,c="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...c,fatal:o})}})):wg.create(),Qg={object:Tg.lazycreate};var ew;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ew||(ew={}));const tw=ug.create,nw=pg.create,rw=Zg.create,aw=hg.create,sw=mg.create,iw=fg.create,ow=yg.create,cw=bg.create,lw=gg.create,uw=wg.create,dw=vg.create,pw=Cg.create,hw=Eg.create,mw=xg.create,fw=Tg.create,yw=Tg.strictCreate,bw=Pg.create,gw=_g.create,ww=Fg.create,vw=Og.create,Cw=Sg.create,Ew=Mg.create,xw=Ig.create,kw=Ng.create,Tw=Ug.create,Pw=Lg.create,Aw=Rg.create,_w=jg.create,Dw=Gg.create,Fw=Hg.create,Ow=zg.create,Sw=$g.create,Mw=Hg.createWithPreprocess,Iw=Jg.create,Nw={string:e=>ug.create({...e,coerce:!0}),number:e=>pg.create({...e,coerce:!0}),boolean:e=>mg.create({...e,coerce:!0}),bigint:e=>hg.create({...e,coerce:!0}),date:e=>fg.create({...e,coerce:!0})},Uw=zb;var Lw=Object.freeze({__proto__:null,defaultErrorMap:Lb,setErrorMap:function(e){Bb=e},getErrorMap:Rb,makeIssue:jb,EMPTY_PATH:[],addIssueToContext:Gb,ParseStatus:Hb,INVALID:zb,DIRTY:$b,OK:Vb,isAborted:qb,isDirty:Zb,isValid:Wb,isAsync:Kb,get util(){return Ob},get objectUtil(){return Sb},ZodParsedType:Mb,getParsedType:Ib,ZodType:eg,ZodString:ug,ZodNumber:pg,ZodBigInt:hg,ZodBoolean:mg,ZodDate:fg,ZodSymbol:yg,ZodUndefined:bg,ZodNull:gg,ZodAny:wg,ZodUnknown:vg,ZodNever:Cg,ZodVoid:Eg,ZodArray:xg,ZodObject:Tg,ZodUnion:Pg,ZodDiscriminatedUnion:_g,ZodIntersection:Fg,ZodTuple:Og,ZodRecord:Sg,ZodMap:Mg,ZodSet:Ig,ZodFunction:Ng,ZodLazy:Ug,ZodLiteral:Lg,ZodEnum:Rg,ZodNativeEnum:jg,ZodPromise:Gg,ZodEffects:Hg,ZodTransformer:Hg,ZodOptional:zg,ZodNullable:$g,ZodDefault:Vg,ZodCatch:qg,ZodNaN:Zg,BRAND:Wg,ZodBranded:Kg,ZodPipeline:Jg,ZodReadonly:Xg,custom:Yg,Schema:eg,ZodSchema:eg,late:Qg,get ZodFirstPartyTypeKind(){return ew},coerce:Nw,any:uw,array:mw,bigint:aw,boolean:sw,date:iw,discriminatedUnion:gw,effect:Fw,enum:Aw,function:kw,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Yg((t=>t instanceof e),t),intersection:ww,lazy:Tw,literal:Pw,map:Ew,nan:rw,nativeEnum:_w,never:pw,null:lw,nullable:Sw,number:nw,object:fw,oboolean:()=>sw().optional(),onumber:()=>nw().optional(),optional:Ow,ostring:()=>tw().optional(),pipeline:Iw,preprocess:Mw,promise:Dw,record:Cw,set:xw,strictObject:yw,string:tw,symbol:ow,transformer:Fw,tuple:vw,undefined:cw,union:bw,unknown:dw,void:hw,NEVER:Uw,ZodIssueCode:Nb,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Ub});const Bw={...Np,rpcUrls:{...Np.rpcUrls,alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"]}}},Rw={...Up,rpcUrls:{...Up.rpcUrls,alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"]}}},jw={...Gp,rpcUrls:{...Gp.rpcUrls,alchemy:{http:["https://arb-sepolia.g.alchemy.com/v2"]}}},Gw={...mm,rpcUrls:{...mm.rpcUrls,alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"]}}},Hw={...Gm,rpcUrls:{...Gm.rpcUrls,alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"]}}},zw={...bf,rpcUrls:{...bf.rpcUrls,alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"]}}},$w={...gf,rpcUrls:{...gf.rpcUrls,alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"]}}},Vw={...vf,rpcUrls:{...vf.rpcUrls,alchemy:{http:["https://opt-sepolia.g.alchemy.com/v2"]}}},qw={...ey,rpcUrls:{...ey.rpcUrls,alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"]}}},Zw={...Kp,rpcUrls:{...Kp.rpcUrls,alchemy:{http:["https://base-mainnet.g.alchemy.com/v2"]}}},Ww={...Jp,rpcUrls:{...Jp.rpcUrls,alchemy:{http:["https://base-goerli.g.alchemy.com/v2"]}}},Kw={...Yp,rpcUrls:{...Yp.rpcUrls,alchemy:{http:["https://base-sepolia.g.alchemy.com/v2"]}}},Jw={...If,rpcUrls:{...If.rpcUrls,alchemy:{http:["https://polygon-mumbai.g.alchemy.com/v2"]}}},Xw={...Mf,rpcUrls:{...Mf.rpcUrls,alchemy:{http:["https://polygon-amoy.g.alchemy.com/v2"]}}},Yw={...Sf,rpcUrls:{...Sf.rpcUrls,alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"]}}},Qw={...am,rpcUrls:{...am.rpcUrls}},ev=ns({id:2523,name:"Fraxtal Sepolia",nativeCurrency:{name:"Frax Ether",symbol:"frxETH",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet-sepolia.frax.com"]}}}),tv={...nb,rpcUrls:{...nb.rpcUrls}},nv={...ab,rpcUrls:{...ab.rpcUrls}};var rv=Object.freeze({__proto__:null,arbitrum:Bw,arbitrumGoerli:Rw,arbitrumSepolia:jw,goerli:Gw,mainnet:Hw,optimism:zw,optimismGoerli:$w,optimismSepolia:Vw,sepolia:qw,base:Zw,baseGoerli:Ww,baseSepolia:Kw,polygonMumbai:Jw,polygonAmoy:Xw,polygon:Yw,fraxtal:Qw,fraxtalSepolia:ev,zora:tv,zoraSepolia:nv});const av=Lw.custom((e=>null!=e&&"object"==typeof e&&"id"in e&&"number"==typeof e.id)),sv=Lw.custom((e=>ds(e,{strict:!0}))),iv=Lw.union([sv,Lw.number(),Lw.bigint()]),ov=Lw.object({min:iv.optional(),max:iv.optional()}).strict(),cv=Lw.object({multiplier:Lw.number().refine((e=>(e.toString().split(".")[1]?.length??0)<=4),{message:"Max precision is 4 decimal places"})}).strict();function lv(e){return null!=e&&iv.safeParse(e).success}function uv(e){return null!=e&&cv.safeParse(e).success}const dv=(...e)=>{if(!e.length)throw new Error("bigIntMax requires at least one argument");return e.reduce(((e,t)=>e>t?e:t))},pv=(e,t,n)=>{if(t=null!=t?BigInt(t):null,null!=(n=null!=n?BigInt(n):null)&&null!=t&&n<t)throw new Error(`invalid range: upper bound ${n} is less than lower bound ${t}`);let r=BigInt(e);return null!=t&&t>r&&(r=t),null!=n&&n<r&&(r=n),r};var hv;!function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_UP=1]="ROUND_UP"}(hv||(hv={}));const mv=(e,t,n=hv.ROUND_UP)=>{if(!uv({multiplier:t}))throw new Error("bigIntMultiply requires a multiplier validated number as the second argument");const r=t.toString().split(".")[1]?.length??0;return(n===hv.ROUND_UP?BigInt(e)*BigInt(t*10**r)+BigInt(10**r-1):BigInt(e)*BigInt(t*10**r))/BigInt(10**r)},fv=(e,t={})=>{const{offset:n,count:r}=t,a=2+(n?2*n:0),s=r?a+2*r:void 0;return`0x${e.slice(a,s)}`},yv=new Map([[Bw.id,10000000n],[Rw.id,10000000n],[jw.id,10000000n]]),bv=e=>({maxPriorityFeePerGas:{min:yv.get(e.id)??100000000n,multiplier:1.33}});function gv(e){return BigInt(e.callGasLimit||0n)>0n&&BigInt(e.maxFeePerGas||0n)>0n&&BigInt(e.preVerificationGas||0n)>0n&&BigInt(e.verificationGasLimit||0n)>0n&&null!=e.maxPriorityFeePerGas&&function(e){if("paymasterAndData"in e)return null!=e.paymasterAndData;return _v(null==e.paymaster,null==e.paymasterData,null==e.paymasterPostOpGasLimit,null==e.paymasterVerificationGasLimit)}(e)&&function(e){if("initCode"in e){const{initCode:t}=e;return null!=t}return _v(null==e.factory,null==e.factoryData)}(e)}function wv(e,t,n){return null!=e&&null!=t?function(e,t){return null==t?e:lv(t)?t:null!=e?mv(e,t.multiplier):e}(e,t):function(e,t){return null==t?e:null!=e?pv(t.multiplier?mv(e,t.multiplier):e,t.min,t.max):t.min??0n}(e,n)}const vv=e=>!!e&&("paymasterAndData"in e||"paymasterData"in e),Cv=e=>void 0!==e&&("paymasterAndData"in e&&"0x"===e.paymasterAndData||"paymasterData"in e&&"0x"===e.paymasterData),Ev=({paymaster:e="0x",paymasterData:t="0x"})=>Di([e,t]),xv=new Map(Object.values(rv).map((e=>[e.id,e]))),kv=e=>{for(const t of Object.values(ib))if(t.id===e)return xv.get(t.id)??t;throw new Error("could not find chain")};async function Tv(e){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return Av((await Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{}))}function Pv(e){if("function"!=typeof e)return null==e||"string"==typeof e||"boolean"==typeof e?e:"bigint"==typeof e?vs(e):null!=e._isBigNumber||"object"!=typeof e?vs(e).replace(/^0x0/,"0x"):Array.isArray(e)?e.map((e=>Pv(e))):Object.keys(e).reduce(((t,n)=>({...t,[n]:Pv(e[n])})),{})}function Av(e){for(const t in e)null==e[t]&&delete e[t];return e}const _v=(...e)=>{if(0===e.length)throw new Error("no values passed in");return e.every((t=>t===e[0]))},Dv=(e,t)=>e.then((e=>e?t():void 0)),Fv=Lw.union([Lw.object({rpcUrl:Lw.never().optional(),apiKey:Lw.string(),jwt:Lw.never().optional()}),Lw.object({rpcUrl:Lw.never().optional(),apiKey:Lw.never().optional(),jwt:Lw.string()}),Lw.object({rpcUrl:Lw.string(),apiKey:Lw.never().optional(),jwt:Lw.never().optional()}),Lw.object({rpcUrl:Lw.string(),apiKey:Lw.never().optional(),jwt:Lw.string()})]),Ov=ov.merge(cv).partial(),Sv=Lw.object({maxFeePerGas:Ov,maxPriorityFeePerGas:Ov,callGasLimit:Ov,verificationGasLimit:Ov,preVerificationGas:Ov}).partial().strict().extend({paymasterVerificationGasLimit:Ov,paymasterPostOpGasLimit:Ov}).partial().strict(),Mv=Lw.object({txMaxRetries:Lw.number().min(0).optional().default(5),txRetryIntervalMs:Lw.number().min(0).optional().default(2e3),txRetryMultiplier:Lw.number().min(0).optional().default(1.5),feeOptions:Sv.optional()}).strict();var Iv;function Nv(e){if("string"==typeof e){if(!_i(e,{strict:!1}))throw new Zs({address:e});return{address:e,type:"json-rpc"}}if(!_i(e.address,{strict:!1}))throw new Zs({address:e.address});return{address:e.address,signMessage:e.signMessage,signTransaction:e.signTransaction,signTypedData:e.signTypedData,source:"custom",type:"local"}}Lw.custom((e=>null!=e&&"object"==typeof e&&"signerType"in e&&"signMessage"in e&&"signTypedData"in e&&"getAddress"in e&&"inner"in e)),function(e){e.UNDEFINED="0x0",e.NOT_DEPLOYED="0x1",e.DEPLOYED="0x2"}(Iv||(Iv={}));const Uv=e=>"getSigner"in e,Lv=e=>[`0x${e.substring(2,42)}`,`0x${e.substring(42)}`],Bv=async({client:e,entryPoint:t,accountAddress:n,getAccountInitCode:r})=>{if(n)return n;const a=Wu({address:t.address,abi:t.abi,client:e}),s=await r();Db.verbose("[BaseSmartContractAccount](getAddress) initCode: ",s);try{await a.simulate.getSenderAddress([s])}catch(e){if(Db.verbose("[BaseSmartContractAccount](getAddress) getSenderAddress err: ",e),"SenderAddressResult"===e.cause?.data?.errorName)return Db.verbose("[BaseSmartContractAccount](getAddress) entryPoint.getSenderAddress result:",e.cause.data.args[0]),e.cause.data.args[0];if("Invalid URL"===e.details)throw new ub}throw new xb};class Rv extends cb{constructor(){super("Transaction is missing `to` address set on request"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionMissingToParamError"})}}class jv extends cb{constructor(e){super(`Failed to find transaction for user operation ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FailedToFindTransactionError"})}}async function Gv(e,t,n,r){const{account:a=e.account,...s}=t;if(!a||"string"==typeof a)throw new Eb;if(!s.to)throw new Rv;if(!tC(e))throw new lb("BaseSmartAccountClient","buildUserOperationFromTx",e);const i={...n,maxFeePerGas:s.maxFeePerGas?s.maxFeePerGas:void 0,maxPriorityFeePerGas:s.maxPriorityFeePerGas?s.maxPriorityFeePerGas:void 0};return nC(e,{uo:{target:s.to,data:s.data??"0x",value:s.value?s.value:0n},account:a,context:r,overrides:i})}async function Hv(e,t){const{account:n=e.account,requests:r,overrides:a,context:s}=t;if(!n)throw new Eb;if(!tC(e))throw new lb("BaseSmartAccountClient","buildUserOperationFromTxs",e);const i=r.map((e=>{if(!e.to)throw new Rv;return{target:e.to,data:e.data??"0x",value:e.value?Ms(e.value,"bigint"):0n}})),o=()=>r.filter((e=>null!=e.maxFeePerGas)).map((e=>Ms(e.maxFeePerGas,"bigint"))),c=()=>r.filter((e=>null!=e.maxPriorityFeePerGas)).map((e=>Ms(e.maxPriorityFeePerGas,"bigint"))),l={maxFeePerGas:null!=a?.maxFeePerGas?a?.maxFeePerGas:o().length>0?dv(...o()):void 0,maxPriorityFeePerGas:null!=a?.maxPriorityFeePerGas?a?.maxPriorityFeePerGas:c().length>0?dv(...c()):void 0};return{uoStruct:await nC(e,{uo:i,account:n,context:s,overrides:l}),batch:i,overrides:l}}const zv=async e=>e,$v=(...e)=>async(t,n)=>{let r=t;for(const t of e)r=await t(r,n);return r};async function Vv(e,t){const{uo:n,overrides:r,account:a=e.account,context:s}=t;if(!a)throw new Eb;const{dummyPaymasterAndData:i,paymasterAndData:o}=vv(r)?{dummyPaymasterAndData:async(e,{overrides:t})=>({...e,..."paymasterAndData"in t?{paymasterAndData:t.paymasterAndData}:"paymasterData"in t&&"paymaster"in t&&"0x"!==t.paymasterData?{paymasterData:t.paymasterData,paymaster:t.paymaster}:void 0}),paymasterAndData:zv}:{dummyPaymasterAndData:e.middleware.dummyPaymasterAndData,paymasterAndData:e.middleware.paymasterAndData};return Tv(await $v(i,e.middleware.feeEstimator,e.middleware.gasEstimator,e.middleware.customMiddleware,o,e.middleware.userOperationSimulator)(n,{overrides:r,feeOptions:e.feeOptions,account:a,client:e,context:s}))}async function qv(e,t){const{account:n=e.account,context:r}=t;if(!n)throw new Eb;if(!tC(e))throw new lb("BaseSmartAccountClient","signUserOperation",e);if(!e.chain)throw new db;return await e.middleware.signUserOperation(t.uoStruct,{...t,account:n,client:e,context:r}).then(Tv).then(Pv)}async function Zv(e,t){const{account:n=e.account,uoStruct:r,context:a,overrides:s}=t;if(!n)throw new Eb;if(!e.chain)throw new db;const i=n.getEntryPoint(),o=await qv(e,{uoStruct:r,account:n,context:a,overrides:s});return{hash:await e.sendRawUserOperation(o,i.address),request:o}}class Wv extends cb{constructor(e){super(`Request is missing parameters. All properties on UserOperationStruct must be set. uo: ${JSON.stringify(e,((e,t)=>"bigint"==typeof t?{type:"bigint",value:t.toString()}:t),2)}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidUserOperationError"})}}class Kv extends cb{constructor(e,t){super(`Failed to find User Operation: ${t.message}`),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:e})}}const Jv=async(e,t)=>{if(!tC(e))throw new lb("BaseSmartAccountClient","waitForUserOperationTransaction",e);const{hash:n,retries:r={maxRetries:e.txMaxRetries,intervalMs:e.txRetryIntervalMs,multiplier:e.txRetryMultiplier}}=t;for(let t=0;t<r.maxRetries;t++){const a=r.intervalMs*Math.pow(r.multiplier,t)+100*Math.random();await new Promise((e=>setTimeout(e,a)));const s=await e.getUserOperationReceipt(n).catch((e=>{Db.error(`[SmartAccountProvider] waitForUserOperationTransaction error fetching receipt for ${n}: ${e}`)}));if(s)return vp(e,{hash:s.receipt.transactionHash}).then((e=>e.hash))}throw new jv(n)};async function Xv(e,t){const{account:n=e.account,context:r,overrides:a}=t;if(!n)throw new Eb;if(!tC(e))throw new lb("BaseSmartAccountClient","sendUserOperation",e);return Zv(e,{account:n,uoStruct:await nC(e,{uo:t.uo,account:n,context:r,overrides:a}),context:r,overrides:a})}const Yv=e=>({buildUserOperation:t=>nC(e,t),buildUserOperationFromTx:(t,n,r)=>Gv(e,t,n,r),buildUserOperationFromTxs:t=>Hv(e,t),checkGasSponsorshipEligibility:t=>function(e,t){const{account:n=e.account,overrides:r,context:a}=t;if(!n)throw new Eb;if(!tC(e))throw new lb("BaseSmartAccountClient","checkGasSponsorshipEligibility",e);return nC(e,{uo:t.uo,account:n,overrides:r,context:a}).then((e=>"0.6.0"===n.getEntryPoint().version?"0x"!==e.paymasterAndData&&null!==e.paymasterAndData:"0x"!==e.paymasterData&&null!==e.paymasterData)).catch((()=>!1))}(e,t),signUserOperation:t=>qv(e,t),dropAndReplaceUserOperation:t=>async function(e,t){const{account:n=e.account,uoToDrop:r,overrides:a,context:s}=t;if(!n)throw new Eb;if(!tC(e))throw new lb("BaseSmartAccountClient","dropAndReplaceUserOperation",e);const i="0.6.0"===n.getEntryPoint().version?{initCode:r.initCode,sender:r.sender,nonce:r.nonce,callData:r.callData,signature:await n.getDummySignature()}:{...r.factory&&r.factoryData?{factory:r.factory,factoryData:r.factoryData}:{},sender:r.sender,nonce:r.nonce,callData:r.callData,signature:await n.getDummySignature()},{maxFeePerGas:o,maxPriorityFeePerGas:c}=await Vv(e,{uo:i,overrides:a,account:n}),l={...a,maxFeePerGas:dv(BigInt(o??0n),mv(r.maxFeePerGas,1.1)),maxPriorityFeePerGas:dv(BigInt(c??0n),mv(r.maxPriorityFeePerGas,1.1))};return Zv(e,{uoStruct:await Vv(e,{uo:i,overrides:l,account:n}),account:n,context:s,overrides:l})}(e,t),sendTransaction:(t,n,r)=>async function(e,t,n,r){const{account:a=e.account}=t;if(!a||"string"==typeof a)throw new Eb;if(!t.to)throw new Rv;if(!tC(e))throw new lb("BaseSmartAccountClient","sendTransaction",e);const s=await Gv(e,t,n,r),{hash:i,request:o}=await Zv(e,{account:a,uoStruct:s,context:r,overrides:n});return Jv(e,{hash:i}).catch((e=>{throw new Kv(o,e)}))}(e,t,n,r),sendTransactions:t=>async function(e,t){const{requests:n,overrides:r,account:a=e.account,context:s}=t;if(!a)throw new Eb;if(!tC(e))throw new lb("BaseSmartAccountClient","sendTransactions",e);const{uoStruct:i}=await Hv(e,{requests:n,overrides:r,account:a,context:s}),{hash:o,request:c}=await Zv(e,{account:a,uoStruct:i,context:s,overrides:r});return Jv(e,{hash:o}).catch((e=>{throw new Kv(c,e)}))}(e,t),sendUserOperation:t=>Xv(e,t),waitForUserOperationTransaction:t=>Jv.bind(e)(e,t),upgradeAccount:t=>(async(e,t)=>{const{account:n=e.account,upgradeTo:r,overrides:a,waitForTx:s,context:i}=t;if(!n)throw new Eb;if(!tC(e))throw new lb("BaseSmartAccountClient","upgradeAccount",e);const{implAddress:o,initializationData:c}=r,l=await n.encodeUpgradeToAndCall({upgradeToAddress:o,upgradeToInitData:c}),u=await Xv(e,{uo:{target:n.address,data:l},account:n,overrides:a,context:i});let d=u.hash;return s&&(d=await Jv(e,u)),d})(e,t),getAddress:t=>((e,t)=>{const{account:n}=t??{account:e.account};if(!n)throw new Eb;return n.address})(e,t),signMessage:t=>(async(e,{account:t=e.account,message:n})=>{if(!t)throw new Eb;return t.signMessage({message:n})})(e,t),signTypedData:t=>(async(e,{account:t=e.account,typedData:n})=>{if(!t)throw new Eb;return t.signTypedData(n)})(e,t),signMessageWith6492:t=>(async(e,{account:t=e.account,message:n})=>{if(!t)throw new Eb;return t.signMessageWith6492({message:n})})(e,t),signTypedDataWith6492:t=>(async(e,{account:t=e.account,typedData:n})=>{if(!t)throw new Eb;return t.signTypedDataWith6492(n)})(e,t)}),Qv=Object.keys(Yv(void 0)).reduce(((e,t)=>(e.add(t),e)),new Set);function eC(e){for(const t of Qv)if(!(t in e))return!1;return e&&"middleware"in e}function tC(e){return e&&"middleware"in e}async function nC(e,t){const{account:n=e.account,overrides:r,context:a}=t;if(!n)throw new Eb;if(!tC(e))throw new lb("BaseSmartAccountClient","buildUserOperation",e);return async function(e,t){const{account:n=e.account,uo:r,overrides:a}=t;if(!n)throw new Eb;if(!e.chain)throw new db;const s=n.getEntryPoint(),i=Array.isArray(r)?n.encodeBatchExecute(r):"string"==typeof r?r:n.encodeExecute(r),o=n.getDummySignature(),c=n.getNonce(a?.nonceKey);return"0.6.0"===s.version?{initCode:n.getInitCode(),sender:n.address,nonce:c,callData:i,signature:o}:{factory:Dv(n.isAccountDeployed().then((e=>!e)),n.getFactoryAddress),factoryData:Dv(n.isAccountDeployed().then((e=>!e)),n.getFactoryData),sender:n.address,nonce:c,callData:i,signature:o}}(e,t).then((t=>Vv(e,{uo:t,overrides:r,account:n,context:a})))}const rC=e=>async(t,{overrides:n,feeOptions:r})=>{const a=await e.estimateFeesPerGas();if(!a.maxFeePerGas||null==a.maxPriorityFeePerGas)throw new Error("feeData is missing maxFeePerGas or maxPriorityFeePerGas");let s=await e.estimateMaxPriorityFeePerGas();s=wv(s,n?.maxPriorityFeePerGas,r?.maxPriorityFeePerGas);let i=a.maxFeePerGas-a.maxPriorityFeePerGas+BigInt(s);return i=wv(i,n?.maxFeePerGas,r?.maxFeePerGas),t.maxFeePerGas=i,t.maxPriorityFeePerGas=s,t},aC=e=>async(t,{account:n,overrides:r,feeOptions:a})=>{const s=Pv(await Tv(t)),i=await e.estimateUserOperationGas(s,n.getEntryPoint().address,r?.stateOverride),o=wv(i.callGasLimit,r?.callGasLimit,a?.callGasLimit),c=wv(i.verificationGasLimit,r?.verificationGasLimit,a?.verificationGasLimit),l=wv(i.preVerificationGas,r?.preVerificationGas,a?.preVerificationGas);t.callGasLimit=o,t.verificationGasLimit=c,t.preVerificationGas=l;if("0.7.0"===n.getEntryPoint().version){const e=wv(i.paymasterVerificationGasLimit,r?.paymasterVerificationGasLimit,a?.paymasterVerificationGasLimit);t.paymasterVerificationGasLimit=e}return t},sC=async(e,{account:t})=>("0.6.0"===t.getEntryPoint().version&&(e.paymasterAndData="0x"),e),iC=async(e,{client:t,account:n=t.account})=>{if(!n)throw new Eb;if(!t?.chain)throw new db;const r=await Tv(e),a=Pv(r);if(!gv(a))throw new Wv(r);return{...r,signature:await n.signUserOperationHash(n.getEntryPoint().getUserOperationHash(a))}},oC=e=>t=>({middleware:{customMiddleware:e.customMiddleware??zv,dummyPaymasterAndData:e.paymasterAndData?.dummyPaymasterAndData?async(t,{account:n})=>{const r=e.paymasterAndData.dummyPaymasterAndData();var a;return{...t,..."0.7.0"===n.getEntryPoint().version?ds(r)?{paymaster:(a=r).substring(0,42),paymasterData:`0x${a.substring(42)}`}:r:{paymasterAndData:ds(r)?r:Ev(r)}}}:sC,feeEstimator:e.feeEstimator??rC(t),gasEstimator:e.gasEstimator??aC(t),paymasterAndData:e.paymasterAndData?.paymasterAndData??sC,userOperationSimulator:e.userOperationSimulator??zv,signUserOperation:e.signUserOperation??iC}});function cC(e){return function(e){const{key:t="account",name:n="account provider",transport:r,type:a="SmartAccountClient",...s}=e,i=hb({...s,key:t,name:n,type:"SmartAccountClient",transport:e=>{const t=r(e);return sd({async request({method:n,params:r}){switch(n){case"eth_sendTransaction":if(!i.account)throw new Eb;if(!i.chain)throw new db;const[a]=r;return i.sendTransaction({...a,account:i.account,chain:i.chain});case"eth_sign":if(!i.account)throw new Eb;const[s,o]=r;if(s!==i.account.address)throw new Error("cannot sign for address that is not the current account");return i.signMessage(o);case"personal_sign":{if(!i.account)throw new Eb;const[e,t]=r;if(t!==i.account.address)throw new Error("cannot sign for address that is not the current account");return i.signMessage(e)}case"eth_signTypedData_v4":{if(!i.account)throw new Eb;const[e,t]=r;if(e!==i.account.address)throw new Error("cannot sign for address that is not the current account");return i.signTypedData(t)}case"eth_chainId":if(!e.chain)throw new db;return e.chain.id;default:return t.request({method:n,params:r})}}})(e)}}).extend((()=>({...Mv.parse(e.opts??{})}))).extend(oC(e)).extend(Yv);return{...i,type:a}}({...e,chain:e.client.chain,transport:sd(e.client)})}const lC=async(e,{account:t=e.account,overrides:n,...r})=>{if(!t)throw new Eb;if(!(e=>eC(e))(e))throw new lb("AlchemySmartAccountClient","SimulateUserOperationAssetChanges",e);const a=Pv(await e.buildUserOperation({...r,account:t,overrides:n}));return e.request({method:"alchemy_simulateUserOperationAssetChanges",params:[a,t.getEntryPoint().address]})};var uC,dC={exports:{}};
4
4
  /**
5
5
  * [js-sha3]{@link https://github.com/emn178/js-sha3}
@@ -23,6 +23,6 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
23
23
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
24
24
  PERFORMANCE OF THIS SOFTWARE.
25
25
  ***************************************************************************** */
26
- function ak(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function o(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}c((r=r.apply(e,t||[])).next())}))}function sk(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ik(e){return this instanceof ik?(this.v=e,this):new ik(e)}function ok(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,a=n.apply(e,t||[]),s=[];return r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r;function i(e){a[e]&&(r[e]=function(t){return new Promise((function(n,r){s.push([e,t,n,r])>1||o(e,t)}))})}function o(e,t){try{!function(e){e.value instanceof ik?Promise.resolve(e.value.v).then(c,l):u(s[0][2],e)}(a[e](t))}catch(e){u(s[0][3],e)}}function c(e){o("next",e)}function l(e){o("throw",e)}function u(e,t){e(t),s.shift(),s.length&&o(s[0][0],s[0][1])}}function ck(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=sk(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,a){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,a,(t=e[n](t)).done,t.value)}))}}}!function(e){e.ETH_MAINNET="eth-mainnet",e.ETH_GOERLI="eth-goerli",e.ETH_SEPOLIA="eth-sepolia",e.OPT_MAINNET="opt-mainnet",e.OPT_GOERLI="opt-goerli",e.OPT_SEPOLIA="opt-sepolia",e.ARB_MAINNET="arb-mainnet",e.ARB_GOERLI="arb-goerli",e.ARB_SEPOLIA="arb-sepolia",e.MATIC_MAINNET="polygon-mainnet",e.MATIC_MUMBAI="polygon-mumbai",e.MATIC_AMOY="polygon-amoy",e.ASTAR_MAINNET="astar-mainnet",e.POLYGONZKEVM_MAINNET="polygonzkevm-mainnet",e.POLYGONZKEVM_TESTNET="polygonzkevm-testnet",e.BASE_MAINNET="base-mainnet",e.BASE_GOERLI="base-goerli",e.BASE_SEPOLIA="base-sepolia"}(Mx||(Mx={})),function(e){e.DEFAULT_TOKENS="DEFAULT_TOKENS",e.ERC20="erc20"}(Ix||(Ix={})),function(e){e.EXTERNAL="external",e.INTERNAL="internal",e.ERC20="erc20",e.ERC721="erc721",e.ERC1155="erc1155",e.SPECIALNFT="specialnft"}(Nx||(Nx={})),function(e){e.TO="TO",e.FROM="FROM"}(Ux||(Ux={})),function(e){e.ASCENDING="asc",e.DESCENDING="desc"}(Lx||(Lx={})),function(e){e.VERIFIED="verified",e.APPROVED="approved",e.REQUESTED="requested",e.NOT_REQUESTED="not_requested"}(Bx||(Bx={})),function(e){e.PENDING_TRANSACTIONS="alchemy_pendingTransactions",e.MINED_TRANSACTIONS="alchemy_minedTransactions"}(Rx||(Rx={})),function(e){e.NATIVE="NATIVE",e.ERC20="ERC20",e.ERC721="ERC721",e.ERC1155="ERC1155",e.SPECIAL_NFT="SPECIAL_NFT"}(jx||(jx={})),function(e){e.APPROVE="APPROVE",e.TRANSFER="TRANSFER"}(Gx||(Gx={})),function(e){e.ETHERSCAN="ETHERSCAN"}(Hx||(Hx={})),function(e){e.CREATE="CREATE",e.CALL="CALL",e.STATICCALL="STATICCALL",e.DELEGATECALL="DELEGATECALL"}(zx||(zx={})),function(e){e.UNSPECIFIED="TRANSACTION_JOB_STATUS_UNSPECIFIED",e.IN_PROGRESS="IN_PROGRESS",e.COMPLETE="COMPLETE",e.ABANDONED="ABANDONED"}($x||($x={})),function(e){e.V1="V1",e.V2="V2"}(Vx||(Vx={})),function(e){e.MINED_TRANSACTION="MINED_TRANSACTION",e.DROPPED_TRANSACTION="DROPPED_TRANSACTION",e.ADDRESS_ACTIVITY="ADDRESS_ACTIVITY",e.NFT_ACTIVITY="NFT_ACTIVITY",e.NFT_METADATA_UPDATE="NFT_METADATA_UPDATE",e.GRAPHQL="GRAPHQL"}(qx||(qx={})),function(e){e.PENDING="pending",e.LATEST="latest",e.SAFE="safe",e.FINALIZED="finalized",e.EARLIEST="earliest"}(Zx||(Zx={})),function(e){e.CALL_TRACER="callTracer",e.PRESTATE_TRACER="prestateTracer"}(Wx||(Wx={})),function(e){e.ERC721="ERC721",e.ERC1155="ERC1155",e.NO_SUPPORTED_NFT_STANDARD="NO_SUPPORTED_NFT_STANDARD",e.NOT_A_CONTRACT="NOT_A_CONTRACT",e.UNKNOWN="UNKNOWN"}(Kx||(Kx={})),function(e){e.Erc721TooManyOwners="Erc721TooManyOwners",e.Erc721TooManyTokens="Erc721TooManyTokens",e.Erc721DishonestTotalSupply="Erc721DishonestTotalSupply",e.MostlyHoneyPotOwners="MostlyHoneyPotOwners",e.OwnedByMostHoneyPots="OwnedByMostHoneyPots",e.LowDistinctOwnersPercent="LowDistinctOwnersPercent",e.HighHoneyPotOwnerPercent="HighHoneyPotOwnerPercent",e.HighHoneyPotPercent="HighHoneyPotPercent",e.HoneyPotsOwnMultipleTokens="HoneyPotsOwnMultipleTokens",e.NoSalesActivity="NoSalesActivity",e.HighAirdropPercent="HighAirdropPercent",e.Unknown="Unknown"}(Jx||(Jx={})),function(e){e.SPAM="SPAM",e.AIRDROPS="AIRDROPS"}(Xx||(Xx={})),function(e){e.TRANSFERTIME="TRANSFERTIME"}(Yx||(Yx={})),function(e){e.SEAPORT="seaport",e.LOOKSRARE="looksrare",e.X2Y2="x2y2",e.WYVERN="wyvern",e.CRYPTOPUNKS="cryptopunks",e.BLUR="blur",e.UNKNOWN="unknown"}(Qx||(Qx={})),function(e){e.BUYER="buyer",e.SELLER="seller"}(ek||(ek={})),function(e){e.DOES_NOT_EXIST="does_not_exist",e.ALREADY_QUEUED="already_queued",e.IN_PROGRESS="in_progress",e.FINISHED="finished",e.QUEUED="queued",e.QUEUE_FAILED="queue_failed"}(tk||(tk={})),function(e){e.OPENSEA="OpenSea"}(nk||(nk={}));const lk="demo",uk=Mx.ETH_MAINNET;function dk(e,t){return`https://${e}.g.alchemy.com/v2/${t}`}function pk(e,t){return`wss://${e}.g.alchemy.com/v2/${t}`}var hk;!function(e){e[e.BASE=0]="BASE",e[e.NFT=1]="NFT",e[e.WEBHOOK=2]="WEBHOOK"}(hk||(hk={}));const mk={[Mx.ETH_MAINNET]:"mainnet",[Mx.ETH_GOERLI]:"goerli",[Mx.ETH_SEPOLIA]:"sepolia",[Mx.OPT_MAINNET]:"optimism",[Mx.OPT_GOERLI]:"optimism-goerli",[Mx.OPT_SEPOLIA]:"optimism-sepolia",[Mx.ARB_MAINNET]:"arbitrum",[Mx.ARB_GOERLI]:"arbitrum-goerli",[Mx.ARB_SEPOLIA]:"arbitrum-sepolia",[Mx.MATIC_MAINNET]:"matic",[Mx.MATIC_MUMBAI]:"maticmum",[Mx.MATIC_AMOY]:"maticamoy",[Mx.ASTAR_MAINNET]:"astar-mainnet",[Mx.POLYGONZKEVM_MAINNET]:"polygonzkevm-mainnet",[Mx.POLYGONZKEVM_TESTNET]:"polygonzkevm-testnet",[Mx.BASE_MAINNET]:"base-mainnet",[Mx.BASE_GOERLI]:"base-goerli",[Mx.BASE_SEPOLIA]:"base-sepolia"},fk={"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},"arbitrum-sepolia":{chainId:421614,name:"arbitrum-sepolia"},"astar-mainnet":{chainId:592,name:"astar-mainnet"},sepolia:{chainId:11155111,name:"sepolia"},"optimism-sepolia":{chainId:11155420,name:"optimism-sepolia"},"polygonzkevm-mainnet":{chainId:1101,name:"polygonzkevm-mainnet"},"polygonzkevm-testnet":{chainId:1442,name:"polygonzkevm-testnet"},"base-mainnet":{chainId:8453,name:"base-mainnet"},"base-goerli":{chainId:84531,name:"base-goerli"},"base-sepolia":{chainId:84532,name:"base-sepolia"},maticamoy:{chainId:80002,name:"maticamoy"}};function yk(){}class bk{constructor(e){this.apiKey=(null==e?void 0:e.apiKey)||lk,this.network=(null==e?void 0:e.network)||uk,this.maxRetries=(null==e?void 0:e.maxRetries)||5,this.url=null==e?void 0:e.url,this.authToken=null==e?void 0:e.authToken,this.batchRequests=(null==e?void 0:e.batchRequests)||!1,this.requestTimeout=(null==e?void 0:e.requestTimeout)||0}_getRequestUrl(e){return void 0!==this.url?this.url:e===hk.NFT?(t=this.network,n=this.apiKey,`https://${t}.g.alchemy.com/nft/v3/${n}`):e===hk.WEBHOOK?"https://dashboard.alchemy.com/api":dk(this.network,this.apiKey);var t,n}getProvider(){return this._baseAlchemyProvider||(this._baseAlchemyProvider=(()=>ak(this,void 0,void 0,(function*(){const{AlchemyProvider:e}=yield import("./alchemy-provider-5870b6fa-0a3b2dbe.js").then((function(e){return e.a}));return new e(this)})))()),this._baseAlchemyProvider}getWebSocketProvider(){return this._baseAlchemyWssProvider||(this._baseAlchemyWssProvider=(()=>ak(this,void 0,void 0,(function*(){const{AlchemyWebSocketProvider:e}=yield import("./alchemy-websocket-provider-213da986-d0c3633b.js");return new e(this)})))()),this._baseAlchemyWssProvider}}let gk=!1,wk=!1;const vk={debug:1,default:2,info:2,warning:3,error:4,off:5};let Ck=vk.default,Ek=null;const xk=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var kk,Tk;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(kk||(kk={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(Tk||(Tk={}));const Pk="0123456789abcdef";class Ak{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==vk[n]&&this.throwArgumentError("invalid log level name","logLevel",e),Ck>vk[n]||console.log.apply(console,t)}debug(...e){this._log(Ak.levels.DEBUG,e)}info(...e){this._log(Ak.levels.INFO,e)}warn(...e){this._log(Ak.levels.WARNING,e)}makeError(e,t,n){if(wk)return this.makeError("censored error",t,{});t||(t=Ak.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=Pk[t[e]>>4],n+=Pk[15&t[e]];r.push(e+"=Uint8Array(0x"+n+")")}else r.push(e+"="+JSON.stringify(t))}catch(t){r.push(e+"="+JSON.stringify(n[e].toString()))}})),r.push(`code=${t}`),r.push(`version=${this.version}`);const a=e;let s="";switch(t){case Tk.NUMERIC_FAULT:{s="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":s+="-"+t;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case Tk.CALL_EXCEPTION:case Tk.INSUFFICIENT_FUNDS:case Tk.MISSING_NEW:case Tk.NONCE_EXPIRED:case Tk.REPLACEMENT_UNDERPRICED:case Tk.TRANSACTION_REPLACED:case Tk.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const i=new Error(e);return i.reason=a,i.code=t,Object.keys(n).forEach((function(e){i[e]=n[e]})),i}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,Ak.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(e){xk&&this.throwError("platform missing String.prototype.normalize",Ak.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:xk})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,Ak.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,Ak.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,Ak.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,Ak.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",Ak.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",Ak.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",Ak.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Ek||(Ek=new Ak("logger/5.7.0")),Ek}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Ak.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),gk){if(!e)return;this.globalLogger().throwError("error censorship permanent",Ak.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}wk=!!e,gk=!!t}static setLogLevel(e){const t=vk[e.toLowerCase()];null!=t?Ck=t:Ak.globalLogger().warn("invalid log level - "+e)}static from(e){return new Ak(e)}}Ak.errors=Tk,Ak.levels=kk;var _k=function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function o(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}c((r=r.apply(e,t||[])).next())}))};const Dk=new Ak("properties/5.7.0");function Fk(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function Ok(e){return _k(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}const Sk={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Mk(e){if(null==e||Sk[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let n=0;n<t.length;n++){let r=null;try{r=e[t[n]]}catch(e){continue}if(!Mk(r))return!1}return!0}return Dk.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Ik(e){if(Mk(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>Nk(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&Fk(t,n,Nk(r))}return t}return Dk.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Nk(e){return Ik(e)}function Uk(e){return xC.from(e).toNumber()}function Lk(e){return xC.from(e).toHexString()}function Bk(e){return"string"==typeof e?e:Number.isInteger(e)?Lk(e):e.toString()}function Rk(e,t){return Object.values(t).includes(e)?e:null}function jk(e){return Jk(Object.assign(Object.assign({},Gk(e)),{displayNft:e.displayNft,image:e.image,totalBalance:e.totalBalance,numDistinctTokensOwned:e.numDistinctTokensOwned,isSpam:e.isSpam}))}function Gk(e){return Jk(Object.assign(Object.assign({},e),{tokenType:Wk(e.tokenType),openSeaMetadata:Object.assign(Object.assign({},e.openSeaMetadata),{safelistRequestStatus:null!==e.openSeaMetadata.safelistRequestStatus?Rk(e.openSeaMetadata.safelistRequestStatus,Bx):null})}))}function Hk(e,t){return{contractAddress:t||e.contractAddress,tokenId:e.tokenId}}function zk(e){return Jk(Object.assign(Object.assign({},e),{contract:(t=e.contract,Jk(Object.assign(Object.assign({},Gk(t)),{spamClassifications:t.spamClassifications.map(Zk)}))),tokenType:Wk(e.tokenType),acquiredAt:e.acquiredAt,collection:e.collection,mint:e.mint}));var t}function $k(e){switch(e){case"looksrare":return Qx.LOOKSRARE;case"seaport":return Qx.SEAPORT;case"x2y2":return Qx.X2Y2;case"wyvern":return Qx.WYVERN;case"cryptopunks":return Qx.CRYPTOPUNKS;case"blur":return Qx.BLUR;default:return Qx.UNKNOWN}}function Vk(e){if("OpenSea"===e)return nk.OPENSEA}function qk(e){switch(e.toLowerCase()){case"buyer":return ek.BUYER;case"seller":return ek.SELLER;default:throw new Error(`Unsupported NftSaleTakerType ${e}`)}}function Zk(e){const t=Rk(e,Jx);return null==t?Jx.Unknown:t}function Wk(e){switch(e){case"erc721":case"ERC721":return Kx.ERC721;case"erc1155":case"ERC1155":return Kx.ERC1155;case"no_supported_nft_standard":case"NO_SUPPORTED_NFT_STANDARD":return Kx.NO_SUPPORTED_NFT_STANDARD;case"not_a_contract":case"NOT_A_CONTRACT":return Kx.NOT_A_CONTRACT;default:return Kx.UNKNOWN}}const Kk="undefined"!=typeof window&&null!==window;function Jk(e){if(null!=e){if("Object"===e.constructor.name||Array.isArray(e))for(const t in e)e[t]=Jk(e[t]);return e}}function Xk(e,t,n="getAssetTransfers"){return ak(this,void 0,void 0,(function*(){const r=yield e.getProvider();return t.fromAddress&&(t.fromAddress=yield r._getAddress(t.fromAddress)),t.toAddress&&(t.toAddress=yield r._getAddress(t.toAddress)),r._send("alchemy_getAssetTransfers",[Object.assign(Object.assign({},t),{fromBlock:null!=t.fromBlock?Bk(t.fromBlock):void 0,toBlock:null!=t.toBlock?Bk(t.toBlock):void 0,maxCount:null!=t.maxCount?Lk(t.maxCount):void 0})],n)}))}function Yk(e,t,n="getTransactionReceipts"){return ak(this,void 0,void 0,(function*(){return(yield e.getProvider())._send("alchemy_getTransactionReceipts",[t],n)}))}function Qk(e,t){return ak(this,void 0,void 0,(function*(){const n=yield e.getProvider();yield n.getNetwork();const r=yield Ok({filter:eT(e,t)}),a=yield n.send("eth_getLogs",[r.filter]);return a.forEach((e=>{null==e.removed&&(e.removed=!1)})),(s=n.formatter.filterLog.bind(n.formatter),function(e){if(!Array.isArray(e))throw new Error("not an array");const t=[];return e.forEach((e=>{t.push(s(e))})),t})(a);var s}))}function eT(e,t){return ak(this,void 0,void 0,(function*(){const n=yield e.getProvider(),r=yield t;let a={};return["blockHash","topics"].forEach((e=>{null!=r[e]&&(a[e]=r[e])})),["fromBlock","toBlock"].forEach((e=>{null!=r[e]&&(a[e]=n._getBlockTag(r[e]))})),a=n.formatter.filter(yield Ok(a)),Array.isArray(r.address)?a.address=yield Promise.all(r.address.map((e=>ak(this,void 0,void 0,(function*(){return n._getAddress(e)}))))):null!=r.address&&(a.address=yield n._getAddress(r.address)),a}))}class tT{constructor(e){this.config=e}getBalance(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBalance(e,t)}))}isContractAddress(e){return ak(this,void 0,void 0,(function*(){const t=yield this.config.getProvider();return"0x"!==(yield t.getCode(e))}))}getCode(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getCode(e,t)}))}getStorageAt(e,t,n){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getStorageAt(e,t,n)}))}getTransactionCount(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransactionCount(e,t)}))}getBlock(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlock(e)}))}getBlockWithTransactions(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlockWithTransactions(e)}))}getNetwork(){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getNetwork()}))}getBlockNumber(){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlockNumber()}))}getGasPrice(){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getGasPrice()}))}getFeeData(){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getFeeData()}))}ready(){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).ready}))}call(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).call(e,t)}))}estimateGas(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).estimateGas(e)}))}getTransaction(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransaction(e)}))}getTransactionReceipt(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransactionReceipt(e)}))}sendTransaction(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).sendTransaction(e)}))}waitForTransaction(e,t,n){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).waitForTransaction(e,t,n)}))}getLogs(e){return ak(this,void 0,void 0,(function*(){return Qk(this.config,e)}))}send(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).send(e,t)}))}findContractDeployer(e){var t;return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=yield n.getBlockNumber();if("0x"===(yield n.getCode(e,r)))throw new Error(`Contract '${e}' does not exist`);const a=yield nT(0,r+1,e,this.config),s=yield Yk(this.config,{blockNumber:Lk(a)},"findContractDeployer"),i=null===(t=s.receipts)||void 0===t?void 0:t.find((t=>t.contractAddress===e.toLowerCase()));return{deployerAddress:null==i?void 0:i.from,blockNumber:a}}))}getTokenBalances(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=yield n._getAddress(e);if(Array.isArray(t)){if(t.length>1500)throw new Error("You cannot pass in more than 1500 contract addresses to getTokenBalances()");if(0===t.length)throw new Error("getTokenBalances() requires at least one contractAddress when using an array");return n._send("alchemy_getTokenBalances",[r,t],"getTokenBalances")}{const e=[r,void 0===t?Ix.ERC20:t.type];return(null==t?void 0:t.type)===Ix.ERC20&&t.pageKey&&e.push({pageKey:t.pageKey}),n._send("alchemy_getTokenBalances",e,"getTokenBalances")}}))}getTokensForOwner(e,t){var n;return ak(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[yield r._getAddress(e),null!==(n=null==t?void 0:t.contractAddresses)&&void 0!==n?n:Ix.ERC20];(null==t?void 0:t.pageKey)&&a.push({pageKey:t.pageKey});const s=yield r._send("alchemy_getTokenBalances",a,"getTokensForOwner"),i=s.tokenBalances.map((e=>({contractAddress:e.contractAddress,rawBalance:xC.from(e.tokenBalance).toString()}))),o=(yield Promise.allSettled(s.tokenBalances.map((e=>r._send("alchemy_getTokenMetadata",[e.contractAddress],"getTokensForOwner",!0))))).map((e=>"fulfilled"===e.status?e.value:{name:null,symbol:null,decimals:null,logo:null})),c=i.map(((e,t)=>Object.assign(Object.assign(Object.assign({},e),o[t]),{balance:null!==o[t].decimals?$C(e.rawBalance,o[t].decimals):void 0})));return{tokens:c.map((e=>Jk(e))),pageKey:s.pageKey}}))}getTokenMetadata(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_getTokenMetadata",[e],"getTokenMetadata")}))}getAssetTransfers(e){return ak(this,void 0,void 0,(function*(){return Xk(this.config,e)}))}getTransactionReceipts(e){return ak(this,void 0,void 0,(function*(){return Yk(this.config,e)}))}resolveName(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).resolveName(e)}))}lookupAddress(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).lookupAddress(e)}))}}function nT(e,t,n,r){return ak(this,void 0,void 0,(function*(){if(e>=t)return t;const a=Math.floor((e+t)/2),s=yield r.getProvider();return"0x"===(yield s.getCode(n,a))?nT(a+1,t,n,r):nT(e,a,n,r)}))}class rT{constructor(e){this.config=e}traceCall(e,t,n){return ak(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[e,t,aT(n)];return r._send("debug_traceCall",a,"traceCall")}))}traceTransaction(e,t,n){return ak(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[e,aT(t,n)];return r._send("debug_traceTransaction",a,"traceTransaction")}))}traceBlock(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider();let r,a;if(c(e,32))r="debug_traceBlockByHash",a=[e,aT(t)];else{r="debug_traceBlockByNumber";a=["number"==typeof e?u(d(e)):e,aT(t)]}return n._send(r,a,"traceBlock")}))}}function aT(e,t){return Object.assign({tracer:e.type},void 0!==e.onlyTopCall&&{tracerConfig:{onlyTopCall:e.onlyTopCall,timeout:t}})}function sT(e){if(e===Kx.ERC1155||e===Kx.ERC721)return e}var iT;!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.SILENT=4]="SILENT"}(iT||(iT={})),iT.DEBUG,iT.INFO,iT.WARN,iT.ERROR,iT.SILENT;const oT={[iT.DEBUG]:"log",[iT.INFO]:"info",[iT.WARN]:"warn",[iT.ERROR]:"error"},cT=iT.INFO;function lT(e,...t){hT.debug(e,t)}function uT(e,...t){hT.info(e,t)}function dT(e,...t){hT.warn(e,t)}function pT(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return e}}const hT=new class{constructor(){this._logLevel=cT}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in iT))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}debug(...e){this._log(iT.DEBUG,...e)}info(...e){this._log(iT.INFO,...e)}warn(...e){this._log(iT.WARN,...e)}error(...e){this._log(iT.ERROR,...e)}_log(e,...t){if(e<this._logLevel)return;const n=(new Date).toISOString(),r=oT[e];if(!r)throw new Error(`Logger received an invalid logLevel (value: ${e})`);console[r](`[${n}] Alchemy:`,...t.map(pT))}},mT="3.2.0";function fT(e,t,n,r,a){var s;const i=e+"/"+t,o=Object.assign(Object.assign({},a),{headers:Object.assign(Object.assign(Object.assign({},null==a?void 0:a.headers),!Kk&&{"Accept-Encoding":"gzip"}),{"Alchemy-Ethers-Sdk-Version":mT,"Alchemy-Ethers-Sdk-Method":n}),method:null!==(s=null==a?void 0:a.method)&&void 0!==s?s:"GET",url:i,params:r});return rk(o)}class yT{constructor(e=5){this.maxAttempts=e,this.initialDelayMs=1e3,this.backoffMultiplier=1.5,this.maxDelayMs=3e4,this.numAttempts=0,this.currentDelayMs=0,this.isInBackoff=!1}backoff(){if(this.numAttempts>=this.maxAttempts)return Promise.reject(new Error(`Exceeded maximum number of attempts: ${this.maxAttempts}`));if(this.isInBackoff)return Promise.reject(new Error("A backoff operation is already in progress"));const e=this.withJitterMs(this.currentDelayMs);return e>0&&lT("ExponentialBackoff.backoff",`Backing off for ${e}ms`),this.currentDelayMs*=this.backoffMultiplier,this.currentDelayMs=Math.max(this.currentDelayMs,this.initialDelayMs),this.currentDelayMs=Math.min(this.currentDelayMs,this.maxDelayMs),this.numAttempts+=1,new Promise((t=>{this.isInBackoff=!0,setTimeout((()=>{this.isInBackoff=!1,t()}),e)}))}withJitterMs(e){return Math.min(e+(Math.random()-.5)*e,this.maxDelayMs)}}function bT(e,t,n,r,a,s){return ak(this,void 0,void 0,(function*(){let i;const o=new yT(e.maxRetries);for(let c=0;c<e.maxRetries+1;c++)try{void 0!==i&&uT("requestHttp",`Retrying after error: ${i.message}`);try{yield o.backoff()}catch(e){break}const c=yield fT(e._getRequestUrl(t),n,r,a,Object.assign(Object.assign({},s),{timeout:e.requestTimeout}));if(200===c.status)return lT(n,`Successful request: ${n}`),c.data;uT(n,`Request failed: ${n}, ${c.status}, ${c.data}`),i=new Error(c.status+": "+c.data)}catch(e){if(!rk.isAxiosError(e)||void 0===e.response)throw e;if(i=new Error(e.response.status+": "+e.response.data),!gT(e,t))break}return Promise.reject(i)}))}function gT(e,t){const n=t===hk.WEBHOOK?[429,500]:[429];return void 0!==e.response&&n.includes(e.response.status)}function wT(e,t,n,r,a,s,i){return ok(this,arguments,(function*(){let o=!0;const c=Object.assign({},i);for(;o;){const i=yield ik(bT(e,t,n,r,c));yield yield ik(i),null!==i[s]?c[a]=i[s]:o=!1}}))}function vT(e,t,n,r,a="getNftMetadata"){return ak(this,void 0,void 0,(function*(){return zk(yield bT(e,hk.NFT,"getNFTMetadata",a,{contractAddress:t,tokenId:xC.from(n).toString(),tokenType:sT(null==r?void 0:r.tokenType),tokenUriTimeoutInMs:null==r?void 0:r.tokenUriTimeoutInMs,refreshCache:null==r?void 0:r.refreshCache}))}))}function CT(e,t,n){return ak(this,void 0,void 0,(function*(){const r={tokens:t,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs,refreshCache:null==n?void 0:n.refreshCache};return{nfts:(yield bT(e,hk.NFT,"getNFTMetadataBatch","getNftMetadataBatch",{},{method:"POST",data:r})).nfts.map((e=>zk(e)))}}))}function ET(e,t,n="getCollectionMetadata"){return ak(this,void 0,void 0,(function*(){const r=yield bT(e,hk.NFT,"getCollectionMetadata",n,{collectionSlug:t});return a=r,Jk(Object.assign(Object.assign({},a),{floorPrice:Object.assign(Object.assign({},a.floorPrice),{marketplace:Vk(a.floorPrice.marketplace)})}));var a}))}function xT(e,t,n,r="getNftsForOwner"){return ak(this,void 0,void 0,(function*(){const a=OT(null==n?void 0:n.omitMetadata),s=yield bT(e,hk.NFT,"getNFTsForOwner",r,{contractAddresses:null==n?void 0:n.contractAddresses,pageKey:null==n?void 0:n.pageKey,excludeFilters:null==n?void 0:n.excludeFilters,includeFilters:null==n?void 0:n.includeFilters,owner:t,pageSize:null==n?void 0:n.pageSize,withMetadata:a,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs,orderBy:null==n?void 0:n.orderBy});return Jk(a?{ownedNfts:s.ownedNfts.map((e=>Object.assign(Object.assign({},zk(e)),{balance:e.balance}))),pageKey:s.pageKey,totalCount:s.totalCount,validAt:s.validAt}:{ownedNfts:s.ownedNfts.map((e=>Object.assign(Object.assign({},Hk(e)),{balance:e.balance}))),pageKey:s.pageKey,totalCount:s.totalCount,validAt:s.validAt})}))}function kT(e){switch(e){case Kx.ERC721:return[Nx.ERC721];case Kx.ERC1155:return[Nx.ERC1155];default:return[Nx.ERC721,Nx.ERC1155,Nx.SPECIALNFT]}}function TT(e,t={},n="getNftSales"){return ak(this,void 0,void 0,(function*(){const r=Object.assign({},t),a=yield bT(e,hk.NFT,"getNFTSales",n,{fromBlock:null==r?void 0:r.fromBlock,toBlock:null==r?void 0:r.toBlock,order:null==r?void 0:r.order,marketplace:null==r?void 0:r.marketplace,contractAddress:null==r?void 0:r.contractAddress,tokenId:(null==r?void 0:r.tokenId)?xC.from(null==r?void 0:r.tokenId).toString():void 0,sellerAddress:null==r?void 0:r.sellerAddress,buyerAddress:null==r?void 0:r.buyerAddress,taker:null==r?void 0:r.taker,limit:null==r?void 0:r.limit,pageKey:null==r?void 0:r.pageKey});return Jk({nftSales:(s=a).nftSales.map((e=>Object.assign(Object.assign({},e),{marketplace:$k(e.marketplace),taker:qk(e.taker)}))),validAt:s.validAt,pageKey:s.pageKey});var s}))}function PT(e,t,n,r="refreshNftMetadata"){return ak(this,void 0,void 0,(function*(){const a=xC.from(n).toString(),s=yield vT(e,t,a,void 0,r),i=yield function(e,t,n,r){return ak(this,void 0,void 0,(function*(){return zk(yield bT(e,hk.NFT,"getNFTMetadata",r,{contractAddress:t,tokenId:xC.from(n).toString(),refreshCache:!0}))}))}(e,t,a,r);return s.timeLastUpdated!==i.timeLastUpdated}))}function AT(e){return DT(e)?zk(e):Hk(e)}function _T(e,t){return DT(e)?zk(e):Hk(e,t)}function DT(e){return void 0!==e.name}function FT(e,t){return ak(this,void 0,void 0,(function*(){const n=t.transfers.filter((e=>null!==e.rawContract.address)).flatMap((e=>{var t;const n=function(e){return e.category===Nx.ERC1155?function(e){return e.erc1155Metadata.map((t=>({contractAddress:e.rawContract.address,tokenId:t.tokenId,tokenType:Kx.ERC1155})))}(e):[{contractAddress:e.rawContract.address,tokenId:e.tokenId,tokenType:e.category===Nx.ERC721?Kx.ERC721:void 0}]}(e),r={from:e.from,to:null!==(t=e.to)&&void 0!==t?t:void 0,transactionHash:e.hash,blockNumber:e.blockNum};return n.map((e=>({metadata:r,token:e})))}));if(0===n.length)return{nfts:[]};const r=[];for(let e=0;e<n.length;e+=100)r.push(n.slice(e,e+100));const a=(yield Promise.all(r.map((t=>CT(e,t.map((e=>e.token))))))).map((e=>e.nfts)).flat(),s=new Map;a.forEach((e=>{const t=`${e.contract.address.toLowerCase()}-${xC.from(e.tokenId).toString()}`;s.set(t,e)}));const i=n.map((e=>{const t=`${e.token.contractAddress.toLowerCase()}-${xC.from(e.token.tokenId).toString()}`;return Object.assign(Object.assign({},s.get(t)),e.metadata)}));return{nfts:i,pageKey:t.pageKey}}))}function OT(e){return void 0===e||!e}function ST(e){switch(e){case"does_not_exist":return tk.DOES_NOT_EXIST;case"already_queued":return tk.ALREADY_QUEUED;case"in_progress":return tk.IN_PROGRESS;case"finished":return tk.FINISHED;case"queued":return tk.QUEUED;case"queue_failed":return tk.QUEUE_FAILED;default:throw new Error("Unknown reingestion state: "+e)}}class MT{constructor(e){this.config=e}getNftMetadata(e,t,n,r){let a;return a="object"==typeof n?{tokenType:n.tokenType,tokenUriTimeoutInMs:n.tokenUriTimeoutInMs,refreshCache:n.refreshCache}:{tokenType:n,tokenUriTimeoutInMs:r},vT(this.config,e,t,a)}getNftMetadataBatch(e,t){return CT(this.config,e,t)}getContractMetadata(e){return function(e,t,n="getContractMetadata"){return ak(this,void 0,void 0,(function*(){return Gk(yield bT(e,hk.NFT,"getContractMetadata",n,{contractAddress:t}))}))}(this.config,e)}getContractMetadataBatch(e){return function(e,t){return ak(this,void 0,void 0,(function*(){return{contracts:(yield bT(e,hk.NFT,"getContractMetadataBatch","getContractMetadataBatch",{},{method:"POST",data:{contractAddresses:t}})).contracts.map(Gk)}}))}(this.config,e)}getCollectionMetadata(e){return ET(this.config,e)}getNftsForOwnerIterator(e,t){return function(e,t,n,r="getNftsForOwnerIterator"){return ok(this,arguments,(function*(){var a,s;const i=OT(null==n?void 0:n.omitMetadata);try{for(var o,c=ck(wT(e,hk.NFT,"getNFTsForOwner",r,"pageKey","pageKey",{contractAddresses:null==n?void 0:n.contractAddresses,pageKey:null==n?void 0:n.pageKey,excludeFilters:null==n?void 0:n.excludeFilters,includeFilters:null==n?void 0:n.includeFilters,owner:t,withMetadata:i,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs,orderBy:null==n?void 0:n.orderBy}));!(o=yield ik(c.next())).done;){const e=o.value;for(const t of e.ownedNfts)yield yield ik(Object.assign(Object.assign({},AT(t)),{balance:t.balance}))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(s=c.return)&&(yield ik(s.call(c)))}finally{if(a)throw a.error}}}))}(this.config,e,t)}getNftsForOwner(e,t){return xT(this.config,e,t)}getNftsForContract(e,t){return function(e,t,n,r="getNftsForContract"){var a;return ak(this,void 0,void 0,(function*(){const s=OT(null==n?void 0:n.omitMetadata),i=yield bT(e,hk.NFT,"getNFTsForContract",r,{contractAddress:t,pageKey:null==n?void 0:n.pageKey,withMetadata:s,limit:null!==(a=null==n?void 0:n.pageSize)&&void 0!==a?a:void 0,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs});return Jk(s?{nfts:i.nfts.map((e=>zk(e))),pageKey:i.pageKey}:{nfts:i.nfts.map((e=>Hk(e,t))),pageKey:i.pageKey})}))}(this.config,e,t)}getNftsForContractIterator(e,t){return function(e,t,n,r="getNftsForContractIterator"){return ok(this,arguments,(function*(){var a,s;const i=OT(null==n?void 0:n.omitMetadata);try{for(var o,c=ck(wT(e,hk.NFT,"getNFTsForContract",r,"pageKey","pageKey",{contractAddress:t,pageKey:null==n?void 0:n.pageKey,withMetadata:i}));!(o=yield ik(c.next())).done;){const e=o.value;for(const n of e.nfts)yield yield ik(_T(n,t))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(s=c.return)&&(yield ik(s.call(c)))}finally{if(a)throw a.error}}}))}(this.config,e,t)}getOwnersForContract(e,t){return function(e,t,n,r="getOwnersForContract"){return ak(this,void 0,void 0,(function*(){const a=yield bT(e,hk.NFT,"getOwnersForContract",r,Object.assign(Object.assign({},n),{contractAddress:t}));return null==n||n.withTokenBalances,Jk({owners:a.owners,pageKey:a.pageKey})}))}(this.config,e,t)}getOwnersForNft(e,t,n){return function(e,t,n,r,a="getOwnersForNft"){return ak(this,void 0,void 0,(function*(){return bT(e,hk.NFT,"getOwnersForNFT",a,Object.assign({contractAddress:t,tokenId:xC.from(n).toString()},r))}))}(this.config,e,t,n)}getContractsForOwner(e,t){return function(e,t,n,r="getContractsForOwner"){return ak(this,void 0,void 0,(function*(){const a=yield bT(e,hk.NFT,"getContractsForOwner",r,{owner:t,excludeFilters:null==n?void 0:n.excludeFilters,includeFilters:null==n?void 0:n.includeFilters,pageKey:null==n?void 0:n.pageKey,pageSize:null==n?void 0:n.pageSize,orderBy:null==n?void 0:n.orderBy});return Jk({contracts:a.contracts.map(jk),pageKey:a.pageKey,totalCount:a.totalCount})}))}(this.config,e,t)}getTransfersForOwner(e,t,n){return function(e,t,n,r){return ak(this,void 0,void 0,(function*(){const a=yield e.getProvider(),s=yield a._getAddress(t),i=kT(null==r?void 0:r.tokenType),o={fromBlock:"0x0",excludeZeroValue:!0,contractAddresses:null==r?void 0:r.contractAddresses,category:i,maxCount:100,pageKey:null==r?void 0:r.pageKey};n===Ux.TO?o.toAddress=s:o.fromAddress=s;const c=yield Xk(e,o,"getTransfersForOwner");return FT(e,c)}))}(this.config,e,t,n)}getTransfersForContract(e,t){return function(e,t,n){return ak(this,void 0,void 0,(function*(){const r=[Nx.ERC721,Nx.ERC1155,Nx.SPECIALNFT],a=yield e.getProvider(),s={fromBlock:(null==n?void 0:n.fromBlock)?a.formatter.blockTag(yield a._getBlockTag(n.fromBlock)):"0x0",toBlock:(null==n?void 0:n.toBlock)?a.formatter.blockTag(yield a._getBlockTag(n.toBlock)):void 0,excludeZeroValue:!0,contractAddresses:[t],order:null==n?void 0:n.order,category:r,maxCount:100,pageKey:null==n?void 0:n.pageKey},i=yield Xk(e,s,"getTransfersForContract");return FT(e,i)}))}(this.config,e,t)}getMintedNfts(e,t){return ak(this,void 0,void 0,(function*(){return function(e,t,n){return ak(this,void 0,void 0,(function*(){const r=yield e.getProvider(),a=yield r._getAddress(t),s=kT(null==n?void 0:n.tokenType),i={fromBlock:"0x0",fromAddress:"0x0000000000000000000000000000000000000000",toAddress:a,excludeZeroValue:!0,contractAddresses:null==n?void 0:n.contractAddresses,category:s,maxCount:100,pageKey:null==n?void 0:n.pageKey},o=yield Xk(e,i,"getMintedNfts");return FT(e,o)}))}(this.config,e,t)}))}verifyNftOwnership(e,t){return function(e,t,n,r="verifyNftOwnership"){return ak(this,void 0,void 0,(function*(){if("string"==typeof n)return(yield xT(e,t,{contractAddresses:[n],omitMetadata:!0},r)).ownedNfts.length>0;{if(0===n.length)throw new Error("Must provide at least one contract address");const a=yield xT(e,t,{contractAddresses:n,omitMetadata:!0},r),s=n.reduce(((e,t)=>(e[t]=!1,e)),{});for(const e of a.ownedNfts)s[e.contractAddress]=!0;return s}}))}(this.config,e,t)}isSpamContract(e){return function(e,t,n="isSpamContract"){return ak(this,void 0,void 0,(function*(){return bT(e,hk.NFT,"isSpamContract",n,{contractAddress:t})}))}(this.config,e)}getSpamContracts(){return function(e,t="getSpamContracts"){return ak(this,void 0,void 0,(function*(){return bT(e,hk.NFT,"getSpamContracts",t,void 0)}))}(this.config)}reportSpam(e){return function(e,t,n="reportSpam"){return ak(this,void 0,void 0,(function*(){bT(e,hk.NFT,"reportSpam",n,{contractAddress:t})}))}(this.config,e)}isAirdropNft(e,t){return function(e,t,n,r="isAirdropNft"){return ak(this,void 0,void 0,(function*(){return bT(e,hk.NFT,"isAirdropNFT",r,{contractAddress:t,tokenId:n})}))}(this.config,e,t)}getFloorPrice(e){return function(e,t,n="getFloorPrice"){return ak(this,void 0,void 0,(function*(){return Jk(yield bT(e,hk.NFT,"getFloorPrice",n,{contractAddress:t}))}))}(this.config,e)}getNftSales(e){return TT(this.config,e)}computeRarity(e,t){return function(e,t,n,r="computeRarity"){return ak(this,void 0,void 0,(function*(){return Jk(yield bT(e,hk.NFT,"computeRarity",r,{contractAddress:t,tokenId:xC.from(n).toString()}))}))}(this.config,e,t)}searchContractMetadata(e){return function(e,t,n="searchContractMetadata"){return ak(this,void 0,void 0,(function*(){return{contracts:(yield bT(e,hk.NFT,"searchContractMetadata",n,{query:t})).contracts.map(Gk)}}))}(this.config,e)}summarizeNftAttributes(e){return function(e,t,n="summarizeNftAttributes"){return ak(this,void 0,void 0,(function*(){return bT(e,hk.NFT,"summarizeNFTAttributes",n,{contractAddress:t})}))}(this.config,e)}refreshNftMetadata(e,t){return PT(this.config,e,t)}refreshContract(e){return function(e,t,n="refreshContract"){return ak(this,void 0,void 0,(function*(){const r=yield bT(e,hk.NFT,"reingestContract",n,{contractAddress:t});return{contractAddress:r.contractAddress,refreshState:ST(r.reingestionState),progress:r.progress}}))}(this.config,e)}}class IT{constructor(e){this.config=e}getAllWebhooks(){return ak(this,void 0,void 0,(function*(){this.verifyConfig();const e=yield this.sendWebhookRequest("team-webhooks","getAllWebhooks",{});return{webhooks:LT(e),totalCount:e.data.length}}))}getAddresses(e,t){return ak(this,void 0,void 0,(function*(){this.verifyConfig();const n="string"==typeof e?e:e.id;return function(e){return{addresses:e.data,totalCount:e.pagination.total_count,pageKey:e.pagination.cursors.after}}(yield this.sendWebhookRequest("webhook-addresses","getAddresses",{webhook_id:n,limit:null==t?void 0:t.limit,after:null==t?void 0:t.pageKey}))}))}getGraphqlQuery(e){return ak(this,void 0,void 0,(function*(){this.verifyConfig();const t="string"==typeof e?e:e.id;return function(e){return{graphqlQuery:e.data.graphql_query}}(yield this.sendWebhookRequest("dashboard-webhook-graphql-query","getGraphqlQuery",{webhook_id:t}))}))}getNftFilters(e,t){return ak(this,void 0,void 0,(function*(){this.verifyConfig();const n="string"==typeof e?e:e.id;return function(e){return{filters:e.data.map((e=>e.token_id?{contractAddress:e.contract_address,tokenId:xC.from(e.token_id).toString()}:{contractAddress:e.contract_address})),totalCount:e.pagination.total_count,pageKey:e.pagination.cursors.after}}(yield this.sendWebhookRequest("webhook-nft-filters","getNftFilters",{webhook_id:n,limit:null==t?void 0:t.limit,after:null==t?void 0:t.pageKey}))}))}updateWebhook(e,t){return ak(this,void 0,void 0,(function*(){const n="string"==typeof e?e:e.id;let r,a,s,i;if("isActive"in t)r="update-webhook",a="updateWebhook",s="PUT",i={webhook_id:n,is_active:t.isActive};else if("addFilters"in t||"removeFilters"in t)r="update-webhook-nft-filters",a="updateWebhookNftFilters",s="PATCH",i={webhook_id:n,nft_filters_to_add:t.addFilters?t.addFilters.map(RT):[],nft_filters_to_remove:t.removeFilters?t.removeFilters.map(RT):[]};else if("addMetadataFilters"in t||"removeMetadataFilters"in t)r="update-webhook-nft-metadata-filters",a="updateWebhookNftMetadataFilters",s="PATCH",i={webhook_id:n,nft_metadata_filters_to_add:t.addMetadataFilters?t.addMetadataFilters.map(RT):[],nft_metadata_filters_to_remove:t.removeMetadataFilters?t.removeMetadataFilters.map(RT):[]};else if("addAddresses"in t||"removeAddresses"in t)r="update-webhook-addresses",a="webhook:updateWebhookAddresses",s="PATCH",i={webhook_id:n,addresses_to_add:yield this.resolveAddresses(t.addAddresses),addresses_to_remove:yield this.resolveAddresses(t.removeAddresses)};else{if(!("newAddresses"in t))throw new Error("Invalid `update` param passed into `updateWebhook`");r="update-webhook-addresses",a="webhook:updateWebhookAddress",s="PUT",i={webhook_id:n,addresses:yield this.resolveAddresses(t.newAddresses)}}yield this.sendWebhookRequest(r,a,{},{method:s,data:i})}))}createWebhook(e,t,n){return ak(this,void 0,void 0,(function*(){let r;if(t===qx.MINED_TRANSACTION||t===qx.DROPPED_TRANSACTION){if(!("appId"in n))throw new Error("Transaction Webhooks require an app id.");r=n.appId}let a,s,i,o=UT.get(this.config.network);if(t===qx.NFT_ACTIVITY||t===qx.NFT_METADATA_UPDATE){if(!("filters"in n)||0===n.filters.length)throw new Error("Nft Activity Webhooks require a non-empty array input.");o=n.network?UT.get(n.network):o;const e=n.filters.map((e=>e.tokenId?{contract_address:e.contractAddress,token_id:xC.from(e.tokenId).toString()}:{contract_address:e.contractAddress}));a=t===qx.NFT_ACTIVITY?{nft_filters:e}:{nft_metadata_filters:e}}else if(t===qx.ADDRESS_ACTIVITY){if(void 0===n||!("addresses"in n)||0===n.addresses.length)throw new Error("Address Activity Webhooks require a non-empty array input.");o=n.network?UT.get(n.network):o,s=yield this.resolveAddresses(n.addresses)}else if(t==qx.GRAPHQL){if(void 0===n||!("graphqlQuery"in n)||0===n.graphqlQuery.length)throw new Error("Custom Webhooks require a non-empty graphql query.");o=n.network?UT.get(n.network):o,i=n.graphqlQuery}const c=Object.assign(Object.assign(Object.assign(Object.assign({network:o,webhook_type:t,webhook_url:e},r&&{app_id:r}),a),s&&{addresses:s}),i&&{graphql_query:i});return BT((yield this.sendWebhookRequest("create-webhook","createWebhook",{},{method:"POST",data:c})).data)}))}deleteWebhook(e){return ak(this,void 0,void 0,(function*(){this.verifyConfig();const t="string"==typeof e?e:e.id;if("message"in(yield this.sendWebhookRequest("delete-webhook","deleteWebhook",{webhook_id:t},{method:"DELETE"})))throw new Error(`Webhook not found. Failed to delete webhook: ${t}`)}))}verifyConfig(){if(void 0===this.config.authToken)throw new Error("Using the Notify API requires setting the Alchemy Auth Token in the settings object when initializing Alchemy.")}sendWebhookRequest(e,t,n,r){return bT(this.config,hk.WEBHOOK,e,t,n,Object.assign(Object.assign({},r),{headers:Object.assign({"X-Alchemy-Token":this.config.authToken},null==r?void 0:r.headers)}))}resolveAddresses(e){return ak(this,void 0,void 0,(function*(){if(void 0===e)return[];const t=[],n=yield this.config.getProvider();for(const r of e){const e=yield n.resolveName(r);if(null===e)throw new Error(`Unable to resolve the ENS address: ${r}`);t.push(e)}return t}))}}const NT={ETH_MAINNET:Mx.ETH_MAINNET,ETH_GOERLI:Mx.ETH_GOERLI,ETH_SEPOLIA:Mx.ETH_SEPOLIA,MATIC_MAINNET:Mx.MATIC_MAINNET,MATIC_MUMBAI:Mx.MATIC_MUMBAI,MATIC_AMOY:Mx.MATIC_AMOY,ARB_MAINNET:Mx.ARB_MAINNET,ARB_GOERLI:Mx.ARB_GOERLI,OPT_MAINNET:Mx.OPT_MAINNET,OPT_GOERLI:Mx.OPT_GOERLI,BASE_MAINNET:Mx.BASE_MAINNET,BASE_GOERLI:Mx.BASE_GOERLI,BASE_SEPOLIA:Mx.BASE_SEPOLIA},UT=Object.keys(Mx).reduce(((e,t)=>(t in NT&&e.set(NT[t],t),e)),new Map);function LT(e){return e.data.map(BT)}function BT(e){return Object.assign({id:e.id,network:NT[e.network],type:e.webhook_type,url:e.webhook_url,isActive:e.is_active,timeCreated:new Date(e.time_created).toISOString(),signingKey:e.signing_key,version:e.version},void 0!==e.app_id&&{appId:e.app_id})}function RT(e){return e.tokenId?{contract_address:e.contractAddress,token_id:xC.from(e.tokenId).toString()}:{contract_address:e.contractAddress}}const jT=[.9,1,1.1,1.2,1.3];class GT{constructor(e){this.config=e}sendPrivateTransaction(e,t,n){return ak(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=t?Lk(t):void 0;return r._send("eth_sendPrivateTransaction",[{tx:e,maxBlockNumber:a,preferences:n}],"sendPrivateTransaction")}))}cancelPrivateTransaction(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("eth_cancelPrivateTransaction",[{txHash:e}],"cancelPrivateTransaction")}))}simulateAssetChangesBundle(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Jk(yield n._send("alchemy_simulateAssetChangesBundle",r,"simulateAssetChangesBundle"))}))}simulateAssetChanges(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Jk(yield n._send("alchemy_simulateAssetChanges",r,"simulateAssetChanges"))}))}simulateExecutionBundle(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Jk(n._send("alchemy_simulateExecutionBundle",r,"simulateExecutionBundle"))}))}simulateExecution(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Jk(n._send("alchemy_simulateExecution",r,"simulateExecution"))}))}getTransaction(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransaction(e)}))}sendTransaction(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).sendTransaction(e)}))}estimateGas(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).estimateGas(e)}))}getMaxPriorityFeePerGas(){return ak(this,void 0,void 0,(function*(){const e=yield this.config.getProvider();return Uk(yield e._send("eth_maxPriorityFeePerGas",[],"getMaxPriorityFeePerGas"))}))}waitForTransaction(e,t,n){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).waitForTransaction(e,t,n)}))}sendGasOptimizedTransaction(e,t){return ak(this,void 0,void 0,(function*(){if(Array.isArray(e))return this._sendGasOptimizedTransaction(e,"sendGasOptimizedTransactionPreSigned");let n,r,a;const s=yield this.config.getProvider();try{n=yield this.estimateGas(e),r=yield this.getMaxPriorityFeePerGas();a=(yield s.getBlock("latest")).baseFeePerGas.toNumber()}catch(e){throw new Error(`Failed to estimate gas for transaction: ${e}`)}const i=function(e,t,n,r){return jT.map((a=>Object.assign(Object.assign({},e),{gasLimit:t,maxFeePerGas:Math.round(n*a+r*a),maxPriorityFeePerGas:Math.round(a*r)})))}(e,n.toNumber(),a,r),o=yield Promise.all(i.map((e=>t.signTransaction(e))));return this._sendGasOptimizedTransaction(o,"sendGasOptimizedTransactionGenerated")}))}getGasOptimizedTransactionStatus(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_getGasOptimizedTransactionStatus",[e],"getGasOptimizedTransactionStatus")}))}_sendGasOptimizedTransaction(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_sendGasOptimizedTransaction",[{rawTransactions:e}],t)}))}}const HT="alchemy-pending-transactions",zT="alchemy-mined-transactions",$T=[HT,zT];class VT{constructor(e,t,n){this.listener=t,this.tag=e,this.once=n,this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter;default:return this.tag}}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");if("tx"!==e[0])throw new Error("Not a transaction event");return e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])throw new Error("Not a transaction event");const t=e[1],n=function(e){if(""===e)return[];return e.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}))}(e[2]),r={};return n.length>0&&(r.topics=n),t&&"*"!==t&&(r.address=t),r}pollable(){return this.tag.indexOf(":")>=0||["block","network","pending","poll"].indexOf(this.tag)>=0}}class qT extends VT{get fromAddress(){const e=this.tag.split(":");if(e[0]===HT)return e[1]&&"*"!==e[1]?YT(e[1]):void 0}get toAddress(){const e=this.tag.split(":");if(e[0]===HT)return e[2]&&"*"!==e[2]?YT(e[2]):void 0}get hashesOnly(){const e=this.tag.split(":");if($T.includes(e[0]))return e[3]&&"*"!==e[3]?"true"===e[3]:void 0}get includeRemoved(){const e=this.tag.split(":");if(e[0]===zT)return e[2]&&"*"!==e[2]?"true"===e[2]:void 0}get addresses(){const e=this.tag.split(":");if(e[0]===zT)return e[1]&&"*"!==e[1]?function(e){if(""===e)return;return e.split("|").map((e=>e.split(","))).map((e=>Object.assign(Object.assign({},"*"!==e[0]&&{to:e[0]}),"*"!==e[1]&&{from:e[1]})))}(e[1]):void 0}}function ZT(e){return"object"==typeof e&&"method"in e}function WT(e){if(!ZT(e))throw new Error("Event tag requires AlchemyEventType");if(e.method===Rx.PENDING_TRANSACTIONS)return function(e){const t=JT(e.fromAddress),n=JT(e.toAddress),r=XT(e.hashesOnly);return HT+":"+t+":"+n+":"+r}(e);if(e.method===Rx.MINED_TRANSACTIONS)return function(e){const t=function(e){if(void 0===e)return"*";return e.map((e=>JT(e.to)+","+JT(e.from))).join("|")}(e.addresses),n=XT(e.includeRemoved),r=XT(e.hashesOnly);return zT+":"+t+":"+n+":"+r}(e);throw new Error(`Unrecognized AlchemyFilterEvent: ${e}`)}function KT(e){if(!Object.values(Rx).includes(e.method))throw new Error(`Invalid method name ${e.method}. Accepted method names: ${Object.values(Rx)}`)}function JT(e){return void 0===e?"*":Array.isArray(e)?e.join("|"):e}function XT(e){return void 0===e?"*":e.toString()}function YT(e){if(""===e)return;const t=e.split("|");return 1===t.length?t[0]:t}class QT{constructor(e){this.config=e}on(e,t){return(()=>{ak(this,void 0,void 0,(function*(){const n=yield this.config.getWebSocketProvider(),r=yield this._resolveEnsAlchemyEvent(e);n.on(r,t)}))})(),this}once(e,t){return(()=>{ak(this,void 0,void 0,(function*(){const n=yield this.config.getWebSocketProvider(),r=yield this._resolveEnsAlchemyEvent(e);n.once(r,t)}))})(),this}off(e,t){return(()=>{ak(this,void 0,void 0,(function*(){const n=yield this.config.getWebSocketProvider(),r=yield this._resolveEnsAlchemyEvent(e);return n.off(r,t)}))})(),this}removeAllListeners(e){return(()=>{ak(this,void 0,void 0,(function*(){const t=yield this.config.getWebSocketProvider(),n=e?yield this._resolveEnsAlchemyEvent(e):void 0;t.removeAllListeners(n)}))})(),this}listenerCount(e){return ak(this,void 0,void 0,(function*(){const t=yield this.config.getWebSocketProvider(),n=e?yield this._resolveEnsAlchemyEvent(e):void 0;return t.listenerCount(n)}))}listeners(e){return ak(this,void 0,void 0,(function*(){const t=yield this.config.getWebSocketProvider(),n=e?yield this._resolveEnsAlchemyEvent(e):void 0;return t.listeners(n)}))}_resolveEnsAlchemyEvent(e){return ak(this,void 0,void 0,(function*(){if(!ZT(e))return e;if(e.method===Rx.MINED_TRANSACTIONS&&e.addresses){const t=[];for(const n of e.addresses)n.to&&(n.to=yield this._resolveNameOrError(n.to)),n.from&&(n.from=yield this._resolveNameOrError(n.from)),t.push(n);e.addresses=t}else e.method===Rx.PENDING_TRANSACTIONS&&(e.fromAddress&&("string"==typeof e.fromAddress?e.fromAddress=yield this._resolveNameOrError(e.fromAddress):e.fromAddress=yield Promise.all(e.fromAddress.map((e=>this._resolveNameOrError(e))))),e.toAddress&&("string"==typeof e.toAddress?e.toAddress=yield this._resolveNameOrError(e.toAddress):e.toAddress=yield Promise.all(e.toAddress.map((e=>this._resolveNameOrError(e))))));return e}))}_resolveNameOrError(e){return ak(this,void 0,void 0,(function*(){const t=yield this.config.getProvider(),n=yield t.resolveName(e);if(null===n)throw new Error(`Unable to resolve the ENS address: ${e}`);return n}))}}const eP=Lw.custom((e=>{const t=av.parse(e);let n;try{n=kv(t.id)}catch{return!1}return null!=n.rpcUrls.alchemy}),"chain must include an alchemy rpc url. See `createAlchemyChain` or use the `AlchemyChainMap` exported from `@alchemy/aa-core`"),tP=Fv.and(Lw.object({chain:eP,opts:Mv.optional().default(Mv.parse({}))}));Lw.instanceof(class{constructor(e){this.config=new bk(e),this.core=new tT(this.config),this.nft=new MT(this.config),this.ws=new QT(this.config),this.transact=new GT(this.config),this.notify=new IT(this.config),this.debug=new rT(this.config)}});const nP=e=>({simulateUserOperation:async t=>lC(e,t)}),rP=e=>async(t,{overrides:n,feeOptions:r})=>{let[a,s]=await Promise.all([e.getBlock({blockTag:"latest"}),e.request({method:"rundler_maxPriorityFeePerGas",params:[]})]);const i=a.baseFeePerGas;if(null==i)throw new Error("baseFeePerGas is null");const o=wv(s,n?.maxPriorityFeePerGas,r?.maxPriorityFeePerGas);return{...t,maxPriorityFeePerGas:o,maxFeePerGas:wv(i+BigInt(o),n?.maxFeePerGas,r?.maxFeePerGas)}},aP=(e,t)=>()=>Di([t.paymasterAddress??(e=>{switch(e.id){case Xw.id:case Vw.id:case Kw.id:case tv.id:case nv.id:case Qw.id:case ev.id:return"0x4f84a207A80c39E9e8BaE717c1F25bA7AD1fB08F";case Hw.id:case Bw.id:case zw.id:case Yw.id:case Zw.id:return"0x4Fd9098af9ddcB41DA48A1d78F91F1398965addc";case jw.id:return"0x0804Afe6EEFb73ce7F93CD0d5e7079a5a8068592";case qw.id:case Jw.id:return"0xc03aac639bb21233e0139381970328db8bceeb67";default:throw new Error(`Unsupported chain: ${e}`)}})(e.chain),t.dummyData??"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"]);function sP(e,t){const n=t.gasEstimationOptions,r=n?.disableGasEstimation??!1,a=n?.fallbackFeeDataGetter??rP(e),s=n?.fallbackGasEstimator??aC(e);return{gasEstimator:r?s:async(t,{overrides:n,account:r,feeOptions:a})=>Cv(n)?{...t,...await s(t,{overrides:n,account:r,feeOptions:a,client:e})}:t,feeEstimator:r?a:async(t,{overrides:n,account:r,feeOptions:s})=>{let i=await t.maxFeePerGas,o=await t.maxPriorityFeePerGas;if(Cv(n)){const c=await a(t,{overrides:n,feeOptions:s,account:r,client:e});i=await c.maxFeePerGas??i,o=await c.maxPriorityFeePerGas??o}return{...t,maxFeePerGas:i,maxPriorityFeePerGas:o}},paymasterAndData:r?cP(e,t):oP(e,t)}}const iP=(e,t,n,r)=>{let a=e;if(null!=t?.[a])return lv(t[a])?Pv(t[a]):{multiplier:Number(t[a].multiplier)};if(uv(n?.[e]))return{multiplier:Number(n[e].multiplier)};const s=r[e];return ds(s)&&Ms(s,"bigint")>0n?s:void 0};function oP(e,t){return{dummyPaymasterAndData:aP(e,t),paymasterAndData:async(n,{overrides:r,feeOptions:a,account:s})=>{const i=Pv(await Tv(n)),o=Av({maxFeePerGas:iP("maxFeePerGas",r,a,i),maxPriorityFeePerGas:iP("maxPriorityFeePerGas",r,a,i),callGasLimit:iP("callGasLimit",r,a,i),verificationGasLimit:iP("verificationGasLimit",r,a,i),preVerificationGas:iP("preVerificationGas",r,a,i)});if("0.7.0"===s.getEntryPoint().version){const e=iP("paymasterVerificationGasLimit",r,a,i);null!=e&&(o.paymasterVerificationGasLimit=e);const t=iP("paymasterPostOpGasLimit",r,a,i);null!=t&&(o.paymasterPostOpGasLimit=t)}const c=await e.request({method:"alchemy_requestGasAndPaymasterAndData",params:[{policyId:t.policyId,entryPoint:s.getEntryPoint().address,userOperation:i,dummySignature:i.signature,overrides:o}]});return{...n,...c}}}}const cP=(e,t)=>({dummyPaymasterAndData:aP(e,t),paymasterAndData:async(n,{account:r})=>{const a=await e.request({method:"alchemy_requestPaymasterAndData",params:[{policyId:t.policyId,entryPoint:r.getEntryPoint().address,userOperation:Pv(await Tv(n))}]});return{...n,...a}}});function lP(e){return async(t,{account:n})=>{const r=await e.request({method:"alchemy_simulateUserOperationAssetChanges",params:[Pv(await Tv(t)),n.getEntryPoint().address]});if(r.error)throw new Error(r.error.message);return t}}function uP(e){return{"Alchemy-Aa-Sdk-Signer":e.getSigner().signerType}}const dP=[{type:"function",name:"getExecutionFunctionConfig",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple",internalType:"struct IAccountLoupe.ExecutionFunctionConfig",components:[{name:"plugin",type:"address",internalType:"address"},{name:"userOpValidationFunction",type:"bytes21",internalType:"FunctionReference"},{name:"runtimeValidationFunction",type:"bytes21",internalType:"FunctionReference"}]}],stateMutability:"view"},{type:"function",name:"getExecutionHooks",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple[]",internalType:"struct IAccountLoupe.ExecutionHooks[]",components:[{name:"preExecHook",type:"bytes21",internalType:"FunctionReference"},{name:"postExecHook",type:"bytes21",internalType:"FunctionReference"}]}],stateMutability:"view"},{type:"function",name:"getInstalledPlugins",inputs:[],outputs:[{name:"",type:"address[]",internalType:"address[]"}],stateMutability:"view"},{type:"function",name:"getPreValidationHooks",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"preUserOpValidationHooks",type:"bytes21[]",internalType:"FunctionReference[]"},{name:"preRuntimeValidationHooks",type:"bytes21[]",internalType:"FunctionReference[]"}],stateMutability:"view"}],pP=[{type:"function",name:"onInstall",inputs:[{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"onUninstall",inputs:[{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"pluginManifest",inputs:[],outputs:[{name:"",type:"tuple",internalType:"struct PluginManifest",components:[{name:"interfaceIds",type:"bytes4[]",internalType:"bytes4[]"},{name:"dependencyInterfaceIds",type:"bytes4[]",internalType:"bytes4[]"},{name:"executionFunctions",type:"bytes4[]",internalType:"bytes4[]"},{name:"permittedExecutionSelectors",type:"bytes4[]",internalType:"bytes4[]"},{name:"permitAnyExternalAddress",type:"bool",internalType:"bool"},{name:"canSpendNativeToken",type:"bool",internalType:"bool"},{name:"permittedExternalCalls",type:"tuple[]",internalType:"struct ManifestExternalCallPermission[]",components:[{name:"externalAddress",type:"address",internalType:"address"},{name:"permitAnySelector",type:"bool",internalType:"bool"},{name:"selectors",type:"bytes4[]",internalType:"bytes4[]"}]},{name:"userOpValidationFunctions",type:"tuple[]",internalType:"struct ManifestAssociatedFunction[]",components:[{name:"executionSelector",type:"bytes4",internalType:"bytes4"},{name:"associatedFunction",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]}]},{name:"runtimeValidationFunctions",type:"tuple[]",internalType:"struct ManifestAssociatedFunction[]",components:[{name:"executionSelector",type:"bytes4",internalType:"bytes4"},{name:"associatedFunction",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]}]},{name:"preUserOpValidationHooks",type:"tuple[]",internalType:"struct ManifestAssociatedFunction[]",components:[{name:"executionSelector",type:"bytes4",internalType:"bytes4"},{name:"associatedFunction",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]}]},{name:"preRuntimeValidationHooks",type:"tuple[]",internalType:"struct ManifestAssociatedFunction[]",components:[{name:"executionSelector",type:"bytes4",internalType:"bytes4"},{name:"associatedFunction",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]}]},{name:"executionHooks",type:"tuple[]",internalType:"struct ManifestExecutionHook[]",components:[{name:"executionSelector",type:"bytes4",internalType:"bytes4"},{name:"preExecHook",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]},{name:"postExecHook",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]}]}]}],stateMutability:"pure"},{type:"function",name:"pluginMetadata",inputs:[],outputs:[{name:"",type:"tuple",internalType:"struct PluginMetadata",components:[{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"author",type:"string",internalType:"string"},{name:"permissionDescriptors",type:"tuple[]",internalType:"struct SelectorPermission[]",components:[{name:"functionSelector",type:"bytes4",internalType:"bytes4"},{name:"permissionDescription",type:"string",internalType:"string"}]}]}],stateMutability:"pure"},{type:"function",name:"postExecutionHook",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"preExecHookData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"preExecutionHook",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"sender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes",internalType:"bytes"}],stateMutability:"nonpayable"},{type:"function",name:"preRuntimeValidationHook",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"sender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"preUserOpValidationHook",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"userOp",type:"tuple",internalType:"struct UserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"callGasLimit",type:"uint256",internalType:"uint256"},{name:"verificationGasLimit",type:"uint256",internalType:"uint256"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"maxFeePerGas",type:"uint256",internalType:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256",internalType:"uint256"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"runtimeValidationFunction",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"sender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"userOpValidationFunction",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"userOp",type:"tuple",internalType:"struct UserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"callGasLimit",type:"uint256",internalType:"uint256"},{name:"verificationGasLimit",type:"uint256",internalType:"uint256"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"maxFeePerGas",type:"uint256",internalType:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256",internalType:"uint256"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"}],hP=[{type:"function",name:"installPlugin",inputs:[{name:"plugin",type:"address",internalType:"address"},{name:"manifestHash",type:"bytes32",internalType:"bytes32"},{name:"pluginInitData",type:"bytes",internalType:"bytes"},{name:"dependencies",type:"bytes21[]",internalType:"FunctionReference[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"uninstallPlugin",inputs:[{name:"plugin",type:"address",internalType:"address"},{name:"config",type:"bytes",internalType:"bytes"},{name:"pluginUninstallData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"event",name:"PluginIgnoredHookUnapplyCallbackFailure",inputs:[{name:"plugin",type:"address",indexed:!0,internalType:"address"},{name:"providingPlugin",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"PluginIgnoredUninstallCallbackFailure",inputs:[{name:"plugin",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"PluginInstalled",inputs:[{name:"plugin",type:"address",indexed:!0,internalType:"address"},{name:"manifestHash",type:"bytes32",indexed:!1,internalType:"bytes32"},{name:"dependencies",type:"bytes21[]",indexed:!1,internalType:"FunctionReference[]"}],anonymous:!1},{type:"event",name:"PluginUninstalled",inputs:[{name:"plugin",type:"address",indexed:!0,internalType:"address"},{name:"callbacksSucceeded",type:"bool",indexed:!0,internalType:"bool"}],anonymous:!1}],mP=[{type:"function",name:"execute",inputs:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes",internalType:"bytes"}],stateMutability:"payable"},{type:"function",name:"executeBatch",inputs:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"}],fP=[{type:"constructor",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"multiOwnerPlugin",type:"address",internalType:"address"},{name:"implementation",type:"address",internalType:"address"},{name:"multiOwnerPluginManifestHash",type:"bytes32",internalType:"bytes32"},{name:"entryPoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"ENTRYPOINT",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"IMPL",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"MULTI_OWNER_PLUGIN",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"acceptOwnership",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"addStake",inputs:[{name:"unstakeDelay",type:"uint32",internalType:"uint32"},{name:"amount",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"payable"},{type:"function",name:"createAccount",inputs:[{name:"salt",type:"uint256",internalType:"uint256"},{name:"owners",type:"address[]",internalType:"address[]"}],outputs:[{name:"addr",type:"address",internalType:"address"}],stateMutability:"nonpayable"},{type:"function",name:"getAddress",inputs:[{name:"salt",type:"uint256",internalType:"uint256"},{name:"owners",type:"address[]",internalType:"address[]"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"owner",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"pendingOwner",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"renounceOwnership",inputs:[],outputs:[],stateMutability:"view"},{type:"function",name:"transferOwnership",inputs:[{name:"newOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"unlockStake",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"withdraw",inputs:[{name:"to",type:"address",internalType:"address payable"},{name:"token",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"withdrawStake",inputs:[{name:"to",type:"address",internalType:"address payable"}],outputs:[],stateMutability:"nonpayable"},{type:"event",name:"OwnershipTransferStarted",inputs:[{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"OwnershipTransferred",inputs:[{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"error",name:"InvalidAction",inputs:[]},{type:"error",name:"InvalidOwner",inputs:[]},{type:"error",name:"OwnersArrayEmpty",inputs:[]},{type:"error",name:"OwnersLimitExceeded",inputs:[]},{type:"error",name:"TransferFailed",inputs:[]}],yP=e=>({getExecutionFunctionConfig:async({selector:t,account:n=e.account})=>{if(!n)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","getExecutionFunctionConfig",e);return e.readContract({address:n.address,abi:dP,functionName:"getExecutionFunctionConfig",args:[t]})},getExecutionHooks:async({selector:t,account:n=e.account})=>{if(!n)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","getExecutionHooks",e);return e.readContract({address:n.address,abi:dP,functionName:"getExecutionHooks",args:[t]})},getPreValidationHooks:async({selector:t,account:n=e.account})=>{if(!n)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","getPreValidationHooks",e);return e.readContract({address:n.address,abi:dP,functionName:"getPreValidationHooks",args:[t]})},getInstalledPlugins:async({account:t=e.account})=>{if(!t)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","getInstalledPlugins",e);return e.readContract({address:t.address,abi:dP,functionName:"getInstalledPlugins"}).catch((()=>[]))}});async function bP(e,{overrides:t,context:n,account:r=e.account,...a}){if(!r)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","installPlugin",e);const s=await async function(e,t){const n=await e.readContract({abi:pP,address:t.pluginAddress,functionName:"pluginManifest"}),r=t.manifestHash??ki(function(e){const{abi:t,functionName:n,result:r}=e;let a=t[0];if(n){const e=Yo({abi:t,name:n});if(!e)throw new _o(n,{docsPath:Vd});a=e}if("function"!==a.type)throw new _o(void 0,{docsPath:Vd});if(!a.outputs)throw new Do(a.name,{docsPath:Vd});let s=Array.isArray(r)?r:[r];return 0!==a.outputs.length||s[0]||(s=[]),Zo(a.outputs,s)}({abi:pP,functionName:"pluginManifest",result:n}));return cc({abi:hP,functionName:"installPlugin",args:[t.pluginAddress,r,t.pluginInitData??"0x",t.dependencies??[]]})}(e,a);return e.sendUserOperation({uo:s,overrides:t,account:r,context:n})}const gP={1:"0xcE0000007B008F50d762D155002600004cD6c647",10:"0xcE0000007B008F50d762D155002600004cD6c647",137:"0xcE0000007B008F50d762D155002600004cD6c647",252:"0xcE0000007B008F50d762D155002600004cD6c647",2523:"0xcE0000007B008F50d762D155002600004cD6c647",8453:"0xcE0000007B008F50d762D155002600004cD6c647",42161:"0xcE0000007B008F50d762D155002600004cD6c647",80001:"0xcE0000007B008F50d762D155002600004cD6c647",80002:"0xcE0000007B008F50d762D155002600004cD6c647",84532:"0xcE0000007B008F50d762D155002600004cD6c647",421614:"0xcE0000007B008F50d762D155002600004cD6c647",7777777:"0xcE0000007B008F50d762D155002600004cD6c647",11155111:"0xcE0000007B008F50d762D155002600004cD6c647",11155420:"0xcE0000007B008F50d762D155002600004cD6c647",999999999:"0xcE0000007B008F50d762D155002600004cD6c647"},wP={meta:{name:"Multi Owner Plugin",version:"1.0.0",addresses:gP},getContract:(e,t)=>{if(!e.chain)throw new db;return Wu({address:t||gP[e.chain.id],abi:EP,client:e})}},vP=e=>({updateOwners({args:t,overrides:n,context:r,account:a=e.account}){if(!a)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","updateOwners",e);const s=cc({abi:CP,functionName:"updateOwners",args:t});return e.sendUserOperation({uo:s,overrides:n,account:a,context:r})},installMultiOwnerPlugin({account:t=e.account,overrides:n,context:r,...a}){if(!t)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","installMultiOwnerPlugin",e);const s=e.chain;if(!s)throw new db;const i=a.dependencyOverrides??[],o=a.pluginAddress??wP.meta.addresses[s.id];if(!o)throw new Error("missing MultiOwnerPlugin address for chain "+s.name);return bP(e,{pluginAddress:o,pluginInitData:Zo([{type:"address[]"}],a.args),dependencies:i,overrides:n,account:t,context:r})},encodeUpdateOwners:({args:e})=>cc({abi:CP,functionName:"updateOwners",args:e}),encodeEip712Domain:()=>cc({abi:CP,functionName:"eip712Domain"}),async readEip712Domain({account:t=e.account}){if(!t)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","readEip712Domain",e);return e.readContract({address:t.address,abi:CP,functionName:"eip712Domain"})},encodeIsValidSignature:({args:e})=>cc({abi:CP,functionName:"isValidSignature",args:e}),async readIsValidSignature({args:t,account:n=e.account}){if(!n)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","readIsValidSignature",e);return e.readContract({address:n.address,abi:CP,functionName:"isValidSignature",args:t})}}),CP=[{stateMutability:"nonpayable",type:"function",inputs:[{name:"ownersToAdd",internalType:"address[]",type:"address[]"},{name:"ownersToRemove",internalType:"address[]",type:"address[]"}],name:"updateOwners",outputs:[]},{stateMutability:"view",type:"function",inputs:[],name:"eip712Domain",outputs:[{name:"fields",internalType:"bytes1",type:"bytes1"},{name:"name",internalType:"string",type:"string"},{name:"version",internalType:"string",type:"string"},{name:"chainId",internalType:"uint256",type:"uint256"},{name:"verifyingContract",internalType:"address",type:"address"},{name:"salt",internalType:"bytes32",type:"bytes32"},{name:"extensions",internalType:"uint256[]",type:"uint256[]"}]},{stateMutability:"view",type:"function",inputs:[{name:"digest",internalType:"bytes32",type:"bytes32"},{name:"signature",internalType:"bytes",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",internalType:"bytes4",type:"bytes4"}]}],EP=[{stateMutability:"view",type:"function",inputs:[],name:"eip712Domain",outputs:[{name:"fields",internalType:"bytes1",type:"bytes1"},{name:"name",internalType:"string",type:"string"},{name:"version",internalType:"string",type:"string"},{name:"chainId",internalType:"uint256",type:"uint256"},{name:"verifyingContract",internalType:"address",type:"address"},{name:"salt",internalType:"bytes32",type:"bytes32"},{name:"extensions",internalType:"uint256[]",type:"uint256[]"}]},{stateMutability:"view",type:"function",inputs:[{name:"account",internalType:"address",type:"address"},{name:"message",internalType:"bytes",type:"bytes"}],name:"encodeMessageData",outputs:[{name:"",internalType:"bytes",type:"bytes"}]},{stateMutability:"view",type:"function",inputs:[{name:"account",internalType:"address",type:"address"},{name:"message",internalType:"bytes",type:"bytes"}],name:"getMessageHash",outputs:[{name:"",internalType:"bytes32",type:"bytes32"}]},{stateMutability:"view",type:"function",inputs:[{name:"account",internalType:"address",type:"address"},{name:"ownerToCheck",internalType:"address",type:"address"}],name:"isOwnerOf",outputs:[{name:"",internalType:"bool",type:"bool"}]},{stateMutability:"view",type:"function",inputs:[{name:"digest",internalType:"bytes32",type:"bytes32"},{name:"signature",internalType:"bytes",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",internalType:"bytes4",type:"bytes4"}]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"data",internalType:"bytes",type:"bytes"}],name:"onInstall",outputs:[]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"",internalType:"bytes",type:"bytes"}],name:"onUninstall",outputs:[]},{stateMutability:"view",type:"function",inputs:[{name:"account",internalType:"address",type:"address"}],name:"ownersOf",outputs:[{name:"",internalType:"address[]",type:"address[]"}]},{stateMutability:"pure",type:"function",inputs:[],name:"pluginManifest",outputs:[{name:"",internalType:"struct PluginManifest",type:"tuple",components:[{name:"interfaceIds",internalType:"bytes4[]",type:"bytes4[]"},{name:"dependencyInterfaceIds",internalType:"bytes4[]",type:"bytes4[]"},{name:"executionFunctions",internalType:"bytes4[]",type:"bytes4[]"},{name:"permittedExecutionSelectors",internalType:"bytes4[]",type:"bytes4[]"},{name:"permitAnyExternalAddress",internalType:"bool",type:"bool"},{name:"canSpendNativeToken",internalType:"bool",type:"bool"},{name:"permittedExternalCalls",internalType:"struct ManifestExternalCallPermission[]",type:"tuple[]",components:[{name:"externalAddress",internalType:"address",type:"address"},{name:"permitAnySelector",internalType:"bool",type:"bool"},{name:"selectors",internalType:"bytes4[]",type:"bytes4[]"}]},{name:"userOpValidationFunctions",internalType:"struct ManifestAssociatedFunction[]",type:"tuple[]",components:[{name:"executionSelector",internalType:"bytes4",type:"bytes4"},{name:"associatedFunction",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]}]},{name:"runtimeValidationFunctions",internalType:"struct ManifestAssociatedFunction[]",type:"tuple[]",components:[{name:"executionSelector",internalType:"bytes4",type:"bytes4"},{name:"associatedFunction",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]}]},{name:"preUserOpValidationHooks",internalType:"struct ManifestAssociatedFunction[]",type:"tuple[]",components:[{name:"executionSelector",internalType:"bytes4",type:"bytes4"},{name:"associatedFunction",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]}]},{name:"preRuntimeValidationHooks",internalType:"struct ManifestAssociatedFunction[]",type:"tuple[]",components:[{name:"executionSelector",internalType:"bytes4",type:"bytes4"},{name:"associatedFunction",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]}]},{name:"executionHooks",internalType:"struct ManifestExecutionHook[]",type:"tuple[]",components:[{name:"executionSelector",internalType:"bytes4",type:"bytes4"},{name:"preExecHook",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]},{name:"postExecHook",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]}]}]}]},{stateMutability:"pure",type:"function",inputs:[],name:"pluginMetadata",outputs:[{name:"",internalType:"struct PluginMetadata",type:"tuple",components:[{name:"name",internalType:"string",type:"string"},{name:"version",internalType:"string",type:"string"},{name:"author",internalType:"string",type:"string"},{name:"permissionDescriptors",internalType:"struct SelectorPermission[]",type:"tuple[]",components:[{name:"functionSelector",internalType:"bytes4",type:"bytes4"},{name:"permissionDescription",internalType:"string",type:"string"}]}]}]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"preExecHookData",internalType:"bytes",type:"bytes"}],name:"postExecutionHook",outputs:[]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"sender",internalType:"address",type:"address"},{name:"value",internalType:"uint256",type:"uint256"},{name:"data",internalType:"bytes",type:"bytes"}],name:"preExecutionHook",outputs:[{name:"",internalType:"bytes",type:"bytes"}]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"sender",internalType:"address",type:"address"},{name:"value",internalType:"uint256",type:"uint256"},{name:"data",internalType:"bytes",type:"bytes"}],name:"preRuntimeValidationHook",outputs:[]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"userOp",internalType:"struct UserOperation",type:"tuple",components:[{name:"sender",internalType:"address",type:"address"},{name:"nonce",internalType:"uint256",type:"uint256"},{name:"initCode",internalType:"bytes",type:"bytes"},{name:"callData",internalType:"bytes",type:"bytes"},{name:"callGasLimit",internalType:"uint256",type:"uint256"},{name:"verificationGasLimit",internalType:"uint256",type:"uint256"},{name:"preVerificationGas",internalType:"uint256",type:"uint256"},{name:"maxFeePerGas",internalType:"uint256",type:"uint256"},{name:"maxPriorityFeePerGas",internalType:"uint256",type:"uint256"},{name:"paymasterAndData",internalType:"bytes",type:"bytes"},{name:"signature",internalType:"bytes",type:"bytes"}]},{name:"userOpHash",internalType:"bytes32",type:"bytes32"}],name:"preUserOpValidationHook",outputs:[{name:"",internalType:"uint256",type:"uint256"}]},{stateMutability:"view",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"sender",internalType:"address",type:"address"},{name:"",internalType:"uint256",type:"uint256"},{name:"",internalType:"bytes",type:"bytes"}],name:"runtimeValidationFunction",outputs:[]},{stateMutability:"view",type:"function",inputs:[{name:"interfaceId",internalType:"bytes4",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",internalType:"bool",type:"bool"}]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"ownersToAdd",internalType:"address[]",type:"address[]"},{name:"ownersToRemove",internalType:"address[]",type:"address[]"}],name:"updateOwners",outputs:[]},{stateMutability:"view",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"userOp",internalType:"struct UserOperation",type:"tuple",components:[{name:"sender",internalType:"address",type:"address"},{name:"nonce",internalType:"uint256",type:"uint256"},{name:"initCode",internalType:"bytes",type:"bytes"},{name:"callData",internalType:"bytes",type:"bytes"},{name:"callGasLimit",internalType:"uint256",type:"uint256"},{name:"verificationGasLimit",internalType:"uint256",type:"uint256"},{name:"preVerificationGas",internalType:"uint256",type:"uint256"},{name:"maxFeePerGas",internalType:"uint256",type:"uint256"},{name:"maxPriorityFeePerGas",internalType:"uint256",type:"uint256"},{name:"paymasterAndData",internalType:"bytes",type:"bytes"},{name:"signature",internalType:"bytes",type:"bytes"}]},{name:"userOpHash",internalType:"bytes32",type:"bytes32"}],name:"userOpValidationFunction",outputs:[{name:"",internalType:"uint256",type:"uint256"}]},{type:"event",anonymous:!1,inputs:[{name:"account",internalType:"address",type:"address",indexed:!0},{name:"addedOwners",internalType:"address[]",type:"address[]",indexed:!1},{name:"removedOwners",internalType:"address[]",type:"address[]",indexed:!1}],name:"OwnerUpdated"},{type:"error",inputs:[],name:"AlreadyInitialized"},{type:"error",inputs:[],name:"EmptyOwnersNotAllowed"},{type:"error",inputs:[],name:"InvalidAction"},{type:"error",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"InvalidOwner"},{type:"error",inputs:[],name:"NotAuthorized"},{type:"error",inputs:[{name:"caller",internalType:"address",type:"address"}],name:"NotContractCaller"},{type:"error",inputs:[{name:"selector",internalType:"bytes4",type:"bytes4"},{name:"functionId",internalType:"uint8",type:"uint8"}],name:"NotImplemented"},{type:"error",inputs:[],name:"NotInitialized"},{type:"error",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"OwnerDoesNotExist"}],xP=(e,t,n,r=wP.meta.addresses[e.chain.id])=>{const a=async a=>{const[,s,i,o,c,l]=await e.readContract({abi:EP,address:r,functionName:"eip712Domain",account:t});return n().signTypedData({domain:{chainId:Number(o),name:s,salt:l,verifyingContract:c,version:i},types:{AlchemyModularAccountMessage:[{name:"message",type:"bytes"}]},message:{message:a},primaryType:"AlchemyModularAccountMessage"})};return{getDummySignature:()=>"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",signUserOperationHash:e=>n().signMessage({raw:e}),signMessage:({message:e})=>a(tp(e)),signTypedData:e=>a(Ud(e))}},kP=e=>(e.id,"0x000000e92D78D90000007F0082006FDA09BD5f11"),TP={encodeExecute:async({target:e,data:t,value:n})=>cc({abi:mP,functionName:"execute",args:[e,n??0n,t]}),encodeBatchExecute:async e=>cc({abi:mP,functionName:"executeBatch",args:[e.map((e=>({target:e.target,data:e.data,value:e.value??0n})))]})};async function PP({transport:e,chain:t,signer:n,accountAddress:r,initCode:a,entryPoint:s=Cb(t,{version:"0.6.0"}),factoryAddress:i=kP(t),owners:o=[],salt:c=0n}){const l=hb({transport:e,chain:t}),u=async()=>{if(a)return a;const e=await n.getAddress(),t=Array.from(new Set([...o,e])).filter((e=>0n!==Is(e))).sort(((e,t)=>{const n=Is(e),r=Is(t);return n<r?-1:n>r?1:0}));return Fi([i,cc({abi:fP,functionName:"createAccount",args:[c,t]})])},d=await Bv({client:l,entryPoint:s,accountAddress:r,getAccountInitCode:u}),p=await async function({transport:e,chain:t,entryPoint:n,source:r,accountAddress:a,getAccountInitCode:s,signMessage:i,signTypedData:o,encodeBatchExecute:c,encodeExecute:l,getDummySignature:u,signUserOperationHash:d,encodeUpgradeToAndCall:p}){const h=hb({transport:n=>e({...n,chain:t,retryCount:0}),chain:t}),m=Wu({address:n.address,abi:n.abi,client:h}),f=await Bv({client:h,entryPoint:n,accountAddress:a,getAccountInitCode:s});let y=Iv.UNDEFINED;const b=async()=>{if(y===Iv.DEPLOYED)return"0x";const e=await h.getBytecode({address:f});return(e?.length??0)>2?(y=Iv.DEPLOYED,"0x"):(y=Iv.NOT_DEPLOYED,s())},g=d??(async e=>i({message:{raw:Fs(e)}})),w=p??(()=>{throw new kb(r)}),v=async()=>"0x"===await b(),C=Nv({address:f,signMessage:i,signTypedData:o,signTransaction:()=>{throw new Tb}}),E=async(e,t)=>{if(e)return t;const[n,r]=Lv(await s());return Fb({factoryAddress:n,factoryCalldata:r,signature:t})};if("0.6.0"!==n.version&&"0.7.0"!==n.version)throw new fb(t,n.version);return{...C,source:r,signUserOperationHash:g,getFactoryAddress:async()=>Lv(await s())[0],getFactoryData:async()=>Lv(await s())[1],encodeBatchExecute:c??(()=>{throw new Ab(r)}),encodeExecute:l,getDummySignature:u,getInitCode:b,encodeUpgradeToAndCall:w,getEntryPoint:()=>n,isAccountDeployed:v,getNonce:async(e=0n)=>await v()?m.read.getNonce([f,e]):0n,signMessageWith6492:async e=>{const[t,n]=await Promise.all([v(),C.signMessage(e)]);return E(t,n)},signTypedDataWith6492:async e=>{const[t,n]=await Promise.all([v(),C.signTypedData(e)]);return E(t,n)},getImplementationAddress:async()=>{const e=await h.getStorageAt({address:C.address,slot:"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"});if(null==e)throw new Pb("0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc","Proxy Implementation Address");return hs(e)}}}({transport:e,chain:t,entryPoint:s,accountAddress:d,source:"MultiOwnerModularAccount",getAccountInitCode:u,...TP,...xP(l,d,(()=>n))});return{...p,publicKey:await n.getAddress(),getSigner:()=>n}}async function AP(e,{overrides:t,account:n=e.account,context:r,...a}){if(!n)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","uninstallPlugin",e);const s=await async function(e){return cc({abi:hP,functionName:"uninstallPlugin",args:[e.pluginAddress,e.config??"0x",e.pluginUninstallData??"0x"]})}(a);return e.sendUserOperation({uo:s,overrides:t,account:n,context:r})}const _P=e=>({installPlugin:async t=>bP(e,t),uninstallPlugin:async t=>AP(e,t)}),DP=e=>({...vP(e),async readOwners(t){const n=t?.account??e.account;if(!n)throw new Eb;return wP.getContract(e,t?.pluginAddress).read.ownersOf([n.address])},async isOwnerOf(t){const n=t.account??e.account;if(!n)throw new Eb;return wP.getContract(e,t.pluginAddress).read.isOwnerOf([n.address,t.address])}}),FP=({chain:e,connectionConfig:t,fetchOptions:n={}})=>{const r=eP.parse(e),a=null==t.rpcUrl?`${r.rpcUrls.alchemy.http[0]}/${t.apiKey??""}`:t.rpcUrl;return n.headers={...n.headers,"Alchemy-AA-Sdk-Version":"3.18.2"},null!=t.jwt&&(n.headers={...n.headers,Authorization:`Bearer ${t.jwt}`}),hb({chain:r,transport:ud(a,{fetchOptions:n})}).extend((()=>({updateHeaders(e){n.headers={...n.headers,...e}}})))};async function OP(e){const{chain:t,opts:n,...r}=tP.parse(e),a=FP({chain:t,connectionConfig:r}),s=await PP({transport:sd(a),...e});return function({opts:e,account:t,useSimulation:n,gasManagerConfig:r,feeEstimator:a,gasEstimator:s,customMiddleware:i,signUserOperation:o,client:c}){const l=e?.feeOptions??bv(c.chain),u=cC({account:t,client:c,type:"AlchemySmartAccountClient",opts:{...e,feeOptions:l},customMiddleware:async(e,t)=>(Uv(t.account)&&c.updateHeaders(uP(t.account)),i?i(e,t):e),feeEstimator:a??rP(c),userOperationSimulator:n?lP(c):void 0,gasEstimator:s,...r&&sP(c,{...r,gasEstimationOptions:{...r.gasEstimationOptions,disableGasEstimation:r.gasEstimationOptions?.disableGasEstimation??!1,fallbackFeeDataGetter:r.gasEstimationOptions?.fallbackFeeDataGetter??a,fallbackGasEstimator:r.gasEstimationOptions?.fallbackGasEstimator??s}}),signUserOperation:o}).extend(nP);return t&&Uv(t)&&c.updateHeaders(uP(t)),u}({...e,client:a,account:s,opts:n}).extend(DP).extend(_P).extend(yP)}const SP=e=>(t,n,r)=>{const a=r.subscribe;r.subscribe=(e,t,n)=>{let s=e;if(t){const a=(null==n?void 0:n.equalityFn)||Object.is;let i=e(r.getState());s=n=>{const r=e(n);if(!a(i,r)){const e=i;t(i=r,e)}},(null==n?void 0:n.fireImmediately)&&t(i,i)}return a(s)};return e(t,n,r)};function MP(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var r;const a=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),s=null!=(r=n.getItem(e))?r:null;return s instanceof Promise?s.then(a):a(s)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}const IP=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>IP(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>IP(t)(e)}}},NP=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((e,t)=>(n,r,a)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},i=!1;const o=new Set,c=new Set;let l;try{l=s.getStorage()}catch(e){}if(!l)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...e)}),r,a);const u=IP(s.serialize),d=()=>{const e=s.partialize({...r()});let t;const n=u({state:e,version:s.version}).then((e=>l.setItem(s.name,e))).catch((e=>{t=e}));if(t)throw t;return n},p=a.setState;a.setState=(e,t)=>{p(e,t),d()};const h=e(((...e)=>{n(...e),d()}),r,a);let m;const f=()=>{var e;if(!l)return;i=!1,o.forEach((e=>e(r())));const t=(null==(e=s.onRehydrateStorage)?void 0:e.call(s,r()))||void 0;return IP(l.getItem.bind(l))(s.name).then((e=>{if(e)return s.deserialize(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===s.version)return e.state;if(s.migrate)return s.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return m=s.merge(e,null!=(t=r())?t:h),n(m,!0),d()})).then((()=>{null==t||t(m,void 0),i=!0,c.forEach((e=>e(m)))})).catch((e=>{null==t||t(void 0,e)}))};return a.persist={setOptions:e=>{s={...s,...e},e.getStorage&&(l=e.getStorage())},clearStorage:()=>{null==l||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>f(),hasHydrated:()=>i,onHydrate:e=>(o.add(e),()=>{o.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},f(),m||h})(e,t)):((e,t)=>(n,r,a)=>{let s={storage:MP((()=>localStorage)),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},i=!1;const o=new Set,c=new Set;let l=s.storage;if(!l)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...e)}),r,a);const u=()=>{const e=s.partialize({...r()});return l.setItem(s.name,{state:e,version:s.version})},d=a.setState;a.setState=(e,t)=>{d(e,t),u()};const p=e(((...e)=>{n(...e),u()}),r,a);let h;a.getInitialState=()=>p;const m=()=>{var e,t;if(!l)return;i=!1,o.forEach((e=>{var t;return e(null!=(t=r())?t:p)}));const a=(null==(t=s.onRehydrateStorage)?void 0:t.call(s,null!=(e=r())?e:p))||void 0;return IP(l.getItem.bind(l))(s.name).then((e=>{if(e){if("number"!=typeof e.version||e.version===s.version)return e.state;if(s.migrate)return s.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return h=s.merge(e,null!=(t=r())?t:p),n(h,!0),u()})).then((()=>{null==a||a(h,void 0),h=r(),i=!0,c.forEach((e=>e(h)))})).catch((e=>{null==a||a(void 0,e)}))};return a.persist={setOptions:e=>{s={...s,...e},e.storage&&(l=e.storage)},clearStorage:()=>{null==l||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:e=>(o.add(e),()=>{o.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},s.skipHydration||m(),h||p})(e,t),UP=e=>{let t;const n=new Set,r=(e,r)=>{const a="function"==typeof e?e(t):e;if(!Object.is(a,t)){const e=t;t=(null!=r?r:"object"!=typeof a||null===a)?a:Object.assign({},t,a),n.forEach((n=>n(t,e)))}},a=()=>t,s={setState:r,getState:a,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(r,a,s);return s},LP=e=>e?UP(e):UP;class BP extends cb{constructor(){super(["Signer not authenticated","Please authenticate to use this signer"].join("\n"),{docsPath:"/signers/alchemy-signer/introduction.html"})}}const RP=Lw.object({sessionKey:Lw.string().default("alchemy-signer-session"),storage:Lw.enum(["localStorage","sessionStorage"]).default("localStorage").or(Lw.custom()),expirationTimeMs:Lw.number().default(9e5).describe("The time in milliseconds that a session should last before expiring [default: 15 minutes]"),client:Lw.custom()});class jP{constructor(e){Object.defineProperty(this,"sessionKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"eventEmitter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expirationTimeMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getSessionUser",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{const e=this.getSession();if(null==e)return null;switch(e.type){case"email":{const t=await this.client.completeEmailAuth({bundle:e.bundle,orgId:e.user.orgId}).catch((e=>(console.warn("Failed to load user from session",e),null)));return t||(this.clearSession(),null)}case"passkey":return this.client.lookupUserWithPasskey(e.user);default:throw new Error("Unknown session type")}}}),Object.defineProperty(this,"clearSession",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.store.setState({session:null})}}),Object.defineProperty(this,"setTemporarySession",{enumerable:!0,configurable:!0,writable:!0,value:e=>{localStorage.setItem(`${this.sessionKey}:temporary`,JSON.stringify(e))}}),Object.defineProperty(this,"getTemporarySession",{enumerable:!0,configurable:!0,writable:!0,value:()=>{const e=localStorage.getItem(`${this.sessionKey}:temporary`);return e?JSON.parse(e):null}}),Object.defineProperty(this,"on",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>(this.eventEmitter.on(e,t),()=>this.eventEmitter.removeListener(e,t))}),Object.defineProperty(this,"getSession",{enumerable:!0,configurable:!0,writable:!0,value:()=>{const e=this.store.getState().session;return e?e.expirationDateMs<Date.now()?(this.store.setState({session:null}),null):e:null}}),Object.defineProperty(this,"setSession",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.store.setState({session:{...e,expirationDateMs:Date.now()+this.expirationTimeMs}})}}),Object.defineProperty(this,"registerEventListeners",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.store.subscribe((({session:e})=>e),((e,t)=>{null!=e&&null==t?this.eventEmitter.emit("connected",e):null==e&&null!=t&&this.eventEmitter.emit("disconnected")})),this.client.on("disconnected",(()=>this.clearSession())),this.client.on("connectedEmail",((e,t)=>{const n=this.getSession();null!=n&&"email"===n.type&&n.user.userId===e.userId&&n.bundle===t||this.setSession({type:"email",user:e,bundle:t})})),this.client.on("connectedPasskey",(e=>{const t=this.getSession();null!=t&&"passkey"===t.type&&t.user.userId===e.userId||this.setSession({type:"passkey",user:e})})),window.addEventListener("focus",(()=>{this.store.persist.rehydrate(),this.initialize()}))}});const{sessionKey:t,storage:n,expirationTimeMs:r,client:a}=RP.parse(e);this.sessionKey=t;const s="string"==typeof n?"localStorage"===n?localStorage:sessionStorage:n;this.expirationTimeMs=r,this.client=a,this.eventEmitter=new vn,this.store=LP(SP(NP(this.getInitialState,{name:this.sessionKey,storage:MP((()=>s))}))),this.registerEventListeners()}initialize(){this.getSessionUser().then((e=>{e?this.eventEmitter.emit("connected",this.getSession()):this.eventEmitter.emit("disconnected")})).finally((()=>{this.eventEmitter.emit("initialized")}))}getInitialState(){return{session:null}}}var GP;!function(e){e.INITIALIZING="INITIALIZING",e.CONNECTED="CONNECTED",e.DISCONNECTED="DISCONNECTED",e.AUTHENTICATING="AUTHENTICATING",e.AWAITING_EMAIL_AUTH="AWAITING_EMAIL_AUTH"}(GP||(GP={}));class HP{constructor({client:e,sessionConfig:t}){Object.defineProperty(this,"signerType",{enumerable:!0,configurable:!0,writable:!0,value:"alchemy-signer"}),Object.defineProperty(this,"inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sessionManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"on",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{switch(e){case"connected":return this.store.subscribe((({status:e})=>e),(e=>e===GP.CONNECTED&&t(this.store.getState().user)),{fireImmediately:!0});case"disconnected":return this.store.subscribe((({status:e})=>e),(e=>e===GP.DISCONNECTED&&t()),{fireImmediately:!0});case"statusChanged":return this.store.subscribe((({status:e})=>e),t,{fireImmediately:!0});default:throw new Error(`Uknown event type ${e}`)}}}),Object.defineProperty(this,"authenticate",{enumerable:!0,configurable:!0,writable:!0,value:async e=>"email"===e.type?this.authenticateWithEmail(e):this.authenticateWithPasskey(e)}),Object.defineProperty(this,"disconnect",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{await this.inner.disconnect()}}),Object.defineProperty(this,"getAuthDetails",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{const e=await this.sessionManager.getSessionUser();return null!=e?e:this.inner.whoami()}}),Object.defineProperty(this,"getAddress",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{const{address:e}=await this.inner.whoami();return e}}),Object.defineProperty(this,"signMessage",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=tp(e);return this.inner.signRawMessage(t)}}),Object.defineProperty(this,"signTypedData",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=Ud(e);return this.inner.signRawMessage(t)}}),Object.defineProperty(this,"signTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{const n=t?.serializer??bp,r=n(e),a=await this.inner.signRawMessage(ki(r));return n(e,{r:fv(a,{count:32}),s:fv(a,{count:32,offset:32}),v:BigInt(fv(a,{count:1,offset:64}))})}}),Object.defineProperty(this,"getUser",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=await this.inner.lookupUserByEmail(e);return null==t.orgId?null:{orgId:t.orgId}}}),Object.defineProperty(this,"addPasskey",{enumerable:!0,configurable:!0,writable:!0,value:async e=>this.inner.addPasskey(e??{})}),Object.defineProperty(this,"exportWallet",{enumerable:!0,configurable:!0,writable:!0,value:async e=>this.inner.exportWallet(e)}),Object.defineProperty(this,"toViemAccount",{enumerable:!0,configurable:!0,writable:!0,value:()=>{if(!this.inner.getUser())throw new BP;return Nv({address:this.inner.getUser().address,signMessage:e=>this.signMessage(e.message),signTypedData:e=>this.signTypedData(e),signTransaction:this.signTransaction})}}),Object.defineProperty(this,"authenticateWithEmail",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if("email"in e){const t=await this.getUser(e.email),{orgId:n}=t?await this.inner.initEmailAuth({email:e.email,expirationSeconds:this.sessionManager.expirationTimeMs,redirectParams:e.redirectParams}):await this.inner.createAccount({type:"email",email:e.email,expirationSeconds:this.sessionManager.expirationTimeMs,redirectParams:e.redirectParams});return this.sessionManager.setTemporarySession({orgId:n}),this.store.setState({status:GP.AWAITING_EMAIL_AUTH}),new Promise((e=>{const t=this.sessionManager.on("connected",(n=>{e(n.user),t()}))}))}{const t=e.orgId?{orgId:e.orgId}:this.sessionManager.getTemporarySession();if(!t)throw this.store.setState({status:GP.DISCONNECTED}),new Error("Could not find email auth init session!");return await this.inner.completeEmailAuth({bundle:e.bundle,orgId:t.orgId})}}}),Object.defineProperty(this,"authenticateWithPasskey",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{let t;if(e.createNew){const n=await this.inner.createAccount(e);t={address:n.address,userId:n.userId,orgId:n.orgId}}else if(t=await this.inner.lookupUserWithPasskey(),!t)throw this.store.setState({status:GP.DISCONNECTED}),new Error("No user found");return t}}),Object.defineProperty(this,"registerListeners",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.sessionManager.on("connected",(e=>{this.store.setState({user:e.user,status:GP.CONNECTED})})),this.sessionManager.on("disconnected",(()=>{this.store.setState({user:null,status:GP.DISCONNECTED})})),this.sessionManager.on("initialized",(()=>{this.store.setState((e=>({status:e.user?GP.CONNECTED:GP.DISCONNECTED})))})),this.inner.on("authenticating",(()=>{this.store.setState({status:GP.AUTHENTICATING})}))}}),this.inner=e,this.store=LP(SP((()=>({user:null,status:GP.INITIALIZING})))),this.sessionManager=new jP({...t,client:this.inner}),this.store=LP(SP((()=>({user:null,status:GP.INITIALIZING})))),this.registerListeners(),this.sessionManager.initialize()}}"undefined"!=typeof process&&null!=process.versions&&process.versions.node;var zP={exports:{}};!function(e,t){var n="undefined"!=typeof self?self:fe,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(n.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function i(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function u(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function d(e){var t=new FileReader,n=u(t);return t.readAsArrayBuffer(e),n}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:n.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:n.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():n.arrayBuffer&&n.blob&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var e=l(this);if(e)return e;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(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,n,r=l(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=u(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},n.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=s(e),t=i(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},c.prototype.delete=function(e){delete this.map[s(e)]},c.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},c.prototype.set=function(e,t){this.map[s(e)]=i(t)},c.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},c.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),o(e)},c.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),o(e)},c.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),o(e)},n.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function f(e,t){var n,r,a=(t=t||{}).body;if(e instanceof f){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new c(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),m.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(a)}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(a))}})),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}f.prototype.clone=function(){return new f(this,{body:this._bodyInit})},h.call(f.prototype),h.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var g=[301,302,303,307,308];b.redirect=function(e,t){if(-1===g.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function w(e,r){return new Promise((function(a,s){var i=new f(e,r);if(i.signal&&i.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function l(){o.abort()}o.onload=function(){var e,t,n={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var a=n.join(":").trim();t.append(r,a)}})),t)};n.url="responseURL"in o?o.responseURL:n.headers.get("X-Request-URL");var r="response"in o?o.response:o.responseText;a(new b(r,n))},o.onerror=function(){s(new TypeError("Network request failed"))},o.ontimeout=function(){s(new TypeError("Network request failed"))},o.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},o.open(i.method,i.url,!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&n.blob&&(o.responseType="blob"),i.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),i.signal&&(i.signal.addEventListener("abort",l),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",l)}),o.send(void 0===i._bodyInit?null:i._bodyInit)}))}w.polyfill=!0,e.fetch||(e.fetch=w,e.Headers=c,e.Request=f,e.Response=b),t.Headers=c,t.Request=f,t.Response=b,t.fetch=w,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var a=r;(t=a.fetch).default=a.fetch,t.fetch=a.fetch,t.Headers=a.Headers,t.Request=a.Request,t.Response=a.Response,e.exports=t}(zP,zP.exports);var $P=ye(zP.exports);const VP=zP.exports.fetch;function qP(e){const t=new Uint8Array(e);let n="";for(const e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}const ZP="copy",WP="convert";function KP(e,t,n){if(t===ZP)return n;if(t===WP)return e(n);if(t instanceof Array)return n.map((n=>KP(e,t[0],n)));if(t instanceof Object){const r={};for(const[a,s]of Object.entries(t)){if(s.derive){const e=s.derive(n);void 0!==e&&(n[a]=e)}if(a in n)null!=n[a]?r[a]=KP(e,s.schema,n[a]):r[a]=null;else if(s.required)throw new Error(`Missing key: ${a}`)}return r}}function JP(e,t){return{required:!0,schema:e,derive:t}}function XP(e){return{required:!0,schema:e}}function YP(e){return{required:!1,schema:e}}const QP={appid:YP(ZP),appidExclude:YP(ZP),credProps:YP(ZP)},eA={type:XP(ZP),id:XP(ZP),rawId:XP(WP),authenticatorAttachment:YP(ZP),response:XP({clientDataJSON:XP(WP),attestationObject:XP(WP),transports:JP(ZP,(e=>e.getTransports?.()||[]))}),clientExtensionResults:JP(QP,(e=>e.getClientExtensionResults()))};function tA(e){return KP(qP,eA,e)}function nA(e){switch(e){case"internal":return"AUTHENTICATOR_TRANSPORT_INTERNAL";case"usb":return"AUTHENTICATOR_TRANSPORT_USB";case"nfc":return"AUTHENTICATOR_TRANSPORT_NFC";case"ble":return"AUTHENTICATOR_TRANSPORT_BLE";case"hybrid":return"AUTHENTICATOR_TRANSPORT_HYBRID";default:throw new Error("unsupported transport format")}}async function rA(e){if(!!!window.PublicKeyCredential)throw new Error("webauthn is not supported by this browser");const t=await async function(e){const t=await navigator.credentials.create(e);return t.toJSON=()=>tA(t),t}(e);return{credentialId:(n=t.toJSON()).rawId,attestationObject:n.response.attestationObject,clientDataJson:n.response.clientDataJSON,transports:n.response.transports.map(nA)};var n}class aA extends Error{constructor(e){let t=`Turnkey error ${e.code}: ${e.message}`;null!=e.details&&(t+=` (Details: ${JSON.stringify(e.details)})`),super(t),this.name="TurnkeyRequestError",this.details=e.details??null,this.code=e.code}}class sA{constructor(e,t){if(this.getActivity=async e=>this.request("/public/v1/query/get_activity",e),this.stampGetActivity=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_activity",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getApiKey=async e=>this.request("/public/v1/query/get_api_key",e),this.stampGetApiKey=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_api_key",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getApiKeys=async e=>this.request("/public/v1/query/get_api_keys",e),this.stampGetApiKeys=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_api_keys",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getAuthenticator=async e=>this.request("/public/v1/query/get_authenticator",e),this.stampGetAuthenticator=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_authenticator",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getAuthenticators=async e=>this.request("/public/v1/query/get_authenticators",e),this.stampGetAuthenticators=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_authenticators",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getOrganization=async e=>this.request("/public/v1/query/get_organization",e),this.stampGetOrganization=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_organization",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getPolicy=async e=>this.request("/public/v1/query/get_policy",e),this.stampGetPolicy=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_policy",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getPrivateKey=async e=>this.request("/public/v1/query/get_private_key",e),this.stampGetPrivateKey=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_private_key",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getUser=async e=>this.request("/public/v1/query/get_user",e),this.stampGetUser=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_user",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getWallet=async e=>this.request("/public/v1/query/get_wallet",e),this.stampGetWallet=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_wallet",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getActivities=async e=>this.request("/public/v1/query/list_activities",e),this.stampGetActivities=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_activities",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getPolicies=async e=>this.request("/public/v1/query/list_policies",e),this.stampGetPolicies=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_policies",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.listPrivateKeyTags=async e=>this.request("/public/v1/query/list_private_key_tags",e),this.stampListPrivateKeyTags=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_private_key_tags",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getPrivateKeys=async e=>this.request("/public/v1/query/list_private_keys",e),this.stampGetPrivateKeys=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_private_keys",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getSubOrgIds=async e=>this.request("/public/v1/query/list_suborgs",e),this.stampGetSubOrgIds=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_suborgs",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.listUserTags=async e=>this.request("/public/v1/query/list_user_tags",e),this.stampListUserTags=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_user_tags",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getUsers=async e=>this.request("/public/v1/query/list_users",e),this.stampGetUsers=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_users",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getWalletAccounts=async e=>this.request("/public/v1/query/list_wallet_accounts",e),this.stampGetWalletAccounts=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_wallet_accounts",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getWallets=async e=>this.request("/public/v1/query/list_wallets",e),this.stampGetWallets=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_wallets",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getWhoami=async e=>this.request("/public/v1/query/whoami",e),this.stampGetWhoami=async e=>{const t=this.config.baseUrl+"/public/v1/query/whoami",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.approveActivity=async e=>this.request("/public/v1/submit/approve_activity",e),this.stampApproveActivity=async e=>{const t=this.config.baseUrl+"/public/v1/submit/approve_activity",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createApiKeys=async e=>this.request("/public/v1/submit/create_api_keys",e),this.stampCreateApiKeys=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_api_keys",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createApiOnlyUsers=async e=>this.request("/public/v1/submit/create_api_only_users",e),this.stampCreateApiOnlyUsers=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_api_only_users",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createAuthenticators=async e=>this.request("/public/v1/submit/create_authenticators",e),this.stampCreateAuthenticators=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_authenticators",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createInvitations=async e=>this.request("/public/v1/submit/create_invitations",e),this.stampCreateInvitations=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_invitations",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createPolicy=async e=>this.request("/public/v1/submit/create_policy",e),this.stampCreatePolicy=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_policy",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createPrivateKeyTag=async e=>this.request("/public/v1/submit/create_private_key_tag",e),this.stampCreatePrivateKeyTag=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_private_key_tag",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createPrivateKeys=async e=>this.request("/public/v1/submit/create_private_keys",e),this.stampCreatePrivateKeys=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_private_keys",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createSubOrganization=async e=>this.request("/public/v1/submit/create_sub_organization",e),this.stampCreateSubOrganization=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_sub_organization",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createUserTag=async e=>this.request("/public/v1/submit/create_user_tag",e),this.stampCreateUserTag=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_user_tag",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createUsers=async e=>this.request("/public/v1/submit/create_users",e),this.stampCreateUsers=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_users",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createWallet=async e=>this.request("/public/v1/submit/create_wallet",e),this.stampCreateWallet=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_wallet",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createWalletAccounts=async e=>this.request("/public/v1/submit/create_wallet_accounts",e),this.stampCreateWalletAccounts=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_wallet_accounts",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deleteApiKeys=async e=>this.request("/public/v1/submit/delete_api_keys",e),this.stampDeleteApiKeys=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_api_keys",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deleteAuthenticators=async e=>this.request("/public/v1/submit/delete_authenticators",e),this.stampDeleteAuthenticators=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_authenticators",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deleteInvitation=async e=>this.request("/public/v1/submit/delete_invitation",e),this.stampDeleteInvitation=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_invitation",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deletePolicy=async e=>this.request("/public/v1/submit/delete_policy",e),this.stampDeletePolicy=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_policy",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deletePrivateKeyTags=async e=>this.request("/public/v1/submit/delete_private_key_tags",e),this.stampDeletePrivateKeyTags=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_private_key_tags",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deleteUserTags=async e=>this.request("/public/v1/submit/delete_user_tags",e),this.stampDeleteUserTags=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_user_tags",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deleteUsers=async e=>this.request("/public/v1/submit/delete_users",e),this.stampDeleteUsers=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_users",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.emailAuth=async e=>this.request("/public/v1/submit/email_auth",e),this.stampEmailAuth=async e=>{const t=this.config.baseUrl+"/public/v1/submit/email_auth",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.exportPrivateKey=async e=>this.request("/public/v1/submit/export_private_key",e),this.stampExportPrivateKey=async e=>{const t=this.config.baseUrl+"/public/v1/submit/export_private_key",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.exportWallet=async e=>this.request("/public/v1/submit/export_wallet",e),this.stampExportWallet=async e=>{const t=this.config.baseUrl+"/public/v1/submit/export_wallet",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.exportWalletAccount=async e=>this.request("/public/v1/submit/export_wallet_account",e),this.stampExportWalletAccount=async e=>{const t=this.config.baseUrl+"/public/v1/submit/export_wallet_account",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.importPrivateKey=async e=>this.request("/public/v1/submit/import_private_key",e),this.stampImportPrivateKey=async e=>{const t=this.config.baseUrl+"/public/v1/submit/import_private_key",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.importWallet=async e=>this.request("/public/v1/submit/import_wallet",e),this.stampImportWallet=async e=>{const t=this.config.baseUrl+"/public/v1/submit/import_wallet",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.initImportPrivateKey=async e=>this.request("/public/v1/submit/init_import_private_key",e),this.stampInitImportPrivateKey=async e=>{const t=this.config.baseUrl+"/public/v1/submit/init_import_private_key",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.initImportWallet=async e=>this.request("/public/v1/submit/init_import_wallet",e),this.stampInitImportWallet=async e=>{const t=this.config.baseUrl+"/public/v1/submit/init_import_wallet",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.initUserEmailRecovery=async e=>this.request("/public/v1/submit/init_user_email_recovery",e),this.stampInitUserEmailRecovery=async e=>{const t=this.config.baseUrl+"/public/v1/submit/init_user_email_recovery",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.recoverUser=async e=>this.request("/public/v1/submit/recover_user",e),this.stampRecoverUser=async e=>{const t=this.config.baseUrl+"/public/v1/submit/recover_user",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.rejectActivity=async e=>this.request("/public/v1/submit/reject_activity",e),this.stampRejectActivity=async e=>{const t=this.config.baseUrl+"/public/v1/submit/reject_activity",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.removeOrganizationFeature=async e=>this.request("/public/v1/submit/remove_organization_feature",e),this.stampRemoveOrganizationFeature=async e=>{const t=this.config.baseUrl+"/public/v1/submit/remove_organization_feature",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.setOrganizationFeature=async e=>this.request("/public/v1/submit/set_organization_feature",e),this.stampSetOrganizationFeature=async e=>{const t=this.config.baseUrl+"/public/v1/submit/set_organization_feature",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.signRawPayload=async e=>this.request("/public/v1/submit/sign_raw_payload",e),this.stampSignRawPayload=async e=>{const t=this.config.baseUrl+"/public/v1/submit/sign_raw_payload",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.signTransaction=async e=>this.request("/public/v1/submit/sign_transaction",e),this.stampSignTransaction=async e=>{const t=this.config.baseUrl+"/public/v1/submit/sign_transaction",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.updatePolicy=async e=>this.request("/public/v1/submit/update_policy",e),this.stampUpdatePolicy=async e=>{const t=this.config.baseUrl+"/public/v1/submit/update_policy",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.updatePrivateKeyTag=async e=>this.request("/public/v1/submit/update_private_key_tag",e),this.stampUpdatePrivateKeyTag=async e=>{const t=this.config.baseUrl+"/public/v1/submit/update_private_key_tag",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.updateRootQuorum=async e=>this.request("/public/v1/submit/update_root_quorum",e),this.stampUpdateRootQuorum=async e=>{const t=this.config.baseUrl+"/public/v1/submit/update_root_quorum",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.updateUser=async e=>this.request("/public/v1/submit/update_user",e),this.stampUpdateUser=async e=>{const t=this.config.baseUrl+"/public/v1/submit/update_user",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.updateUserTag=async e=>this.request("/public/v1/submit/update_user_tag",e),this.stampUpdateUserTag=async e=>{const t=this.config.baseUrl+"/public/v1/submit/update_user_tag",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},!e.baseUrl)throw new Error("Missing base URL. Please verify env vars.");this.config=e,this.stamper=t}async request(e,t){const n=this.config.baseUrl+e,r=JSON.stringify(t),a=await this.stamper.stamp(r),s=await VP(n,{method:"POST",headers:{[a.stampHeaderName]:a.stampHeaderValue,"X-Client-Version":"@turnkey/http@2.9.0"},body:r,redirect:"follow"});if(!s.ok){let e;try{e=await s.json()}catch(e){throw new Error(`${s.status} ${s.statusText}`)}throw new aA(e)}return await s.json()}}var iA;!function(e){e.PublicKeyReady="PUBLIC_KEY_READY",e.InjectCredentialBundle="INJECT_CREDENTIAL_BUNDLE",e.InjectKeyExportBundle="INJECT_KEY_EXPORT_BUNDLE",e.InjectWalletExportBundle="INJECT_WALLET_EXPORT_BUNDLE",e.InjectImportBundle="INJECT_IMPORT_BUNDLE",e.ExtractWalletEncryptedBundle="EXTRACT_WALLET_ENCRYPTED_BUNDLE",e.BundleInjected="BUNDLE_INJECTED",e.EncryptedBundleExtracted="ENCRYPTED_BUNDLE_EXTRACTED",e.StampRequest="STAMP_REQUEST",e.Stamp="STAMP",e.Error="ERROR"}(iA||(iA={}));class oA{constructor(e){if("undefined"==typeof window)throw new Error("Cannot initialize iframe in non-browser environment");if(!e.iframeContainer)throw new Error("Iframe container cannot be found");if(this.container=e.iframeContainer,this.container.querySelector(`#${e.iframeElementId}`))throw new Error(`Iframe element with ID ${e.iframeElementId} already exists`);let t=window.document.createElement("iframe");t.id=e.iframeElementId,t.src=e.iframeUrl,this.iframe=t;const n=new URL(e.iframeUrl);this.iframeOrigin=n.origin,this.iframePublicKey=null}async init(){return this.container.appendChild(this.iframe),new Promise(((e,t)=>{window.addEventListener("message",(t=>{t.origin===this.iframeOrigin&&t.data?.type===iA.PublicKeyReady&&(this.iframePublicKey=t.data.value,e(t.data.value))}),!1)}))}clear(){this.iframe.remove()}publicKey(){return this.iframePublicKey}async injectCredentialBundle(e){return new Promise(((t,n)=>{this.iframe.contentWindow?.postMessage({type:iA.InjectCredentialBundle,value:e},"*"),window.addEventListener("message",(e=>{e.origin===this.iframeOrigin&&(e.data?.type===iA.BundleInjected&&t(e.data.value),e.data?.type===iA.Error&&n(e.data.value))}),!1)}))}async injectKeyExportBundle(e){return this.iframe.contentWindow?.postMessage({type:iA.InjectKeyExportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===iA.BundleInjected&&e(n.data.value),n.data?.type===iA.Error&&t(n.data.value))}),!1)}))}async injectWalletExportBundle(e){return this.iframe.contentWindow?.postMessage({type:iA.InjectWalletExportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===iA.BundleInjected&&e(n.data.value),n.data?.type===iA.Error&&t(n.data.value))}),!1)}))}async injectImportBundle(e){return this.iframe.contentWindow?.postMessage({type:iA.InjectImportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===iA.BundleInjected&&e(n.data.value),n.data?.type===iA.Error&&t(n.data.value))}),!1)}))}async extractWalletEncryptedBundle(){return this.iframe.contentWindow?.postMessage({type:iA.ExtractWalletEncryptedBundle},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===iA.EncryptedBundleExtracted&&e(n.data.value),n.data?.type===iA.Error&&t(n.data.value))}),!1)}))}async stamp(e){if(null===this.iframePublicKey)throw new Error("null iframe public key. Have you called/awaited .init()?");const t=this.iframeOrigin;return this.iframe.contentWindow?.postMessage({type:iA.StampRequest,value:e},"*"),new Promise((function(e,n){window.addEventListener("message",(r=>{r.origin===t&&(r.data?.type===iA.Stamp&&e({stampHeaderName:"X-Stamp",stampHeaderValue:r.data.value}),r.data?.type===iA.Error&&n(r.data.value))}),!1)}))}}function cA(e){const t=new Uint8Array(e);let n="";for(const e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}const lA="copy",uA="convert";function dA(e,t,n){if(t===lA)return n;if(t===uA)return e(n);if(t instanceof Array)return n.map((n=>dA(e,t[0],n)));if(t instanceof Object){const r={};for(const[a,s]of Object.entries(t)){if(s.derive){const e=s.derive(n);void 0!==e&&(n[a]=e)}if(a in n)null!=n[a]?r[a]=dA(e,s.schema,n[a]):r[a]=null;else if(s.required)throw new Error(`Missing key: ${a}`)}return r}}function pA(e){return{required:!0,schema:e}}function hA(e){return{required:!1,schema:e}}const mA={appid:hA(lA),appidExclude:hA(lA),credProps:hA(lA)},fA={type:pA(lA),id:pA(lA),rawId:pA(uA),authenticatorAttachment:hA(lA),response:pA({clientDataJSON:pA(uA),authenticatorData:pA(uA),signature:pA(uA),userHandle:pA(uA)}),clientExtensionResults:(yA=mA,bA=e=>e.getClientExtensionResults(),{required:!0,schema:yA,derive:bA})};var yA,bA;function gA(e){return dA(cA,fA,e)}let wA;function vA(e,...t){if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function CA(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")}wA=void 0!==globalThis?.Buffer?globalThis.Buffer:b;
26
+ function ak(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function o(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}c((r=r.apply(e,t||[])).next())}))}function sk(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ik(e){return this instanceof ik?(this.v=e,this):new ik(e)}function ok(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,a=n.apply(e,t||[]),s=[];return r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r;function i(e){a[e]&&(r[e]=function(t){return new Promise((function(n,r){s.push([e,t,n,r])>1||o(e,t)}))})}function o(e,t){try{!function(e){e.value instanceof ik?Promise.resolve(e.value.v).then(c,l):u(s[0][2],e)}(a[e](t))}catch(e){u(s[0][3],e)}}function c(e){o("next",e)}function l(e){o("throw",e)}function u(e,t){e(t),s.shift(),s.length&&o(s[0][0],s[0][1])}}function ck(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=sk(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,a){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,a,(t=e[n](t)).done,t.value)}))}}}!function(e){e.ETH_MAINNET="eth-mainnet",e.ETH_GOERLI="eth-goerli",e.ETH_SEPOLIA="eth-sepolia",e.OPT_MAINNET="opt-mainnet",e.OPT_GOERLI="opt-goerli",e.OPT_SEPOLIA="opt-sepolia",e.ARB_MAINNET="arb-mainnet",e.ARB_GOERLI="arb-goerli",e.ARB_SEPOLIA="arb-sepolia",e.MATIC_MAINNET="polygon-mainnet",e.MATIC_MUMBAI="polygon-mumbai",e.MATIC_AMOY="polygon-amoy",e.ASTAR_MAINNET="astar-mainnet",e.POLYGONZKEVM_MAINNET="polygonzkevm-mainnet",e.POLYGONZKEVM_TESTNET="polygonzkevm-testnet",e.BASE_MAINNET="base-mainnet",e.BASE_GOERLI="base-goerli",e.BASE_SEPOLIA="base-sepolia"}(Mx||(Mx={})),function(e){e.DEFAULT_TOKENS="DEFAULT_TOKENS",e.ERC20="erc20"}(Ix||(Ix={})),function(e){e.EXTERNAL="external",e.INTERNAL="internal",e.ERC20="erc20",e.ERC721="erc721",e.ERC1155="erc1155",e.SPECIALNFT="specialnft"}(Nx||(Nx={})),function(e){e.TO="TO",e.FROM="FROM"}(Ux||(Ux={})),function(e){e.ASCENDING="asc",e.DESCENDING="desc"}(Lx||(Lx={})),function(e){e.VERIFIED="verified",e.APPROVED="approved",e.REQUESTED="requested",e.NOT_REQUESTED="not_requested"}(Bx||(Bx={})),function(e){e.PENDING_TRANSACTIONS="alchemy_pendingTransactions",e.MINED_TRANSACTIONS="alchemy_minedTransactions"}(Rx||(Rx={})),function(e){e.NATIVE="NATIVE",e.ERC20="ERC20",e.ERC721="ERC721",e.ERC1155="ERC1155",e.SPECIAL_NFT="SPECIAL_NFT"}(jx||(jx={})),function(e){e.APPROVE="APPROVE",e.TRANSFER="TRANSFER"}(Gx||(Gx={})),function(e){e.ETHERSCAN="ETHERSCAN"}(Hx||(Hx={})),function(e){e.CREATE="CREATE",e.CALL="CALL",e.STATICCALL="STATICCALL",e.DELEGATECALL="DELEGATECALL"}(zx||(zx={})),function(e){e.UNSPECIFIED="TRANSACTION_JOB_STATUS_UNSPECIFIED",e.IN_PROGRESS="IN_PROGRESS",e.COMPLETE="COMPLETE",e.ABANDONED="ABANDONED"}($x||($x={})),function(e){e.V1="V1",e.V2="V2"}(Vx||(Vx={})),function(e){e.MINED_TRANSACTION="MINED_TRANSACTION",e.DROPPED_TRANSACTION="DROPPED_TRANSACTION",e.ADDRESS_ACTIVITY="ADDRESS_ACTIVITY",e.NFT_ACTIVITY="NFT_ACTIVITY",e.NFT_METADATA_UPDATE="NFT_METADATA_UPDATE",e.GRAPHQL="GRAPHQL"}(qx||(qx={})),function(e){e.PENDING="pending",e.LATEST="latest",e.SAFE="safe",e.FINALIZED="finalized",e.EARLIEST="earliest"}(Zx||(Zx={})),function(e){e.CALL_TRACER="callTracer",e.PRESTATE_TRACER="prestateTracer"}(Wx||(Wx={})),function(e){e.ERC721="ERC721",e.ERC1155="ERC1155",e.NO_SUPPORTED_NFT_STANDARD="NO_SUPPORTED_NFT_STANDARD",e.NOT_A_CONTRACT="NOT_A_CONTRACT",e.UNKNOWN="UNKNOWN"}(Kx||(Kx={})),function(e){e.Erc721TooManyOwners="Erc721TooManyOwners",e.Erc721TooManyTokens="Erc721TooManyTokens",e.Erc721DishonestTotalSupply="Erc721DishonestTotalSupply",e.MostlyHoneyPotOwners="MostlyHoneyPotOwners",e.OwnedByMostHoneyPots="OwnedByMostHoneyPots",e.LowDistinctOwnersPercent="LowDistinctOwnersPercent",e.HighHoneyPotOwnerPercent="HighHoneyPotOwnerPercent",e.HighHoneyPotPercent="HighHoneyPotPercent",e.HoneyPotsOwnMultipleTokens="HoneyPotsOwnMultipleTokens",e.NoSalesActivity="NoSalesActivity",e.HighAirdropPercent="HighAirdropPercent",e.Unknown="Unknown"}(Jx||(Jx={})),function(e){e.SPAM="SPAM",e.AIRDROPS="AIRDROPS"}(Xx||(Xx={})),function(e){e.TRANSFERTIME="TRANSFERTIME"}(Yx||(Yx={})),function(e){e.SEAPORT="seaport",e.LOOKSRARE="looksrare",e.X2Y2="x2y2",e.WYVERN="wyvern",e.CRYPTOPUNKS="cryptopunks",e.BLUR="blur",e.UNKNOWN="unknown"}(Qx||(Qx={})),function(e){e.BUYER="buyer",e.SELLER="seller"}(ek||(ek={})),function(e){e.DOES_NOT_EXIST="does_not_exist",e.ALREADY_QUEUED="already_queued",e.IN_PROGRESS="in_progress",e.FINISHED="finished",e.QUEUED="queued",e.QUEUE_FAILED="queue_failed"}(tk||(tk={})),function(e){e.OPENSEA="OpenSea"}(nk||(nk={}));const lk="demo",uk=Mx.ETH_MAINNET;function dk(e,t){return`https://${e}.g.alchemy.com/v2/${t}`}function pk(e,t){return`wss://${e}.g.alchemy.com/v2/${t}`}var hk;!function(e){e[e.BASE=0]="BASE",e[e.NFT=1]="NFT",e[e.WEBHOOK=2]="WEBHOOK"}(hk||(hk={}));const mk={[Mx.ETH_MAINNET]:"mainnet",[Mx.ETH_GOERLI]:"goerli",[Mx.ETH_SEPOLIA]:"sepolia",[Mx.OPT_MAINNET]:"optimism",[Mx.OPT_GOERLI]:"optimism-goerli",[Mx.OPT_SEPOLIA]:"optimism-sepolia",[Mx.ARB_MAINNET]:"arbitrum",[Mx.ARB_GOERLI]:"arbitrum-goerli",[Mx.ARB_SEPOLIA]:"arbitrum-sepolia",[Mx.MATIC_MAINNET]:"matic",[Mx.MATIC_MUMBAI]:"maticmum",[Mx.MATIC_AMOY]:"maticamoy",[Mx.ASTAR_MAINNET]:"astar-mainnet",[Mx.POLYGONZKEVM_MAINNET]:"polygonzkevm-mainnet",[Mx.POLYGONZKEVM_TESTNET]:"polygonzkevm-testnet",[Mx.BASE_MAINNET]:"base-mainnet",[Mx.BASE_GOERLI]:"base-goerli",[Mx.BASE_SEPOLIA]:"base-sepolia"},fk={"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},"arbitrum-sepolia":{chainId:421614,name:"arbitrum-sepolia"},"astar-mainnet":{chainId:592,name:"astar-mainnet"},sepolia:{chainId:11155111,name:"sepolia"},"optimism-sepolia":{chainId:11155420,name:"optimism-sepolia"},"polygonzkevm-mainnet":{chainId:1101,name:"polygonzkevm-mainnet"},"polygonzkevm-testnet":{chainId:1442,name:"polygonzkevm-testnet"},"base-mainnet":{chainId:8453,name:"base-mainnet"},"base-goerli":{chainId:84531,name:"base-goerli"},"base-sepolia":{chainId:84532,name:"base-sepolia"},maticamoy:{chainId:80002,name:"maticamoy"}};function yk(){}class bk{constructor(e){this.apiKey=(null==e?void 0:e.apiKey)||lk,this.network=(null==e?void 0:e.network)||uk,this.maxRetries=(null==e?void 0:e.maxRetries)||5,this.url=null==e?void 0:e.url,this.authToken=null==e?void 0:e.authToken,this.batchRequests=(null==e?void 0:e.batchRequests)||!1,this.requestTimeout=(null==e?void 0:e.requestTimeout)||0}_getRequestUrl(e){return void 0!==this.url?this.url:e===hk.NFT?(t=this.network,n=this.apiKey,`https://${t}.g.alchemy.com/nft/v3/${n}`):e===hk.WEBHOOK?"https://dashboard.alchemy.com/api":dk(this.network,this.apiKey);var t,n}getProvider(){return this._baseAlchemyProvider||(this._baseAlchemyProvider=(()=>ak(this,void 0,void 0,(function*(){const{AlchemyProvider:e}=yield import("./alchemy-provider-5870b6fa-1d4efe84.js").then((function(e){return e.a}));return new e(this)})))()),this._baseAlchemyProvider}getWebSocketProvider(){return this._baseAlchemyWssProvider||(this._baseAlchemyWssProvider=(()=>ak(this,void 0,void 0,(function*(){const{AlchemyWebSocketProvider:e}=yield import("./alchemy-websocket-provider-213da986-d5cf3f6a.js");return new e(this)})))()),this._baseAlchemyWssProvider}}let gk=!1,wk=!1;const vk={debug:1,default:2,info:2,warning:3,error:4,off:5};let Ck=vk.default,Ek=null;const xk=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var kk,Tk;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(kk||(kk={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(Tk||(Tk={}));const Pk="0123456789abcdef";class Ak{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==vk[n]&&this.throwArgumentError("invalid log level name","logLevel",e),Ck>vk[n]||console.log.apply(console,t)}debug(...e){this._log(Ak.levels.DEBUG,e)}info(...e){this._log(Ak.levels.INFO,e)}warn(...e){this._log(Ak.levels.WARNING,e)}makeError(e,t,n){if(wk)return this.makeError("censored error",t,{});t||(t=Ak.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=Pk[t[e]>>4],n+=Pk[15&t[e]];r.push(e+"=Uint8Array(0x"+n+")")}else r.push(e+"="+JSON.stringify(t))}catch(t){r.push(e+"="+JSON.stringify(n[e].toString()))}})),r.push(`code=${t}`),r.push(`version=${this.version}`);const a=e;let s="";switch(t){case Tk.NUMERIC_FAULT:{s="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":s+="-"+t;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case Tk.CALL_EXCEPTION:case Tk.INSUFFICIENT_FUNDS:case Tk.MISSING_NEW:case Tk.NONCE_EXPIRED:case Tk.REPLACEMENT_UNDERPRICED:case Tk.TRANSACTION_REPLACED:case Tk.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const i=new Error(e);return i.reason=a,i.code=t,Object.keys(n).forEach((function(e){i[e]=n[e]})),i}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,Ak.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(e){xk&&this.throwError("platform missing String.prototype.normalize",Ak.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:xk})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,Ak.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,Ak.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,Ak.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,Ak.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",Ak.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",Ak.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",Ak.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Ek||(Ek=new Ak("logger/5.7.0")),Ek}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Ak.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),gk){if(!e)return;this.globalLogger().throwError("error censorship permanent",Ak.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}wk=!!e,gk=!!t}static setLogLevel(e){const t=vk[e.toLowerCase()];null!=t?Ck=t:Ak.globalLogger().warn("invalid log level - "+e)}static from(e){return new Ak(e)}}Ak.errors=Tk,Ak.levels=kk;var _k=function(e,t,n,r){return new(n||(n=Promise))((function(a,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function o(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}c((r=r.apply(e,t||[])).next())}))};const Dk=new Ak("properties/5.7.0");function Fk(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function Ok(e){return _k(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}const Sk={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Mk(e){if(null==e||Sk[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let n=0;n<t.length;n++){let r=null;try{r=e[t[n]]}catch(e){continue}if(!Mk(r))return!1}return!0}return Dk.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Ik(e){if(Mk(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>Nk(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&Fk(t,n,Nk(r))}return t}return Dk.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Nk(e){return Ik(e)}function Uk(e){return xC.from(e).toNumber()}function Lk(e){return xC.from(e).toHexString()}function Bk(e){return"string"==typeof e?e:Number.isInteger(e)?Lk(e):e.toString()}function Rk(e,t){return Object.values(t).includes(e)?e:null}function jk(e){return Jk(Object.assign(Object.assign({},Gk(e)),{displayNft:e.displayNft,image:e.image,totalBalance:e.totalBalance,numDistinctTokensOwned:e.numDistinctTokensOwned,isSpam:e.isSpam}))}function Gk(e){return Jk(Object.assign(Object.assign({},e),{tokenType:Wk(e.tokenType),openSeaMetadata:Object.assign(Object.assign({},e.openSeaMetadata),{safelistRequestStatus:null!==e.openSeaMetadata.safelistRequestStatus?Rk(e.openSeaMetadata.safelistRequestStatus,Bx):null})}))}function Hk(e,t){return{contractAddress:t||e.contractAddress,tokenId:e.tokenId}}function zk(e){return Jk(Object.assign(Object.assign({},e),{contract:(t=e.contract,Jk(Object.assign(Object.assign({},Gk(t)),{spamClassifications:t.spamClassifications.map(Zk)}))),tokenType:Wk(e.tokenType),acquiredAt:e.acquiredAt,collection:e.collection,mint:e.mint}));var t}function $k(e){switch(e){case"looksrare":return Qx.LOOKSRARE;case"seaport":return Qx.SEAPORT;case"x2y2":return Qx.X2Y2;case"wyvern":return Qx.WYVERN;case"cryptopunks":return Qx.CRYPTOPUNKS;case"blur":return Qx.BLUR;default:return Qx.UNKNOWN}}function Vk(e){if("OpenSea"===e)return nk.OPENSEA}function qk(e){switch(e.toLowerCase()){case"buyer":return ek.BUYER;case"seller":return ek.SELLER;default:throw new Error(`Unsupported NftSaleTakerType ${e}`)}}function Zk(e){const t=Rk(e,Jx);return null==t?Jx.Unknown:t}function Wk(e){switch(e){case"erc721":case"ERC721":return Kx.ERC721;case"erc1155":case"ERC1155":return Kx.ERC1155;case"no_supported_nft_standard":case"NO_SUPPORTED_NFT_STANDARD":return Kx.NO_SUPPORTED_NFT_STANDARD;case"not_a_contract":case"NOT_A_CONTRACT":return Kx.NOT_A_CONTRACT;default:return Kx.UNKNOWN}}const Kk="undefined"!=typeof window&&null!==window;function Jk(e){if(null!=e){if("Object"===e.constructor.name||Array.isArray(e))for(const t in e)e[t]=Jk(e[t]);return e}}function Xk(e,t,n="getAssetTransfers"){return ak(this,void 0,void 0,(function*(){const r=yield e.getProvider();return t.fromAddress&&(t.fromAddress=yield r._getAddress(t.fromAddress)),t.toAddress&&(t.toAddress=yield r._getAddress(t.toAddress)),r._send("alchemy_getAssetTransfers",[Object.assign(Object.assign({},t),{fromBlock:null!=t.fromBlock?Bk(t.fromBlock):void 0,toBlock:null!=t.toBlock?Bk(t.toBlock):void 0,maxCount:null!=t.maxCount?Lk(t.maxCount):void 0})],n)}))}function Yk(e,t,n="getTransactionReceipts"){return ak(this,void 0,void 0,(function*(){return(yield e.getProvider())._send("alchemy_getTransactionReceipts",[t],n)}))}function Qk(e,t){return ak(this,void 0,void 0,(function*(){const n=yield e.getProvider();yield n.getNetwork();const r=yield Ok({filter:eT(e,t)}),a=yield n.send("eth_getLogs",[r.filter]);return a.forEach((e=>{null==e.removed&&(e.removed=!1)})),(s=n.formatter.filterLog.bind(n.formatter),function(e){if(!Array.isArray(e))throw new Error("not an array");const t=[];return e.forEach((e=>{t.push(s(e))})),t})(a);var s}))}function eT(e,t){return ak(this,void 0,void 0,(function*(){const n=yield e.getProvider(),r=yield t;let a={};return["blockHash","topics"].forEach((e=>{null!=r[e]&&(a[e]=r[e])})),["fromBlock","toBlock"].forEach((e=>{null!=r[e]&&(a[e]=n._getBlockTag(r[e]))})),a=n.formatter.filter(yield Ok(a)),Array.isArray(r.address)?a.address=yield Promise.all(r.address.map((e=>ak(this,void 0,void 0,(function*(){return n._getAddress(e)}))))):null!=r.address&&(a.address=yield n._getAddress(r.address)),a}))}class tT{constructor(e){this.config=e}getBalance(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBalance(e,t)}))}isContractAddress(e){return ak(this,void 0,void 0,(function*(){const t=yield this.config.getProvider();return"0x"!==(yield t.getCode(e))}))}getCode(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getCode(e,t)}))}getStorageAt(e,t,n){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getStorageAt(e,t,n)}))}getTransactionCount(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransactionCount(e,t)}))}getBlock(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlock(e)}))}getBlockWithTransactions(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlockWithTransactions(e)}))}getNetwork(){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getNetwork()}))}getBlockNumber(){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlockNumber()}))}getGasPrice(){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getGasPrice()}))}getFeeData(){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getFeeData()}))}ready(){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).ready}))}call(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).call(e,t)}))}estimateGas(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).estimateGas(e)}))}getTransaction(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransaction(e)}))}getTransactionReceipt(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransactionReceipt(e)}))}sendTransaction(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).sendTransaction(e)}))}waitForTransaction(e,t,n){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).waitForTransaction(e,t,n)}))}getLogs(e){return ak(this,void 0,void 0,(function*(){return Qk(this.config,e)}))}send(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).send(e,t)}))}findContractDeployer(e){var t;return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=yield n.getBlockNumber();if("0x"===(yield n.getCode(e,r)))throw new Error(`Contract '${e}' does not exist`);const a=yield nT(0,r+1,e,this.config),s=yield Yk(this.config,{blockNumber:Lk(a)},"findContractDeployer"),i=null===(t=s.receipts)||void 0===t?void 0:t.find((t=>t.contractAddress===e.toLowerCase()));return{deployerAddress:null==i?void 0:i.from,blockNumber:a}}))}getTokenBalances(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=yield n._getAddress(e);if(Array.isArray(t)){if(t.length>1500)throw new Error("You cannot pass in more than 1500 contract addresses to getTokenBalances()");if(0===t.length)throw new Error("getTokenBalances() requires at least one contractAddress when using an array");return n._send("alchemy_getTokenBalances",[r,t],"getTokenBalances")}{const e=[r,void 0===t?Ix.ERC20:t.type];return(null==t?void 0:t.type)===Ix.ERC20&&t.pageKey&&e.push({pageKey:t.pageKey}),n._send("alchemy_getTokenBalances",e,"getTokenBalances")}}))}getTokensForOwner(e,t){var n;return ak(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[yield r._getAddress(e),null!==(n=null==t?void 0:t.contractAddresses)&&void 0!==n?n:Ix.ERC20];(null==t?void 0:t.pageKey)&&a.push({pageKey:t.pageKey});const s=yield r._send("alchemy_getTokenBalances",a,"getTokensForOwner"),i=s.tokenBalances.map((e=>({contractAddress:e.contractAddress,rawBalance:xC.from(e.tokenBalance).toString()}))),o=(yield Promise.allSettled(s.tokenBalances.map((e=>r._send("alchemy_getTokenMetadata",[e.contractAddress],"getTokensForOwner",!0))))).map((e=>"fulfilled"===e.status?e.value:{name:null,symbol:null,decimals:null,logo:null})),c=i.map(((e,t)=>Object.assign(Object.assign(Object.assign({},e),o[t]),{balance:null!==o[t].decimals?$C(e.rawBalance,o[t].decimals):void 0})));return{tokens:c.map((e=>Jk(e))),pageKey:s.pageKey}}))}getTokenMetadata(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_getTokenMetadata",[e],"getTokenMetadata")}))}getAssetTransfers(e){return ak(this,void 0,void 0,(function*(){return Xk(this.config,e)}))}getTransactionReceipts(e){return ak(this,void 0,void 0,(function*(){return Yk(this.config,e)}))}resolveName(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).resolveName(e)}))}lookupAddress(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).lookupAddress(e)}))}}function nT(e,t,n,r){return ak(this,void 0,void 0,(function*(){if(e>=t)return t;const a=Math.floor((e+t)/2),s=yield r.getProvider();return"0x"===(yield s.getCode(n,a))?nT(a+1,t,n,r):nT(e,a,n,r)}))}class rT{constructor(e){this.config=e}traceCall(e,t,n){return ak(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[e,t,aT(n)];return r._send("debug_traceCall",a,"traceCall")}))}traceTransaction(e,t,n){return ak(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[e,aT(t,n)];return r._send("debug_traceTransaction",a,"traceTransaction")}))}traceBlock(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider();let r,a;if(c(e,32))r="debug_traceBlockByHash",a=[e,aT(t)];else{r="debug_traceBlockByNumber";a=["number"==typeof e?u(d(e)):e,aT(t)]}return n._send(r,a,"traceBlock")}))}}function aT(e,t){return Object.assign({tracer:e.type},void 0!==e.onlyTopCall&&{tracerConfig:{onlyTopCall:e.onlyTopCall,timeout:t}})}function sT(e){if(e===Kx.ERC1155||e===Kx.ERC721)return e}var iT;!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.SILENT=4]="SILENT"}(iT||(iT={})),iT.DEBUG,iT.INFO,iT.WARN,iT.ERROR,iT.SILENT;const oT={[iT.DEBUG]:"log",[iT.INFO]:"info",[iT.WARN]:"warn",[iT.ERROR]:"error"},cT=iT.INFO;function lT(e,...t){hT.debug(e,t)}function uT(e,...t){hT.info(e,t)}function dT(e,...t){hT.warn(e,t)}function pT(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return e}}const hT=new class{constructor(){this._logLevel=cT}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in iT))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}debug(...e){this._log(iT.DEBUG,...e)}info(...e){this._log(iT.INFO,...e)}warn(...e){this._log(iT.WARN,...e)}error(...e){this._log(iT.ERROR,...e)}_log(e,...t){if(e<this._logLevel)return;const n=(new Date).toISOString(),r=oT[e];if(!r)throw new Error(`Logger received an invalid logLevel (value: ${e})`);console[r](`[${n}] Alchemy:`,...t.map(pT))}},mT="3.2.0";function fT(e,t,n,r,a){var s;const i=e+"/"+t,o=Object.assign(Object.assign({},a),{headers:Object.assign(Object.assign(Object.assign({},null==a?void 0:a.headers),!Kk&&{"Accept-Encoding":"gzip"}),{"Alchemy-Ethers-Sdk-Version":mT,"Alchemy-Ethers-Sdk-Method":n}),method:null!==(s=null==a?void 0:a.method)&&void 0!==s?s:"GET",url:i,params:r});return rk(o)}class yT{constructor(e=5){this.maxAttempts=e,this.initialDelayMs=1e3,this.backoffMultiplier=1.5,this.maxDelayMs=3e4,this.numAttempts=0,this.currentDelayMs=0,this.isInBackoff=!1}backoff(){if(this.numAttempts>=this.maxAttempts)return Promise.reject(new Error(`Exceeded maximum number of attempts: ${this.maxAttempts}`));if(this.isInBackoff)return Promise.reject(new Error("A backoff operation is already in progress"));const e=this.withJitterMs(this.currentDelayMs);return e>0&&lT("ExponentialBackoff.backoff",`Backing off for ${e}ms`),this.currentDelayMs*=this.backoffMultiplier,this.currentDelayMs=Math.max(this.currentDelayMs,this.initialDelayMs),this.currentDelayMs=Math.min(this.currentDelayMs,this.maxDelayMs),this.numAttempts+=1,new Promise((t=>{this.isInBackoff=!0,setTimeout((()=>{this.isInBackoff=!1,t()}),e)}))}withJitterMs(e){return Math.min(e+(Math.random()-.5)*e,this.maxDelayMs)}}function bT(e,t,n,r,a,s){return ak(this,void 0,void 0,(function*(){let i;const o=new yT(e.maxRetries);for(let c=0;c<e.maxRetries+1;c++)try{void 0!==i&&uT("requestHttp",`Retrying after error: ${i.message}`);try{yield o.backoff()}catch(e){break}const c=yield fT(e._getRequestUrl(t),n,r,a,Object.assign(Object.assign({},s),{timeout:e.requestTimeout}));if(200===c.status)return lT(n,`Successful request: ${n}`),c.data;uT(n,`Request failed: ${n}, ${c.status}, ${c.data}`),i=new Error(c.status+": "+c.data)}catch(e){if(!rk.isAxiosError(e)||void 0===e.response)throw e;if(i=new Error(e.response.status+": "+e.response.data),!gT(e,t))break}return Promise.reject(i)}))}function gT(e,t){const n=t===hk.WEBHOOK?[429,500]:[429];return void 0!==e.response&&n.includes(e.response.status)}function wT(e,t,n,r,a,s,i){return ok(this,arguments,(function*(){let o=!0;const c=Object.assign({},i);for(;o;){const i=yield ik(bT(e,t,n,r,c));yield yield ik(i),null!==i[s]?c[a]=i[s]:o=!1}}))}function vT(e,t,n,r,a="getNftMetadata"){return ak(this,void 0,void 0,(function*(){return zk(yield bT(e,hk.NFT,"getNFTMetadata",a,{contractAddress:t,tokenId:xC.from(n).toString(),tokenType:sT(null==r?void 0:r.tokenType),tokenUriTimeoutInMs:null==r?void 0:r.tokenUriTimeoutInMs,refreshCache:null==r?void 0:r.refreshCache}))}))}function CT(e,t,n){return ak(this,void 0,void 0,(function*(){const r={tokens:t,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs,refreshCache:null==n?void 0:n.refreshCache};return{nfts:(yield bT(e,hk.NFT,"getNFTMetadataBatch","getNftMetadataBatch",{},{method:"POST",data:r})).nfts.map((e=>zk(e)))}}))}function ET(e,t,n="getCollectionMetadata"){return ak(this,void 0,void 0,(function*(){const r=yield bT(e,hk.NFT,"getCollectionMetadata",n,{collectionSlug:t});return a=r,Jk(Object.assign(Object.assign({},a),{floorPrice:Object.assign(Object.assign({},a.floorPrice),{marketplace:Vk(a.floorPrice.marketplace)})}));var a}))}function xT(e,t,n,r="getNftsForOwner"){return ak(this,void 0,void 0,(function*(){const a=OT(null==n?void 0:n.omitMetadata),s=yield bT(e,hk.NFT,"getNFTsForOwner",r,{contractAddresses:null==n?void 0:n.contractAddresses,pageKey:null==n?void 0:n.pageKey,excludeFilters:null==n?void 0:n.excludeFilters,includeFilters:null==n?void 0:n.includeFilters,owner:t,pageSize:null==n?void 0:n.pageSize,withMetadata:a,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs,orderBy:null==n?void 0:n.orderBy});return Jk(a?{ownedNfts:s.ownedNfts.map((e=>Object.assign(Object.assign({},zk(e)),{balance:e.balance}))),pageKey:s.pageKey,totalCount:s.totalCount,validAt:s.validAt}:{ownedNfts:s.ownedNfts.map((e=>Object.assign(Object.assign({},Hk(e)),{balance:e.balance}))),pageKey:s.pageKey,totalCount:s.totalCount,validAt:s.validAt})}))}function kT(e){switch(e){case Kx.ERC721:return[Nx.ERC721];case Kx.ERC1155:return[Nx.ERC1155];default:return[Nx.ERC721,Nx.ERC1155,Nx.SPECIALNFT]}}function TT(e,t={},n="getNftSales"){return ak(this,void 0,void 0,(function*(){const r=Object.assign({},t),a=yield bT(e,hk.NFT,"getNFTSales",n,{fromBlock:null==r?void 0:r.fromBlock,toBlock:null==r?void 0:r.toBlock,order:null==r?void 0:r.order,marketplace:null==r?void 0:r.marketplace,contractAddress:null==r?void 0:r.contractAddress,tokenId:(null==r?void 0:r.tokenId)?xC.from(null==r?void 0:r.tokenId).toString():void 0,sellerAddress:null==r?void 0:r.sellerAddress,buyerAddress:null==r?void 0:r.buyerAddress,taker:null==r?void 0:r.taker,limit:null==r?void 0:r.limit,pageKey:null==r?void 0:r.pageKey});return Jk({nftSales:(s=a).nftSales.map((e=>Object.assign(Object.assign({},e),{marketplace:$k(e.marketplace),taker:qk(e.taker)}))),validAt:s.validAt,pageKey:s.pageKey});var s}))}function PT(e,t,n,r="refreshNftMetadata"){return ak(this,void 0,void 0,(function*(){const a=xC.from(n).toString(),s=yield vT(e,t,a,void 0,r),i=yield function(e,t,n,r){return ak(this,void 0,void 0,(function*(){return zk(yield bT(e,hk.NFT,"getNFTMetadata",r,{contractAddress:t,tokenId:xC.from(n).toString(),refreshCache:!0}))}))}(e,t,a,r);return s.timeLastUpdated!==i.timeLastUpdated}))}function AT(e){return DT(e)?zk(e):Hk(e)}function _T(e,t){return DT(e)?zk(e):Hk(e,t)}function DT(e){return void 0!==e.name}function FT(e,t){return ak(this,void 0,void 0,(function*(){const n=t.transfers.filter((e=>null!==e.rawContract.address)).flatMap((e=>{var t;const n=function(e){return e.category===Nx.ERC1155?function(e){return e.erc1155Metadata.map((t=>({contractAddress:e.rawContract.address,tokenId:t.tokenId,tokenType:Kx.ERC1155})))}(e):[{contractAddress:e.rawContract.address,tokenId:e.tokenId,tokenType:e.category===Nx.ERC721?Kx.ERC721:void 0}]}(e),r={from:e.from,to:null!==(t=e.to)&&void 0!==t?t:void 0,transactionHash:e.hash,blockNumber:e.blockNum};return n.map((e=>({metadata:r,token:e})))}));if(0===n.length)return{nfts:[]};const r=[];for(let e=0;e<n.length;e+=100)r.push(n.slice(e,e+100));const a=(yield Promise.all(r.map((t=>CT(e,t.map((e=>e.token))))))).map((e=>e.nfts)).flat(),s=new Map;a.forEach((e=>{const t=`${e.contract.address.toLowerCase()}-${xC.from(e.tokenId).toString()}`;s.set(t,e)}));const i=n.map((e=>{const t=`${e.token.contractAddress.toLowerCase()}-${xC.from(e.token.tokenId).toString()}`;return Object.assign(Object.assign({},s.get(t)),e.metadata)}));return{nfts:i,pageKey:t.pageKey}}))}function OT(e){return void 0===e||!e}function ST(e){switch(e){case"does_not_exist":return tk.DOES_NOT_EXIST;case"already_queued":return tk.ALREADY_QUEUED;case"in_progress":return tk.IN_PROGRESS;case"finished":return tk.FINISHED;case"queued":return tk.QUEUED;case"queue_failed":return tk.QUEUE_FAILED;default:throw new Error("Unknown reingestion state: "+e)}}class MT{constructor(e){this.config=e}getNftMetadata(e,t,n,r){let a;return a="object"==typeof n?{tokenType:n.tokenType,tokenUriTimeoutInMs:n.tokenUriTimeoutInMs,refreshCache:n.refreshCache}:{tokenType:n,tokenUriTimeoutInMs:r},vT(this.config,e,t,a)}getNftMetadataBatch(e,t){return CT(this.config,e,t)}getContractMetadata(e){return function(e,t,n="getContractMetadata"){return ak(this,void 0,void 0,(function*(){return Gk(yield bT(e,hk.NFT,"getContractMetadata",n,{contractAddress:t}))}))}(this.config,e)}getContractMetadataBatch(e){return function(e,t){return ak(this,void 0,void 0,(function*(){return{contracts:(yield bT(e,hk.NFT,"getContractMetadataBatch","getContractMetadataBatch",{},{method:"POST",data:{contractAddresses:t}})).contracts.map(Gk)}}))}(this.config,e)}getCollectionMetadata(e){return ET(this.config,e)}getNftsForOwnerIterator(e,t){return function(e,t,n,r="getNftsForOwnerIterator"){return ok(this,arguments,(function*(){var a,s;const i=OT(null==n?void 0:n.omitMetadata);try{for(var o,c=ck(wT(e,hk.NFT,"getNFTsForOwner",r,"pageKey","pageKey",{contractAddresses:null==n?void 0:n.contractAddresses,pageKey:null==n?void 0:n.pageKey,excludeFilters:null==n?void 0:n.excludeFilters,includeFilters:null==n?void 0:n.includeFilters,owner:t,withMetadata:i,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs,orderBy:null==n?void 0:n.orderBy}));!(o=yield ik(c.next())).done;){const e=o.value;for(const t of e.ownedNfts)yield yield ik(Object.assign(Object.assign({},AT(t)),{balance:t.balance}))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(s=c.return)&&(yield ik(s.call(c)))}finally{if(a)throw a.error}}}))}(this.config,e,t)}getNftsForOwner(e,t){return xT(this.config,e,t)}getNftsForContract(e,t){return function(e,t,n,r="getNftsForContract"){var a;return ak(this,void 0,void 0,(function*(){const s=OT(null==n?void 0:n.omitMetadata),i=yield bT(e,hk.NFT,"getNFTsForContract",r,{contractAddress:t,pageKey:null==n?void 0:n.pageKey,withMetadata:s,limit:null!==(a=null==n?void 0:n.pageSize)&&void 0!==a?a:void 0,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs});return Jk(s?{nfts:i.nfts.map((e=>zk(e))),pageKey:i.pageKey}:{nfts:i.nfts.map((e=>Hk(e,t))),pageKey:i.pageKey})}))}(this.config,e,t)}getNftsForContractIterator(e,t){return function(e,t,n,r="getNftsForContractIterator"){return ok(this,arguments,(function*(){var a,s;const i=OT(null==n?void 0:n.omitMetadata);try{for(var o,c=ck(wT(e,hk.NFT,"getNFTsForContract",r,"pageKey","pageKey",{contractAddress:t,pageKey:null==n?void 0:n.pageKey,withMetadata:i}));!(o=yield ik(c.next())).done;){const e=o.value;for(const n of e.nfts)yield yield ik(_T(n,t))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(s=c.return)&&(yield ik(s.call(c)))}finally{if(a)throw a.error}}}))}(this.config,e,t)}getOwnersForContract(e,t){return function(e,t,n,r="getOwnersForContract"){return ak(this,void 0,void 0,(function*(){const a=yield bT(e,hk.NFT,"getOwnersForContract",r,Object.assign(Object.assign({},n),{contractAddress:t}));return null==n||n.withTokenBalances,Jk({owners:a.owners,pageKey:a.pageKey})}))}(this.config,e,t)}getOwnersForNft(e,t,n){return function(e,t,n,r,a="getOwnersForNft"){return ak(this,void 0,void 0,(function*(){return bT(e,hk.NFT,"getOwnersForNFT",a,Object.assign({contractAddress:t,tokenId:xC.from(n).toString()},r))}))}(this.config,e,t,n)}getContractsForOwner(e,t){return function(e,t,n,r="getContractsForOwner"){return ak(this,void 0,void 0,(function*(){const a=yield bT(e,hk.NFT,"getContractsForOwner",r,{owner:t,excludeFilters:null==n?void 0:n.excludeFilters,includeFilters:null==n?void 0:n.includeFilters,pageKey:null==n?void 0:n.pageKey,pageSize:null==n?void 0:n.pageSize,orderBy:null==n?void 0:n.orderBy});return Jk({contracts:a.contracts.map(jk),pageKey:a.pageKey,totalCount:a.totalCount})}))}(this.config,e,t)}getTransfersForOwner(e,t,n){return function(e,t,n,r){return ak(this,void 0,void 0,(function*(){const a=yield e.getProvider(),s=yield a._getAddress(t),i=kT(null==r?void 0:r.tokenType),o={fromBlock:"0x0",excludeZeroValue:!0,contractAddresses:null==r?void 0:r.contractAddresses,category:i,maxCount:100,pageKey:null==r?void 0:r.pageKey};n===Ux.TO?o.toAddress=s:o.fromAddress=s;const c=yield Xk(e,o,"getTransfersForOwner");return FT(e,c)}))}(this.config,e,t,n)}getTransfersForContract(e,t){return function(e,t,n){return ak(this,void 0,void 0,(function*(){const r=[Nx.ERC721,Nx.ERC1155,Nx.SPECIALNFT],a=yield e.getProvider(),s={fromBlock:(null==n?void 0:n.fromBlock)?a.formatter.blockTag(yield a._getBlockTag(n.fromBlock)):"0x0",toBlock:(null==n?void 0:n.toBlock)?a.formatter.blockTag(yield a._getBlockTag(n.toBlock)):void 0,excludeZeroValue:!0,contractAddresses:[t],order:null==n?void 0:n.order,category:r,maxCount:100,pageKey:null==n?void 0:n.pageKey},i=yield Xk(e,s,"getTransfersForContract");return FT(e,i)}))}(this.config,e,t)}getMintedNfts(e,t){return ak(this,void 0,void 0,(function*(){return function(e,t,n){return ak(this,void 0,void 0,(function*(){const r=yield e.getProvider(),a=yield r._getAddress(t),s=kT(null==n?void 0:n.tokenType),i={fromBlock:"0x0",fromAddress:"0x0000000000000000000000000000000000000000",toAddress:a,excludeZeroValue:!0,contractAddresses:null==n?void 0:n.contractAddresses,category:s,maxCount:100,pageKey:null==n?void 0:n.pageKey},o=yield Xk(e,i,"getMintedNfts");return FT(e,o)}))}(this.config,e,t)}))}verifyNftOwnership(e,t){return function(e,t,n,r="verifyNftOwnership"){return ak(this,void 0,void 0,(function*(){if("string"==typeof n)return(yield xT(e,t,{contractAddresses:[n],omitMetadata:!0},r)).ownedNfts.length>0;{if(0===n.length)throw new Error("Must provide at least one contract address");const a=yield xT(e,t,{contractAddresses:n,omitMetadata:!0},r),s=n.reduce(((e,t)=>(e[t]=!1,e)),{});for(const e of a.ownedNfts)s[e.contractAddress]=!0;return s}}))}(this.config,e,t)}isSpamContract(e){return function(e,t,n="isSpamContract"){return ak(this,void 0,void 0,(function*(){return bT(e,hk.NFT,"isSpamContract",n,{contractAddress:t})}))}(this.config,e)}getSpamContracts(){return function(e,t="getSpamContracts"){return ak(this,void 0,void 0,(function*(){return bT(e,hk.NFT,"getSpamContracts",t,void 0)}))}(this.config)}reportSpam(e){return function(e,t,n="reportSpam"){return ak(this,void 0,void 0,(function*(){bT(e,hk.NFT,"reportSpam",n,{contractAddress:t})}))}(this.config,e)}isAirdropNft(e,t){return function(e,t,n,r="isAirdropNft"){return ak(this,void 0,void 0,(function*(){return bT(e,hk.NFT,"isAirdropNFT",r,{contractAddress:t,tokenId:n})}))}(this.config,e,t)}getFloorPrice(e){return function(e,t,n="getFloorPrice"){return ak(this,void 0,void 0,(function*(){return Jk(yield bT(e,hk.NFT,"getFloorPrice",n,{contractAddress:t}))}))}(this.config,e)}getNftSales(e){return TT(this.config,e)}computeRarity(e,t){return function(e,t,n,r="computeRarity"){return ak(this,void 0,void 0,(function*(){return Jk(yield bT(e,hk.NFT,"computeRarity",r,{contractAddress:t,tokenId:xC.from(n).toString()}))}))}(this.config,e,t)}searchContractMetadata(e){return function(e,t,n="searchContractMetadata"){return ak(this,void 0,void 0,(function*(){return{contracts:(yield bT(e,hk.NFT,"searchContractMetadata",n,{query:t})).contracts.map(Gk)}}))}(this.config,e)}summarizeNftAttributes(e){return function(e,t,n="summarizeNftAttributes"){return ak(this,void 0,void 0,(function*(){return bT(e,hk.NFT,"summarizeNFTAttributes",n,{contractAddress:t})}))}(this.config,e)}refreshNftMetadata(e,t){return PT(this.config,e,t)}refreshContract(e){return function(e,t,n="refreshContract"){return ak(this,void 0,void 0,(function*(){const r=yield bT(e,hk.NFT,"reingestContract",n,{contractAddress:t});return{contractAddress:r.contractAddress,refreshState:ST(r.reingestionState),progress:r.progress}}))}(this.config,e)}}class IT{constructor(e){this.config=e}getAllWebhooks(){return ak(this,void 0,void 0,(function*(){this.verifyConfig();const e=yield this.sendWebhookRequest("team-webhooks","getAllWebhooks",{});return{webhooks:LT(e),totalCount:e.data.length}}))}getAddresses(e,t){return ak(this,void 0,void 0,(function*(){this.verifyConfig();const n="string"==typeof e?e:e.id;return function(e){return{addresses:e.data,totalCount:e.pagination.total_count,pageKey:e.pagination.cursors.after}}(yield this.sendWebhookRequest("webhook-addresses","getAddresses",{webhook_id:n,limit:null==t?void 0:t.limit,after:null==t?void 0:t.pageKey}))}))}getGraphqlQuery(e){return ak(this,void 0,void 0,(function*(){this.verifyConfig();const t="string"==typeof e?e:e.id;return function(e){return{graphqlQuery:e.data.graphql_query}}(yield this.sendWebhookRequest("dashboard-webhook-graphql-query","getGraphqlQuery",{webhook_id:t}))}))}getNftFilters(e,t){return ak(this,void 0,void 0,(function*(){this.verifyConfig();const n="string"==typeof e?e:e.id;return function(e){return{filters:e.data.map((e=>e.token_id?{contractAddress:e.contract_address,tokenId:xC.from(e.token_id).toString()}:{contractAddress:e.contract_address})),totalCount:e.pagination.total_count,pageKey:e.pagination.cursors.after}}(yield this.sendWebhookRequest("webhook-nft-filters","getNftFilters",{webhook_id:n,limit:null==t?void 0:t.limit,after:null==t?void 0:t.pageKey}))}))}updateWebhook(e,t){return ak(this,void 0,void 0,(function*(){const n="string"==typeof e?e:e.id;let r,a,s,i;if("isActive"in t)r="update-webhook",a="updateWebhook",s="PUT",i={webhook_id:n,is_active:t.isActive};else if("addFilters"in t||"removeFilters"in t)r="update-webhook-nft-filters",a="updateWebhookNftFilters",s="PATCH",i={webhook_id:n,nft_filters_to_add:t.addFilters?t.addFilters.map(RT):[],nft_filters_to_remove:t.removeFilters?t.removeFilters.map(RT):[]};else if("addMetadataFilters"in t||"removeMetadataFilters"in t)r="update-webhook-nft-metadata-filters",a="updateWebhookNftMetadataFilters",s="PATCH",i={webhook_id:n,nft_metadata_filters_to_add:t.addMetadataFilters?t.addMetadataFilters.map(RT):[],nft_metadata_filters_to_remove:t.removeMetadataFilters?t.removeMetadataFilters.map(RT):[]};else if("addAddresses"in t||"removeAddresses"in t)r="update-webhook-addresses",a="webhook:updateWebhookAddresses",s="PATCH",i={webhook_id:n,addresses_to_add:yield this.resolveAddresses(t.addAddresses),addresses_to_remove:yield this.resolveAddresses(t.removeAddresses)};else{if(!("newAddresses"in t))throw new Error("Invalid `update` param passed into `updateWebhook`");r="update-webhook-addresses",a="webhook:updateWebhookAddress",s="PUT",i={webhook_id:n,addresses:yield this.resolveAddresses(t.newAddresses)}}yield this.sendWebhookRequest(r,a,{},{method:s,data:i})}))}createWebhook(e,t,n){return ak(this,void 0,void 0,(function*(){let r;if(t===qx.MINED_TRANSACTION||t===qx.DROPPED_TRANSACTION){if(!("appId"in n))throw new Error("Transaction Webhooks require an app id.");r=n.appId}let a,s,i,o=UT.get(this.config.network);if(t===qx.NFT_ACTIVITY||t===qx.NFT_METADATA_UPDATE){if(!("filters"in n)||0===n.filters.length)throw new Error("Nft Activity Webhooks require a non-empty array input.");o=n.network?UT.get(n.network):o;const e=n.filters.map((e=>e.tokenId?{contract_address:e.contractAddress,token_id:xC.from(e.tokenId).toString()}:{contract_address:e.contractAddress}));a=t===qx.NFT_ACTIVITY?{nft_filters:e}:{nft_metadata_filters:e}}else if(t===qx.ADDRESS_ACTIVITY){if(void 0===n||!("addresses"in n)||0===n.addresses.length)throw new Error("Address Activity Webhooks require a non-empty array input.");o=n.network?UT.get(n.network):o,s=yield this.resolveAddresses(n.addresses)}else if(t==qx.GRAPHQL){if(void 0===n||!("graphqlQuery"in n)||0===n.graphqlQuery.length)throw new Error("Custom Webhooks require a non-empty graphql query.");o=n.network?UT.get(n.network):o,i=n.graphqlQuery}const c=Object.assign(Object.assign(Object.assign(Object.assign({network:o,webhook_type:t,webhook_url:e},r&&{app_id:r}),a),s&&{addresses:s}),i&&{graphql_query:i});return BT((yield this.sendWebhookRequest("create-webhook","createWebhook",{},{method:"POST",data:c})).data)}))}deleteWebhook(e){return ak(this,void 0,void 0,(function*(){this.verifyConfig();const t="string"==typeof e?e:e.id;if("message"in(yield this.sendWebhookRequest("delete-webhook","deleteWebhook",{webhook_id:t},{method:"DELETE"})))throw new Error(`Webhook not found. Failed to delete webhook: ${t}`)}))}verifyConfig(){if(void 0===this.config.authToken)throw new Error("Using the Notify API requires setting the Alchemy Auth Token in the settings object when initializing Alchemy.")}sendWebhookRequest(e,t,n,r){return bT(this.config,hk.WEBHOOK,e,t,n,Object.assign(Object.assign({},r),{headers:Object.assign({"X-Alchemy-Token":this.config.authToken},null==r?void 0:r.headers)}))}resolveAddresses(e){return ak(this,void 0,void 0,(function*(){if(void 0===e)return[];const t=[],n=yield this.config.getProvider();for(const r of e){const e=yield n.resolveName(r);if(null===e)throw new Error(`Unable to resolve the ENS address: ${r}`);t.push(e)}return t}))}}const NT={ETH_MAINNET:Mx.ETH_MAINNET,ETH_GOERLI:Mx.ETH_GOERLI,ETH_SEPOLIA:Mx.ETH_SEPOLIA,MATIC_MAINNET:Mx.MATIC_MAINNET,MATIC_MUMBAI:Mx.MATIC_MUMBAI,MATIC_AMOY:Mx.MATIC_AMOY,ARB_MAINNET:Mx.ARB_MAINNET,ARB_GOERLI:Mx.ARB_GOERLI,OPT_MAINNET:Mx.OPT_MAINNET,OPT_GOERLI:Mx.OPT_GOERLI,BASE_MAINNET:Mx.BASE_MAINNET,BASE_GOERLI:Mx.BASE_GOERLI,BASE_SEPOLIA:Mx.BASE_SEPOLIA},UT=Object.keys(Mx).reduce(((e,t)=>(t in NT&&e.set(NT[t],t),e)),new Map);function LT(e){return e.data.map(BT)}function BT(e){return Object.assign({id:e.id,network:NT[e.network],type:e.webhook_type,url:e.webhook_url,isActive:e.is_active,timeCreated:new Date(e.time_created).toISOString(),signingKey:e.signing_key,version:e.version},void 0!==e.app_id&&{appId:e.app_id})}function RT(e){return e.tokenId?{contract_address:e.contractAddress,token_id:xC.from(e.tokenId).toString()}:{contract_address:e.contractAddress}}const jT=[.9,1,1.1,1.2,1.3];class GT{constructor(e){this.config=e}sendPrivateTransaction(e,t,n){return ak(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=t?Lk(t):void 0;return r._send("eth_sendPrivateTransaction",[{tx:e,maxBlockNumber:a,preferences:n}],"sendPrivateTransaction")}))}cancelPrivateTransaction(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("eth_cancelPrivateTransaction",[{txHash:e}],"cancelPrivateTransaction")}))}simulateAssetChangesBundle(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Jk(yield n._send("alchemy_simulateAssetChangesBundle",r,"simulateAssetChangesBundle"))}))}simulateAssetChanges(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Jk(yield n._send("alchemy_simulateAssetChanges",r,"simulateAssetChanges"))}))}simulateExecutionBundle(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Jk(n._send("alchemy_simulateExecutionBundle",r,"simulateExecutionBundle"))}))}simulateExecution(e,t){return ak(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Jk(n._send("alchemy_simulateExecution",r,"simulateExecution"))}))}getTransaction(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransaction(e)}))}sendTransaction(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).sendTransaction(e)}))}estimateGas(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).estimateGas(e)}))}getMaxPriorityFeePerGas(){return ak(this,void 0,void 0,(function*(){const e=yield this.config.getProvider();return Uk(yield e._send("eth_maxPriorityFeePerGas",[],"getMaxPriorityFeePerGas"))}))}waitForTransaction(e,t,n){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).waitForTransaction(e,t,n)}))}sendGasOptimizedTransaction(e,t){return ak(this,void 0,void 0,(function*(){if(Array.isArray(e))return this._sendGasOptimizedTransaction(e,"sendGasOptimizedTransactionPreSigned");let n,r,a;const s=yield this.config.getProvider();try{n=yield this.estimateGas(e),r=yield this.getMaxPriorityFeePerGas();a=(yield s.getBlock("latest")).baseFeePerGas.toNumber()}catch(e){throw new Error(`Failed to estimate gas for transaction: ${e}`)}const i=function(e,t,n,r){return jT.map((a=>Object.assign(Object.assign({},e),{gasLimit:t,maxFeePerGas:Math.round(n*a+r*a),maxPriorityFeePerGas:Math.round(a*r)})))}(e,n.toNumber(),a,r),o=yield Promise.all(i.map((e=>t.signTransaction(e))));return this._sendGasOptimizedTransaction(o,"sendGasOptimizedTransactionGenerated")}))}getGasOptimizedTransactionStatus(e){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_getGasOptimizedTransactionStatus",[e],"getGasOptimizedTransactionStatus")}))}_sendGasOptimizedTransaction(e,t){return ak(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_sendGasOptimizedTransaction",[{rawTransactions:e}],t)}))}}const HT="alchemy-pending-transactions",zT="alchemy-mined-transactions",$T=[HT,zT];class VT{constructor(e,t,n){this.listener=t,this.tag=e,this.once=n,this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter;default:return this.tag}}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");if("tx"!==e[0])throw new Error("Not a transaction event");return e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])throw new Error("Not a transaction event");const t=e[1],n=function(e){if(""===e)return[];return e.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}))}(e[2]),r={};return n.length>0&&(r.topics=n),t&&"*"!==t&&(r.address=t),r}pollable(){return this.tag.indexOf(":")>=0||["block","network","pending","poll"].indexOf(this.tag)>=0}}class qT extends VT{get fromAddress(){const e=this.tag.split(":");if(e[0]===HT)return e[1]&&"*"!==e[1]?YT(e[1]):void 0}get toAddress(){const e=this.tag.split(":");if(e[0]===HT)return e[2]&&"*"!==e[2]?YT(e[2]):void 0}get hashesOnly(){const e=this.tag.split(":");if($T.includes(e[0]))return e[3]&&"*"!==e[3]?"true"===e[3]:void 0}get includeRemoved(){const e=this.tag.split(":");if(e[0]===zT)return e[2]&&"*"!==e[2]?"true"===e[2]:void 0}get addresses(){const e=this.tag.split(":");if(e[0]===zT)return e[1]&&"*"!==e[1]?function(e){if(""===e)return;return e.split("|").map((e=>e.split(","))).map((e=>Object.assign(Object.assign({},"*"!==e[0]&&{to:e[0]}),"*"!==e[1]&&{from:e[1]})))}(e[1]):void 0}}function ZT(e){return"object"==typeof e&&"method"in e}function WT(e){if(!ZT(e))throw new Error("Event tag requires AlchemyEventType");if(e.method===Rx.PENDING_TRANSACTIONS)return function(e){const t=JT(e.fromAddress),n=JT(e.toAddress),r=XT(e.hashesOnly);return HT+":"+t+":"+n+":"+r}(e);if(e.method===Rx.MINED_TRANSACTIONS)return function(e){const t=function(e){if(void 0===e)return"*";return e.map((e=>JT(e.to)+","+JT(e.from))).join("|")}(e.addresses),n=XT(e.includeRemoved),r=XT(e.hashesOnly);return zT+":"+t+":"+n+":"+r}(e);throw new Error(`Unrecognized AlchemyFilterEvent: ${e}`)}function KT(e){if(!Object.values(Rx).includes(e.method))throw new Error(`Invalid method name ${e.method}. Accepted method names: ${Object.values(Rx)}`)}function JT(e){return void 0===e?"*":Array.isArray(e)?e.join("|"):e}function XT(e){return void 0===e?"*":e.toString()}function YT(e){if(""===e)return;const t=e.split("|");return 1===t.length?t[0]:t}class QT{constructor(e){this.config=e}on(e,t){return(()=>{ak(this,void 0,void 0,(function*(){const n=yield this.config.getWebSocketProvider(),r=yield this._resolveEnsAlchemyEvent(e);n.on(r,t)}))})(),this}once(e,t){return(()=>{ak(this,void 0,void 0,(function*(){const n=yield this.config.getWebSocketProvider(),r=yield this._resolveEnsAlchemyEvent(e);n.once(r,t)}))})(),this}off(e,t){return(()=>{ak(this,void 0,void 0,(function*(){const n=yield this.config.getWebSocketProvider(),r=yield this._resolveEnsAlchemyEvent(e);return n.off(r,t)}))})(),this}removeAllListeners(e){return(()=>{ak(this,void 0,void 0,(function*(){const t=yield this.config.getWebSocketProvider(),n=e?yield this._resolveEnsAlchemyEvent(e):void 0;t.removeAllListeners(n)}))})(),this}listenerCount(e){return ak(this,void 0,void 0,(function*(){const t=yield this.config.getWebSocketProvider(),n=e?yield this._resolveEnsAlchemyEvent(e):void 0;return t.listenerCount(n)}))}listeners(e){return ak(this,void 0,void 0,(function*(){const t=yield this.config.getWebSocketProvider(),n=e?yield this._resolveEnsAlchemyEvent(e):void 0;return t.listeners(n)}))}_resolveEnsAlchemyEvent(e){return ak(this,void 0,void 0,(function*(){if(!ZT(e))return e;if(e.method===Rx.MINED_TRANSACTIONS&&e.addresses){const t=[];for(const n of e.addresses)n.to&&(n.to=yield this._resolveNameOrError(n.to)),n.from&&(n.from=yield this._resolveNameOrError(n.from)),t.push(n);e.addresses=t}else e.method===Rx.PENDING_TRANSACTIONS&&(e.fromAddress&&("string"==typeof e.fromAddress?e.fromAddress=yield this._resolveNameOrError(e.fromAddress):e.fromAddress=yield Promise.all(e.fromAddress.map((e=>this._resolveNameOrError(e))))),e.toAddress&&("string"==typeof e.toAddress?e.toAddress=yield this._resolveNameOrError(e.toAddress):e.toAddress=yield Promise.all(e.toAddress.map((e=>this._resolveNameOrError(e))))));return e}))}_resolveNameOrError(e){return ak(this,void 0,void 0,(function*(){const t=yield this.config.getProvider(),n=yield t.resolveName(e);if(null===n)throw new Error(`Unable to resolve the ENS address: ${e}`);return n}))}}const eP=Lw.custom((e=>{const t=av.parse(e);let n;try{n=kv(t.id)}catch{return!1}return null!=n.rpcUrls.alchemy}),"chain must include an alchemy rpc url. See `createAlchemyChain` or use the `AlchemyChainMap` exported from `@alchemy/aa-core`"),tP=Fv.and(Lw.object({chain:eP,opts:Mv.optional().default(Mv.parse({}))}));Lw.instanceof(class{constructor(e){this.config=new bk(e),this.core=new tT(this.config),this.nft=new MT(this.config),this.ws=new QT(this.config),this.transact=new GT(this.config),this.notify=new IT(this.config),this.debug=new rT(this.config)}});const nP=e=>({simulateUserOperation:async t=>lC(e,t)}),rP=e=>async(t,{overrides:n,feeOptions:r})=>{let[a,s]=await Promise.all([e.getBlock({blockTag:"latest"}),e.request({method:"rundler_maxPriorityFeePerGas",params:[]})]);const i=a.baseFeePerGas;if(null==i)throw new Error("baseFeePerGas is null");const o=wv(s,n?.maxPriorityFeePerGas,r?.maxPriorityFeePerGas);return{...t,maxPriorityFeePerGas:o,maxFeePerGas:wv(i+BigInt(o),n?.maxFeePerGas,r?.maxFeePerGas)}},aP=(e,t)=>()=>Di([t.paymasterAddress??(e=>{switch(e.id){case Xw.id:case Vw.id:case Kw.id:case tv.id:case nv.id:case Qw.id:case ev.id:return"0x4f84a207A80c39E9e8BaE717c1F25bA7AD1fB08F";case Hw.id:case Bw.id:case zw.id:case Yw.id:case Zw.id:return"0x4Fd9098af9ddcB41DA48A1d78F91F1398965addc";case jw.id:return"0x0804Afe6EEFb73ce7F93CD0d5e7079a5a8068592";case qw.id:case Jw.id:return"0xc03aac639bb21233e0139381970328db8bceeb67";default:throw new Error(`Unsupported chain: ${e}`)}})(e.chain),t.dummyData??"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"]);function sP(e,t){const n=t.gasEstimationOptions,r=n?.disableGasEstimation??!1,a=n?.fallbackFeeDataGetter??rP(e),s=n?.fallbackGasEstimator??aC(e);return{gasEstimator:r?s:async(t,{overrides:n,account:r,feeOptions:a})=>Cv(n)?{...t,...await s(t,{overrides:n,account:r,feeOptions:a,client:e})}:t,feeEstimator:r?a:async(t,{overrides:n,account:r,feeOptions:s})=>{let i=await t.maxFeePerGas,o=await t.maxPriorityFeePerGas;if(Cv(n)){const c=await a(t,{overrides:n,feeOptions:s,account:r,client:e});i=await c.maxFeePerGas??i,o=await c.maxPriorityFeePerGas??o}return{...t,maxFeePerGas:i,maxPriorityFeePerGas:o}},paymasterAndData:r?cP(e,t):oP(e,t)}}const iP=(e,t,n,r)=>{let a=e;if(null!=t?.[a])return lv(t[a])?Pv(t[a]):{multiplier:Number(t[a].multiplier)};if(uv(n?.[e]))return{multiplier:Number(n[e].multiplier)};const s=r[e];return ds(s)&&Ms(s,"bigint")>0n?s:void 0};function oP(e,t){return{dummyPaymasterAndData:aP(e,t),paymasterAndData:async(n,{overrides:r,feeOptions:a,account:s})=>{const i=Pv(await Tv(n)),o=Av({maxFeePerGas:iP("maxFeePerGas",r,a,i),maxPriorityFeePerGas:iP("maxPriorityFeePerGas",r,a,i),callGasLimit:iP("callGasLimit",r,a,i),verificationGasLimit:iP("verificationGasLimit",r,a,i),preVerificationGas:iP("preVerificationGas",r,a,i)});if("0.7.0"===s.getEntryPoint().version){const e=iP("paymasterVerificationGasLimit",r,a,i);null!=e&&(o.paymasterVerificationGasLimit=e);const t=iP("paymasterPostOpGasLimit",r,a,i);null!=t&&(o.paymasterPostOpGasLimit=t)}const c=await e.request({method:"alchemy_requestGasAndPaymasterAndData",params:[{policyId:t.policyId,entryPoint:s.getEntryPoint().address,userOperation:i,dummySignature:i.signature,overrides:o}]});return{...n,...c}}}}const cP=(e,t)=>({dummyPaymasterAndData:aP(e,t),paymasterAndData:async(n,{account:r})=>{const a=await e.request({method:"alchemy_requestPaymasterAndData",params:[{policyId:t.policyId,entryPoint:r.getEntryPoint().address,userOperation:Pv(await Tv(n))}]});return{...n,...a}}});function lP(e){return async(t,{account:n})=>{const r=await e.request({method:"alchemy_simulateUserOperationAssetChanges",params:[Pv(await Tv(t)),n.getEntryPoint().address]});if(r.error)throw new Error(r.error.message);return t}}function uP(e){return{"Alchemy-Aa-Sdk-Signer":e.getSigner().signerType}}const dP=[{type:"function",name:"getExecutionFunctionConfig",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple",internalType:"struct IAccountLoupe.ExecutionFunctionConfig",components:[{name:"plugin",type:"address",internalType:"address"},{name:"userOpValidationFunction",type:"bytes21",internalType:"FunctionReference"},{name:"runtimeValidationFunction",type:"bytes21",internalType:"FunctionReference"}]}],stateMutability:"view"},{type:"function",name:"getExecutionHooks",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple[]",internalType:"struct IAccountLoupe.ExecutionHooks[]",components:[{name:"preExecHook",type:"bytes21",internalType:"FunctionReference"},{name:"postExecHook",type:"bytes21",internalType:"FunctionReference"}]}],stateMutability:"view"},{type:"function",name:"getInstalledPlugins",inputs:[],outputs:[{name:"",type:"address[]",internalType:"address[]"}],stateMutability:"view"},{type:"function",name:"getPreValidationHooks",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"preUserOpValidationHooks",type:"bytes21[]",internalType:"FunctionReference[]"},{name:"preRuntimeValidationHooks",type:"bytes21[]",internalType:"FunctionReference[]"}],stateMutability:"view"}],pP=[{type:"function",name:"onInstall",inputs:[{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"onUninstall",inputs:[{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"pluginManifest",inputs:[],outputs:[{name:"",type:"tuple",internalType:"struct PluginManifest",components:[{name:"interfaceIds",type:"bytes4[]",internalType:"bytes4[]"},{name:"dependencyInterfaceIds",type:"bytes4[]",internalType:"bytes4[]"},{name:"executionFunctions",type:"bytes4[]",internalType:"bytes4[]"},{name:"permittedExecutionSelectors",type:"bytes4[]",internalType:"bytes4[]"},{name:"permitAnyExternalAddress",type:"bool",internalType:"bool"},{name:"canSpendNativeToken",type:"bool",internalType:"bool"},{name:"permittedExternalCalls",type:"tuple[]",internalType:"struct ManifestExternalCallPermission[]",components:[{name:"externalAddress",type:"address",internalType:"address"},{name:"permitAnySelector",type:"bool",internalType:"bool"},{name:"selectors",type:"bytes4[]",internalType:"bytes4[]"}]},{name:"userOpValidationFunctions",type:"tuple[]",internalType:"struct ManifestAssociatedFunction[]",components:[{name:"executionSelector",type:"bytes4",internalType:"bytes4"},{name:"associatedFunction",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]}]},{name:"runtimeValidationFunctions",type:"tuple[]",internalType:"struct ManifestAssociatedFunction[]",components:[{name:"executionSelector",type:"bytes4",internalType:"bytes4"},{name:"associatedFunction",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]}]},{name:"preUserOpValidationHooks",type:"tuple[]",internalType:"struct ManifestAssociatedFunction[]",components:[{name:"executionSelector",type:"bytes4",internalType:"bytes4"},{name:"associatedFunction",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]}]},{name:"preRuntimeValidationHooks",type:"tuple[]",internalType:"struct ManifestAssociatedFunction[]",components:[{name:"executionSelector",type:"bytes4",internalType:"bytes4"},{name:"associatedFunction",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]}]},{name:"executionHooks",type:"tuple[]",internalType:"struct ManifestExecutionHook[]",components:[{name:"executionSelector",type:"bytes4",internalType:"bytes4"},{name:"preExecHook",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]},{name:"postExecHook",type:"tuple",internalType:"struct ManifestFunction",components:[{name:"functionType",type:"uint8",internalType:"enum ManifestAssociatedFunctionType"},{name:"functionId",type:"uint8",internalType:"uint8"},{name:"dependencyIndex",type:"uint256",internalType:"uint256"}]}]}]}],stateMutability:"pure"},{type:"function",name:"pluginMetadata",inputs:[],outputs:[{name:"",type:"tuple",internalType:"struct PluginMetadata",components:[{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"author",type:"string",internalType:"string"},{name:"permissionDescriptors",type:"tuple[]",internalType:"struct SelectorPermission[]",components:[{name:"functionSelector",type:"bytes4",internalType:"bytes4"},{name:"permissionDescription",type:"string",internalType:"string"}]}]}],stateMutability:"pure"},{type:"function",name:"postExecutionHook",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"preExecHookData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"preExecutionHook",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"sender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes",internalType:"bytes"}],stateMutability:"nonpayable"},{type:"function",name:"preRuntimeValidationHook",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"sender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"preUserOpValidationHook",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"userOp",type:"tuple",internalType:"struct UserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"callGasLimit",type:"uint256",internalType:"uint256"},{name:"verificationGasLimit",type:"uint256",internalType:"uint256"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"maxFeePerGas",type:"uint256",internalType:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256",internalType:"uint256"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"runtimeValidationFunction",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"sender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"userOpValidationFunction",inputs:[{name:"functionId",type:"uint8",internalType:"uint8"},{name:"userOp",type:"tuple",internalType:"struct UserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"callGasLimit",type:"uint256",internalType:"uint256"},{name:"verificationGasLimit",type:"uint256",internalType:"uint256"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"maxFeePerGas",type:"uint256",internalType:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256",internalType:"uint256"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"}],hP=[{type:"function",name:"installPlugin",inputs:[{name:"plugin",type:"address",internalType:"address"},{name:"manifestHash",type:"bytes32",internalType:"bytes32"},{name:"pluginInitData",type:"bytes",internalType:"bytes"},{name:"dependencies",type:"bytes21[]",internalType:"FunctionReference[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"uninstallPlugin",inputs:[{name:"plugin",type:"address",internalType:"address"},{name:"config",type:"bytes",internalType:"bytes"},{name:"pluginUninstallData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"event",name:"PluginIgnoredHookUnapplyCallbackFailure",inputs:[{name:"plugin",type:"address",indexed:!0,internalType:"address"},{name:"providingPlugin",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"PluginIgnoredUninstallCallbackFailure",inputs:[{name:"plugin",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"PluginInstalled",inputs:[{name:"plugin",type:"address",indexed:!0,internalType:"address"},{name:"manifestHash",type:"bytes32",indexed:!1,internalType:"bytes32"},{name:"dependencies",type:"bytes21[]",indexed:!1,internalType:"FunctionReference[]"}],anonymous:!1},{type:"event",name:"PluginUninstalled",inputs:[{name:"plugin",type:"address",indexed:!0,internalType:"address"},{name:"callbacksSucceeded",type:"bool",indexed:!0,internalType:"bool"}],anonymous:!1}],mP=[{type:"function",name:"execute",inputs:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes",internalType:"bytes"}],stateMutability:"payable"},{type:"function",name:"executeBatch",inputs:[{name:"calls",type:"tuple[]",internalType:"struct Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"}],fP=[{type:"constructor",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"multiOwnerPlugin",type:"address",internalType:"address"},{name:"implementation",type:"address",internalType:"address"},{name:"multiOwnerPluginManifestHash",type:"bytes32",internalType:"bytes32"},{name:"entryPoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"ENTRYPOINT",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"IMPL",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"MULTI_OWNER_PLUGIN",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"acceptOwnership",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"addStake",inputs:[{name:"unstakeDelay",type:"uint32",internalType:"uint32"},{name:"amount",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"payable"},{type:"function",name:"createAccount",inputs:[{name:"salt",type:"uint256",internalType:"uint256"},{name:"owners",type:"address[]",internalType:"address[]"}],outputs:[{name:"addr",type:"address",internalType:"address"}],stateMutability:"nonpayable"},{type:"function",name:"getAddress",inputs:[{name:"salt",type:"uint256",internalType:"uint256"},{name:"owners",type:"address[]",internalType:"address[]"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"owner",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"pendingOwner",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"renounceOwnership",inputs:[],outputs:[],stateMutability:"view"},{type:"function",name:"transferOwnership",inputs:[{name:"newOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"unlockStake",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"withdraw",inputs:[{name:"to",type:"address",internalType:"address payable"},{name:"token",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"withdrawStake",inputs:[{name:"to",type:"address",internalType:"address payable"}],outputs:[],stateMutability:"nonpayable"},{type:"event",name:"OwnershipTransferStarted",inputs:[{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"OwnershipTransferred",inputs:[{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"error",name:"InvalidAction",inputs:[]},{type:"error",name:"InvalidOwner",inputs:[]},{type:"error",name:"OwnersArrayEmpty",inputs:[]},{type:"error",name:"OwnersLimitExceeded",inputs:[]},{type:"error",name:"TransferFailed",inputs:[]}],yP=e=>({getExecutionFunctionConfig:async({selector:t,account:n=e.account})=>{if(!n)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","getExecutionFunctionConfig",e);return e.readContract({address:n.address,abi:dP,functionName:"getExecutionFunctionConfig",args:[t]})},getExecutionHooks:async({selector:t,account:n=e.account})=>{if(!n)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","getExecutionHooks",e);return e.readContract({address:n.address,abi:dP,functionName:"getExecutionHooks",args:[t]})},getPreValidationHooks:async({selector:t,account:n=e.account})=>{if(!n)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","getPreValidationHooks",e);return e.readContract({address:n.address,abi:dP,functionName:"getPreValidationHooks",args:[t]})},getInstalledPlugins:async({account:t=e.account})=>{if(!t)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","getInstalledPlugins",e);return e.readContract({address:t.address,abi:dP,functionName:"getInstalledPlugins"}).catch((()=>[]))}});async function bP(e,{overrides:t,context:n,account:r=e.account,...a}){if(!r)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","installPlugin",e);const s=await async function(e,t){const n=await e.readContract({abi:pP,address:t.pluginAddress,functionName:"pluginManifest"}),r=t.manifestHash??ki(function(e){const{abi:t,functionName:n,result:r}=e;let a=t[0];if(n){const e=Yo({abi:t,name:n});if(!e)throw new _o(n,{docsPath:Vd});a=e}if("function"!==a.type)throw new _o(void 0,{docsPath:Vd});if(!a.outputs)throw new Do(a.name,{docsPath:Vd});let s=Array.isArray(r)?r:[r];return 0!==a.outputs.length||s[0]||(s=[]),Zo(a.outputs,s)}({abi:pP,functionName:"pluginManifest",result:n}));return cc({abi:hP,functionName:"installPlugin",args:[t.pluginAddress,r,t.pluginInitData??"0x",t.dependencies??[]]})}(e,a);return e.sendUserOperation({uo:s,overrides:t,account:r,context:n})}const gP={1:"0xcE0000007B008F50d762D155002600004cD6c647",10:"0xcE0000007B008F50d762D155002600004cD6c647",137:"0xcE0000007B008F50d762D155002600004cD6c647",252:"0xcE0000007B008F50d762D155002600004cD6c647",2523:"0xcE0000007B008F50d762D155002600004cD6c647",8453:"0xcE0000007B008F50d762D155002600004cD6c647",42161:"0xcE0000007B008F50d762D155002600004cD6c647",80001:"0xcE0000007B008F50d762D155002600004cD6c647",80002:"0xcE0000007B008F50d762D155002600004cD6c647",84532:"0xcE0000007B008F50d762D155002600004cD6c647",421614:"0xcE0000007B008F50d762D155002600004cD6c647",7777777:"0xcE0000007B008F50d762D155002600004cD6c647",11155111:"0xcE0000007B008F50d762D155002600004cD6c647",11155420:"0xcE0000007B008F50d762D155002600004cD6c647",999999999:"0xcE0000007B008F50d762D155002600004cD6c647"},wP={meta:{name:"Multi Owner Plugin",version:"1.0.0",addresses:gP},getContract:(e,t)=>{if(!e.chain)throw new db;return Wu({address:t||gP[e.chain.id],abi:EP,client:e})}},vP=e=>({updateOwners({args:t,overrides:n,context:r,account:a=e.account}){if(!a)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","updateOwners",e);const s=cc({abi:CP,functionName:"updateOwners",args:t});return e.sendUserOperation({uo:s,overrides:n,account:a,context:r})},installMultiOwnerPlugin({account:t=e.account,overrides:n,context:r,...a}){if(!t)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","installMultiOwnerPlugin",e);const s=e.chain;if(!s)throw new db;const i=a.dependencyOverrides??[],o=a.pluginAddress??wP.meta.addresses[s.id];if(!o)throw new Error("missing MultiOwnerPlugin address for chain "+s.name);return bP(e,{pluginAddress:o,pluginInitData:Zo([{type:"address[]"}],a.args),dependencies:i,overrides:n,account:t,context:r})},encodeUpdateOwners:({args:e})=>cc({abi:CP,functionName:"updateOwners",args:e}),encodeEip712Domain:()=>cc({abi:CP,functionName:"eip712Domain"}),async readEip712Domain({account:t=e.account}){if(!t)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","readEip712Domain",e);return e.readContract({address:t.address,abi:CP,functionName:"eip712Domain"})},encodeIsValidSignature:({args:e})=>cc({abi:CP,functionName:"isValidSignature",args:e}),async readIsValidSignature({args:t,account:n=e.account}){if(!n)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","readIsValidSignature",e);return e.readContract({address:n.address,abi:CP,functionName:"isValidSignature",args:t})}}),CP=[{stateMutability:"nonpayable",type:"function",inputs:[{name:"ownersToAdd",internalType:"address[]",type:"address[]"},{name:"ownersToRemove",internalType:"address[]",type:"address[]"}],name:"updateOwners",outputs:[]},{stateMutability:"view",type:"function",inputs:[],name:"eip712Domain",outputs:[{name:"fields",internalType:"bytes1",type:"bytes1"},{name:"name",internalType:"string",type:"string"},{name:"version",internalType:"string",type:"string"},{name:"chainId",internalType:"uint256",type:"uint256"},{name:"verifyingContract",internalType:"address",type:"address"},{name:"salt",internalType:"bytes32",type:"bytes32"},{name:"extensions",internalType:"uint256[]",type:"uint256[]"}]},{stateMutability:"view",type:"function",inputs:[{name:"digest",internalType:"bytes32",type:"bytes32"},{name:"signature",internalType:"bytes",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",internalType:"bytes4",type:"bytes4"}]}],EP=[{stateMutability:"view",type:"function",inputs:[],name:"eip712Domain",outputs:[{name:"fields",internalType:"bytes1",type:"bytes1"},{name:"name",internalType:"string",type:"string"},{name:"version",internalType:"string",type:"string"},{name:"chainId",internalType:"uint256",type:"uint256"},{name:"verifyingContract",internalType:"address",type:"address"},{name:"salt",internalType:"bytes32",type:"bytes32"},{name:"extensions",internalType:"uint256[]",type:"uint256[]"}]},{stateMutability:"view",type:"function",inputs:[{name:"account",internalType:"address",type:"address"},{name:"message",internalType:"bytes",type:"bytes"}],name:"encodeMessageData",outputs:[{name:"",internalType:"bytes",type:"bytes"}]},{stateMutability:"view",type:"function",inputs:[{name:"account",internalType:"address",type:"address"},{name:"message",internalType:"bytes",type:"bytes"}],name:"getMessageHash",outputs:[{name:"",internalType:"bytes32",type:"bytes32"}]},{stateMutability:"view",type:"function",inputs:[{name:"account",internalType:"address",type:"address"},{name:"ownerToCheck",internalType:"address",type:"address"}],name:"isOwnerOf",outputs:[{name:"",internalType:"bool",type:"bool"}]},{stateMutability:"view",type:"function",inputs:[{name:"digest",internalType:"bytes32",type:"bytes32"},{name:"signature",internalType:"bytes",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",internalType:"bytes4",type:"bytes4"}]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"data",internalType:"bytes",type:"bytes"}],name:"onInstall",outputs:[]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"",internalType:"bytes",type:"bytes"}],name:"onUninstall",outputs:[]},{stateMutability:"view",type:"function",inputs:[{name:"account",internalType:"address",type:"address"}],name:"ownersOf",outputs:[{name:"",internalType:"address[]",type:"address[]"}]},{stateMutability:"pure",type:"function",inputs:[],name:"pluginManifest",outputs:[{name:"",internalType:"struct PluginManifest",type:"tuple",components:[{name:"interfaceIds",internalType:"bytes4[]",type:"bytes4[]"},{name:"dependencyInterfaceIds",internalType:"bytes4[]",type:"bytes4[]"},{name:"executionFunctions",internalType:"bytes4[]",type:"bytes4[]"},{name:"permittedExecutionSelectors",internalType:"bytes4[]",type:"bytes4[]"},{name:"permitAnyExternalAddress",internalType:"bool",type:"bool"},{name:"canSpendNativeToken",internalType:"bool",type:"bool"},{name:"permittedExternalCalls",internalType:"struct ManifestExternalCallPermission[]",type:"tuple[]",components:[{name:"externalAddress",internalType:"address",type:"address"},{name:"permitAnySelector",internalType:"bool",type:"bool"},{name:"selectors",internalType:"bytes4[]",type:"bytes4[]"}]},{name:"userOpValidationFunctions",internalType:"struct ManifestAssociatedFunction[]",type:"tuple[]",components:[{name:"executionSelector",internalType:"bytes4",type:"bytes4"},{name:"associatedFunction",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]}]},{name:"runtimeValidationFunctions",internalType:"struct ManifestAssociatedFunction[]",type:"tuple[]",components:[{name:"executionSelector",internalType:"bytes4",type:"bytes4"},{name:"associatedFunction",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]}]},{name:"preUserOpValidationHooks",internalType:"struct ManifestAssociatedFunction[]",type:"tuple[]",components:[{name:"executionSelector",internalType:"bytes4",type:"bytes4"},{name:"associatedFunction",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]}]},{name:"preRuntimeValidationHooks",internalType:"struct ManifestAssociatedFunction[]",type:"tuple[]",components:[{name:"executionSelector",internalType:"bytes4",type:"bytes4"},{name:"associatedFunction",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]}]},{name:"executionHooks",internalType:"struct ManifestExecutionHook[]",type:"tuple[]",components:[{name:"executionSelector",internalType:"bytes4",type:"bytes4"},{name:"preExecHook",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]},{name:"postExecHook",internalType:"struct ManifestFunction",type:"tuple",components:[{name:"functionType",internalType:"enum ManifestAssociatedFunctionType",type:"uint8"},{name:"functionId",internalType:"uint8",type:"uint8"},{name:"dependencyIndex",internalType:"uint256",type:"uint256"}]}]}]}]},{stateMutability:"pure",type:"function",inputs:[],name:"pluginMetadata",outputs:[{name:"",internalType:"struct PluginMetadata",type:"tuple",components:[{name:"name",internalType:"string",type:"string"},{name:"version",internalType:"string",type:"string"},{name:"author",internalType:"string",type:"string"},{name:"permissionDescriptors",internalType:"struct SelectorPermission[]",type:"tuple[]",components:[{name:"functionSelector",internalType:"bytes4",type:"bytes4"},{name:"permissionDescription",internalType:"string",type:"string"}]}]}]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"preExecHookData",internalType:"bytes",type:"bytes"}],name:"postExecutionHook",outputs:[]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"sender",internalType:"address",type:"address"},{name:"value",internalType:"uint256",type:"uint256"},{name:"data",internalType:"bytes",type:"bytes"}],name:"preExecutionHook",outputs:[{name:"",internalType:"bytes",type:"bytes"}]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"sender",internalType:"address",type:"address"},{name:"value",internalType:"uint256",type:"uint256"},{name:"data",internalType:"bytes",type:"bytes"}],name:"preRuntimeValidationHook",outputs:[]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"userOp",internalType:"struct UserOperation",type:"tuple",components:[{name:"sender",internalType:"address",type:"address"},{name:"nonce",internalType:"uint256",type:"uint256"},{name:"initCode",internalType:"bytes",type:"bytes"},{name:"callData",internalType:"bytes",type:"bytes"},{name:"callGasLimit",internalType:"uint256",type:"uint256"},{name:"verificationGasLimit",internalType:"uint256",type:"uint256"},{name:"preVerificationGas",internalType:"uint256",type:"uint256"},{name:"maxFeePerGas",internalType:"uint256",type:"uint256"},{name:"maxPriorityFeePerGas",internalType:"uint256",type:"uint256"},{name:"paymasterAndData",internalType:"bytes",type:"bytes"},{name:"signature",internalType:"bytes",type:"bytes"}]},{name:"userOpHash",internalType:"bytes32",type:"bytes32"}],name:"preUserOpValidationHook",outputs:[{name:"",internalType:"uint256",type:"uint256"}]},{stateMutability:"view",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"sender",internalType:"address",type:"address"},{name:"",internalType:"uint256",type:"uint256"},{name:"",internalType:"bytes",type:"bytes"}],name:"runtimeValidationFunction",outputs:[]},{stateMutability:"view",type:"function",inputs:[{name:"interfaceId",internalType:"bytes4",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",internalType:"bool",type:"bool"}]},{stateMutability:"nonpayable",type:"function",inputs:[{name:"ownersToAdd",internalType:"address[]",type:"address[]"},{name:"ownersToRemove",internalType:"address[]",type:"address[]"}],name:"updateOwners",outputs:[]},{stateMutability:"view",type:"function",inputs:[{name:"functionId",internalType:"uint8",type:"uint8"},{name:"userOp",internalType:"struct UserOperation",type:"tuple",components:[{name:"sender",internalType:"address",type:"address"},{name:"nonce",internalType:"uint256",type:"uint256"},{name:"initCode",internalType:"bytes",type:"bytes"},{name:"callData",internalType:"bytes",type:"bytes"},{name:"callGasLimit",internalType:"uint256",type:"uint256"},{name:"verificationGasLimit",internalType:"uint256",type:"uint256"},{name:"preVerificationGas",internalType:"uint256",type:"uint256"},{name:"maxFeePerGas",internalType:"uint256",type:"uint256"},{name:"maxPriorityFeePerGas",internalType:"uint256",type:"uint256"},{name:"paymasterAndData",internalType:"bytes",type:"bytes"},{name:"signature",internalType:"bytes",type:"bytes"}]},{name:"userOpHash",internalType:"bytes32",type:"bytes32"}],name:"userOpValidationFunction",outputs:[{name:"",internalType:"uint256",type:"uint256"}]},{type:"event",anonymous:!1,inputs:[{name:"account",internalType:"address",type:"address",indexed:!0},{name:"addedOwners",internalType:"address[]",type:"address[]",indexed:!1},{name:"removedOwners",internalType:"address[]",type:"address[]",indexed:!1}],name:"OwnerUpdated"},{type:"error",inputs:[],name:"AlreadyInitialized"},{type:"error",inputs:[],name:"EmptyOwnersNotAllowed"},{type:"error",inputs:[],name:"InvalidAction"},{type:"error",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"InvalidOwner"},{type:"error",inputs:[],name:"NotAuthorized"},{type:"error",inputs:[{name:"caller",internalType:"address",type:"address"}],name:"NotContractCaller"},{type:"error",inputs:[{name:"selector",internalType:"bytes4",type:"bytes4"},{name:"functionId",internalType:"uint8",type:"uint8"}],name:"NotImplemented"},{type:"error",inputs:[],name:"NotInitialized"},{type:"error",inputs:[{name:"owner",internalType:"address",type:"address"}],name:"OwnerDoesNotExist"}],xP=(e,t,n,r=wP.meta.addresses[e.chain.id])=>{const a=async a=>{const[,s,i,o,c,l]=await e.readContract({abi:EP,address:r,functionName:"eip712Domain",account:t});return n().signTypedData({domain:{chainId:Number(o),name:s,salt:l,verifyingContract:c,version:i},types:{AlchemyModularAccountMessage:[{name:"message",type:"bytes"}]},message:{message:a},primaryType:"AlchemyModularAccountMessage"})};return{getDummySignature:()=>"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",signUserOperationHash:e=>n().signMessage({raw:e}),signMessage:({message:e})=>a(tp(e)),signTypedData:e=>a(Ud(e))}},kP=e=>(e.id,"0x000000e92D78D90000007F0082006FDA09BD5f11"),TP={encodeExecute:async({target:e,data:t,value:n})=>cc({abi:mP,functionName:"execute",args:[e,n??0n,t]}),encodeBatchExecute:async e=>cc({abi:mP,functionName:"executeBatch",args:[e.map((e=>({target:e.target,data:e.data,value:e.value??0n})))]})};async function PP({transport:e,chain:t,signer:n,accountAddress:r,initCode:a,entryPoint:s=Cb(t,{version:"0.6.0"}),factoryAddress:i=kP(t),owners:o=[],salt:c=0n}){const l=hb({transport:e,chain:t}),u=async()=>{if(a)return a;const e=await n.getAddress(),t=Array.from(new Set([...o,e])).filter((e=>0n!==Is(e))).sort(((e,t)=>{const n=Is(e),r=Is(t);return n<r?-1:n>r?1:0}));return Fi([i,cc({abi:fP,functionName:"createAccount",args:[c,t]})])},d=await Bv({client:l,entryPoint:s,accountAddress:r,getAccountInitCode:u}),p=await async function({transport:e,chain:t,entryPoint:n,source:r,accountAddress:a,getAccountInitCode:s,signMessage:i,signTypedData:o,encodeBatchExecute:c,encodeExecute:l,getDummySignature:u,signUserOperationHash:d,encodeUpgradeToAndCall:p}){const h=hb({transport:n=>e({...n,chain:t,retryCount:0}),chain:t}),m=Wu({address:n.address,abi:n.abi,client:h}),f=await Bv({client:h,entryPoint:n,accountAddress:a,getAccountInitCode:s});let y=Iv.UNDEFINED;const b=async()=>{if(y===Iv.DEPLOYED)return"0x";const e=await h.getBytecode({address:f});return(e?.length??0)>2?(y=Iv.DEPLOYED,"0x"):(y=Iv.NOT_DEPLOYED,s())},g=d??(async e=>i({message:{raw:Fs(e)}})),w=p??(()=>{throw new kb(r)}),v=async()=>"0x"===await b(),C=Nv({address:f,signMessage:i,signTypedData:o,signTransaction:()=>{throw new Tb}}),E=async(e,t)=>{if(e)return t;const[n,r]=Lv(await s());return Fb({factoryAddress:n,factoryCalldata:r,signature:t})};if("0.6.0"!==n.version&&"0.7.0"!==n.version)throw new fb(t,n.version);return{...C,source:r,signUserOperationHash:g,getFactoryAddress:async()=>Lv(await s())[0],getFactoryData:async()=>Lv(await s())[1],encodeBatchExecute:c??(()=>{throw new Ab(r)}),encodeExecute:l,getDummySignature:u,getInitCode:b,encodeUpgradeToAndCall:w,getEntryPoint:()=>n,isAccountDeployed:v,getNonce:async(e=0n)=>await v()?m.read.getNonce([f,e]):0n,signMessageWith6492:async e=>{const[t,n]=await Promise.all([v(),C.signMessage(e)]);return E(t,n)},signTypedDataWith6492:async e=>{const[t,n]=await Promise.all([v(),C.signTypedData(e)]);return E(t,n)},getImplementationAddress:async()=>{const e=await h.getStorageAt({address:C.address,slot:"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"});if(null==e)throw new Pb("0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc","Proxy Implementation Address");return hs(e)}}}({transport:e,chain:t,entryPoint:s,accountAddress:d,source:"MultiOwnerModularAccount",getAccountInitCode:u,...TP,...xP(l,d,(()=>n))});return{...p,publicKey:await n.getAddress(),getSigner:()=>n}}async function AP(e,{overrides:t,account:n=e.account,context:r,...a}){if(!n)throw new Eb;if(!eC(e))throw new lb("SmartAccountClient","uninstallPlugin",e);const s=await async function(e){return cc({abi:hP,functionName:"uninstallPlugin",args:[e.pluginAddress,e.config??"0x",e.pluginUninstallData??"0x"]})}(a);return e.sendUserOperation({uo:s,overrides:t,account:n,context:r})}const _P=e=>({installPlugin:async t=>bP(e,t),uninstallPlugin:async t=>AP(e,t)}),DP=e=>({...vP(e),async readOwners(t){const n=t?.account??e.account;if(!n)throw new Eb;return wP.getContract(e,t?.pluginAddress).read.ownersOf([n.address])},async isOwnerOf(t){const n=t.account??e.account;if(!n)throw new Eb;return wP.getContract(e,t.pluginAddress).read.isOwnerOf([n.address,t.address])}}),FP=({chain:e,connectionConfig:t,fetchOptions:n={}})=>{const r=eP.parse(e),a=null==t.rpcUrl?`${r.rpcUrls.alchemy.http[0]}/${t.apiKey??""}`:t.rpcUrl;return n.headers={...n.headers,"Alchemy-AA-Sdk-Version":"3.18.2"},null!=t.jwt&&(n.headers={...n.headers,Authorization:`Bearer ${t.jwt}`}),hb({chain:r,transport:ud(a,{fetchOptions:n})}).extend((()=>({updateHeaders(e){n.headers={...n.headers,...e}}})))};async function OP(e){const{chain:t,opts:n,...r}=tP.parse(e),a=FP({chain:t,connectionConfig:r}),s=await PP({transport:sd(a),...e});return function({opts:e,account:t,useSimulation:n,gasManagerConfig:r,feeEstimator:a,gasEstimator:s,customMiddleware:i,signUserOperation:o,client:c}){const l=e?.feeOptions??bv(c.chain),u=cC({account:t,client:c,type:"AlchemySmartAccountClient",opts:{...e,feeOptions:l},customMiddleware:async(e,t)=>(Uv(t.account)&&c.updateHeaders(uP(t.account)),i?i(e,t):e),feeEstimator:a??rP(c),userOperationSimulator:n?lP(c):void 0,gasEstimator:s,...r&&sP(c,{...r,gasEstimationOptions:{...r.gasEstimationOptions,disableGasEstimation:r.gasEstimationOptions?.disableGasEstimation??!1,fallbackFeeDataGetter:r.gasEstimationOptions?.fallbackFeeDataGetter??a,fallbackGasEstimator:r.gasEstimationOptions?.fallbackGasEstimator??s}}),signUserOperation:o}).extend(nP);return t&&Uv(t)&&c.updateHeaders(uP(t)),u}({...e,client:a,account:s,opts:n}).extend(DP).extend(_P).extend(yP)}const SP=e=>(t,n,r)=>{const a=r.subscribe;r.subscribe=(e,t,n)=>{let s=e;if(t){const a=(null==n?void 0:n.equalityFn)||Object.is;let i=e(r.getState());s=n=>{const r=e(n);if(!a(i,r)){const e=i;t(i=r,e)}},(null==n?void 0:n.fireImmediately)&&t(i,i)}return a(s)};return e(t,n,r)};function MP(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var r;const a=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),s=null!=(r=n.getItem(e))?r:null;return s instanceof Promise?s.then(a):a(s)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}const IP=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>IP(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>IP(t)(e)}}},NP=(e,t)=>(n,r,a)=>{let s={storage:MP((()=>localStorage)),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},i=!1,o=0;const c=new Set,l=new Set;let u=s.storage;if(!u)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...e)}),r,a);const d=()=>{const e=s.partialize({...r()});return u.setItem(s.name,{state:e,version:s.version})},p=a.setState;a.setState=(e,t)=>(p(e,t),d());const h=e(((...e)=>(n(...e),d())),r,a);let m;a.getInitialState=()=>h;const f=()=>{var e,t;if(!u)return;const a=++o;i=!1,c.forEach((e=>{var t;return e(null!=(t=r())?t:h)}));const p=(null==(t=s.onRehydrateStorage)?void 0:t.call(s,null!=(e=r())?e:h))||void 0;return IP(u.getItem.bind(u))(s.name).then((e=>{if(e){if("number"!=typeof e.version||e.version===s.version)return[!1,e.state];if(s.migrate){const t=s.migrate(e.state,e.version);return t instanceof Promise?t.then((e=>[!0,e])):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]})).then((e=>{var t;if(a!==o)return;const[i,c]=e;return m=s.merge(c,null!=(t=r())?t:h),n(m,!0),i?d():void 0})).then((()=>{a===o&&(null==p||p(m,void 0),m=r(),i=!0,l.forEach((e=>e(m))))})).catch((e=>{a===o&&(null==p||p(void 0,e))}))};return a.persist={setOptions:e=>{s={...s,...e},e.storage&&(u=e.storage)},clearStorage:()=>{null==u||u.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>f(),hasHydrated:()=>i,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},s.skipHydration||f(),m||h},UP=e=>{let t;const n=new Set,r=(e,r)=>{const a="function"==typeof e?e(t):e;if(!Object.is(a,t)){const e=t;t=(null!=r?r:"object"!=typeof a||null===a)?a:Object.assign({},t,a),n.forEach((n=>n(t,e)))}},a=()=>t,s={setState:r,getState:a,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e))},i=t=e(r,a,s);return s},LP=e=>e?UP(e):UP;class BP extends cb{constructor(){super(["Signer not authenticated","Please authenticate to use this signer"].join("\n"),{docsPath:"/signers/alchemy-signer/introduction.html"})}}const RP=Lw.object({sessionKey:Lw.string().default("alchemy-signer-session"),storage:Lw.enum(["localStorage","sessionStorage"]).default("localStorage").or(Lw.custom()),expirationTimeMs:Lw.number().default(9e5).describe("The time in milliseconds that a session should last before expiring [default: 15 minutes]"),client:Lw.custom()});class jP{constructor(e){Object.defineProperty(this,"sessionKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"eventEmitter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expirationTimeMs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getSessionUser",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{const e=this.getSession();if(null==e)return null;switch(e.type){case"email":{const t=await this.client.completeEmailAuth({bundle:e.bundle,orgId:e.user.orgId}).catch((e=>(console.warn("Failed to load user from session",e),null)));return t||(this.clearSession(),null)}case"passkey":return this.client.lookupUserWithPasskey(e.user);default:throw new Error("Unknown session type")}}}),Object.defineProperty(this,"clearSession",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.store.setState({session:null})}}),Object.defineProperty(this,"setTemporarySession",{enumerable:!0,configurable:!0,writable:!0,value:e=>{localStorage.setItem(`${this.sessionKey}:temporary`,JSON.stringify(e))}}),Object.defineProperty(this,"getTemporarySession",{enumerable:!0,configurable:!0,writable:!0,value:()=>{const e=localStorage.getItem(`${this.sessionKey}:temporary`);return e?JSON.parse(e):null}}),Object.defineProperty(this,"on",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>(this.eventEmitter.on(e,t),()=>this.eventEmitter.removeListener(e,t))}),Object.defineProperty(this,"getSession",{enumerable:!0,configurable:!0,writable:!0,value:()=>{const e=this.store.getState().session;return e?e.expirationDateMs<Date.now()?(this.store.setState({session:null}),null):e:null}}),Object.defineProperty(this,"setSession",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.store.setState({session:{...e,expirationDateMs:Date.now()+this.expirationTimeMs}})}}),Object.defineProperty(this,"registerEventListeners",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.store.subscribe((({session:e})=>e),((e,t)=>{null!=e&&null==t?this.eventEmitter.emit("connected",e):null==e&&null!=t&&this.eventEmitter.emit("disconnected")})),this.client.on("disconnected",(()=>this.clearSession())),this.client.on("connectedEmail",((e,t)=>{const n=this.getSession();null!=n&&"email"===n.type&&n.user.userId===e.userId&&n.bundle===t||this.setSession({type:"email",user:e,bundle:t})})),this.client.on("connectedPasskey",(e=>{const t=this.getSession();null!=t&&"passkey"===t.type&&t.user.userId===e.userId||this.setSession({type:"passkey",user:e})})),window.addEventListener("focus",(()=>{this.store.persist.rehydrate(),this.initialize()}))}});const{sessionKey:t,storage:n,expirationTimeMs:r,client:a}=RP.parse(e);this.sessionKey=t;const s="string"==typeof n?"localStorage"===n?localStorage:sessionStorage:n;this.expirationTimeMs=r,this.client=a,this.eventEmitter=new vn,this.store=LP(SP(NP(this.getInitialState,{name:this.sessionKey,storage:MP((()=>s))}))),this.registerEventListeners()}initialize(){this.getSessionUser().then((e=>{e?this.eventEmitter.emit("connected",this.getSession()):this.eventEmitter.emit("disconnected")})).finally((()=>{this.eventEmitter.emit("initialized")}))}getInitialState(){return{session:null}}}var GP;!function(e){e.INITIALIZING="INITIALIZING",e.CONNECTED="CONNECTED",e.DISCONNECTED="DISCONNECTED",e.AUTHENTICATING="AUTHENTICATING",e.AWAITING_EMAIL_AUTH="AWAITING_EMAIL_AUTH"}(GP||(GP={}));class HP{constructor({client:e,sessionConfig:t}){Object.defineProperty(this,"signerType",{enumerable:!0,configurable:!0,writable:!0,value:"alchemy-signer"}),Object.defineProperty(this,"inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sessionManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"on",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{switch(e){case"connected":return this.store.subscribe((({status:e})=>e),(e=>e===GP.CONNECTED&&t(this.store.getState().user)),{fireImmediately:!0});case"disconnected":return this.store.subscribe((({status:e})=>e),(e=>e===GP.DISCONNECTED&&t()),{fireImmediately:!0});case"statusChanged":return this.store.subscribe((({status:e})=>e),t,{fireImmediately:!0});default:throw new Error(`Uknown event type ${e}`)}}}),Object.defineProperty(this,"authenticate",{enumerable:!0,configurable:!0,writable:!0,value:async e=>"email"===e.type?this.authenticateWithEmail(e):this.authenticateWithPasskey(e)}),Object.defineProperty(this,"disconnect",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{await this.inner.disconnect()}}),Object.defineProperty(this,"getAuthDetails",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{const e=await this.sessionManager.getSessionUser();return null!=e?e:this.inner.whoami()}}),Object.defineProperty(this,"getAddress",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{const{address:e}=await this.inner.whoami();return e}}),Object.defineProperty(this,"signMessage",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=tp(e);return this.inner.signRawMessage(t)}}),Object.defineProperty(this,"signTypedData",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=Ud(e);return this.inner.signRawMessage(t)}}),Object.defineProperty(this,"signTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{const n=t?.serializer??bp,r=n(e),a=await this.inner.signRawMessage(ki(r));return n(e,{r:fv(a,{count:32}),s:fv(a,{count:32,offset:32}),v:BigInt(fv(a,{count:1,offset:64}))})}}),Object.defineProperty(this,"getUser",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=await this.inner.lookupUserByEmail(e);return null==t.orgId?null:{orgId:t.orgId}}}),Object.defineProperty(this,"addPasskey",{enumerable:!0,configurable:!0,writable:!0,value:async e=>this.inner.addPasskey(e??{})}),Object.defineProperty(this,"exportWallet",{enumerable:!0,configurable:!0,writable:!0,value:async e=>this.inner.exportWallet(e)}),Object.defineProperty(this,"toViemAccount",{enumerable:!0,configurable:!0,writable:!0,value:()=>{if(!this.inner.getUser())throw new BP;return Nv({address:this.inner.getUser().address,signMessage:e=>this.signMessage(e.message),signTypedData:e=>this.signTypedData(e),signTransaction:this.signTransaction})}}),Object.defineProperty(this,"authenticateWithEmail",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if("email"in e){const t=await this.getUser(e.email),{orgId:n}=t?await this.inner.initEmailAuth({email:e.email,expirationSeconds:this.sessionManager.expirationTimeMs,redirectParams:e.redirectParams}):await this.inner.createAccount({type:"email",email:e.email,expirationSeconds:this.sessionManager.expirationTimeMs,redirectParams:e.redirectParams});return this.sessionManager.setTemporarySession({orgId:n}),this.store.setState({status:GP.AWAITING_EMAIL_AUTH}),new Promise((e=>{const t=this.sessionManager.on("connected",(n=>{e(n.user),t()}))}))}{const t=e.orgId?{orgId:e.orgId}:this.sessionManager.getTemporarySession();if(!t)throw this.store.setState({status:GP.DISCONNECTED}),new Error("Could not find email auth init session!");return await this.inner.completeEmailAuth({bundle:e.bundle,orgId:t.orgId})}}}),Object.defineProperty(this,"authenticateWithPasskey",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{let t;if(e.createNew){const n=await this.inner.createAccount(e);t={address:n.address,userId:n.userId,orgId:n.orgId}}else if(t=await this.inner.lookupUserWithPasskey(),!t)throw this.store.setState({status:GP.DISCONNECTED}),new Error("No user found");return t}}),Object.defineProperty(this,"registerListeners",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.sessionManager.on("connected",(e=>{this.store.setState({user:e.user,status:GP.CONNECTED})})),this.sessionManager.on("disconnected",(()=>{this.store.setState({user:null,status:GP.DISCONNECTED})})),this.sessionManager.on("initialized",(()=>{this.store.setState((e=>({status:e.user?GP.CONNECTED:GP.DISCONNECTED})))})),this.inner.on("authenticating",(()=>{this.store.setState({status:GP.AUTHENTICATING})}))}}),this.inner=e,this.store=LP(SP((()=>({user:null,status:GP.INITIALIZING})))),this.sessionManager=new jP({...t,client:this.inner}),this.store=LP(SP((()=>({user:null,status:GP.INITIALIZING})))),this.registerListeners(),this.sessionManager.initialize()}}"undefined"!=typeof process&&null!=process.versions&&process.versions.node;var zP={exports:{}};!function(e,t){var n="undefined"!=typeof self?self:fe,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(n.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function i(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function u(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function d(e){var t=new FileReader,n=u(t);return t.readAsArrayBuffer(e),n}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:n.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:n.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():n.arrayBuffer&&n.blob&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):n.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n.blob&&(this.blob=function(){var e=l(this);if(e)return e;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(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,n,r=l(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=u(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},n.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=s(e),t=i(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},c.prototype.delete=function(e){delete this.map[s(e)]},c.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},c.prototype.set=function(e,t){this.map[s(e)]=i(t)},c.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},c.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),o(e)},c.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),o(e)},c.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),o(e)},n.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function f(e,t){var n,r,a=(t=t||{}).body;if(e instanceof f){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new c(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),m.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(a)}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(a))}})),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}f.prototype.clone=function(){return new f(this,{body:this._bodyInit})},h.call(f.prototype),h.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var g=[301,302,303,307,308];b.redirect=function(e,t){if(-1===g.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function w(e,r){return new Promise((function(a,s){var i=new f(e,r);if(i.signal&&i.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function l(){o.abort()}o.onload=function(){var e,t,n={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var a=n.join(":").trim();t.append(r,a)}})),t)};n.url="responseURL"in o?o.responseURL:n.headers.get("X-Request-URL");var r="response"in o?o.response:o.responseText;a(new b(r,n))},o.onerror=function(){s(new TypeError("Network request failed"))},o.ontimeout=function(){s(new TypeError("Network request failed"))},o.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},o.open(i.method,i.url,!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&n.blob&&(o.responseType="blob"),i.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),i.signal&&(i.signal.addEventListener("abort",l),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",l)}),o.send(void 0===i._bodyInit?null:i._bodyInit)}))}w.polyfill=!0,e.fetch||(e.fetch=w,e.Headers=c,e.Request=f,e.Response=b),t.Headers=c,t.Request=f,t.Response=b,t.fetch=w,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var a=r;(t=a.fetch).default=a.fetch,t.fetch=a.fetch,t.Headers=a.Headers,t.Request=a.Request,t.Response=a.Response,e.exports=t}(zP,zP.exports);var $P=ye(zP.exports);const VP=zP.exports.fetch;function qP(e){const t=new Uint8Array(e);let n="";for(const e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}const ZP="copy",WP="convert";function KP(e,t,n){if(t===ZP)return n;if(t===WP)return e(n);if(t instanceof Array)return n.map((n=>KP(e,t[0],n)));if(t instanceof Object){const r={};for(const[a,s]of Object.entries(t)){if(s.derive){const e=s.derive(n);void 0!==e&&(n[a]=e)}if(a in n)null!=n[a]?r[a]=KP(e,s.schema,n[a]):r[a]=null;else if(s.required)throw new Error(`Missing key: ${a}`)}return r}}function JP(e,t){return{required:!0,schema:e,derive:t}}function XP(e){return{required:!0,schema:e}}function YP(e){return{required:!1,schema:e}}const QP={appid:YP(ZP),appidExclude:YP(ZP),credProps:YP(ZP)},eA={type:XP(ZP),id:XP(ZP),rawId:XP(WP),authenticatorAttachment:YP(ZP),response:XP({clientDataJSON:XP(WP),attestationObject:XP(WP),transports:JP(ZP,(e=>e.getTransports?.()||[]))}),clientExtensionResults:JP(QP,(e=>e.getClientExtensionResults()))};function tA(e){return KP(qP,eA,e)}function nA(e){switch(e){case"internal":return"AUTHENTICATOR_TRANSPORT_INTERNAL";case"usb":return"AUTHENTICATOR_TRANSPORT_USB";case"nfc":return"AUTHENTICATOR_TRANSPORT_NFC";case"ble":return"AUTHENTICATOR_TRANSPORT_BLE";case"hybrid":return"AUTHENTICATOR_TRANSPORT_HYBRID";default:throw new Error("unsupported transport format")}}async function rA(e){if(!!!window.PublicKeyCredential)throw new Error("webauthn is not supported by this browser");const t=await async function(e){const t=await navigator.credentials.create(e);return t.toJSON=()=>tA(t),t}(e);return{credentialId:(n=t.toJSON()).rawId,attestationObject:n.response.attestationObject,clientDataJson:n.response.clientDataJSON,transports:n.response.transports.map(nA)};var n}class aA extends Error{constructor(e){let t=`Turnkey error ${e.code}: ${e.message}`;null!=e.details&&(t+=` (Details: ${JSON.stringify(e.details)})`),super(t),this.name="TurnkeyRequestError",this.details=e.details??null,this.code=e.code}}class sA{constructor(e,t){if(this.getActivity=async e=>this.request("/public/v1/query/get_activity",e),this.stampGetActivity=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_activity",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getApiKey=async e=>this.request("/public/v1/query/get_api_key",e),this.stampGetApiKey=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_api_key",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getApiKeys=async e=>this.request("/public/v1/query/get_api_keys",e),this.stampGetApiKeys=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_api_keys",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getAuthenticator=async e=>this.request("/public/v1/query/get_authenticator",e),this.stampGetAuthenticator=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_authenticator",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getAuthenticators=async e=>this.request("/public/v1/query/get_authenticators",e),this.stampGetAuthenticators=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_authenticators",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getOrganization=async e=>this.request("/public/v1/query/get_organization",e),this.stampGetOrganization=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_organization",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getPolicy=async e=>this.request("/public/v1/query/get_policy",e),this.stampGetPolicy=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_policy",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getPrivateKey=async e=>this.request("/public/v1/query/get_private_key",e),this.stampGetPrivateKey=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_private_key",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getUser=async e=>this.request("/public/v1/query/get_user",e),this.stampGetUser=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_user",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getWallet=async e=>this.request("/public/v1/query/get_wallet",e),this.stampGetWallet=async e=>{const t=this.config.baseUrl+"/public/v1/query/get_wallet",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getActivities=async e=>this.request("/public/v1/query/list_activities",e),this.stampGetActivities=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_activities",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getPolicies=async e=>this.request("/public/v1/query/list_policies",e),this.stampGetPolicies=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_policies",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.listPrivateKeyTags=async e=>this.request("/public/v1/query/list_private_key_tags",e),this.stampListPrivateKeyTags=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_private_key_tags",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getPrivateKeys=async e=>this.request("/public/v1/query/list_private_keys",e),this.stampGetPrivateKeys=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_private_keys",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getSubOrgIds=async e=>this.request("/public/v1/query/list_suborgs",e),this.stampGetSubOrgIds=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_suborgs",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.listUserTags=async e=>this.request("/public/v1/query/list_user_tags",e),this.stampListUserTags=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_user_tags",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getUsers=async e=>this.request("/public/v1/query/list_users",e),this.stampGetUsers=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_users",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getWalletAccounts=async e=>this.request("/public/v1/query/list_wallet_accounts",e),this.stampGetWalletAccounts=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_wallet_accounts",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getWallets=async e=>this.request("/public/v1/query/list_wallets",e),this.stampGetWallets=async e=>{const t=this.config.baseUrl+"/public/v1/query/list_wallets",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.getWhoami=async e=>this.request("/public/v1/query/whoami",e),this.stampGetWhoami=async e=>{const t=this.config.baseUrl+"/public/v1/query/whoami",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.approveActivity=async e=>this.request("/public/v1/submit/approve_activity",e),this.stampApproveActivity=async e=>{const t=this.config.baseUrl+"/public/v1/submit/approve_activity",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createApiKeys=async e=>this.request("/public/v1/submit/create_api_keys",e),this.stampCreateApiKeys=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_api_keys",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createApiOnlyUsers=async e=>this.request("/public/v1/submit/create_api_only_users",e),this.stampCreateApiOnlyUsers=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_api_only_users",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createAuthenticators=async e=>this.request("/public/v1/submit/create_authenticators",e),this.stampCreateAuthenticators=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_authenticators",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createInvitations=async e=>this.request("/public/v1/submit/create_invitations",e),this.stampCreateInvitations=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_invitations",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createPolicy=async e=>this.request("/public/v1/submit/create_policy",e),this.stampCreatePolicy=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_policy",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createPrivateKeyTag=async e=>this.request("/public/v1/submit/create_private_key_tag",e),this.stampCreatePrivateKeyTag=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_private_key_tag",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createPrivateKeys=async e=>this.request("/public/v1/submit/create_private_keys",e),this.stampCreatePrivateKeys=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_private_keys",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createSubOrganization=async e=>this.request("/public/v1/submit/create_sub_organization",e),this.stampCreateSubOrganization=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_sub_organization",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createUserTag=async e=>this.request("/public/v1/submit/create_user_tag",e),this.stampCreateUserTag=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_user_tag",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createUsers=async e=>this.request("/public/v1/submit/create_users",e),this.stampCreateUsers=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_users",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createWallet=async e=>this.request("/public/v1/submit/create_wallet",e),this.stampCreateWallet=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_wallet",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.createWalletAccounts=async e=>this.request("/public/v1/submit/create_wallet_accounts",e),this.stampCreateWalletAccounts=async e=>{const t=this.config.baseUrl+"/public/v1/submit/create_wallet_accounts",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deleteApiKeys=async e=>this.request("/public/v1/submit/delete_api_keys",e),this.stampDeleteApiKeys=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_api_keys",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deleteAuthenticators=async e=>this.request("/public/v1/submit/delete_authenticators",e),this.stampDeleteAuthenticators=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_authenticators",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deleteInvitation=async e=>this.request("/public/v1/submit/delete_invitation",e),this.stampDeleteInvitation=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_invitation",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deletePolicy=async e=>this.request("/public/v1/submit/delete_policy",e),this.stampDeletePolicy=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_policy",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deletePrivateKeyTags=async e=>this.request("/public/v1/submit/delete_private_key_tags",e),this.stampDeletePrivateKeyTags=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_private_key_tags",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deleteUserTags=async e=>this.request("/public/v1/submit/delete_user_tags",e),this.stampDeleteUserTags=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_user_tags",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.deleteUsers=async e=>this.request("/public/v1/submit/delete_users",e),this.stampDeleteUsers=async e=>{const t=this.config.baseUrl+"/public/v1/submit/delete_users",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.emailAuth=async e=>this.request("/public/v1/submit/email_auth",e),this.stampEmailAuth=async e=>{const t=this.config.baseUrl+"/public/v1/submit/email_auth",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.exportPrivateKey=async e=>this.request("/public/v1/submit/export_private_key",e),this.stampExportPrivateKey=async e=>{const t=this.config.baseUrl+"/public/v1/submit/export_private_key",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.exportWallet=async e=>this.request("/public/v1/submit/export_wallet",e),this.stampExportWallet=async e=>{const t=this.config.baseUrl+"/public/v1/submit/export_wallet",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.exportWalletAccount=async e=>this.request("/public/v1/submit/export_wallet_account",e),this.stampExportWalletAccount=async e=>{const t=this.config.baseUrl+"/public/v1/submit/export_wallet_account",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.importPrivateKey=async e=>this.request("/public/v1/submit/import_private_key",e),this.stampImportPrivateKey=async e=>{const t=this.config.baseUrl+"/public/v1/submit/import_private_key",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.importWallet=async e=>this.request("/public/v1/submit/import_wallet",e),this.stampImportWallet=async e=>{const t=this.config.baseUrl+"/public/v1/submit/import_wallet",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.initImportPrivateKey=async e=>this.request("/public/v1/submit/init_import_private_key",e),this.stampInitImportPrivateKey=async e=>{const t=this.config.baseUrl+"/public/v1/submit/init_import_private_key",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.initImportWallet=async e=>this.request("/public/v1/submit/init_import_wallet",e),this.stampInitImportWallet=async e=>{const t=this.config.baseUrl+"/public/v1/submit/init_import_wallet",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.initUserEmailRecovery=async e=>this.request("/public/v1/submit/init_user_email_recovery",e),this.stampInitUserEmailRecovery=async e=>{const t=this.config.baseUrl+"/public/v1/submit/init_user_email_recovery",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.recoverUser=async e=>this.request("/public/v1/submit/recover_user",e),this.stampRecoverUser=async e=>{const t=this.config.baseUrl+"/public/v1/submit/recover_user",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.rejectActivity=async e=>this.request("/public/v1/submit/reject_activity",e),this.stampRejectActivity=async e=>{const t=this.config.baseUrl+"/public/v1/submit/reject_activity",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.removeOrganizationFeature=async e=>this.request("/public/v1/submit/remove_organization_feature",e),this.stampRemoveOrganizationFeature=async e=>{const t=this.config.baseUrl+"/public/v1/submit/remove_organization_feature",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.setOrganizationFeature=async e=>this.request("/public/v1/submit/set_organization_feature",e),this.stampSetOrganizationFeature=async e=>{const t=this.config.baseUrl+"/public/v1/submit/set_organization_feature",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.signRawPayload=async e=>this.request("/public/v1/submit/sign_raw_payload",e),this.stampSignRawPayload=async e=>{const t=this.config.baseUrl+"/public/v1/submit/sign_raw_payload",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.signTransaction=async e=>this.request("/public/v1/submit/sign_transaction",e),this.stampSignTransaction=async e=>{const t=this.config.baseUrl+"/public/v1/submit/sign_transaction",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.updatePolicy=async e=>this.request("/public/v1/submit/update_policy",e),this.stampUpdatePolicy=async e=>{const t=this.config.baseUrl+"/public/v1/submit/update_policy",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.updatePrivateKeyTag=async e=>this.request("/public/v1/submit/update_private_key_tag",e),this.stampUpdatePrivateKeyTag=async e=>{const t=this.config.baseUrl+"/public/v1/submit/update_private_key_tag",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.updateRootQuorum=async e=>this.request("/public/v1/submit/update_root_quorum",e),this.stampUpdateRootQuorum=async e=>{const t=this.config.baseUrl+"/public/v1/submit/update_root_quorum",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.updateUser=async e=>this.request("/public/v1/submit/update_user",e),this.stampUpdateUser=async e=>{const t=this.config.baseUrl+"/public/v1/submit/update_user",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},this.updateUserTag=async e=>this.request("/public/v1/submit/update_user_tag",e),this.stampUpdateUserTag=async e=>{const t=this.config.baseUrl+"/public/v1/submit/update_user_tag",n=JSON.stringify(e);return{body:n,stamp:await this.stamper.stamp(n),url:t}},!e.baseUrl)throw new Error("Missing base URL. Please verify env vars.");this.config=e,this.stamper=t}async request(e,t){const n=this.config.baseUrl+e,r=JSON.stringify(t),a=await this.stamper.stamp(r),s=await VP(n,{method:"POST",headers:{[a.stampHeaderName]:a.stampHeaderValue,"X-Client-Version":"@turnkey/http@2.9.0"},body:r,redirect:"follow"});if(!s.ok){let e;try{e=await s.json()}catch(e){throw new Error(`${s.status} ${s.statusText}`)}throw new aA(e)}return await s.json()}}var iA;!function(e){e.PublicKeyReady="PUBLIC_KEY_READY",e.InjectCredentialBundle="INJECT_CREDENTIAL_BUNDLE",e.InjectKeyExportBundle="INJECT_KEY_EXPORT_BUNDLE",e.InjectWalletExportBundle="INJECT_WALLET_EXPORT_BUNDLE",e.InjectImportBundle="INJECT_IMPORT_BUNDLE",e.ExtractWalletEncryptedBundle="EXTRACT_WALLET_ENCRYPTED_BUNDLE",e.BundleInjected="BUNDLE_INJECTED",e.EncryptedBundleExtracted="ENCRYPTED_BUNDLE_EXTRACTED",e.StampRequest="STAMP_REQUEST",e.Stamp="STAMP",e.Error="ERROR"}(iA||(iA={}));class oA{constructor(e){if("undefined"==typeof window)throw new Error("Cannot initialize iframe in non-browser environment");if(!e.iframeContainer)throw new Error("Iframe container cannot be found");if(this.container=e.iframeContainer,this.container.querySelector(`#${e.iframeElementId}`))throw new Error(`Iframe element with ID ${e.iframeElementId} already exists`);let t=window.document.createElement("iframe");t.id=e.iframeElementId,t.src=e.iframeUrl,this.iframe=t;const n=new URL(e.iframeUrl);this.iframeOrigin=n.origin,this.iframePublicKey=null}async init(){return this.container.appendChild(this.iframe),new Promise(((e,t)=>{window.addEventListener("message",(t=>{t.origin===this.iframeOrigin&&t.data?.type===iA.PublicKeyReady&&(this.iframePublicKey=t.data.value,e(t.data.value))}),!1)}))}clear(){this.iframe.remove()}publicKey(){return this.iframePublicKey}async injectCredentialBundle(e){return new Promise(((t,n)=>{this.iframe.contentWindow?.postMessage({type:iA.InjectCredentialBundle,value:e},"*"),window.addEventListener("message",(e=>{e.origin===this.iframeOrigin&&(e.data?.type===iA.BundleInjected&&t(e.data.value),e.data?.type===iA.Error&&n(e.data.value))}),!1)}))}async injectKeyExportBundle(e){return this.iframe.contentWindow?.postMessage({type:iA.InjectKeyExportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===iA.BundleInjected&&e(n.data.value),n.data?.type===iA.Error&&t(n.data.value))}),!1)}))}async injectWalletExportBundle(e){return this.iframe.contentWindow?.postMessage({type:iA.InjectWalletExportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===iA.BundleInjected&&e(n.data.value),n.data?.type===iA.Error&&t(n.data.value))}),!1)}))}async injectImportBundle(e){return this.iframe.contentWindow?.postMessage({type:iA.InjectImportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===iA.BundleInjected&&e(n.data.value),n.data?.type===iA.Error&&t(n.data.value))}),!1)}))}async extractWalletEncryptedBundle(){return this.iframe.contentWindow?.postMessage({type:iA.ExtractWalletEncryptedBundle},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===iA.EncryptedBundleExtracted&&e(n.data.value),n.data?.type===iA.Error&&t(n.data.value))}),!1)}))}async stamp(e){if(null===this.iframePublicKey)throw new Error("null iframe public key. Have you called/awaited .init()?");const t=this.iframeOrigin;return this.iframe.contentWindow?.postMessage({type:iA.StampRequest,value:e},"*"),new Promise((function(e,n){window.addEventListener("message",(r=>{r.origin===t&&(r.data?.type===iA.Stamp&&e({stampHeaderName:"X-Stamp",stampHeaderValue:r.data.value}),r.data?.type===iA.Error&&n(r.data.value))}),!1)}))}}function cA(e){const t=new Uint8Array(e);let n="";for(const e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}const lA="copy",uA="convert";function dA(e,t,n){if(t===lA)return n;if(t===uA)return e(n);if(t instanceof Array)return n.map((n=>dA(e,t[0],n)));if(t instanceof Object){const r={};for(const[a,s]of Object.entries(t)){if(s.derive){const e=s.derive(n);void 0!==e&&(n[a]=e)}if(a in n)null!=n[a]?r[a]=dA(e,s.schema,n[a]):r[a]=null;else if(s.required)throw new Error(`Missing key: ${a}`)}return r}}function pA(e){return{required:!0,schema:e}}function hA(e){return{required:!1,schema:e}}const mA={appid:hA(lA),appidExclude:hA(lA),credProps:hA(lA)},fA={type:pA(lA),id:pA(lA),rawId:pA(uA),authenticatorAttachment:hA(lA),response:pA({clientDataJSON:pA(uA),authenticatorData:pA(uA),signature:pA(uA),userHandle:pA(uA)}),clientExtensionResults:(yA=mA,bA=e=>e.getClientExtensionResults(),{required:!0,schema:yA,derive:bA})};var yA,bA;function gA(e){return dA(cA,fA,e)}let wA;function vA(e,...t){if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function CA(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")}wA=void 0!==globalThis?.Buffer?globalThis.Buffer:b;
27
27
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
28
28
  const EA=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),xA=(e,t)=>e<<32-t|e>>>t;function kA(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),vA(e),e}new Uint8Array(new Uint32Array([287454020]).buffer)[0];class TA{clone(){return this._cloneInto()}}function PA(e){const t=t=>e().update(kA(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const AA=(e,t,n)=>e&t^~e&n,_A=(e,t,n)=>e&t^e&n^t&n;class DA extends TA{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=EA(this.buffer)}update(e){CA(this);const{view:t,buffer:n,blockLen:r}=this,a=(e=kA(e)).length;for(let s=0;s<a;){const i=Math.min(r-this.pos,a-s);if(i!==r)n.set(e.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===r&&(this.process(t,0),this.pos=0);else{const t=EA(e);for(;r<=a-s;s+=r)this.process(t,s)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){CA(this),function(e,t){vA(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:a}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>r-s&&(this.process(n,0),s=0);for(let e=s;e<r;e++)t[e]=0;!function(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const a=BigInt(32),s=BigInt(4294967295),i=Number(n>>a&s),o=Number(n&s),c=r?4:0,l=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),a),this.process(n,0);const i=EA(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)i.setUint32(4*e,l[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:a,destroyed:s,pos:i}=this;return e.length=r,e.pos=i,e.finished=a,e.destroyed=s,r%t&&e.buffer.set(n),e}}const FA=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]),OA=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SA=new Uint32Array(64);class MA extends DA{constructor(){super(64,32,8,!1),this.A=0|OA[0],this.B=0|OA[1],this.C=0|OA[2],this.D=0|OA[3],this.E=0|OA[4],this.F=0|OA[5],this.G=0|OA[6],this.H=0|OA[7]}get(){const{A:e,B:t,C:n,D:r,E:a,F:s,G:i,H:o}=this;return[e,t,n,r,a,s,i,o]}set(e,t,n,r,a,s,i,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|a,this.F=0|s,this.G=0|i,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)SA[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=SA[e-15],n=SA[e-2],r=xA(t,7)^xA(t,18)^t>>>3,a=xA(n,17)^xA(n,19)^n>>>10;SA[e]=a+SA[e-7]+r+SA[e-16]|0}let{A:n,B:r,C:a,D:s,E:i,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(xA(i,6)^xA(i,11)^xA(i,25))+AA(i,o,c)+FA[e]+SA[e]|0,u=(xA(n,2)^xA(n,13)^xA(n,22))+_A(n,r,a)|0;l=c,c=o,o=i,i=s+t|0,s=a,a=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,a=a+this.C|0,s=s+this.D|0,i=i+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,a,s,i,o,c,l)}roundClean(){SA.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const IA=PA((()=>new MA));class NA{constructor(e){this.rpId=e.rpId,this.timeout=e.timeout||3e5,this.userVerification=e.userVerification||"preferred",this.allowCredentials=e.allowCredentials||[]}async stamp(e){const t=function(e){const t=(new TextEncoder).encode(e),n=IA(t),r=wA.from(n).toString("hex"),a=wA.from(r,"utf8");return new Uint8Array(a)}(e),n={publicKey:{rpId:this.rpId,challenge:t,allowCredentials:this.allowCredentials,timeout:this.timeout,userVerification:this.userVerification}},r=(await async function(e){const t=await navigator.credentials.get(e);return t.toJSON=()=>gA(t),t}(n)).toJSON(),a={authenticatorData:r.response.authenticatorData,clientDataJson:r.response.clientDataJSON,credentialId:r.id,signature:r.response.signature};return{stampHeaderName:"X-Stamp-Webauthn",stampHeaderValue:JSON.stringify(a)}}}const UA=e=>Buffer.from(e).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),LA=()=>{const e=new Uint8Array(32);return crypto.getRandomValues(e),e.buffer};class BA{constructor(e){Object.defineProperty(this,"_user",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"connectionConfig",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"turnkeyClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rootOrg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"eventEmitter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"on",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>(this.eventEmitter.on(e,t),()=>this.eventEmitter.removeListener(e,t))}),Object.defineProperty(this,"addPasskey",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!this.user)throw new BP;const{attestation:t,challenge:n}=await this.getWebAuthnAttestation(e),{activity:r}=await this.turnkeyClient.createAuthenticators({type:"ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2",timestampMs:Date.now().toString(),organizationId:this.user.orgId,parameters:{userId:this.user.userId,authenticators:[{attestation:t,authenticatorName:`passkey-${Date.now().toString()}`,challenge:UA(n)}]}}),{authenticatorIds:a}=await this.pollActivityCompletion(r,this.user.orgId,"createAuthenticatorsResult");return a}}),Object.defineProperty(this,"whoami",{enumerable:!0,configurable:!0,writable:!0,value:async(e=this.user?.orgId)=>{if(this.user)return this.user;if(!e)throw new Error("No orgId provided");const t=await this.turnkeyClient.stampGetWhoami({organizationId:e}),n=await this.request("/v1/whoami",{stampedRequest:t}),r=(()=>{try{return JSON.parse(t?.stamp.stampHeaderValue).credentialId}catch(e){return}})();return this.user={...n,credentialId:r},this.user}}),Object.defineProperty(this,"lookupUserByEmail",{enumerable:!0,configurable:!0,writable:!0,value:async e=>this.request("/v1/lookup",{email:e})}),Object.defineProperty(this,"signRawMessage",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!this.user)throw new BP;const t=await this.turnkeyClient.stampSignRawPayload({organizationId:this.user.orgId,type:"ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2",timestampMs:Date.now().toString(),parameters:{encoding:"PAYLOAD_ENCODING_HEXADECIMAL",hashFunction:"HASH_FUNCTION_NO_OP",payload:e,signWith:this.user.address}}),{signature:n}=await this.request("/v1/sign-payload",{stampedRequest:t});return n}}),Object.defineProperty(this,"getUser",{enumerable:!0,configurable:!0,writable:!0,value:()=>this.user??null}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{const n=this.connectionConfig.rpcUrl??"https://api.g.alchemy.com",r=new Headers;r.append("Content-Type","application/json"),this.connectionConfig.apiKey?r.append("Authorization",`Bearer ${this.connectionConfig.apiKey}`):this.connectionConfig.jwt&&r.append("Authorization",`Bearer ${this.connectionConfig.jwt}`);const a=await fetch(`${n}/signer${e}`,{method:"POST",body:JSON.stringify(t),headers:r});if(!a.ok)throw new Error(await a.text());return await a.json()}}),Object.defineProperty(this,"exportAsSeedPhrase",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!this.user)throw new BP;const{wallets:t}=await this.turnkeyClient.getWallets({organizationId:this.user.orgId}),n=await Promise.all(t.map((({walletId:e})=>this.turnkeyClient.getWalletAccounts({organizationId:this.user.orgId,walletId:e})))).then((e=>e.flatMap((e=>e.accounts)))),r=n.find((e=>e.address===this.user.address));if(!r)throw new Error(`Could not find wallet associated with ${this.user.address}`);const{activity:a}=await this.turnkeyClient.exportWallet({organizationId:this.user.orgId,type:"ACTIVITY_TYPE_EXPORT_WALLET",timestampMs:Date.now().toString(),parameters:{walletId:r.walletId,targetPublicKey:e.publicKey()}}),{exportBundle:s}=await this.pollActivityCompletion(a,this.user.orgId,"exportWalletResult"),i=await e.injectWalletExportBundle(s);if(!i)throw new Error("Failed to inject wallet export bundle");return i}}),Object.defineProperty(this,"exportAsPrivateKey",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!this.user)throw new BP;const{activity:t}=await this.turnkeyClient.exportWalletAccount({organizationId:this.user.orgId,type:"ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT",timestampMs:Date.now().toString(),parameters:{address:this.user.address,targetPublicKey:e.publicKey()}}),{exportBundle:n}=await this.pollActivityCompletion(t,this.user.orgId,"exportWalletAccountResult"),r=await e.injectKeyExportBundle(n);if(!r)throw new Error("Failed to inject wallet export bundle");return r}}),Object.defineProperty(this,"pollActivityCompletion",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t,n)=>{if("ACTIVITY_STATUS_COMPLETED"===e.status)return e.result[n];const{activity:{status:r,id:a,result:s}}=await this.turnkeyClient.getActivity({activityId:e.id,organizationId:t});if("ACTIVITY_STATUS_COMPLETED"===r)return s[n];if("ACTIVITY_STATUS_FAILED"===r||"ACTIVITY_STATUS_REJECTED"===r||"ACTIVITY_STATUS_CONSENSUS_NEEDED"===r)throw new Error(`Failed to get activity with with id ${a} (status: ${r})`);return await new Promise((e=>setTimeout(e,500))),this.pollActivityCompletion(e,t,n)}});const{stamper:t,connection:n,rootOrgId:r}=e;this.rootOrg=r??"24c1acf5-810f-41e0-a503-d5d13fa8e830",this.eventEmitter=new vn,this.connectionConfig=Fv.parse(n),this.turnkeyClient=new sA({baseUrl:"https://api.turnkey.com"},t)}get user(){return this._user}set user(e){e&&!this._user?this.eventEmitter.emit("connected",e):!e&&this._user&&this.eventEmitter.emit("disconnected"),this._user=e}setStamper(e){this.turnkeyClient.stamper=e}exportWalletInner(e){switch(e.exportAs){case"PRIVATE_KEY":return this.exportAsPrivateKey(e.exportStamper);case"SEED_PHRASE":return this.exportAsSeedPhrase(e.exportStamper)}}}const RA=Lw.object({connection:Fv,iframeConfig:Lw.object({iframeElementId:Lw.string().default("turnkey-iframe"),iframeContainerId:Lw.string()}),rpId:Lw.string().optional(),rootOrgId:Lw.string().optional().default("24c1acf5-810f-41e0-a503-d5d13fa8e830")});class jA extends BA{constructor(e){const{connection:t,iframeConfig:n,rpId:r,rootOrgId:a}=RA.parse(e),s=new oA({iframeElementId:n.iframeElementId,iframeUrl:"https://auth.turnkey.com",iframeContainer:document.getElementById(n.iframeContainerId)});super({connection:t,rootOrgId:a,stamper:s}),Object.defineProperty(this,"iframeStamper",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"webauthnStamper",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"iframeContainerId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"createAccount",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(this.eventEmitter.emit("authenticating"),"email"===e.type){const{email:t,expirationSeconds:n}=e,r=await this.initIframeStamper();return await this.request("/v1/signup",{email:t,targetPublicKey:r,expirationSeconds:n,redirectParams:e.redirectParams?.toString()})}const{attestation:t,challenge:n}=await this.getWebAuthnAttestation(e.creationOpts,{username:e.username}),r=await this.request("/v1/signup",{passkey:{challenge:UA(n),attestation:t}});return this.user={orgId:r.orgId,address:r.address,userId:r.userId,credentialId:t.credentialId},this.initWebauthnStamper(this.user),this.eventEmitter.emit("connectedPasskey",this.user),r}}),Object.defineProperty(this,"initEmailAuth",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{this.eventEmitter.emit("authenticating");const{email:t,expirationSeconds:n}=e,r=await this.initIframeStamper();return this.request("/v1/auth",{email:t,targetPublicKey:r,expirationSeconds:n,redirectParams:e.redirectParams?.toString()})}}),Object.defineProperty(this,"completeEmailAuth",{enumerable:!0,configurable:!0,writable:!0,value:async({bundle:e,orgId:t})=>{this.eventEmitter.emit("authenticating"),await this.initIframeStamper();if(!await this.iframeStamper.injectCredentialBundle(e))throw new Error("Failed to inject credential bundle");const n=await this.whoami(t);return this.eventEmitter.emit("connectedEmail",n,e),n}}),Object.defineProperty(this,"lookupUserWithPasskey",{enumerable:!0,configurable:!0,writable:!0,value:async(e=void 0)=>{if(this.eventEmitter.emit("authenticating"),await this.initWebauthnStamper(e),e)return this.user=e,e;const t=await this.whoami(this.rootOrg);return await this.initWebauthnStamper(t),this.eventEmitter.emit("connectedPasskey",t),t}}),Object.defineProperty(this,"exportWallet",{enumerable:!0,configurable:!0,writable:!0,value:async({iframeContainerId:e,iframeElementId:t="turnkey-export-iframe"})=>{const n=new oA({iframeContainer:document.getElementById(e),iframeElementId:t,iframeUrl:"https://export.turnkey.com"});return await n.init(),this.turnkeyClient.stamper===this.iframeStamper?this.exportWalletInner({exportStamper:n,exportAs:"SEED_PHRASE"}):this.exportWalletInner({exportStamper:n,exportAs:"PRIVATE_KEY"})}}),Object.defineProperty(this,"disconnect",{enumerable:!0,configurable:!0,writable:!0,value:async()=>{this.user=void 0,this.iframeStamper.clear()}}),Object.defineProperty(this,"initIframeStamper",{enumerable:!0,configurable:!0,writable:!0,value:async()=>(this.iframeStamper.publicKey()||await this.iframeStamper.init(),this.setStamper(this.iframeStamper),this.iframeStamper.publicKey())}),Object.defineProperty(this,"initWebauthnStamper",{enumerable:!0,configurable:!0,writable:!0,value:async(e=this.user)=>{this.setStamper(this.webauthnStamper),e&&e.credentialId&&(this.webauthnStamper.allowCredentials=[{id:Buffer.from(e.credentialId,"base64"),type:"public-key",transports:["internal","hybrid"]}])}}),Object.defineProperty(this,"getWebAuthnAttestation",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t={username:this.user?.email??"anonymous"})=>{const n=LA(),r=LA(),a=await rA({publicKey:{...e?.publicKey,authenticatorSelection:{residentKey:"preferred",requireResidentKey:!1,userVerification:"preferred",...e?.publicKey?.authenticatorSelection},challenge:n,rp:{id:window.location.hostname,name:window.location.hostname,...e?.publicKey?.rp},pubKeyCredParams:[{type:"public-key",alg:-7},{type:"public-key",alg:-257}],user:{id:r,name:t.username,displayName:t.username,...e?.publicKey?.user}},signal:e?.signal});return null!=a.transports&&0!==a.transports.length||(a.transports=["AUTHENTICATOR_TRANSPORT_INTERNAL","AUTHENTICATOR_TRANSPORT_HYBRID"]),{challenge:n,authenticatorUserId:r,attestation:a}}}),this.iframeStamper=s,this.iframeContainerId=n.iframeContainerId,this.webauthnStamper=new NA({rpId:r??window.location.hostname})}}const GA=Lw.object({client:Lw.custom().or(RA)}).extend({sessionConfig:RP.omit({client:!0}).optional()});class HA extends HP{constructor(e){const{sessionConfig:t,...n}=GA.parse(e);let r;r="connection"in n.client?new jA(n.client):n.client,super({client:r,sessionConfig:t})}}const zA=/^tuple(?<array>(\[(\d*)\])*)$/;function $A(e){let t=e.type;if(zA.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){t+=$A(e.components[r]),r<n-1&&(t+=", ")}const r=function(e,t){const n=e.exec(t);return n?.groups}(zA,e.type);return t+=`)${r?.array??""}`,$A({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function VA(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=$A(e[r]),r!==n-1&&(t+=", ")}return t}function qA(e,t,n){return r=>e[t.name]?.(r)??e[n]?.(r)??t(e,r)}function ZA(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new l_(e.type);return`${e.name}(${WA(e.inputs,{includeName:t})})`}function WA(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${WA(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}function KA(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function JA(e){return KA(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}class XA extends Error{constructor(e,t={}){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:"viem@2.13.7"});const n=t.cause instanceof XA?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof XA&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://viem.sh${r}${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join("\n"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return YA(this,e)}}function YA(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?YA(e.cause,t):t?null:e}class QA extends XA{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class e_ extends XA{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class t_ extends XA{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class n_ extends XA{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${JA(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class r_ extends XA{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class a_ extends XA{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class s_ extends XA{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${ZA(e.abiItem)}\`, and`,`\`${t.type}\` in \`${ZA(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class i_ extends XA{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class o_ extends XA{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class c_ extends XA{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class l_ extends XA{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class u_ extends XA{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class d_ extends XA{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class p_ extends XA{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${t} ${n} long, but is ${e} ${n} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}function h_(e,{dir:t,size:n=32}={}){return"string"==typeof e?m_(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new d_({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let a=0;a<n;a++){const s="right"===t;r[s?a:n-a-1]=e[s?a:e.length-a-1]}return r}(e,{dir:t,size:n})}function m_(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new d_({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}class f_ extends XA{constructor({max:e,min:t,signed:n,size:r,value:a}){super(`Number "${a}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class y_ extends XA{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function b_(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,r=0;for(let e=0;e<n.length-1&&"0"===n["left"===t?e:n.length-e-1].toString();e++)r++;return n="left"===t?n.slice(r):n.slice(0,n.length-r),"string"==typeof e?(1===n.length&&"right"===t&&(n=`${n}0`),`0x${n.length%2==1?`0${n}`:n}`):n}function g_(e,{size:t}){if(JA(e)>t)throw new y_({givenSize:JA(e),maxSize:t})}function w_(e,t={}){const{signed:n}=t;t.size&&g_(e,{size:t.size});const r=BigInt(e);if(!n)return r;const a=(e.length-2)/2;return r<=(1n<<8n*BigInt(a)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*a,"f")}`)-1n}function v_(e,t={}){return Number(w_(e,t))}const C_=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function E_(e,t={}){return"number"==typeof e||"bigint"==typeof e?T_(e,t):"string"==typeof e?A_(e,t):"boolean"==typeof e?x_(e,t):k_(e,t)}function x_(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(g_(n,{size:t.size}),h_(n,{size:t.size})):n}function k_(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=C_[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(g_(r,{size:t.size}),h_(r,{dir:"right",size:t.size})):r}function T_(e,t={}){const{signed:n,size:r}=t,a=BigInt(e);let s;r?s=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i="bigint"==typeof s&&n?-s-1n:0;if(s&&a>s||a<i){const t="bigint"==typeof e?"n":"";throw new f_({max:s?`${s}${t}`:void 0,min:`${i}${t}`,signed:n,size:r,value:`${e}${t}`})}const o=`0x${(n&&a<0?(1n<<BigInt(8*r))+BigInt(a):a).toString(16)}`;return r?h_(o,{size:r}):o}const P_=new TextEncoder;function A_(e,t={}){return k_(P_.encode(e),t)}const __=new TextEncoder;function D_(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=T_(e,t);return S_(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return g_(n,{size:t.size}),h_(n,{size:t.size});return n}(e,t):KA(e)?S_(e,t):M_(e,t)}const F_={zero:48,nine:57,A:65,F:70,a:97,f:102};function O_(e){return e>=F_.zero&&e<=F_.nine?e-F_.zero:e>=F_.A&&e<=F_.F?e-(F_.A-10):e>=F_.a&&e<=F_.f?e-(F_.a-10):void 0}function S_(e,t={}){let n=e;t.size&&(g_(n,{size:t.size}),n=h_(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const a=r.length/2,s=new Uint8Array(a);for(let e=0,t=0;e<a;e++){const n=O_(r.charCodeAt(t++)),a=O_(r.charCodeAt(t++));if(void 0===n||void 0===a)throw new XA(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);s[e]=16*n+a}return s}function M_(e,t={}){const n=__.encode(e);return"number"==typeof t.size?(g_(n,{size:t.size}),h_(n,{dir:"right",size:t.size})):n}function I_(e,t){const n=t||"hex",r=xi(KA(e,{strict:!1})?D_(e):e);return"bytes"===n?r:E_(r)}const N_=e=>I_(D_(e));const U_=e=>{var t;return function(e){let t=!0,n="",r=0,a="",s=!1;for(let i=0;i<e.length;i++){const o=e[i];if(["(",")",","].includes(o)&&(t=!0),"("===o&&r++,")"===o&&r--,t)if(0!==r)" "!==o?(a+=o,n+=o):","!==e[i-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===o&&["event","function",""].includes(a))a="";else if(a+=o,")"===o){s=!0;break}}if(!s)throw new XA("Unable to normalize signature.");return a}("string"==typeof e?e:"function"===(t=e).type?`function ${t.name}(${VA(t.inputs)})${t.stateMutability&&"nonpayable"!==t.stateMutability?` ${t.stateMutability}`:""}${t.outputs.length?` returns (${VA(t.outputs)})`:""}`:"event"===t.type?`event ${t.name}(${VA(t.inputs)})`:"error"===t.type?`error ${t.name}(${VA(t.inputs)})`:"constructor"===t.type?`constructor(${VA(t.inputs)})${"payable"===t.stateMutability?" payable":""}`:"fallback"===t.type?"fallback()":"receive() external payable")};function L_(e){return t=U_(e),N_(t);var t}const B_=L_;class R_ extends XA{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}class j_ extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,t){return super.set(e,t),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}const G_=new j_(8192);function H_(e,t){if(G_.has(`${e}.${t}`))return G_.get(`${e}.${t}`);const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=I_(M_(n),"bytes"),a=(t?n.substring(`${t}0x`.length):n).split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&a[e]&&(a[e]=a[e].toUpperCase()),(15&r[e>>1])>=8&&a[e+1]&&(a[e+1]=a[e+1].toUpperCase());const s=`0x${a.join("")}`;return G_.set(`${e}.${t}`,s),s}const z_=/^0x[a-fA-F0-9]{40}$/,$_=new j_(8192);function V_(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if($_.has(r))return $_.get(r);const a=!(!z_.test(e)||e.toLowerCase()!==e&&n&&H_(e)!==e);return $_.set(r,a),a}function q_(e){return"string"==typeof e[0]?Z_(e):function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(e)}function Z_(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}function W_(e,t,n,{strict:r}={}){return KA(e,{strict:!1})?function(e,t,n,{strict:r}={}){K_(e,t);const a=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&J_(a,t,n);return a}(e,t,n,{strict:r}):function(e,t,n,{strict:r}={}){K_(e,t);const a=e.slice(t,n);r&&J_(a,t,n);return a}(e,t,n,{strict:r})}function K_(e,t){if("number"==typeof t&&t>0&&t>JA(e)-1)throw new u_({offset:t,position:"start",size:JA(e)})}function J_(e,t,n){if("number"==typeof t&&"number"==typeof n&&JA(e)!==n-t)throw new u_({offset:n,position:"end",size:JA(e)})}function X_(e,t){if(e.length!==t.length)throw new r_({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Y_({param:e[r],value:t[r]}));return n}({params:e,values:t}),r=Q_(n);return 0===r.length?"0x":r}function Y_({param:e,value:t}){const n=function(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}(e.type);if(n){const[r,a]=n;return function(e,{length:t,param:n}){const r=null===t;if(!Array.isArray(e))throw new c_(e);if(!r&&e.length!==t)throw new t_({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let a=!1;const s=[];for(let t=0;t<e.length;t++){const r=Y_({param:n,value:e[t]});r.dynamic&&(a=!0),s.push(r)}if(r||a){const e=Q_(s);if(r){const t=T_(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?q_([t,e]):t}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:q_(s.map((({encoded:e})=>e)))}}(t,{length:r,param:{...e,type:a}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const r=[];for(let a=0;a<t.components.length;a++){const s=t.components[a],i=Y_({param:s,value:e[Array.isArray(e)?a:s.name]});r.push(i),i.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Q_(r):q_(r.map((({encoded:e})=>e)))}}(t,{param:e});if("address"===e.type)return function(e){if(!V_(e))throw new R_({address:e});return{dynamic:!1,encoded:m_(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){if("boolean"!=typeof e)throw new XA(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:m_(x_(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:T_(e,{size:32,signed:t})}}(t,{signed:e.type.startsWith("int")})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=JA(e);if(!n){let t=e;return r%32!=0&&(t=m_(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:q_([m_(T_(r,{size:32})),t])}}if(r!==Number.parseInt(n))throw new n_({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:m_(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=A_(e),n=Math.ceil(JA(t)/32),r=[];for(let e=0;e<n;e++)r.push(m_(W_(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:q_([m_(T_(JA(t),{size:32})),...r])}}(t);throw new o_(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Q_(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:r,encoded:a}=e[n];t+=r?32:JA(a)}const n=[],r=[];let a=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:o}=e[s];i?(n.push(T_(t+a,{size:32})),r.push(o),a+=JA(o)):n.push(o)}return q_([...n,...r])}const eD=e=>W_(L_(e),0,4);function tD(e,t){const n=typeof e,r=t.type;switch(r){case"address":return V_(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every(((t,n)=>tD(Object.values(e)[n],t))):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every((e=>tD(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function nD(e,t,n){for(const r in e){const a=e[r],s=t[r];if("tuple"===a.type&&"tuple"===s.type&&"components"in a&&"components"in s)return nD(a.components,s.components,n[r]);const i=[a.type,s.type];if(!(!i.includes("address")||!i.includes("bytes20"))||(i.includes("address")&&i.includes("string")||!(!i.includes("address")||!i.includes("bytes")))&&V_(n[r],{strict:!1}))return i}}function rD(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const aD="/docs/contract/encodeFunctionData";function sD(e){const{abi:t,args:n,functionName:r}=e;let a=t[0];if(r){const e=function(e){const{abi:t,args:n=[],name:r}=e,a=KA(r,{strict:!1}),s=t.filter((e=>a?"function"===e.type?eD(e)===r:"event"===e.type&&B_(e)===r:"name"in e&&e.name===r));if(0===s.length)return;if(1===s.length)return s[0];let i;for(const e of s){if(!("inputs"in e))continue;if(!n||0===n.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==n.length)continue;const t=n.every(((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&tD(t,r)}));if(t){if(i&&"inputs"in i&&i.inputs){const t=nD(e.inputs,i.inputs,n);if(t)throw new s_({abiItem:e,type:t[0]},{abiItem:i,type:t[1]})}i=e}}return i||s[0]}({abi:t,args:n,name:r});if(!e)throw new a_(r,{docsPath:aD});a=e}if("function"!==a.type)throw new a_(void 0,{docsPath:aD});return{abi:[a],functionName:eD(ZA(a))}}function iD(e){const{args:t}=e,{abi:n,functionName:r}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:sD(e),a=n[0];return Z_([r,("inputs"in a&&a.inputs?X_(a.inputs,t??[]):void 0)??"0x"])}class oD extends XA{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class cD extends XA{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class lD extends XA{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const uD={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new lD({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new cD({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new oD({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new oD({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function dD(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(uD);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}const pD=(e,t,n)=>JSON.stringify(e,((e,n)=>{const r="bigint"==typeof n?n.toString():n;return"function"==typeof t?t(e,r):r}),n),hD={gwei:9,wei:18},mD={ether:-9,wei:9};function fD(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[a,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${a||"0"}${s?`.${s}`:""}`}function yD(e,t="wei"){return fD(e,hD[t])}function bD(e,t="wei"){return fD(e,mD[t])}class gD extends XA{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class wD extends XA{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function vD(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}class CD extends XA{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class ED extends XA{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class xD extends XA{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",vD(e),"}","","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","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class kD extends XA{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}class TD extends XA{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:s,gasPrice:i,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=vD({chain:r&&`${r?.name} (id: ${r?.id})`,from:t?.address,to:u,value:void 0!==d&&`${yD(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${bD(i)} gwei`,maxFeePerGas:void 0!==o&&`${bD(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${bD(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class PD extends XA{constructor({body:e,details:t,headers:n,status:r,url:a}){super("HTTP request failed.",{details:t,metaMessages:[r&&`Status: ${r}`,`URL: ${a}`,e&&`Request body: ${pD(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=r,this.url=a}}class AD extends XA{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${pD(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}}class _D extends XA{constructor(e,{code:t,docsPath:n,metaMessages:r,shortMessage:a}){super(a,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof AD?e.code:t??-1}}class DD extends _D{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class FD extends _D{constructor(e){super(e,{code:FD.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(FD,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class OD extends _D{constructor(e){super(e,{code:OD.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(OD,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class SD extends _D{constructor(e){super(e,{code:SD.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(SD,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class MD extends _D{constructor(e){super(e,{code:MD.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(MD,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class ID extends _D{constructor(e){super(e,{code:ID.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(ID,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class ND extends _D{constructor(e){super(e,{code:ND.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(ND,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class UD extends _D{constructor(e){super(e,{code:UD.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(UD,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class LD extends _D{constructor(e){super(e,{code:LD.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(LD,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class BD extends _D{constructor(e){super(e,{code:BD.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(BD,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class RD extends _D{constructor(e){super(e,{code:RD.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(RD,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class jD extends _D{constructor(e){super(e,{code:jD.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(jD,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class GD extends _D{constructor(e){super(e,{code:GD.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(GD,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class HD extends DD{constructor(e){super(e,{code:HD.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(HD,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class zD extends DD{constructor(e){super(e,{code:zD.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(zD,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class $D extends DD{constructor(e){super(e,{code:$D.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty($D,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class VD extends DD{constructor(e){super(e,{code:VD.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(VD,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class qD extends DD{constructor(e){super(e,{code:qD.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(qD,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class ZD extends DD{constructor(e){super(e,{code:ZD.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(ZD,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class WD extends _D{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}class KD extends XA{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:s,gasPrice:i,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=vD({from:t?.address,to:u,value:void 0!==d&&`${yD(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${bD(i)} gwei`,maxFeePerGas:void 0!==o&&`${bD(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${bD(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}class JD extends XA{constructor({cause:e,message:t}={}){const n=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(JD,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(JD,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class XD extends XA{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${bD(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(XD,"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 YD extends XA{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${bD(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(YD,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class QD extends XA{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(QD,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class eF extends XA{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(eF,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class tF extends XA{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(tF,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class nF extends XA{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(nF,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class rF extends XA{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(rF,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class aF extends XA{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(aF,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class sF extends XA{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(sF,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class iF extends XA{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${bD(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${bD(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(iF,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class oF extends XA{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function cF(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof XA?e.walk((e=>e.code===JD.code)):e;return r instanceof XA?new JD({cause:e,message:r.details}):JD.nodeMessage.test(n)?new JD({cause:e,message:e.details}):XD.nodeMessage.test(n)?new XD({cause:e,maxFeePerGas:t?.maxFeePerGas}):YD.nodeMessage.test(n)?new YD({cause:e,maxFeePerGas:t?.maxFeePerGas}):QD.nodeMessage.test(n)?new QD({cause:e,nonce:t?.nonce}):eF.nodeMessage.test(n)?new eF({cause:e,nonce:t?.nonce}):tF.nodeMessage.test(n)?new tF({cause:e,nonce:t?.nonce}):nF.nodeMessage.test(n)?new nF({cause:e}):rF.nodeMessage.test(n)?new rF({cause:e,gas:t?.gas}):aF.nodeMessage.test(n)?new aF({cause:e,gas:t?.gas}):sF.nodeMessage.test(n)?new sF({cause:e}):iF.nodeMessage.test(n)?new iF({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new oF({cause:e})}function lF(e,{format:t}){if(!t)return{};const n={};return function t(r){const a=Object.keys(r);for(const s of a)s in e&&(n[s]=e[s]),r[s]&&"object"==typeof r[s]&&!Array.isArray(r[s])&&t(r[s])}(t(e||{})),n}function uF(e,t){return({exclude:n,format:r})=>({exclude:n,format:e=>{const a=t(e);if(n)for(const e of n)delete a[e];return{...a,...r(e)}},type:e})}const dF={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function pF(e){const t={};return void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?t.blobs=e.blobs.map((e=>k_(e))):t.blobs=e.blobs),void 0!==e.data&&(t.data=e.data),void 0!==e.from&&(t.from=e.from),void 0!==e.gas&&(t.gas=T_(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=T_(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=T_(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=T_(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=T_(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=T_(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=dF[e.type]),void 0!==e.value&&(t.value=T_(e.value)),t}function hF(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new p_({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new p_({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function mF(e){const{balance:t,nonce:n,state:r,stateDiff:a,code:s}=e,i={};if(void 0!==s&&(i.code=s),void 0!==t&&(i.balance=T_(t)),void 0!==n&&(i.nonce=T_(n)),void 0!==r&&(i.state=hF(r)),void 0!==a){if(i.state)throw new wD;i.stateDiff=hF(a)}return i}function fF(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:a,to:s}=e,i=t?rD(t):void 0;if(i&&!V_(i.address))throw new R_({address:i.address});if(s&&!V_(s))throw new R_({address:s});if(void 0!==n&&(void 0!==r||void 0!==a))throw new CD;if(r&&r>2n**256n-1n)throw new XD({maxFeePerGas:r});if(a&&r&&a>r)throw new iF({maxFeePerGas:r,maxPriorityFeePerGas:a})}class yF extends XA{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class bF extends XA{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class gF extends XA{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${bD(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class wF extends XA{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}const vF={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function CF(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?v_(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?v_(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?vF[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("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip1559"===t.type&&delete t.maxFeePerBlobGas,t}const EF=uF("transaction",CF);function xF(e){const t=e.transactions?.map((e=>"string"==typeof e?e:CF(e)));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):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 kF=uF("block",xF);async function TF(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:a}={}){const s=r??"latest",i=a??!1,o=void 0!==n?T_(n):void 0;let c=null;if(c=t?await e.request({method:"eth_getBlockByHash",params:[t,i]}):await e.request({method:"eth_getBlockByNumber",params:[o||s,i]}),!c)throw new wF({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||xF)(c)}async function PF(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function AF(e,t){const{block:n,chain:r=e.chain,request:a,type:s="eip1559"}=t||{},i=await(async()=>"function"==typeof r?.fees?.baseFeeMultiplier?r.fees.baseFeeMultiplier({block:n,client:e,request:a}):r?.fees?.baseFeeMultiplier??1.2)();if(i<1)throw new yF;const o=10**(i.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(i*o))/BigInt(o),l=n||await qA(e,TF,"getBlock")({});if("function"==typeof r?.fees?.estimateFeesPerGas){const t=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:a,type:s});if(null!==t)return t}if("eip1559"===s){if("bigint"!=typeof l.baseFeePerGas)throw new bF;const t="bigint"==typeof a?.maxPriorityFeePerGas?a.maxPriorityFeePerGas:await async function(e,t){const{block:n,chain:r=e.chain,request:a}=t||{};if("function"==typeof r?.fees?.defaultPriorityFee){const t=n||await qA(e,TF,"getBlock")({});return r.fees.defaultPriorityFee({block:t,client:e,request:a})}if(void 0!==r?.fees?.defaultPriorityFee)return r?.fees?.defaultPriorityFee;try{return w_(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):qA(e,TF,"getBlock")({}),qA(e,PF,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new bF;const a=r-t.baseFeePerGas;return a<0n?0n:a}}(e,{block:l,chain:r,request:a}),n=c(l.baseFeePerGas);return{maxFeePerGas:a?.maxFeePerGas??n+t,maxPriorityFeePerGas:t}}return{gasPrice:a?.gasPrice??c(await qA(e,PF,"getGasPrice")({}))}}async function _F(e,{address:t,blockTag:n="latest",blockNumber:r}){return v_(await e.request({method:"eth_getTransactionCount",params:[t,r?T_(r):n]}))}function DF(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>S_(e))):e.blobs,a=[];for(const e of r)a.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?a:a.map((e=>k_(e)))}function FF(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),r="string"==typeof e.blobs[0]?e.blobs.map((e=>S_(e))):e.blobs,a="string"==typeof e.commitments[0]?e.commitments.map((e=>S_(e))):e.commitments,s=[];for(let e=0;e<r.length;e++){const n=r[e],i=a[e];s.push(Uint8Array.from(t.computeBlobKzgProof(n,i)))}return"bytes"===n?s:s.map((e=>k_(e)))}function OF(e){const{commitment:t,version:n=1}=e,r=e.to??("string"==typeof t?"hex":"bytes"),a=function(e,t){const n=t||"hex",r=Qd(KA(e,{strict:!1})?D_(e):e);return"bytes"===n?r:E_(r)}(t,"bytes");return a.set([n],0),"bytes"===r?a:k_(a)}function SF(e){const{commitments:t,version:n}=e,r=e.to??("string"==typeof t[0]?"hex":"bytes"),a=[];for(const e of t)a.push(OF({commitment:e,to:r,version:n}));return a}const MF=32,IF=4096,NF=MF*IF,UF=6*NF-1-1*IF*6,LF=1;class BF extends XA{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class RF extends XA{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class jF extends XA{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class GF extends XA{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${LF}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}function HF(e){const{data:t,kzg:n,to:r}=e,a=e.blobs??function(e){const t=e.to??("string"==typeof e.data?"hex":"bytes"),n="string"==typeof e.data?S_(e.data):e.data,r=JA(n);if(!r)throw new RF;if(r>UF)throw new BF({maxSize:UF,size:r});const a=[];let s=!0,i=0;for(;s;){const e=dD(new Uint8Array(NF));let t=0;for(;t<IF;){const r=n.slice(i,i+(MF-1));if(e.pushByte(0),e.pushBytes(r),r.length<31){e.pushByte(128),s=!1;break}t++,i+=31}a.push(e)}return"bytes"===t?a.map((e=>e.bytes)):a.map((e=>k_(e.bytes)))}({data:t,to:r}),s=e.commitments??DF({blobs:a,kzg:n,to:r}),i=e.proofs??FF({blobs:a,commitments:s,kzg:n,to:r}),o=[];for(let e=0;e<a.length;e++)o.push({blob:a[e],commitment:s[e],proof:i[e]});return o}function zF(e){if(e.type)return e.type;if(void 0!==e.blobs||void 0!==e.blobVersionedHashes||void 0!==e.maxFeePerBlobGas||void 0!==e.sidecars)return"eip4844";if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new xD({transaction:e})}async function $F(e){return v_(await e.request({method:"eth_chainId"}))}const VF=["blobVersionedHashes","chainId","fees","gas","nonce","type"];async function qF(e,t){const{account:n=e.account,blobs:r,chain:a,chainId:s,gas:i,kzg:o,nonce:c,parameters:l=VF,type:u}=t,d=n?rD(n):void 0,p={...t,...d?{from:d?.address}:{}};let h;async function m(){return h||(h=await qA(e,TF,"getBlock")({blockTag:"latest"}),h)}if((l.includes("blobVersionedHashes")||l.includes("sidecars"))&&r&&o){const e=DF({blobs:r,kzg:o});if(l.includes("blobVersionedHashes")){const t=SF({commitments:e,to:"hex"});p.blobVersionedHashes=t}if(l.includes("sidecars")){const t=HF({blobs:r,commitments:e,proofs:FF({blobs:r,commitments:e,kzg:o}),to:"hex"});p.sidecars=t}}if(l.includes("chainId")&&(p.chainId=a?a.id:void 0!==s?s:await qA(e,$F,"getChainId")({})),l.includes("nonce")&&void 0===c&&d&&(p.nonce=await qA(e,_F,"getTransactionCount")({address:d.address,blockTag:"pending"})),(l.includes("fees")||l.includes("type"))&&void 0===u)try{p.type=zF(p)}catch{const e=await m();p.type="bigint"==typeof e?.baseFeePerGas?"eip1559":"legacy"}if(l.includes("fees"))if("legacy"!==p.type&&"eip2930"!==p.type){if(void 0===p.maxFeePerGas||void 0===p.maxPriorityFeePerGas){const n=await m(),{maxFeePerGas:r,maxPriorityFeePerGas:s}=await AF(e,{block:n,chain:a,request:p});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas<s)throw new gF({maxPriorityFeePerGas:s});p.maxPriorityFeePerGas=s,p.maxFeePerGas=r}}else{if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)throw new bF;const n=await m(),{gasPrice:r}=await AF(e,{block:n,chain:a,request:p,type:"legacy"});p.gasPrice=r}return l.includes("gas")&&void 0===i&&(p.gas=await qA(e,ZF,"estimateGas")({...p,account:d?{address:d.address,type:"json-rpc"}:void 0})),fF(p),delete p.parameters,p}async function ZF(e,t){const n=t.account??e.account,r=n?rD(n):void 0;try{const{accessList:n,blobs:a,blobVersionedHashes:s,blockNumber:i,blockTag:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,to:f,value:y,stateOverride:b,...g}=await qF(e,{...t,parameters:"local"===r?.type?void 0:["blobVersionedHashes"]}),w=(i?T_(i):void 0)||o,v=function(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!V_(n,{strict:!1}))throw new R_({address:n});if(t[n])throw new gD({address:n});t[n]=mF(r)}return t}(b);fF(t);const C=e.chain?.formatters?.transactionRequest?.format,E=(C||pF)({...lF(g,{format:C}),from:r?.address,accessList:n,blobs:a,blobVersionedHashes:s,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,to:f,value:y}),x=await e.request({method:"eth_estimateGas",params:v?[E,w??"latest",v]:w?[E,w]:[E]});return BigInt(x)}catch(n){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=cF(e,n);return t instanceof oF?e:t})();return new KD(r,{docsPath:t,...n})}(n,{...t,account:r,chain:e.chain})}}class WF extends XA{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class KF extends XA{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class JF extends XA{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}class XF extends XA{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join("\n"),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}function YF({chain:e,currentChainId:t}){if(!e)throw new KF;if(t!==e.id)throw new WF({chain:e,currentChainId:t})}function QF(e,{docsPath:t,...n}){const r=(()=>{const t=cF(e,n);return t instanceof oF?e:t})();return new TD(r,{docsPath:t,...n})}async function eO(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}async function tO(e,t){const{account:n=e.account,chain:r=e.chain,accessList:a,blobs:s,data:i,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:h,value:m,...f}=t;if(!n)throw new XF({docsPath:"/docs/actions/wallet/sendTransaction"});const y=rD(n);try{let n;if(fF(t),null!==r&&(n=await qA(e,$F,"getChainId")({}),YF({currentChainId:n,chain:r})),"local"===y.type){const t=await qA(e,qF,"prepareTransactionRequest")({account:y,accessList:a,blobs:s,chain:r,chainId:n,data:i,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,parameters:[...VF,"sidecars"],to:h,value:m,...f}),b=r?.serializers?.transaction,g=await y.signTransaction(t,{serializer:b});return await qA(e,eO,"sendRawTransaction")({serializedTransaction:g})}const b=e.chain?.formatters?.transactionRequest?.format,g=(b||pF)({...lF(f,{format:b}),accessList:a,blobs:s,data:i,from:y.address,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:h,value:m});return await e.request({method:"eth_sendTransaction",params:[g]},{retryCount:0})}catch(e){throw QF(e,{...t,account:y,chain:t.chain||void 0})}}const nO=256;let rO,aO=nO;function sO(e=11){if(!rO||aO+e>2*nO){rO="",aO=0;for(let e=0;e<nO;e++)rO+=(256+256*Math.random()|0).toString(16).substring(1)}return rO.substring(aO,aO+++e)}function iO(e,{delay:t=100,retryCount:n=2,shouldRetry:r=(()=>!0)}={}){return new Promise(((a,s)=>{const i=async({count:o=0}={})=>{const c=async({error:e})=>{const n="function"==typeof t?t({count:o,error:e}):t;n&&await async function(e){return new Promise((t=>setTimeout(t,e)))}(n),i({count:o+1})};try{const t=await e();a(t)}catch(e){if(o<n&&await r({count:o,error:e}))return c({error:e});s(e)}};i()}))}function oO(e,t={}){return async(n,r={})=>{const{retryDelay:a=150,retryCount:s=3}={...t,...r};return iO((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case FD.code:throw new FD(t);case OD.code:throw new OD(t);case SD.code:throw new SD(t);case MD.code:throw new MD(t);case ID.code:throw new ID(t);case ND.code:throw new ND(t);case UD.code:throw new UD(t);case LD.code:throw new LD(t);case BD.code:throw new BD(t);case RD.code:throw new RD(t);case jD.code:throw new jD(t);case GD.code:throw new GD(t);case HD.code:throw new HD(t);case zD.code:throw new zD(t);case $D.code:throw new $D(t);case VD.code:throw new VD(t);case qD.code:throw new qD(t);case ZD.code:throw new ZD(t);case 5e3:throw new HD(t);default:if(e instanceof XA)throw e;throw new WD(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof PD){const e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e)}return~~(1<<e)*a},retryCount:s,shouldRetry:({error:e})=>function(e){if("code"in e&&"number"==typeof e.code)return-1===e.code||(e.code===jD.code||e.code===ID.code);if(e instanceof PD&&e.status)return 403===e.status||(408===e.status||(413===e.status||(429===e.status||(500===e.status||(502===e.status||(503===e.status||504===e.status))))));return!0}(e)})}}function cO(e,t={}){const{key:n="custom",name:r="Custom Provider",retryDelay:a}=t;return({retryCount:s})=>function({key:e,name:t,request:n,retryCount:r=3,retryDelay:a=150,timeout:s,type:i},o){return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:a,timeout:s,type:i},request:oO(n,{retryCount:r,retryDelay:a}),value:o}}({key:n,name:r,request:e.request.bind(e),retryCount:t.retryCount??s,retryDelay:a,type:"custom"})}function lO(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const uO=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,dO=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function pO({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},"number"==typeof e?.chainId&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}const hO="/docs/contract/encodeDeployData";function mO(e,t="hex"){const n=fO(e),r=dD(new Uint8Array(n.length));return n.encode(r),"hex"===t?k_(r.bytes):r.bytes}function fO(e){return Array.isArray(e)?function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=yO(t);return{length:t<=55?1+t:1+n+t,encode(r){t<=55?r.pushByte(192+t):(r.pushByte(247+n),1===n?r.pushUint8(t):2===n?r.pushUint16(t):3===n?r.pushUint24(t):r.pushUint32(t));for(const{encode:t}of e)t(r)}}}(e.map((e=>fO(e)))):function(e){const t="string"==typeof e?S_(e):e,n=yO(t.length),r=1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length;return{length:r,encode(e){1===t.length&&t[0]<128?e.pushBytes(t):t.length<=55?(e.pushByte(128+t.length),e.pushBytes(t)):(e.pushByte(183+n),1===n?e.pushUint8(t.length):2===n?e.pushUint16(t.length):3===n?e.pushUint24(t.length):e.pushUint32(t.length),e.pushBytes(t))}}}(e)}function yO(e){if(e<256)return 1;if(e<65536)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new XA("Length is too large.")}const bO={"0x0":"reverted","0x1":"success"};function gO(e){const t={...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((e=>function(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}:{}}}(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?v_(e.transactionIndex):null,status:e.status?bO[e.status]:null,type:e.type?vF[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const wO=uF("transactionReceipt",gO);function vO(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:a}=e;if(t<=0)throw new JF({chainId:t});if(a&&!V_(a))throw new R_({address:a});if(r&&r>2n**256n-1n)throw new XD({maxFeePerGas:r});if(n&&r&&n>r)throw new iF({maxFeePerGas:r,maxPriorityFeePerGas:n})}function CO(e){if(!e||0===e.length)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:a}=e[n];for(let e=0;e<a.length;e++)if(a[e].length-2!=64)throw new kD({storageKey:a[e]});if(!V_(r,{strict:!1}))throw new R_({address:r});t.push([r,a])}return t}function EO(e,t){const n=zF(e);return"eip1559"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:s,value:i,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,data:u}=e;vO(e);const d=CO(l),p=[E_(n),a?E_(a):"0x",c?E_(c):"0x",o?E_(o):"0x",r?E_(r):"0x",s??"0x",i?E_(i):"0x",u??"0x",d,...xO(e,t)];return Z_(["0x02",mO(p)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:r,data:a,nonce:s,to:i,value:o,accessList:c,gasPrice:l}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:s}=e;if(t<=0)throw new JF({chainId:t});if(s&&!V_(s))throw new R_({address:s});if(n||a)throw new XA("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new XD({maxFeePerGas:r})}(e);const u=CO(c),d=[E_(n),s?E_(s):"0x",l?E_(l):"0x",r?E_(r):"0x",i??"0x",o?E_(o):"0x",a??"0x",u,...xO(e,t)];return Z_(["0x01",mO(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:s,value:i,maxFeePerBlobGas:o,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{blobVersionedHashes:t}=e;if(t){if(0===t.length)throw new RF;for(const e of t){const t=JA(e),n=v_(W_(e,0,1));if(32!==t)throw new jF({hash:e,size:t});if(n!==LF)throw new GF({hash:e,version:n})}}vO(e)}(e);let p=e.blobVersionedHashes,h=e.sidecars;if(e.blobs&&(void 0===p||void 0===h)){const t="string"==typeof e.blobs[0]?e.blobs:e.blobs.map((e=>k_(e))),n=e.kzg,r=DF({blobs:t,kzg:n});if(void 0===p&&(p=SF({commitments:r})),void 0===h){h=HF({blobs:t,commitments:r,proofs:FF({blobs:t,commitments:r,kzg:n})})}}const m=CO(u),f=[E_(n),a?E_(a):"0x",l?E_(l):"0x",c?E_(c):"0x",r?E_(r):"0x",s??"0x",i?E_(i):"0x",d??"0x",m,o?E_(o):"0x",p??[],...xO(e,t)],y=[],b=[],g=[];if(h)for(let e=0;e<h.length;e++){const{blob:t,commitment:n,proof:r}=h[e];y.push(t),b.push(n),g.push(r)}return Z_(["0x03",mO(h?[f,y,b,g]:f)])}(e,t):function(e,t){const{chainId:n=0,gas:r,data:a,nonce:s,to:i,value:o,gasPrice:c}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:s,accessList:i}=e;if(s&&!V_(s))throw new R_({address:s});if(void 0!==t&&t<=0)throw new JF({chainId:t});if(n||a)throw new XA("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new XD({maxFeePerGas:r});if(i)throw new XA("`accessList` is not a valid Legacy Transaction attribute.")}(e);let l=[s?E_(s):"0x",c?E_(c):"0x",r?E_(r):"0x",i??"0x",o?E_(o):"0x",a??"0x"];if(t){const e=(()=>{if(t.v>=35n){return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n)}if(n>0)return BigInt(2*n)+BigInt(35n+t.v-27n);const e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new ED({v:t.v});return e})();l=[...l,E_(e),t.r,t.s]}else n>0&&(l=[...l,E_(n),"0x","0x"]);return mO(l)}(e,t)}function xO(e,t){const{r:n,s:r,v:a,yParity:s}=t??e;if(void 0===n)return[];if(void 0===r)return[];if(void 0===a&&void 0===s)return[];return["number"==typeof s?s?E_(1):"0x":0n===a?"0x":1n===a?E_(1):27n===a?"0x":E_(1),b_(n),b_(r)]}function kO(e,t){const{abi:n,args:r,bytecode:a,...s}=t,i=function(e){const{abi:t,args:n,bytecode:r}=e;if(!n||0===n.length)return r;const a=t.find((e=>"type"in e&&"constructor"===e.type));if(!a)throw new QA({docsPath:hO});if(!("inputs"in a))throw new e_({docsPath:hO});if(!a.inputs||0===a.inputs.length)throw new e_({docsPath:hO});return Z_([r,X_(a.inputs,n)])}({abi:n,args:r,bytecode:a});return tO(e,{...s,data:i})}async function TO(e){return(await e.request({method:"eth_requestAccounts"},{retryCount:0})).map((e=>function(e,t){if(!V_(e,{strict:!1}))throw new R_({address:e});return H_(e,t)}(e)))}async function PO(e,t){const{account:n=e.account,domain:r,message:a,primaryType:s}=t;if(!n)throw new XF({docsPath:"/docs/actions/wallet/signTypedData"});const i=rD(n),o={EIP712Domain:pO({domain:r}),...t.types};if(function(e){const{domain:t,message:n,primaryType:r,types:a}=e,s=(e,t)=>{for(const n of e){const{name:e,type:r}=n,i=t[e],o=r.match(dO);if(o&&("number"==typeof i||"bigint"==typeof i)){const[e,t,n]=o;T_(i,{signed:"int"===t,size:Number.parseInt(n)/8})}if("address"===r&&"string"==typeof i&&!V_(i))throw new R_({address:i});const c=r.match(uO);if(c){const[e,t]=c;if(t&&JA(i)!==Number.parseInt(t))throw new i_({expectedSize:Number.parseInt(t),givenSize:JA(i)})}const l=a[r];l&&s(l,i)}};a.EIP712Domain&&t&&s(a.EIP712Domain,t),"EIP712Domain"!==r&&s(a[r],n)}({domain:r,message:a,primaryType:s,types:o}),"local"===i.type)return i.signTypedData({domain:r,message:a,primaryType:s,types:o});const c=function(e){const{domain:t,message:n,primaryType:r,types:a}=e,s=(e,t)=>{const n={...t};for(const t of e){const{name:e,type:r}=t;"address"===r&&(n[e]=n[e].toLowerCase())}return n},i=a.EIP712Domain&&t?s(a.EIP712Domain,t):{},o=(()=>{if("EIP712Domain"!==r)return s(a[r],n)})();return pD({domain:i,message:o,primaryType:r,types:a})}({domain:r,message:a,primaryType:s,types:o});return e.request({method:"eth_signTypedData_v4",params:[i.address,c]},{retryCount:0})}function AO(e){return{addChain:t=>async function(e,{chain:t}){const{id:n,name:r,nativeCurrency:a,rpcUrls:s,blockExplorers:i}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:T_(n),chainName:r,nativeCurrency:a,rpcUrls:s.default.http,blockExplorerUrls:i?Object.values(i).map((({url:e})=>e)):void 0}]},{retryCount:0})}(e,t),deployContract:t=>kO(e,t),getAddresses:()=>async function(e){return"local"===e.account?.type?[e.account.address]:(await e.request({method:"eth_accounts"})).map((e=>H_(e)))}(e),getChainId:()=>$F(e),getPermissions:()=>async function(e){return await e.request({method:"wallet_getPermissions"})}(e),prepareTransactionRequest:t=>qF(e,t),requestAddresses:()=>TO(e),requestPermissions:t=>async function(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}(e,t),sendRawTransaction:t=>eO(e,t),sendTransaction:t=>tO(e,t),signMessage:t=>async function(e,{account:t=e.account,message:n}){if(!t)throw new XF({docsPath:"/docs/actions/wallet/signMessage"});const r=rD(t);if("local"===r.type)return r.signMessage({message:n});const a="string"==typeof n?A_(n):n.raw instanceof Uint8Array?E_(n.raw):n.raw;return e.request({method:"personal_sign",params:[a,r.address]},{retryCount:0})}(e,t),signTransaction:t=>async function(e,t){const{account:n=e.account,chain:r=e.chain,...a}=t;if(!n)throw new XF({docsPath:"/docs/actions/wallet/signTransaction"});const s=rD(n);fF({account:s,...t});const i=await qA(e,$F,"getChainId")({});null!==r&&YF({currentChainId:i,chain:r});const o=r?.formatters||e.chain?.formatters,c=o?.transactionRequest?.format||pF;return"local"===s.type?s.signTransaction({...a,chainId:i},{serializer:e.chain?.serializers?.transaction}):await e.request({method:"eth_signTransaction",params:[{...c(a),chainId:T_(i),from:s.address}]},{retryCount:0})}(e,t),signTypedData:t=>PO(e,t),switchChain:t=>async function(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:T_(t)}]},{retryCount:0})}(e,t),watchAsset:t=>async function(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}(e,t),writeContract:t=>async function(e,t){const{abi:n,address:r,args:a,dataSuffix:s,functionName:i,...o}=t,c=iD({abi:n,args:a,functionName:i});return qA(e,tO,"sendTransaction")({data:`${c}${s?s.replace("0x",""):""}`,to:r,...o})}(e,t)}}function _O(e){const{key:t="wallet",name:n="Wallet Client",transport:r}=e,a=function(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,ccipRead:r,key:a="base",name:s="Base Client",pollingInterval:i=4e3,type:o="base"}=e,c=e.chain,l=e.account?rD(e.account):void 0,{config:u,request:d,value:p}=e.transport({chain:c,pollingInterval:i}),h={account:l,batch:t,cacheTime:n,ccipRead:r,chain:c,key:a,name:s,pollingInterval:i,request:d,transport:{...u,...p},type:o,uid:sO()};return Object.assign(h,{extend:function e(t){return n=>{const r=n(t);for(const e in h)delete r[e];const a={...t,...r};return Object.assign(a,{extend:e(a)})}}(h)})}({...e,key:t,name:n,transport:r,type:"walletClient"});return a.extend(AO)}const DO=e=>{if(null!=e)return i(e)};class FO extends y{constructor(e,t,n,r,a){super(),this._address=t,this._index=n??0,this.provider=e,this.smartAccountClient=r,this.signer=a}_legacySignMessage(e){throw new Error("Method not implemented.")}sendUncheckedTransaction(e){throw new Error("Method not implemented.")}unlock(e){throw new Error("Method not implemented.")}async getAddress(){if(!this.smartAccountClient)throw new Eb;return Promise.resolve(f(this.smartAccountClient.account.address))}async signMessage(e){if(!this.smartAccountClient)throw new Eb;return this.smartAccountClient.account.signMessageWith6492({message:"string"!=typeof e||KA(e)?{raw:KA(e)?D_(e):e}:e})}async _signTypedData(e,t,n){throw new Error("Method not implemented.")}async signTransaction(e){throw new Error("Method not implemented.")}async sendTransaction(e){if(!this.smartAccountClient)throw new Eb;const t=await m(e),n=await this.smartAccountClient.sendUserOperation({uo:{target:t.to,data:DO(t.data),value:BigInt(parseInt(t.value,16))}});return{hash:await this.smartAccountClient.waitForUserOperationTransaction({hash:n.hash})}}connect(e){return new FO(e??this.provider,this._address,this._index,this.smartAccountClient,this.signer)}connectUnchecked(){return new FO(this.provider,this._address,this._index,this.smartAccountClient,this.signer)}}const OO=[E.MAINNET,E.OPTIMISM,E.ARBITRUM_ONE,E.POLYGON,E.BASE];let SO={};const MO="alchemy-iframe-container";function IO(){if("undefined"!=typeof document&&!document.getElementById(MO)){const e=document.createElement("iframe");e.setAttribute("id",MO),e.style.display="none",document.body.appendChild(e)}}function NO(e,t){const n=e,r=SO[n];if(r)return r;const a=t[e];if(!a)throw new Error(`ChainId ${e} is not support`);IO();try{const e=new HA({client:{connection:{apiKey:a},iframeConfig:{iframeContainerId:MO}}});return SO[n]=e,e}catch(e){if("undefined"!=typeof document){const e=document.getElementById(MO);if(e){e.remove(),IO();const t=new HA({client:{connection:{apiKey:a},iframeConfig:{iframeContainerId:MO}}});return SO[n]=t,t}}throw e}}async function UO(e){const{rpcUrl:t,JsonRpcProvider:n=ts}=e,r=e.chainId??1,a=kv(r),s=e.alchemyParams?.apiKeyObject??{},i=NO(r,s),o=s[r];if(!o)throw new Error(`ChainId ${r} is not support`);const c=await OP({apiKey:o,chain:a,signer:i});const l=new class extends n{constructor(e,t){super(e,t),this.smartAccountClient=c}getSigner(){const e=c.account.address;return new FO(l,e,0,c,i)}disconnect(){return i.disconnect()}async listAccounts(){return[c.account.address]}getAddress(){const e=c.account.address;return Promise.resolve(f(e))}}(t,r);return l}var LO,BO;!function(e){e.Request="request",e.Response="response"}(LO||(LO={})),function(e){e.SendTransactionError="SendTransactionError"}(BO||(BO={}));class RO{walletWindow;appWindow;appInfo;constructor({walletWindow:e,appInfo:t}){this.walletWindow=e,this.appWindow=window,this.appInfo=t}sendMessage(e){const t=crypto.randomUUID();return this.postMessage({appId:crypto.randomUUID(),appInfo:this.appInfo,messageId:t,target:"CyberWallet",event:e}),t}onMessage(e){this.appWindow.onmessage=t=>{e(t.data)}}postMessage(e){this.walletWindow.postMessage(e,"*")}}class jO{id;sendTransactionBase;cyberAccount=null;appId;constructor({id:e,sendTransaction:t,appId:n}){this.id=e,this.sendTransactionBase=t,this.appId=n}setCyberAccount(e){this.cyberAccount=e}async sendTransaction(e,t){if(this.cyberAccount)return await this.sendTransactionBase({...e,from:e.from||this.cyberAccount.address,ctx:{chainId:this.id,owner:this.cyberAccount.ownerAddress,appId:this.appId}},t)}}class GO extends Error{constructor(e,t={}){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:"viem@1.16.3"});const n=t.cause instanceof GO?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof GO&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://viem.sh${r}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join("\n"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return HO(this,e)}}function HO(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?HO(e.cause,t):t?null:e}function zO(e,t={}){const{fees:n=e.fees,formatters:r=e.formatters,serializers:a=e.serializers}=t;return{...e,fees:n,formatters:r,serializers:a}}const $O=zO({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}}}),VO=zO({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});class qO extends GO{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function ZO(e){return function(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function WO(e,{size:t}){if(ZO(e)>t)throw new qO({givenSize:ZO(e),maxSize:t})}function KO(e,t={}){const{signed:n}=t;t.size&&WO(e,{size:t.size});const r=BigInt(e);if(!n)return r;const a=(e.length-2)/2;return r<=(1n<<8n*BigInt(a)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*a,"f")}`)-1n}function JO(e,t={}){return Number(KO(e,t))}function XO(e,t){return({exclude:n,format:r})=>({exclude:n,format:e=>{const a=t(e);if(n)for(const e of n)delete a[e];return{...a,...r(e)}},type:e})}const YO={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559"};function QO(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?JO(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?JO(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?YO[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"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip2930"===t.type&&(delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t}const eS=XO("transaction",QO);function tS(e){const t=e.transactions?.map((e=>"string"==typeof e?e:QO(e)));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 nS=XO("block",tS);const rS={"0x0":"reverted","0x1":"success"};function aS(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((e=>function(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}:{}}}(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?JO(e.transactionIndex):null,status:e.status?rS[e.status]:null,type:e.type?YO[e.type]||e.type:null}}const sS=XO("transactionReceipt",aS),iS={block:nS({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=QO(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?KO(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:eS({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?KO(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:sS({format:e=>({l1GasPrice:e.l1GasPrice?KO(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?KO(e.l1GasUsed):null,l1Fee:e.l1Fee?KO(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},oS=zO({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:iS}),cS=zO({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:iS}),lS=zO({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}}}),uS=zO({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.binance.org:8545"]},public:{http:["https://data-seed-prebsc-1-s1.binance.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}),dS=zO({id:59144,name:"Linea Mainnet",network:"linea-mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-mainnet.infura.io/v3"],webSocket:["wss://linea-mainnet.infura.io/ws/v3"]},default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"},blockscout:{name:"Blockscout",url:"https://explorer.linea.build"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:42}},testnet:!1}),pS=zO({id:59140,name:"Linea Goerli Testnet",network:"linea-testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"},blockscout:{name:"Blockscout",url:"https://explorer.goerli.linea.build"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:498623}},testnet:!0}),hS=zO({id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263}}},{formatters:iS}),mS=zO({id:420,name:"Optimism Goerli",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461}},testnet:!0},{formatters:iS}),fS=zO({id:137,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),yS=zO({id:80001,name:"Polygon Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mumbai.g.alchemy.com/v2"],webSocket:["wss://polygon-mumbai.g.alchemy.com/v2"]},infura:{http:["https://polygon-mumbai.infura.io/v3"],webSocket:["wss://polygon-mumbai.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/polygon_mumbai"]},public:{http:["https://rpc.ankr.com/polygon_mumbai"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}},testnet:!0}),bS=zO({id:534351,name:"Scroll Sepolia",network:"scroll-sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rpc.scroll.io"],webSocket:["wss://sepolia-rpc.scroll.io/ws"]},public:{http:["https://sepolia-rpc.scroll.io"],webSocket:["wss://sepolia-rpc.scroll.io/ws"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-blockscout.scroll.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:9473}},testnet:!0}),gS={optimism:hS,optimismGoerli:mS,polygon:fS,polygonMumbai:yS,arbitrum:$O,arbitrumGoerli:VO,linea:dS,lineaTestnet:pS,base:oS,baseGoerli:cS,opBnb:{id:204,name:"opBNB",network:"opBNB",rpcUrls:{public:{http:["https://opbnb-mainnet.nodereal.io/v1/64a9df0874fb4a93b9d0a3849de012d3"]},default:{http:["https://opbnb-mainnet.nodereal.io/v1/64a9df0874fb4a93b9d0a3849de012d3"]}},blockExplorers:{default:{name:"BlockScout",url:"https://opbnbscan.com"}},nativeCurrency:lS.nativeCurrency},opBnbTestnet:{id:5611,name:"opBNB Testnet",network:"opBNB testnet",rpcUrls:{public:{http:["https://opbnb-testnet.nodereal.io/v1/64a9df0874fb4a93b9d0a3849de012d3"]},default:{http:["https://opbnb-testnet.nodereal.io/v1/64a9df0874fb4a93b9d0a3849de012d3"]}},blockExplorers:{default:{name:"BlockScout",url:"https://testnet.opbnbscan.com"}},nativeCurrency:uS.nativeCurrency},scrollSepolia:bS};class wS extends Error{details;shortMessage;constructor({name:e,details:t,shortMessage:n}){super(`${e||"UnknownEventError"}: ${n||"Unknown error, please check the details"}`),this.name=e||"UnknownEventError",this.details=t,this.shortMessage=n||"Unknown error, please check the details"}}class vS{contextWindow;connected;messenger;cyberAccount=null;optimism;optimismGoerli;polygon;polygonMumbai;arbitrum;arbitrumGoerli;linea;lineaTestnet;base;baseGoerli;opBnb;opBnbTestnet;scrollSepolia;constructor({contextWindow:e,appInfo:t}){this.contextWindow=e,this.connected=!1,this.messenger=new RO({walletWindow:this.contextWindow,appInfo:t}),this.cyberAccount=null,Object.entries(gS).forEach((([e,n])=>{this[e]=new jO({id:n.id,sendTransaction:this.bindedSendTransaction,appId:t.appId})}))}bindedSendTransaction=this.sendTransaction.bind(this);setConnection(e){this.connected=e}setCyberAccount(e){this.cyberAccount=e,Object.keys(gS).forEach((t=>{this[t].setCyberAccount(e)}))}resolveActionResponse(e,t,n){"CyberApp"===e.target&&"action"===e.event.name&&(e.event.data?.error?"sendTransaction"===e.event.data?.method?t(new wS({name:BO.SendTransactionError,details:e.event.data.error,shortMessage:"Transaction failed"})):t(new wS({details:e.event.data.error})):n(e.event.data?.data))}sendTransaction(e){return this.messenger.sendMessage({name:"action",data:{type:LO.Request,method:"sendTransaction",data:{transaction:{...e,from:e.from||this.cyberAccount?.address}}}}),new Promise(((e,t)=>{this.messenger.onMessage((n=>{this.resolveActionResponse(n,t,e)}))}))}async getAuthToken(){return this.messenger.sendMessage({name:"action",data:{type:LO.Request,method:"getAuthToken"}}),new Promise(((e,t)=>{this.messenger.onMessage((n=>{this.resolveActionResponse(n,t,e)}))}))}}class CS{appId;name;cyberWallet;messenger;icon;constructor({appId:e,name:t,icon:n}){this.appId=e,this.name=t,this.icon=n,this.cyberWallet=new vS({contextWindow:window.parent,appInfo:{name:t,icon:n,appId:e}}),this.messenger=new RO({walletWindow:this.cyberWallet.contextWindow})}async start(){return await this.connect()}async connect(){return this.messenger.sendMessage({name:"connect"}),await new Promise(((e,t)=>{this.messenger.onMessage((n=>{"CyberApp"===n.target&&"connect"===n.event.name&&("success"===n.event.data?.data?.result?(this.cyberWallet?.setConnection(!0),this.cyberWallet?.setCyberAccount(n.event.data?.data?.cyberAccount),e(n.event.data?.data?.cyberAccount)):n.event.data?.error&&t(n.event.data?.error))}))}))}}function ES(e){try{return f(e)}catch{return!1}}const xS=0,kS=2,TS={};async function PS(e,t,n){const r=t;if(!n)return r;r.type=xS;const a=await async function(e){if(void 0!==TS[e])return TS[e];const t=O.getState().provider;if(!t)return!1;const n=void 0!==(await t.getBlock("latest")).baseFeePerGas;return TS[e]=n,n}(e);if(a){const t=await n(e);t?.maxFeePerGas&&t?.maxPriorityFeePerGas&&(r.maxFeePerGas=t.maxFeePerGas,r.maxPriorityFeePerGas=t.maxPriorityFeePerGas,r.type=kS)}return r}const AS="DODO-WALLET-CACHED-LAST-CONNECTED";class _S{constructor({cacheKey:e,rpcUrl:t}){this._rpcUrl="",this.cacheKey={lastConnectedType:AS,...e},this._rpcUrl=t??""}setCacheType(e){"undefined"!=typeof window&&"undefined"!=typeof localStorage&&(localStorage.setItem(this.cacheKey.lastConnectedType,e),localStorage.setItem(this.cacheKey.autoConnectType,e))}removeAutoConnectCache(){"undefined"!=typeof window&&"undefined"!=typeof localStorage&&localStorage.removeItem(this.cacheKey.autoConnectType)}setRpcUrl(e){this._rpcUrl=e}getAutoCacheType(){return"undefined"!=typeof window&&"undefined"!=typeof localStorage?localStorage.getItem(this.cacheKey.autoConnectType):null}getLastConnectType(){return"undefined"!=typeof window&&"undefined"!=typeof localStorage?localStorage.getItem(this.cacheKey.lastConnectedType):null}async getConnectedWallet(){if(O.getState().connectLoading){let e,t;await Promise.race([new Promise((e=>{t=O.subscribe((t=>{!1===t.connectLoading&&e(!0)}))})),new Promise((t=>{e=setTimeout((()=>{t(!1)}),4e3)}))]),clearTimeout(e),t&&t()}return O.getState().connected?.wallet}async connectWalletProcess(e,t){if(!e)throw new Error("connector is undefined");return await e(t,{connect:({chainId:e})=>{const n=parseInt(e,16);n&&O.getState().chainIdChanged(n),t.events?.connect&&t.events.connect({chainId:e})},accountsChanged:e=>{O.getState().accountsChanged(e),e.length||O.getState().disconnect(),t.events?.accountsChanged&&t.events.accountsChanged(e)},chainChanged:async e=>{await(O.getState().provider?.detectNetwork());const n=parseInt(e,16);n&&O.getState().chainIdChanged(n),t.events?.chainChanged&&t.events.chainChanged(e)},message:(e,n)=>{t.events?.message&&t.events.message(e,n)},disconnect:e=>{O.getState().disconnect(),t.events?.disconnect&&t.events.disconnect(e)}})}async connectWallet(e,t,{isAutoConnect:n}={}){if(t.chainId&&e.supportChains?.length&&!e.supportChains.includes(t.chainId))throw new Error(`${e.showName} does not support ChainId ${t.chainId}.`);if(!e)throw new Error("wallet is not valid.");const r={...e};O.getState().startConnecting(r.type);const{type:a,connector:s,supportMobile:i,supportExtension:o}=r;let c;if(!1===o&&i&&!D()){const{openSingleWalletConnectModal:n,closeSingleWalletConnectModal:a}=t,{connector:s,disconnect:i}=vM;if(r.disconnect=i,n)try{c=await this.connectWalletProcess(s,{...t,walletConnectParams:{...t?.walletConnectParams,showQrModal:!1,qrModalOptions:{...t?.walletConnectParams?.qrModalOptions,openCallback:r=>{t?.walletConnectParams?.qrModalOptions?.openCallback&&t?.walletConnectParams?.qrModalOptions.openCallback(r),n({uri:r,wallet:e})}}}})}finally{a&&a()}else c=await this.connectWalletProcess(s,t)}else{if(!s)throw new Error(`${e.showName} is not valid.`);try{c=await this.connectWalletProcess(s,t)}catch(e){throw O.getState().connectFailed(),console.error(e),e}}return c?(this.setCacheType(a),this._wallet=r,await O.getState().connectSuccess(c,r,!!n)):O.getState().connectFailed(),c}async disconnectWallet(){this.getAutoCacheType()&&(this._wallet?.disconnect&&await this._wallet.disconnect(),this._wallet=void 0,this.removeAutoConnectCache(),O.getState().disconnect(this._rpcUrl))}}const DS=/(?:^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}$)|(?:^0{8}-0{4}-0{4}-0{4}-0{12}$)/u,FS="io.metamask",OS="io.metamask.mobile",SS={"com.coinbase.wallet":x.WalletLink,"com.bitget.web3":x.Bitkeep,"com.okex.wallet":x.OKX,[FS]:x.injected,"io.rabby":x.Rabby,"pro.tokenpocket":x.tokenPocket,"coin98.com":x.Coin98,"xyz.frontier.wallet":x.frontier,"com.brave.wallet":x.Brave,"com.trustwallet.app":x.trust,"so.onekey.wallet":x.OneKey,"so.onekey.app.wallet":x.OneKey,"com.bybit":x.Bybit,"io.zerion.wallet":x.Zerion,"https://www.safepal.com/download":x.SafePal};function MS(e){const{info:t,provider:n}=e;return{type:x.EIP6963Prefix+t.rdns,showName:t.name,logo:t.icon,supportMobile:!0,supportExtension:!0,switchChain:e=>U({...e,provider:n}),injected:()=>!0,disabled:()=>!1,connector:(e,t)=>M(n,t),isEip6963:!0}}const IS={autoConnectType:"DODO-WALLET-CACHED-PROVIDER"};let NS,US,LS;class BS{constructor(e){this.isOpenBlockIframe=!1,this.isSafeIframe=!1;const{providerConfig:t,walletListConfig:n,cacheKey:r}=e;this.providerConfig=t,NS=t,"undefined"!=typeof window&&"undefined"!=typeof window&&(window.addEventListener("eip6963:announceProvider",(e=>{const t=e;try{const{info:e,provider:n}=t.detail;n&&e.uuid&&e.name&&e.rdns&&DS.test(e.uuid)&&O.setState((n=>{const r=[...n.eip6963WalletList];return r.some((t=>t.info.rdns===e.rdns))?{}:{eip6963WalletList:[...r,t.detail]}}))}catch(t){console.error(t,e)}})),window.dispatchEvent(new Event("eip6963:requestProvider"))),this.walletListConfig=n,this.setDisabledState(),this.connectController=new _S({cacheKey:{...IS,...r},rpcUrl:t.rpcUrl})}setDisabledState(){return VM(this.walletListConfig?.extendsWalleObject?Object.values(this.walletListConfig?.extendsWalleObject):void 0)}setWalletListConfig(e){this.walletListConfig={...this.walletListConfig,...e}}async autoConnect(e){try{const t=e=>this.connectToWallet(e,void 0,{isAutoConnect:!0}),n=await WM();if(n)return t(n);if(!O.getState().connected){const n=this.connectController.getAutoCacheType(),r=this.getWalletList(this.providerConfig.chainId??1,e);if(n){const e=r.find((e=>e.type===n));if(e&&(e.type!==x.injected||"undefined"!=typeof window&&window.ethereum))return t(e)}const a=D()?r.find((e=>e.injected?.())):void 0;if(a)return t(a);this.providerConfig.rpcUrl&&O.getState().setRpcUrlProvider(this.providerConfig.rpcUrl,this.providerConfig.chainId)}}catch(e){console.error(e)}}setRpcUrl(e){this.connectController.setRpcUrl(e)}getWalletList(e,t){return ZM({PORTIS_ID:this.providerConfig.portisParams?.id,chainId:e,...this.walletListConfig,...t})}async connectToWallet(e,t,n={}){return t&&(this.providerConfig={...this.providerConfig,...t}),this.connectController.connectWallet(e,this.providerConfig,n)}getConnectedWallet(){return this.connectController.getConnectedWallet()}disconnectWallet(){return this.connectController.disconnectWallet()}connectWalletBefore(e){if(O.getState().disabledWalletKeyList.includes(`${e.type}-${e.showName}`)||!e.connector&&!e.disabled&&!e.injected){let{link:t,supportExtension:n,supportMobile:r}=e;if(!1===n&&r&&!D())return!0;if(T()?t=e.mobileAndroidDeepLink||e.mobileDeepLink||e.link:_()&&(t=e.mobileIOSDeepLink||e.mobileDeepLink||e.link),t&&"undefined"!=typeof window){const e=window.location.origin,n=window.location.host,r=e.replace("://","%3A%2F%2F");t=t.replace("$APP_URL",e),t=t.replace("$host",n),t=t.replace("$formattedAPPUrl",r),window.open(t)}return!1}return!0}clickWallet(e,t){if(this.connectWalletBefore(e))return this.connectToWallet(e,t)}}const RS=()=>LS;async function jS({appName:e,appLogoUrl:t,appId:n}){return US&&LS||(US||(US=new CS({name:e,icon:t,appId:n})),void 0===LS&&(LS=await Promise.race([US.start(),new Promise((e=>setTimeout(e,300)))]))),{app:US,cyberAccount:LS}}async function GS(){const e=NS;if(LS)return!0;try{return US||(e?.cyberParams?.appId||console.warn("cyberParams.appId is required"),US=new CS({name:e?.appName??"DODO",icon:e?.appLogoUrl??"https://app.dodoex.io/DODO.svg",appId:e?.cyberParams?.appId})),LS=await Promise.race([US.start(),new Promise((e=>setTimeout(e,400)))]),!!LS}catch(e){return!1}}const HS=[E.OPTIMISM,E.POLYGON,E.ARBITRUM_ONE,E.LINEA,E.BASE,E.SCROLL_ALPHA_TESTNET];function zS(e,t){if(!e)throw new Error("app is undefined");const{cyberWallet:n}=e;switch(t){case E.OPTIMISM:return n.optimism;case E.POLYGON:return n.polygon;case E.ARBITRUM_ONE:return n.arbitrum;case E.LINEA:return n.linea;case E.BASE:return n.base;case E.SCROLL_ALPHA_TESTNET:return n.scrollSepolia;default:throw new Error("Invalid chain")}}function $S(){if("undefined"==typeof window||!window.ethereum)throw new Error("Method not implemented.");return new n(window.ethereum)}const VS=80001,qS=2025,ZS=9527,WS=534354,KS=421613,JS=42161,XS=43113,YS=43114,QS=2206132,eM=210425,tM=[1,5,137,VS,56,97,qS,ZS,WS,KS,JS,XS,YS,322,321,65,66,QS],nM=e=>{switch(Number(e)){case 1:case 5:return"eth";case 137:case VS:return"polygon";case 56:case 97:return"bsc";case qS:case ZS:return"rangers";case WS:return"scroll";case KS:case JS:return"arbitrum";case XS:case YS:return"avalanche";case 322:case 321:return"kcc";case 65:case 66:return"okc";case QS:case eM:return"platon";default:return"polygon"}},rM=e=>{switch(Number(e)){case 1:case 137:case 56:case qS:case JS:case YS:case 321:case eM:case 66:return"prod";default:return"test"}};const aM={type:x.WalletLink,showName:"Coinbase Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47054%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47054%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8%2020C8%2026.6267%2013.3733%2032%2020%2032C26.6267%2032%2032%2026.6267%2032%2020C32%2013.3733%2026.6267%208%2020%208C13.3733%208%208%2013.3733%208%2020ZM16.9333%2016.1333C16.49%2016.1333%2016.1333%2016.49%2016.1333%2016.9333V23.0667C16.1333%2023.51%2016.49%2023.8667%2016.9333%2023.8667H23.0667C23.51%2023.8667%2023.8667%2023.51%2023.8667%2023.0667V16.9333C23.8667%2016.49%2023.51%2016.1333%2023.0667%2016.1333H16.9333Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47054%22%20x1%3D%2220%22%20y1%3D%220%22%20x2%3D%2220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23345FF8%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%231D43DC%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47054%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,getPackage:W,connector:ie,mobileAndroidDeepLink:"https://go.cb-w.com/dapp?cburl=$formattedAPPUrl",mobileIOSDeepLink:"cbwallet://dapp?url=$formattedAPPUrl",isContractWallet:()=>{const e=O.getState().provider.provider;return!(!e||e?.isWalletLink||e?.isToshi)},disabled:()=>!!D(),injected:()=>D()&&(window.ethereum?.isWalletLink||window.ethereum?.isToshi),connectorInjected:(e,t)=>M(void 0,t),switchChain:e=>U({...e,provider:e.provider??O.getState().provider}),getSupportEip5792ChainIds:()=>{const e=O.getState().provider.provider;return!e||e?.isWalletLink||e?.isToshi?[]:[E.BASE,84532]}},sM={type:x.ImToken,showName:"imToken",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47053%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47053%29%22%2F%3E%3Cpath%20d%3D%22M32.5485%2012.3424C33.3788%2023.5873%2026.1506%2028.9022%2019.6707%2029.469C13.6462%2029.9958%207.97553%2026.2941%207.47806%2020.6066C7.06768%2015.9078%209.97179%2013.9073%2012.2535%2013.7079C14.6002%2013.5022%2016.5724%2015.1206%2016.7435%2017.0801C16.9082%2018.964%2015.7327%2019.8215%2014.9152%2019.8929C14.2686%2019.9496%2013.4552%2019.5571%2013.3818%2018.7143C13.3188%2017.99%2013.5938%2017.8914%2013.5266%2017.1221C13.407%2015.7524%2012.2126%2015.5929%2011.5587%2015.6495C10.7673%2015.7189%209.33155%2016.6424%209.53303%2018.943C9.73561%2021.2636%2011.9606%2023.0972%2014.8774%2022.8421C18.025%2022.5671%2020.2164%2020.1164%2020.3812%2016.6792C20.3797%2016.4971%2020.418%2016.3169%2020.4935%2016.1512L20.4945%2016.1471C20.5284%2016.075%2020.5681%2016.0059%2020.6131%2015.9403C20.6803%2015.8396%2020.7664%2015.7283%2020.8776%2015.6065C20.8787%2015.6034%2020.8787%2015.6034%2020.8808%2015.6034C20.9616%2015.5121%2021.0592%2015.4134%2021.1694%2015.3074C22.5443%2014.0102%2027.4961%2010.9507%2032.1791%2011.9195C32.2781%2011.9407%2032.3676%2011.9933%2032.4342%2012.0696C32.5008%2012.1458%2032.5408%2012.2415%2032.5485%2012.3424Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47053%22%20x1%3D%2238.8816%22%20y1%3D%221.1184%22%20x2%3D%22-1.04289e-05%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2311C4D1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%230062AD%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47053%22%3E%3Crect%20width%3D%2240%22%20height%3D%2239.922%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://token.im/",supportMobile:!0,supportExtension:!1,switchChain:U,mobileDeepLink:"imtokenv2://navigate/DappView?url=$formattedAPPUrl",injected:()=>window.ethereum?.isImToken},iM={type:x.Math,showName:"Math Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22black%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47067%29%22%3E%3Cpath%20d%3D%22M20%2036C28.8366%2036%2036%2028.8366%2036%2020C36%2011.1634%2028.8366%204%2020%204C11.1634%204%204%2011.1634%204%2020C4%2028.8366%2011.1634%2036%2020%2036Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M10.3333%2024.6543C10.7288%2024.6543%2011.0494%2024.9748%2011.0494%2025.3703C11.0494%2025.7658%2010.7288%2026.0864%2010.3333%2026.0864C9.93784%2026.0864%209.61726%2025.7658%209.61726%2025.3703C9.61726%2024.9748%209.93784%2024.6543%2010.3333%2024.6543ZM20%2024.6543C20.3954%2024.6543%2020.716%2024.9748%2020.716%2025.3703C20.716%2025.7658%2020.3954%2026.0864%2020%2026.0864C19.6045%2026.0864%2019.2839%2025.7658%2019.2839%2025.3703C19.2839%2024.9748%2019.6045%2024.6543%2020%2024.6543ZM29.6666%2024.6543C30.0621%2024.6543%2030.3827%2024.9748%2030.3827%2025.3703C30.3827%2025.7658%2030.0621%2026.0864%2029.6666%2026.0864C29.2712%2026.0864%2028.9506%2025.7658%2028.9506%2025.3703C28.9506%2024.9748%2029.2712%2024.6543%2029.6666%2024.6543ZM12.4814%2021.79C13.0746%2021.79%2013.5555%2022.2709%2013.5555%2022.8641C13.5555%2023.4573%2013.0746%2023.9382%2012.4814%2023.9382C11.8882%2023.9382%2011.4074%2023.4573%2011.4074%2022.8641C11.4074%2022.2709%2011.8882%2021.79%2012.4814%2021.79ZM17.4938%2021.79C18.087%2021.79%2018.5679%2022.2709%2018.5679%2022.8641C18.5679%2023.4573%2018.087%2023.9382%2017.4938%2023.9382C16.9006%2023.9382%2016.4197%2023.4573%2016.4197%2022.8641C16.4197%2022.2709%2016.9006%2021.79%2017.4938%2021.79ZM22.5062%2021.79C23.0994%2021.79%2023.5802%2022.2709%2023.5802%2022.8641C23.5802%2023.4573%2023.0994%2023.9382%2022.5062%2023.9382C21.913%2023.9382%2021.4321%2023.4573%2021.4321%2022.8641C21.4321%2022.2709%2021.913%2021.79%2022.5062%2021.79ZM27.5185%2021.79C28.1117%2021.79%2028.5926%2022.2709%2028.5926%2022.8641C28.5926%2023.4573%2028.1117%2023.9382%2027.5185%2023.9382C26.9253%2023.9382%2026.4444%2023.4573%2026.4444%2022.8641C26.4444%2022.2709%2026.9253%2021.79%2027.5185%2021.79ZM7.82713%2022.1481C8.22259%2022.1481%208.54317%2022.4687%208.54317%2022.8641C8.54317%2023.2596%208.22259%2023.5802%207.82713%2023.5802C7.43167%2023.5802%207.11108%2023.2596%207.11108%2022.8641C7.11108%2022.4687%207.43167%2022.1481%207.82713%2022.1481ZM32.1728%2022.1481C32.5683%2022.1481%2032.8889%2022.4687%2032.8889%2022.8641C32.8889%2023.2596%2032.5683%2023.5802%2032.1728%2023.5802C31.7774%2023.5802%2031.4568%2023.2596%2031.4568%2022.8641C31.4568%2022.4687%2031.7774%2022.1481%2032.1728%2022.1481ZM14.9876%2018.9259C15.7786%2018.9259%2016.4197%2019.567%2016.4197%2020.358C16.4197%2021.1489%2015.7786%2021.79%2014.9876%2021.79C14.1967%2021.79%2013.5555%2021.1489%2013.5555%2020.358C13.5555%2019.567%2014.1967%2018.9259%2014.9876%2018.9259ZM25.0123%2018.9259C25.8033%2018.9259%2026.4444%2019.567%2026.4444%2020.358C26.4444%2021.1489%2025.8033%2021.79%2025.0123%2021.79C24.2214%2021.79%2023.5802%2021.1489%2023.5802%2020.358C23.5802%2019.567%2024.2214%2018.9259%2025.0123%2018.9259ZM10.3333%2019.2839C10.9265%2019.2839%2011.4074%2019.7648%2011.4074%2020.358C11.4074%2020.9512%2010.9265%2021.432%2010.3333%2021.432C9.74011%2021.432%209.25922%2020.9512%209.25922%2020.358C9.25922%2019.7648%209.74011%2019.2839%2010.3333%2019.2839ZM20%2019.2839C20.5932%2019.2839%2021.0741%2019.7648%2021.0741%2020.358C21.0741%2020.9512%2020.5932%2021.432%2020%2021.432C19.4068%2021.432%2018.9259%2020.9512%2018.9259%2020.358C18.9259%2019.7648%2019.4068%2019.2839%2020%2019.2839ZM29.6666%2019.2839C30.2598%2019.2839%2030.7407%2019.7648%2030.7407%2020.358C30.7407%2020.9512%2030.2598%2021.432%2029.6666%2021.432C29.0734%2021.432%2028.5926%2020.9512%2028.5926%2020.358C28.5926%2019.7648%2029.0734%2019.2839%2029.6666%2019.2839ZM12.4814%2016.4197C13.2724%2016.4197%2013.9136%2017.0608%2013.9136%2017.8518C13.9136%2018.6427%2013.2724%2019.2839%2012.4814%2019.2839C11.6905%2019.2839%2011.0494%2018.6427%2011.0494%2017.8518C11.0494%2017.0608%2011.6905%2016.4197%2012.4814%2016.4197ZM17.4938%2016.4197C18.2847%2016.4197%2018.9259%2017.0608%2018.9259%2017.8518C18.9259%2018.6427%2018.2847%2019.2839%2017.4938%2019.2839C16.7029%2019.2839%2016.0617%2018.6427%2016.0617%2017.8518C16.0617%2017.0608%2016.7029%2016.4197%2017.4938%2016.4197ZM22.5062%2016.4197C23.2971%2016.4197%2023.9382%2017.0608%2023.9382%2017.8518C23.9382%2018.6427%2023.2971%2019.2839%2022.5062%2019.2839C21.7152%2019.2839%2021.0741%2018.6427%2021.0741%2017.8518C21.0741%2017.0608%2021.7152%2016.4197%2022.5062%2016.4197ZM27.5185%2016.4197C28.3094%2016.4197%2028.9506%2017.0608%2028.9506%2017.8518C28.9506%2018.6427%2028.3094%2019.2839%2027.5185%2019.2839C26.7276%2019.2839%2026.0864%2018.6427%2026.0864%2017.8518C26.0864%2017.0608%2026.7276%2016.4197%2027.5185%2016.4197ZM14.9876%2013.9135C15.7786%2013.9135%2016.4197%2014.5547%2016.4197%2015.3456C16.4197%2016.1365%2015.7786%2016.7777%2014.9876%2016.7777C14.1967%2016.7777%2013.5555%2016.1365%2013.5555%2015.3456C13.5555%2014.5547%2014.1967%2013.9135%2014.9876%2013.9135ZM25.0123%2013.9135C25.8033%2013.9135%2026.4444%2014.5547%2026.4444%2015.3456C26.4444%2016.1365%2025.8033%2016.7777%2025.0123%2016.7777C24.2214%2016.7777%2023.5802%2016.1365%2023.5802%2015.3456C23.5802%2014.5547%2024.2214%2013.9135%2025.0123%2013.9135Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47067%22%3E%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22white%22%20transform%3D%22translate%284%204%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://mathwallet.org",supportMobile:!0,supportExtension:!0,connector:M,switchChain:U,injected:()=>window.ethereum?.isMathWallet},oM={type:x.GameStop,showName:"GameStop Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_3104_80271%29%22%3E%3Cpath%20d%3D%22M21%200H11C4.92487%200%200%204.92487%200%2011V21C0%2027.0751%204.92487%2032%2011%2032H21C27.0751%2032%2032%2027.0751%2032%2021V11C32%204.92487%2027.0751%200%2021%200Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9.86889%2012.6868V21.3057C9.86889%2021.9352%2010.347%2022.4111%2010.968%2022.4111H21.036C21.657%2022.4111%2022.1351%2021.9352%2022.1351%2021.3057V14.077H23.724V21.3057C23.724%2022.8077%2022.5395%2024%2021.036%2024H10.968C9.46452%2024%208.28003%2022.8077%208.28003%2021.3057V12.6868H9.86889Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.28003%2010.6943C8.28003%209.19227%209.46452%208%2010.968%208H21.3686V11.151H21.544C22.7704%2011.151%2023.724%2012.1116%2023.724%2013.3356V14.4013C23.724%2015.6253%2022.7704%2016.5859%2021.544%2016.5859H10.968C9.46452%2016.5859%208.28003%2015.3936%208.28003%2013.8916V10.6943ZM19.7797%2011.151V9.58886H10.968C10.347%209.58886%209.86889%2010.0648%209.86889%2010.6943V13.8916C9.86889%2014.5212%2010.347%2014.9971%2010.968%2014.9971H15.2076V11.151H19.7797ZM16.7964%2014.9971H21.544C21.8879%2014.9971%2022.1351%2014.7528%2022.1351%2014.4013V13.3356C22.1351%2012.9841%2021.8879%2012.7399%2021.544%2012.7399H16.7964V14.9971Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M14.964%2012.8807H17.0825V14.9992H14.964V12.8807Z%22%20fill%3D%22url%28%23paint0_linear_3104_80271%29%22%2F%3E%3Cpath%20d%3D%22M19.2349%209.30048H21.5441V11.154H19.2349V9.30048Z%22%20fill%3D%22url%28%23paint1_linear_3104_80271%29%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_3104_80271%22%20x1%3D%2216.0232%22%20y1%3D%2216.4115%22%20x2%3D%2216.0232%22%20y2%3D%2213.5869%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%2F%3E%3Cstop%20offset%3D%221%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_3104_80271%22%20x1%3D%2220.3894%22%20y1%3D%2212.3897%22%20x2%3D%2220.3894%22%20y2%3D%229.91831%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%2F%3E%3Cstop%20offset%3D%221%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_3104_80271%22%3E%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!1,supportExtension:!0,link:"https://wallet.gamestop.com/",injected:()=>window.ethereum?.isGamestop,disabled:()=>!window.gamestop,connector:(e,t)=>M(window.gamestop,t),switchChain:e=>U({...e,provider:e.provider||window.gamestop})},cM={type:x.Brave,showName:"Brave",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47062%29%22%3E%3Cmask%20id%3D%22mask0_6996_47062%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%227%22%20y%3D%227%22%20width%3D%2226%22%20height%3D%2226%22%3E%3Cpath%20d%3D%22M33%207H7V33H33V7Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_6996_47062%29%22%3E%3Cpath%20d%3D%22M31.1202%2016.2236L30.3185%2014.0461L30.876%2012.7961C30.9111%2012.7173%2030.9214%2012.6297%2030.9058%2012.5448C30.8902%2012.4599%2030.8493%2012.3818%2030.7886%2012.3205L29.2725%2010.7881C28.947%2010.4579%2028.5345%2010.2269%2028.0829%2010.122C27.6313%2010.0172%2027.1591%2010.0428%2026.7215%2010.1959L26.2969%2010.3435L23.981%207.83436L20.0524%207.8125H20.0268L16.0728%207.84347L13.7586%2010.3726L13.3468%2010.2269C12.9064%2010.072%2012.4308%2010.0459%2011.9761%2010.1518C11.5213%2010.2576%2011.1062%2010.491%2010.7794%2010.8245L9.23603%2012.3861C9.18759%2012.4349%209.15506%2012.4973%209.1427%2012.5649C9.13034%2012.6326%209.13874%2012.7024%209.16679%2012.7651L9.74806%2014.0625L8.94995%2016.2382L9.46563%2018.2006L11.818%2027.1438C12.089%2028.174%2012.7125%2029.0767%2013.5801%2029.6948C13.5801%2029.6948%2016.4354%2031.7083%2019.2525%2033.5378C19.4752%2033.7157%2019.7518%2033.8125%2020.0369%2033.8125C20.3219%2033.8125%2020.5985%2033.7157%2020.8213%2033.5378C23.9864%2031.4641%2026.49%2029.6875%2026.49%2029.6875C27.357%2029.069%2027.9798%2028.1664%2028.2503%2027.1365L30.5899%2018.1897L31.1202%2016.2236Z%22%20fill%3D%22url%28%23paint0_linear_6996_47062%29%22%2F%3E%3Cpath%20d%3D%22M20.6827%2023.9297C20.5327%2023.8625%2020.378%2023.8065%2020.2199%2023.762H19.9411C19.7829%2023.8065%2019.6282%2023.8625%2019.4783%2023.9297L18.7767%2024.2212C18.5544%2024.3141%2018.1973%2024.4799%2017.9841%2024.5856L16.694%2025.2579C16.6473%2025.2731%2016.6062%2025.3019%2016.5759%2025.3406C16.5457%2025.3794%2016.5278%2025.4263%2016.5245%2025.4753C16.5212%2025.5243%2016.5325%2025.5732%2016.5572%2025.6156C16.5819%2025.6581%2016.6187%2025.6921%2016.663%2025.7135L17.7836%2026.5043C17.9804%2026.6428%2018.2902%2026.887%2018.4724%2027.051L18.7876%2027.3225C18.9699%2027.4792%2019.2668%2027.7398%2019.4473%2027.9001L19.7461%2028.1643C19.8384%2028.2413%2019.9548%2028.2834%2020.075%2028.2834C20.1952%2028.2834%2020.3116%2028.2413%2020.4039%2028.1643L20.7173%2027.891L21.3769%2027.3152L21.694%2027.0382C21.8762%2026.8797%2022.1841%2026.6355%2022.3809%2026.4916L23.5016%2025.6899C23.5459%2025.6686%2023.5828%2025.6344%2023.6074%2025.5918C23.6319%2025.5492%2023.6431%2025.5001%2023.6394%2025.4512C23.6357%2025.4021%2023.6171%2025.3554%2023.5864%2025.317C23.5556%2025.2786%2023.514%2025.2505%2023.467%2025.2361L22.1787%2024.5819C21.9637%2024.4727%2021.6065%2024.3086%2021.3824%2024.2175L20.6827%2023.9297Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M28.6273%2016.7103L28.6637%2016.5937C28.6659%2016.4377%2028.6561%2016.2818%2028.6345%2016.1273C28.526%2015.8513%2028.3867%2015.5884%2028.2191%2015.3437L27.4902%2014.2741C27.3554%2014.0737%2027.1258%2013.7566%2026.9709%2013.569L25.9942%2012.3463C25.9051%2012.2271%2025.8084%2012.1139%2025.7045%2012.0074H25.6845C25.6845%2012.0074%2025.4877%2012.042%2025.2508%2012.0875L23.7584%2012.3754L23.1043%2012.5012C22.8871%2012.5114%2022.67%2012.4798%2022.4647%2012.4082L21.2858%2012.0274C21.0561%2011.9527%2020.6771%2011.8452%2020.4421%2011.7942C20.1944%2011.7678%2019.9446%2011.7678%2019.6968%2011.7942C19.4618%2011.8488%2019.0827%2011.9545%2018.8531%2012.0292L17.6742%2012.4119C17.469%2012.4835%2017.2519%2012.515%2017.0347%2012.5048L16.3805%2012.3809L14.8863%2012.0948C14.6494%2012.0493%2014.4545%2012.0128%2014.4526%2012.0146H14.4326C14.3287%2012.1212%2014.232%2012.2344%2014.1429%2012.3536L13.168%2013.5762C13.0186%2013.7584%2012.7835%2014.0828%2012.6487%2014.2814L11.9198%2015.351C11.794%2015.5355%2011.679%2015.7271%2011.5755%2015.925C11.513%2016.1456%2011.4799%2016.3736%2011.4771%2016.6028L11.5135%2016.7194C11.531%2016.7943%2011.5536%2016.868%2011.5809%2016.9399C11.7322%2017.1222%2011.9909%2017.4246%2012.1567%2017.6014L14.7077%2020.3128C14.7924%2020.4116%2014.8491%2020.5314%2014.8719%2020.6596C14.8946%2020.7877%2014.8826%2020.9197%2014.8371%2021.0416L14.4198%2022.0311C14.325%2022.2932%2014.3179%2022.5791%2014.3998%2022.8456L14.4836%2023.0751C14.6206%2023.4481%2014.8553%2023.7772%2015.1633%2024.0281L15.5641%2024.3543C15.6683%2024.4294%2015.7898%2024.4769%2015.9173%2024.4921C16.0448%2024.5075%2016.1741%2024.4901%2016.293%2024.4418L17.718%2023.7621C17.9795%2023.6312%2018.2243%2023.469%2018.4468%2023.2792L19.5875%2022.2497C19.633%2022.2087%2019.6697%2022.159%2019.6955%2022.1035C19.7214%2022.0481%2019.7358%2021.9879%2019.7381%2021.9267C19.7403%2021.8656%2019.7302%2021.8045%2019.7084%2021.7473C19.6866%2021.6901%2019.6535%2021.6379%2019.6112%2021.5937L17.0365%2019.859C16.939%2019.7899%2016.8696%2019.688%2016.8408%2019.572C16.812%2019.4559%2016.8259%2019.3335%2016.8797%2019.2267L17.8783%2017.3499C17.9351%2017.235%2017.9686%2017.1101%2017.9771%2016.9822C17.9855%2016.8543%2017.9687%2016.726%2017.9275%2016.6046C17.8035%2016.3731%2017.6033%2016.1916%2017.3608%2016.0908L14.2303%2014.9082C14.0044%2014.8226%2014.0171%2014.726%2014.2558%2014.7114L16.0944%2014.5292C16.3827%2014.5109%2016.6721%2014.5367%2016.9526%2014.6058L18.5525%2015.0522C18.6661%2015.0864%2018.7634%2015.1607%2018.8264%2015.2612C18.8894%2015.3617%2018.9138%2015.4817%2018.8951%2015.5988L18.2664%2019.0318C18.2244%2019.2219%2018.2139%2019.4177%2018.2355%2019.6112C18.261%2019.6933%2018.476%2019.7934%2018.711%2019.8518L19.6859%2020.0595C19.969%2020.1115%2020.2592%2020.1115%2020.5423%2020.0595L21.4188%2019.8609C21.6538%2019.808%2021.867%2019.6968%2021.8943%2019.6149C21.9154%2019.4212%2021.9042%2019.2254%2021.8616%2019.0355L21.2293%2015.6025C21.2105%2015.4853%2021.235%2015.3654%2021.2979%2015.2648C21.3609%2015.1643%2021.4582%2015.0901%2021.5718%2015.0558L23.1716%2014.6076C23.4522%2014.5385%2023.7416%2014.5127%2024.0299%2014.531L25.8685%2014.7023C26.109%2014.7242%2026.12%2014.8135%2025.8958%2014.8991L22.7672%2016.0854C22.5247%2016.1862%2022.3245%2016.3677%2022.2005%2016.5992C22.1175%2016.8443%2022.1352%2017.1124%2022.2497%2017.3445L23.2501%2019.2213C23.3039%2019.328%2023.3177%2019.4505%2023.289%2019.5665C23.2603%2019.6825%2023.1908%2019.7844%2023.0933%2019.8536L20.5205%2021.5919C20.478%2021.6361%2020.4451%2021.6884%2020.4232%2021.7456C20.4014%2021.8028%2020.3914%2021.8638%2020.3935%2021.925C20.3957%2021.9861%2020.4102%2022.0462%2020.4361%2022.1017C20.462%2022.1572%2020.4987%2022.2069%2020.5441%2022.2479L21.6866%2023.2774C21.9093%2023.4666%2022.154%2023.6281%2022.4155%2023.7584L23.8404%2024.4363C23.9595%2024.4844%2024.0889%2024.5015%2024.2164%2024.4858C24.3438%2024.4702%2024.4653%2024.4224%2024.5693%2024.347L24.9702%2024.019C25.2785%2023.7676%2025.5133%2023.4378%2025.6499%2023.0642L25.7336%2022.8346C25.8155%2022.5681%2025.8085%2022.2823%2025.7136%2022.0201L25.2945%2021.0307C25.249%2020.9087%2025.237%2020.7768%2025.2598%2020.6486C25.2825%2020.5205%2025.3392%2020.4007%2025.4239%2020.3018L27.9749%2017.5868C28.1407%2017.4046%2028.3976%2017.113%2028.5489%2016.9254C28.5797%2016.8555%2028.6059%2016.7837%2028.6273%2016.7103Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47062%22%20x1%3D%228.95724%22%20y1%3D%2220.8136%22%20x2%3D%2231.1129%22%20y2%3D%2220.8136%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23F1562B%22%2F%3E%3Cstop%20offset%3D%220.3%22%20stop-color%3D%22%23F1542B%22%2F%3E%3Cstop%20offset%3D%220.41%22%20stop-color%3D%22%23F04D2A%22%2F%3E%3Cstop%20offset%3D%220.49%22%20stop-color%3D%22%23EF4229%22%2F%3E%3Cstop%20offset%3D%220.5%22%20stop-color%3D%22%23EF4029%22%2F%3E%3Cstop%20offset%3D%220.56%22%20stop-color%3D%22%23E83E28%22%2F%3E%3Cstop%20offset%3D%220.67%22%20stop-color%3D%22%23E13C26%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23DF3C26%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47062%22%3E%3Crect%20width%3D%2226%22%20height%3D%2226%22%20fill%3D%22white%22%20transform%3D%22translate%287%207%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!1,supportExtension:!0,switchChain:U,link:"https://wallet-docs.brave.com/",injected:()=>window.ethereum?.isBraveWallet},lM={type:x.FoxWallet,showName:"FoxWallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47068%29%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M17.5234%2021.6769C17.5775%2021.6943%2017.6339%2021.7073%2017.6902%2021.7138C17.6902%2021.7138%2017.4541%2021.8026%2016.9666%2021.6358C16.9666%2021.6358%2016.6004%2021.4863%2016.3274%2021.5123C16.0089%2021.5404%2015.79%2021.9543%2015.79%2021.9543C15.8529%2021.9196%2015.92%2021.8936%2015.9894%2021.8763C16.206%2021.8329%2016.1324%2021.8698%2016.1324%2021.8698C16.1324%2021.8698%2015.7164%2022.0453%2015.6882%2022.1991C15.6817%2022.2381%2015.7987%2022.1276%2016.1064%2022.1384C16.4855%2022.1493%2016.8149%2022.3703%2016.9492%2022.4071C17.2265%2022.4808%2017.623%2022.4981%2017.9892%2022.2121C17.9892%2022.2121%2018.325%2022.0019%2018.429%2021.6119C18.455%2021.5036%2018.4724%2021.3931%2018.4767%2021.2826C18.4789%2021.1851%2018.4681%2021.0876%2018.4464%2020.9901C18.4442%2020.9879%2018.247%2021.4451%2017.5234%2021.6769Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M24.6821%2025.956C25.4166%2025.0351%2025.8152%2023.8933%2025.8152%2022.7146C25.8152%2021.5381%2025.4144%2020.3941%2024.6821%2019.4733L29.3859%2018.9555C29.3859%2018.9555%2029.8756%2020.2966%2030.0034%2021.0138C30.0207%2021.1048%2030.0489%2021.2911%2030.0489%2021.2911C30.0489%2021.2911%2029.3187%2023.0635%2028.1986%2024.0363C26.6949%2025.345%2024.6821%2025.956%2024.6821%2025.956ZM13.5433%2025.891L11.7406%2026.2246C11.1686%2024.7751%2010.9584%2023.2086%2011.1318%2021.6616C11.3029%2020.1125%2011.8533%2018.6305%2012.7286%2017.3435C12.7676%2017.2871%2012.8456%2017.1766%2012.8456%2017.1766L14.8368%2022.7861L13.5433%2025.891Z%22%20fill%3D%22url%28%23paint0_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M20.0674%2014.386C20.0739%2014.3774%2020.0782%2014.3752%2020.0847%2014.3665C20.1324%2014.3145%2021.2525%2013.112%2019.9179%2011.0732C18.932%209.57169%2016.4252%209.61286%2015.4004%208.83069C15.4762%209.43303%2016.0655%209.97686%2016.0027%2010.8002C15.9767%2011.0732%2015.9269%2011.3419%2015.851%2011.604C15.7297%2012.0742%2015.617%2012.5227%2015.786%2013.4002C15.9182%2014.0849%2016.2302%2014.5832%2016.7134%2014.8844C17.268%2015.2267%2018.035%2015.3025%2018.8215%2015.0902C19.3459%2014.9472%2019.8139%2014.6829%2020.0674%2014.386Z%22%20fill%3D%22url%28%23paint1_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.7379%2013.5064C22.0261%2013.0103%2022.0803%2012.4318%2021.9026%2011.7904C21.6556%2010.8934%2021.1876%2010.3041%2020.8084%209.83177C20.6893%209.68227%2020.5788%209.5436%2020.4878%209.41143C20.1281%208.88277%2019.9721%208.24143%2020.0501%207.60876C19.5929%207.9381%2018.7133%208.55777%2018.1521%209.2186C18.9646%209.6086%2019.5994%2010.0333%2020.0999%2010.7981C20.9558%2012.1024%2020.9406%2013.1554%2020.7781%2013.8098C20.7326%2013.9896%2021.0771%2014.1499%2021.0143%2014.2886C21.3068%2014.0806%2021.5516%2013.8141%2021.7379%2013.5064Z%22%20fill%3D%22url%28%23paint2_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M27.9668%2018.9231C27.0113%2018.8321%2025.0764%2018.5959%2025.0764%2018.5959C20.7236%2018.3533%2018.2536%2019.6598%2016.3903%2021.3693C14.9516%2022.7993%2013.6689%2026.5043%2013.6689%2026.5043L12.1111%2026.4198C12.1111%2026.4198%2012.6072%2024.9421%2013.1814%2023.8653C13.8401%2022.6324%2013.9874%2022.7321%2013.8379%2022.5284C13.1424%2021.5729%2012.8152%2020.8211%2012.5357%2019.2134C12.5357%2019.2134%2012.8629%2019.4713%2013.1099%2019.3131C13.1099%2019.3131%2012.5487%2018.3381%2012.4621%2017.2851C12.3082%2015.4196%2013.1814%2012.8716%2013.2031%2012.8131C13.1944%2012.8391%2013.1489%2013.0579%2013.6602%2013.3851C13.6971%2013.2312%2013.7361%2013.0796%2013.7772%2012.9322C13.9571%2012.0526%2014.4402%2010.1307%2015.4044%208.82855C15.4044%208.82855%2015.9439%2010.7114%2017.2981%2011.5651C19.9349%2013.2291%2021.5859%2013.2377%2021.5859%2013.2377C25.3104%2013.6537%2026.9008%2015.4824%2026.9008%2015.4824C29.5744%2018.3663%2032.0033%2018.3403%2032.0033%2018.3403C31.1301%2019.1744%2027.9668%2018.9231%2027.9668%2018.9231Z%22%20fill%3D%22url%28%23paint3_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M32.049%2018.3402C32.049%2018.3402%2031.6698%2020.4375%2029.683%2020.6823C29.683%2020.6823%2022.4767%2020.6368%2021.9502%2027.1823L21.8288%2029.0218L13.1838%2026.502C13.1838%2026.502%2013.9985%2023.7222%2015.7817%2021.4905C15.7817%2021.4905%2018.8085%2017.2157%2027.4318%2018.3423C27.4318%2018.3423%2028.4393%2018.546%2029.852%2018.6782C31.0437%2018.7887%2032.049%2018.3402%2032.049%2018.3402Z%22%20fill%3D%22url%28%23paint4_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M27.1458%2017.3415C27.1458%2017.3415%2025.2738%2016.3687%2022.9446%2016.4597C22.9446%2016.4597%2024.2121%2015.4695%2025.9238%2015.7122L27.1458%2017.3415Z%22%20fill%3D%22%23722B00%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.4115%2026.2854C22.4115%2026.2854%2023.0204%2026.7057%2023.9867%2026.4826C23.9867%2026.4826%2022.4245%2027.3882%2019.1312%2026.1467C19.1312%2026.1467%2015.736%2024.6279%2013.3462%2024.9746C11.81%2025.1977%2010.4537%2026.4176%209.63032%2027.3449C8.63799%2028.4672%208.76149%2027.9429%2011.2553%2027.6331C11.8555%2027.5594%2011.5088%2027.7284%2011.5088%2027.7284C11.5088%2027.7284%208.17866%2029.1259%207.95332%2030.3674C7.89699%2030.6772%208.83082%2029.8019%2011.2943%2029.8799C14.319%2029.9752%2016.9494%2031.7302%2018.0305%2032.0206C20.2449%2032.6121%2023.4212%2032.7486%2026.3354%2030.4627C26.3354%2030.4627%2029.0242%2028.7749%2029.8562%2025.6571C30.0729%2024.7926%2030.2007%2023.9064%2030.2375%2023.0159C30.2809%2021.8546%2029.9277%2020.6326%2029.9277%2020.6326C29.9277%2020.6326%2027.9647%2024.9897%2022.4115%2026.2854Z%22%20fill%3D%22url%28%23paint5_linear_6996_47068%29%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47068%22%20x1%3D%2220.3513%22%20y1%3D%2216.8741%22%20x2%3D%2220.7275%22%20y2%3D%2226.2095%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23DADB48%22%2F%3E%3Cstop%20offset%3D%220.6562%22%20stop-color%3D%22%23637621%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47068%22%20x1%3D%2220.5689%22%20y1%3D%2212.0214%22%20x2%3D%2215.9952%22%20y2%3D%2212.0214%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23EC6F01%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F4B23D%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47068%22%20x1%3D%2220.1979%22%20y1%3D%2212.7904%22%20x2%3D%2219.9276%22%20y2%3D%228.37438%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23F4B33E%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FB6F1B%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_6996_47068%22%20x1%3D%2212.0063%22%20y1%3D%2216.933%22%20x2%3D%2228.093%22%20y2%3D%2223.2866%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FB6D1A%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F3B23E%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_6996_47068%22%20x1%3D%2215.6112%22%20y1%3D%2226.2219%22%20x2%3D%2230.8869%22%20y2%3D%2219.5079%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23F3B63F%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FB701C%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_6996_47068%22%20x1%3D%2214.036%22%20y1%3D%2231.164%22%20x2%3D%2227.2614%22%20y2%3D%2222.9179%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23EC6F00%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F4B33E%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47068%22%3E%3Crect%20width%3D%2226%22%20height%3D%2226%22%20fill%3D%22white%22%20transform%3D%22translate%287%207%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!1,switchChain:U,link:"https://foxwallet.com/",mobileDeepLink:"foxwallet://dapp?url=$APP_URL",injected:()=>window.foxwallet?.ethereum},uM={type:x.BinanceChain,showName:"Binance Web3 Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_7345_82351%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%234D4D4D%22%2F%3E%3Cpath%20d%3D%22M20%2038.6666C30.3093%2038.6666%2038.6667%2030.3092%2038.6667%2019.9999C38.6667%209.6906%2030.3093%201.33325%2020%201.33325C9.69069%201.33325%201.33334%209.6906%201.33334%2019.9999C1.33334%2030.3092%209.69069%2038.6666%2020%2038.6666Z%22%20fill%3D%22%234D4D4D%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14.8214%2017.8718L20%2012.6932L25.1787%2017.8772L28.192%2014.8638L20%206.6665L11.808%2014.8585L14.8214%2017.8718ZM6.66669%2019.9998L9.68002%2016.9865L12.6934%2019.9998L9.68002%2023.0132L6.66669%2019.9998ZM14.8214%2022.1278L20%2027.3065L25.1787%2022.1225L28.1974%2025.1358L20%2033.3332L11.808%2025.1412L11.8027%2025.1358L14.8214%2022.1278ZM27.3067%2019.9998L30.32%2016.9865L33.3334%2019.9998L30.32%2023.0132L27.3067%2019.9998Z%22%20fill%3D%22%23F3BA2F%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M23.36%2019.9998L20%2016.6292L17.5147%2019.1198L17.2267%2019.4078L16.6347%2019.9998L16.6293%2020.0052L16.6347%2020.0105L19.9947%2023.3705L23.36%2020.0052V19.9998Z%22%20fill%3D%22%23F3BA2F%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_7345_82351%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportChains:[E.MAINNET,E.BSC,E.OPTIMISM,E.ARBITRUM_ONE,E.POLYGON,E.AVALANCHE,E.CONFLUX,E.AURORA],link:"https://www.bnbchain.world/en/binance-wallet",supportMobile:!0,supportExtension:!0,disabled:()=>!1,injected:()=>window.ethereum?.isBinance,connector:(e,t)=>de(e,t),switchChain:e=>U({...e,provider:e.provider??O.getState().provider}),isInstalled:()=>!!(window.ethereum?.isBinance||window.BinanceChain||va())},dM={type:x.kuCoinWallet,showName:"Halo Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%2308C082%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M26.9013%2013.0737C26.6763%2012.5218%2026.4011%2011.9917%2026.0791%2011.4901H26.0785C25.4995%2010.5874%2025.7628%209.38621%2026.6656%208.80718C27.5683%208.22873%2028.7695%208.49151%2029.3485%209.39426C33.0136%2015.1116%2031.8584%2022.5371%2026.9261%2026.9002C27.4703%2026.6796%2027.9931%2026.4094%2028.4878%2026.0929C28.7937%2025.8905%2029.1605%2025.7732%2029.555%2025.7709C30.6273%2025.7709%2031.4985%2026.638%2031.5002%2027.7098C31.5013%2028.4113%2031.1322%2029.0254%2030.5767%2029.3681C24.863%2033.009%2017.4553%2031.8498%2013.099%2026.9255C13.3237%2027.4779%2013.5989%2028.0084%2013.9212%2028.5102C14.5002%2029.4118%2014.2369%2030.6147%2013.3341%2031.192C12.4314%2031.7716%2011.2302%2031.5094%2010.6512%2030.6055C6.98616%2024.8888%208.14133%2017.4633%2013.0737%2013.099C12.5218%2013.324%2011.9918%2013.5993%2011.4902%2013.9212C10.5875%2014.5002%209.38621%2014.2369%208.80718%2013.3341C8.22873%2012.4314%208.49151%2011.2302%209.39426%2010.6512C15.1116%206.98616%2022.5371%208.14133%2026.9013%2013.0737ZM15.096%2023.1437C13.3606%2020.4372%2014.1465%2016.8366%2016.8509%2015.0988V15.0983L16.8567%2015.0949C19.5655%2013.3584%2023.1685%2014.1461%2024.9055%2016.8544V16.8555C26.642%2019.5644%2025.8537%2023.1679%2023.1449%2024.9044C20.4361%2026.6397%2016.8325%2025.8531%2015.096%2023.1437ZM17.7681%2020.5844C17.4455%2020.2618%2017.4455%2019.738%2017.7681%2019.4154L19.416%2017.7675C19.4928%2017.6907%2019.5839%2017.6297%2019.6843%2017.5881C19.7846%2017.5465%2019.8922%2017.5251%2020.0008%2017.5251C20.1094%2017.5251%2020.2169%2017.5465%2020.3173%2017.5881C20.4176%2017.6297%2020.5088%2017.6907%2020.5856%2017.7675L22.2335%2019.4154C22.3103%2019.4922%2022.3713%2019.5833%2022.4128%2019.6836C22.4544%2019.7838%2022.4758%2019.8914%2022.4758%2019.9999C22.4758%2020.1085%2022.4544%2020.216%2022.4128%2020.3163C22.3713%2020.4166%2022.3103%2020.5077%2022.2335%2020.5844L20.5856%2022.2329C20.4304%2022.3878%2020.2201%2022.4749%2020.0008%2022.4749C19.7815%2022.4749%2019.5712%2022.3878%2019.416%2022.2329L17.7681%2020.5844Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://halo.social/",disabled:()=>!(window.haloEthereum??window.kucoin),injected:()=>window.ethereum?.isKuCoinWallet||window.ethereum?.isHaloWallet,connector:(e,t)=>M(window.haloEthereum??window.kucoin,t),switchChain:e=>U({...e,provider:e.provider||(window.haloEthereum??window.kucoin)}),isInstalled:()=>!!(window.haloEthereum??window.kucoin)},pM={type:x.Coin98,showName:"Coin98",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47072%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip1_6996_47072%29%22%3E%3Cpath%20d%3D%22M32.6961%200H7.30486C3.25283%200%200%203.252%200%207.304V32.696C0%2036.748%203.25283%2040%207.30486%2040H32.6951C36.6903%2040%2040%2036.748%2040%2032.696V7.304C40%203.252%2036.7481%200%2032.6961%200ZM26.5341%209.986C29.5013%209.986%2031.8979%2012.382%2031.8979%2015.35C31.8979%2016.262%2031.6691%2017.118%2031.2695%2017.917C30.5851%2017.404%2029.8439%2016.947%2029.0446%2016.662C29.2725%2016.262%2029.3874%2015.806%2029.3874%2015.35C29.3874%2013.809%2028.1316%2012.554%2026.5911%2012.554C25.0496%2012.554%2023.7948%2013.809%2023.7948%2015.35C23.7948%2015.806%2023.9087%2016.262%2024.1375%2016.662C23.3382%2016.947%2022.539%2017.347%2021.9116%2017.917C21.4551%2017.118%2021.2832%2016.262%2021.2832%2015.349C21.1704%2012.382%2023.567%209.986%2026.5341%209.986ZM13.4659%2030.014C10.4998%2030.014%208.10309%2027.618%208.10309%2024.651H10.6706C10.6706%2026.191%2011.9264%2027.447%2013.4669%2027.447C15.0074%2027.447%2016.2631%2026.191%2016.2631%2024.651H18.8306C18.8306%2027.618%2016.433%2030.014%2013.4659%2030.014ZM13.4659%2022.482C10.0432%2022.482%207.24694%2019.686%207.24694%2016.262C7.24694%2012.839%2010.0432%209.986%2013.4669%209.986C16.8905%209.986%2019.7437%2012.782%2019.7437%2016.262C19.6868%2019.686%2016.8895%2022.482%2013.4659%2022.482ZM26.5341%2030.014C23.1105%2030.014%2020.2572%2027.218%2020.2572%2023.794C20.2572%2020.314%2023.0535%2017.518%2026.5341%2017.518C29.9578%2017.518%2032.754%2020.314%2032.754%2023.795C32.754%2027.218%2029.9578%2030.014%2026.5341%2030.014ZM30.2425%2023.738C30.2425%2025.792%2028.5881%2027.389%2026.5341%2027.389C24.4801%2027.389%2022.8247%2025.735%2022.8247%2023.738C22.8247%2021.683%2024.4801%2020.028%2026.5341%2020.028C28.5881%2020.086%2030.2425%2021.74%2030.2425%2023.738ZM17.1182%2016.262C17.1182%2018.317%2015.4639%2019.972%2013.4099%2019.972C11.3549%2019.972%209.70054%2018.317%209.70054%2016.262C9.70054%2014.208%2011.3549%2012.553%2013.4099%2012.553C15.5209%2012.553%2017.1182%2014.207%2017.1182%2016.262Z%22%20fill%3D%22%23D9B432%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47072%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3CclipPath%20id%3D%22clip1_6996_47072%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://coin98.com/wallet",disabled:()=>!(window.coin98?.provider||window.ethereum?.isCoin98),injected:()=>window.ethereum?.isCoin98,connector:(e,t)=>M(window.coin98?.provider,t),switchChain:e=>U({...e,provider:e.provider||window.coin98?.provider}),isInstalled:()=>!!window.coin98?.provider},hM={type:x.frontier,showName:"Frontier",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47060%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%23CC703C%22%2F%3E%3Cpath%20d%3D%22M28.8973%209L28.7753%209.3228L28.3759%2010.3548L28.1105%2011.02C26.0949%2016.0081%2024.5274%2018.3752%2022.8605%2018.3752C22.4393%2018.3863%2022.0204%2018.3096%2021.6304%2018.1501C21.2405%2017.9904%2020.8881%2017.7513%2020.5957%2017.4481L20.383%2017.2552C19.8536%2016.7667%2019.6309%2016.6462%2019.121%2016.6462C18.8557%2016.6462%2018.3803%2016.9846%2017.7797%2017.7798C16.9752%2018.9192%2016.291%2020.1392%2015.7384%2021.4198L15.6706%2021.57H22.8206L21.9302%2023.4209H15.2543V31H13.2908V9H28.8973ZM26.1151%2010.8474H15.2543V18.1783C16.5556%2015.9215%2017.7927%2014.7886%2019.1231%2014.7886C19.5705%2014.7743%2020.016%2014.8531%2020.4314%2015.0199C20.8468%2015.1867%2021.223%2015.4379%2021.5361%2015.7577L21.7555%2015.9567C22.2497%2016.4128%2022.44%2016.5177%2022.8624%2016.5177C23.327%2016.5184%2024.5626%2014.5558%2026.1151%2010.8474Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47060%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://www.frontier.xyz/download",injected:()=>window.ethereum?.isFrontier,disabled:()=>!window.frontier?.ethereum,connector:(e,t)=>M(window.frontier?.ethereum,t),switchChain:e=>U({...e,provider:e.provider||window.frontier?.ethereum}),isInstalled:()=>!!window.frontier?.ethereum},mM={type:x.LedgerUSB,showName:"Ledger",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47064%29%22%3E%3Cpath%20d%3D%22M22.8376%2029.1957V30.5203H31.9293V24.546H30.6045V29.1957H22.8376ZM22.8376%209.47949V10.8042H30.6045V15.454H31.9293V9.47949H22.8376ZM18.4295%2015.454H17.1049V24.5457H23.0794V23.3509H18.4295V15.454ZM8%2024.546V30.5206H17.0917V29.1957H9.32468V24.546H8ZM8%209.47949V15.454H9.32468V10.8042H17.0917V9.47949H8Z%22%20fill%3D%22black%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47064%22%3E%3Crect%20width%3D%2224%22%20height%3D%2221.0411%22%20fill%3D%22white%22%20transform%3D%22translate%288%209.47949%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportChains:[E.MAINNET,E.BSC,E.POLYGON],disabled:()=>!k(),getPackage:$,connector:async e=>k()&&e?(await $()).default(e):void 0,needReadProvider:!0},fM={type:x.openBlock,showName:"OpenBlock",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M24.8394%2011.3075C28.3377%2011.3075%2031.1736%2014.1434%2031.1736%2017.6417V17.7911L28.9613%2020.0015L31.1736%2022.2099V22.3614C31.1736%2025.8597%2028.3377%2028.6957%2024.8394%2028.6957H8.81738L13.9384%2024.9696H22.4796C25.2233%2024.9696%2027.4476%2022.7453%2027.4476%2020.0015C27.4476%2017.2578%2025.2233%2015.0335%2022.4796%2015.0335H13.9384L8.81738%2011.3075H24.8394ZM15.1309%2017.89C13.9648%2017.89%2013.0195%2018.8354%2013.0195%2020.0015C13.0195%2021.1676%2013.9648%2022.1129%2015.1309%2022.1129H22.4869C23.653%2022.1129%2024.5983%2021.1676%2024.5983%2020.0015C24.5983%2018.8354%2023.653%2017.89%2022.4869%2017.89H15.1309Z%22%20fill%3D%22%234A3DE6%22%2F%3E%3C%2Fsvg%3E",supportChains:[E.MAINNET,E.GOERLI,E.BSC,E.POLYGON,E.ARBITRUM_ONE,E.OKCHAIN,E.OPTIMISM,E.AVALANCHE],link:"https://openblock.com/#/download",disabled:()=>!window.openblock,connector:(e,t)=>M(window.openblock,t),switchChain:e=>U({...e,provider:e.provider||window.openblock}),isInstalled:()=>!!window.openblock},yM={type:x.OneKey,showName:"OneKey",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47075%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%2344D62C%22%2F%3E%3Cpath%20d%3D%22M21.8071%208.48083H16.2432L15.2671%2011.4322H18.3573V17.6495H21.8071V8.48083Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M26.3455%2025.1739C26.3455%2028.6782%2023.5044%2031.5191%2020%2031.5191C16.4955%2031.5191%2013.6548%2028.6782%2013.6548%2025.1739C13.6548%2021.6694%2016.4955%2018.8286%2020%2018.8286C23.5044%2018.8286%2026.3455%2021.6694%2026.3455%2025.1739ZM23.4648%2025.1739C23.4648%2027.0875%2021.9137%2028.6386%2020%2028.6386C18.0867%2028.6386%2016.5355%2027.0875%2016.5355%2025.1739C16.5355%2023.2605%2018.0867%2021.7091%2020%2021.7091C21.9137%2021.7091%2023.4648%2023.2605%2023.4648%2025.1739Z%22%20fill%3D%22black%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47075%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://onekey.so",supportMobile:!0,injected:()=>window.ethereum?.isOneKey,disabled:()=>!(window.$onekey?.ethereum??window.onekey),connector:(e,t)=>M(window.$onekey?.ethereum??window.onekey,t),switchChain:e=>U({...e,provider:e.provider||(window.$onekey?.ethereum??window.onekey)}),isInstalled:()=>!!(window.$onekey?.ethereum??window.onekey)},bM={type:x.Bitkeep,showName:"Bitget Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_9886_837%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M40%200H0V40H40V0Z%22%20fill%3D%22%23001F29%22%2F%3E%3Cpath%20d%3D%22M17.1833%207.4768C15.7517%207.47608%2014.3225%207.47534%2012.8859%207.47754C12.0172%207.47754%2011.6914%208.56812%2012.3375%209.21405L22.1169%2018.9936C22.4221%2019.2727%2022.6125%2019.5762%2022.6194%2019.9761C22.6125%2020.376%2022.4221%2020.6794%2022.1169%2020.9586L12.3375%2030.738C11.6914%2031.3841%2012.0172%2032.4746%2012.8859%2032.4746C14.3225%2032.4768%2015.7517%2032.4761%2017.1833%2032.4753C17.9%2032.475%2018.6175%2032.4746%2019.3367%2032.4746C20.2776%2032.4746%2020.8374%2031.9719%2021.34%2031.4692L30.1598%2022.6494C30.8637%2021.9455%2031.4936%2021.0109%2031.485%2019.9761C31.4936%2018.9412%2030.8637%2018.0066%2030.1598%2017.3027L21.34%208.48288C20.8374%207.98022%2020.2776%207.47754%2019.3367%207.47754C18.6175%207.47754%2017.9%207.47717%2017.1833%207.4768Z%22%20fill%3D%22%2300F0FF%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_9886_837%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://bitkeep.com/download?type=2",mobileDeepLink:"https://bkcode.vip?action=dapp&url=$APP_URL",supportMobile:!0,injected:()=>D()&&(window.bitkeep?.ethereum||window.isBitKeep),disabled:()=>!(window.bitkeep?.ethereum||window.isBitKeep),connector:(e,t)=>M(window.bitkeep?.ethereum,t),connectorInjected:(e,t)=>M(window.bitkeep?.ethereum,t),switchChain:e=>U({...e,provider:e.provider||window.bitkeep?.ethereum}),isInstalled:()=>!(!window.bitkeep?.ethereum&&!window.isBitKeep)},gM={type:x.Nabox,showName:"Nabox",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.625%2014.3018V26.4113L12.1312%2028.4326V19.7701L15.6249%2021.788V30.4448L19.1322%2032.4661V20.3554L8.625%2014.3018Z%22%20fill%3D%22%232AC98B%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M16.5894%2013.1937L20.1024%2011.1348L24.4673%2013.689L20.9565%2015.7388L16.5894%2013.1937ZM20.107%207L9.5166%2013.196L20.9372%2019.8919V33L24.4013%2030.9822V17.7213L27.9018%2015.6716V28.921L31.4171%2026.8519V13.6173L20.107%207Z%22%20fill%3D%22%232AC98B%22%2F%3E%3C%2Fsvg%3E",link:"https://nabox.io/",supportMobile:!0,disabled:()=>!window.NaboxWallet,injected:()=>window.ethereum?.isNabox,connector:(e,t)=>M(window.NaboxWallet,t),switchChain:e=>U({...e,provider:e.provider||window.NaboxWallet}),isInstalled:()=>!!window.NaboxWallet},wM={type:x.OKX,showName:"OKX Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M16.2222%2010H10.4444C10.199%2010%2010%2010.199%2010%2010.4444V16.2222C10%2016.4677%2010.199%2016.6667%2010.4444%2016.6667H16.2222C16.4677%2016.6667%2016.6667%2016.4677%2016.6667%2016.2222V10.4444C16.6667%2010.199%2016.4677%2010%2016.2222%2010ZM22.8918%2016.6667H17.114C16.8685%2016.6667%2016.6695%2016.8657%2016.6695%2017.1111V22.8889C16.6695%2023.1343%2016.8685%2023.3333%2017.114%2023.3333H22.8918C23.1372%2023.3333%2023.3362%2023.1343%2023.3362%2022.8889V17.1111C23.3362%2016.8657%2023.1372%2016.6667%2022.8918%2016.6667ZM23.7778%2010H29.5556C29.801%2010%2030%2010.199%2030%2010.4444V16.2222C30%2016.4677%2029.801%2016.6667%2029.5556%2016.6667H23.7778C23.5323%2016.6667%2023.3333%2016.4677%2023.3333%2016.2222V10.4444C23.3333%2010.199%2023.5323%2010%2023.7778%2010ZM16.2222%2023.3333H10.4444C10.199%2023.3333%2010%2023.5323%2010%2023.7778V29.5556C10%2029.801%2010.199%2030%2010.4444%2030H16.2222C16.4677%2030%2016.6667%2029.801%2016.6667%2029.5556V23.7778C16.6667%2023.5323%2016.4677%2023.3333%2016.2222%2023.3333ZM23.7778%2023.3333H29.5556C29.801%2023.3333%2030%2023.5323%2030%2023.7778V29.5556C30%2029.801%2029.801%2030%2029.5556%2030H23.7778C23.5323%2030%2023.3333%2029.801%2023.3333%2029.5556V23.7778C23.3333%2023.5323%2023.5323%2023.3333%2023.7778%2023.3333Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://www.okx.com/",mobileDeepLink:"okx://wallet/dapp/details?dappUrl=$APP_URL",injected:()=>D()&&!!window.okxwallet,disabled:()=>!window.okxwallet,connector:(e,t)=>M(window.okxwallet,t),switchChain:e=>U({...e,provider:e.provider||window.okxwallet}),isInstalled:()=>!!window.okxwallet},vM={type:x.WalletConnect,showName:"WalletConnect",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_radial_6996_47051%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M27.2897%2015.446C23.2637%2011.518%2016.7363%2011.518%2012.7103%2015.446L12.1785%2015.9649C11.9772%2016.1613%2011.9772%2016.4797%2012.1785%2016.6761L13.836%2018.2933C13.9366%2018.3915%2014.0998%2018.3915%2014.2005%2018.2933L14.9145%2017.5966C17.7232%2014.8563%2022.2769%2014.8563%2025.0855%2017.5966L25.7523%2018.2471C25.8529%2018.3453%2026.0161%2018.3453%2026.1168%2018.2471L27.7743%2016.63C27.9756%2016.4336%2027.9756%2016.1151%2027.7743%2015.9187L27.2897%2015.446ZM32.1928%2020.2297L30.7176%2018.7904C30.5163%2018.594%2030.1899%2018.594%2029.9886%2018.7904L25.2677%2023.3965C25.2174%2023.4456%2025.1358%2023.4456%2025.0854%2023.3965L20.3644%2018.7903L20.3644%2018.7903C20.1631%2018.5939%2019.8367%2018.5939%2019.6354%2018.7903L14.9146%2023.3965C14.8643%2023.4456%2014.7827%2023.4456%2014.7324%2023.3965L10.0114%2018.7903C9.81008%2018.5939%209.48371%2018.5939%209.28241%2018.7903L7.80722%2020.2296C7.60593%2020.426%207.60593%2020.7444%207.80722%2020.9408L14.4591%2027.4308C14.6604%2027.6272%2014.9868%2027.6272%2015.1881%2027.4308L19.9089%2022.8248C19.9592%2022.7757%2020.0408%2022.7757%2020.0912%2022.8248L24.8121%2027.4308C25.0134%2027.6272%2025.3398%2027.6272%2025.5411%2027.4308L32.1928%2020.9409C32.3941%2020.7445%2032.3941%2020.4261%2032.1928%2020.2297Z%22%20fill%3D%22white%22%2F%3E%3Cdefs%3E%3CradialGradient%20id%3D%22paint0_radial_6996_47051%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%280%2020%29%20scale%2840%29%22%3E%3Cstop%20stop-color%3D%22%235D9DF6%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23006FFF%22%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,getPackage:K,connector:(e,t)=>oe(e,t),disconnect:async()=>(await K()).disconnect(),needReadProvider:!0},CM={type:x.Portis,showName:"Portis",logo:"data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%20301.38%20455.87%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m4.45%20262.11%2010.93-4.75%20135.31-58.82%20146.24%2063.57-54.95%20113.43-134.33%2019-101-109z%22%20fill%3D%22%23133444%22%2F%3E%3Cpath%20d%3D%22m266.51%20192.16a150.43%20150.43%200%200%200%20-95.82-53q-1.2-.17-2.4-.3a152.36%20152.36%200%200%200%20-35.2%200q-1.2.14-2.4.3a150.43%20150.43%200%200%200%20-95.82%2053l-6.08%2010.08-10.13%2016.76-7.41%2012.31c-.14.33-.28.67-.41%201l-.09.23%2016.35%209.67%20103.6%2061.28%2020%2011.83v-146.47l-20%209.08v-21.93l20-9.09%2020%209.09%20101.9%2046.28z%22%20fill%3D%22%23c42370%22%2F%3E%3Cpath%20d%3D%22m301.38%20298.56c0%2048.78-23.18%2094.42-59.12%20123.84a149.45%20149.45%200%200%201%20-47.64%2026.37%20139.51%20139.51%200%200%201%20-43.93%207.1c-83.22%200-150.69-74.09-150.69-157.31a150.49%20150.49%200%200%201%204.45-36.45l146.24%2086.51%20146.24-86.51a150.49%20150.49%200%200%201%204.45%2036.45z%22%20fill%3D%22%231c4d6b%22%2F%3E%3Cpath%20d%3D%22m133.09%20138.89%2017.6%207.99-20%209.09v-18.17z%22%2F%3E%3Cpath%20d%3D%22m130.69%20177.93%2020-9.08v146.53l-20-11.83z%22%2F%3E%3Cpath%20d%3D%22m150.69%20168.85v146.53l140.13-82.89z%22%20fill%3D%22%231d4259%22%2F%3E%3Cpath%20d%3D%22m150.69%200v168.85l140.13%2063.64z%22%20fill%3D%22%234b6b9a%22%2F%3E%3Cpath%20d%3D%22m150.69%20168.85v146.53l-20-11.83-119.95-71-.18-.11.27-.12c.13-.33.27-.67.41-1l17.53-29.09%20101.92-46.23v22z%22%20fill%3D%22%23343535%22%2F%3E%3Cpath%20d%3D%22m150.69%20168.85v146.53l-20-11.83-119.95-70.95-.18-.11.27-.12%20119.86-54.44z%22%20fill%3D%22%233e5578%22%2F%3E%3Cpath%20d%3D%22m150.69%200v168.85l-140.13%2063.64z%22%20fill%3D%22%236db2d8%22%2F%3E%3Cg%20fill%3D%22%23335f8a%22%3E%3Cpath%20d%3D%22m94%20443.85c2.09.92%204.21%201.79%206.34%202.61q-3.26-1.23-6.34-2.61z%22%2F%3E%3Cpath%20d%3D%22m100.29%20446.46c2.14.82%204.29%201.59%206.47%202.31q-3.27-1.07-6.47-2.31z%22%2F%3E%3Cpath%20d%3D%22m112.33%20450.49c1.66.47%203.33.92%205%201.33q-2.51-.62-5-1.33z%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22m4.45%20262.11%20146.24%2086.51a167.48%20167.48%200%200%201%20-10.47%2038.38c-11.7%2028.28-35.34%2058.19-81.08%2035.44-35.96-29.44-59.14-75.1-59.14-123.88a150.49%20150.49%200%200%201%204.45-36.45z%22%20fill%3D%22%236db2d8%22%2F%3E%3Cpath%20d%3D%22m242.24%20422.41-.36.29c-.76.62-1.52%201.23-2.29%201.83l-.2.16q-1.25%201-2.52%201.92c-.91.68-1.83%201.36-2.76%202s-1.86%201.31-2.8%201.95-1.66%201.12-2.49%201.66l-.46.3c-.88.57-1.76%201.13-2.64%201.67a2.63%202.63%200%200%201%20-.33.2c-.91.57-1.82%201.12-2.74%201.65s-2%201.15-3%201.7-2%201.08-3%201.6l-.11.06c-1%20.52-2%201-3%201.52s-2%201-3.08%201.49-2.08%201-3.12%201.42c-2.09.92-4.21%201.79-6.34%202.61s-4.29%201.59-6.47%202.31c-.87.29-1.74.57-2.62.84s-2%20.6-2.95.88c-1.66.47-3.33.92-5%201.33-.63.16-1.27.31-1.91.45l-1.07.25c-.89.2-1.78.39-2.68.57s-1.64.33-2.47.48-1.51.28-2.27.4-1.68.27-2.52.39c-.41.07-.82.13-1.24.18l-1.89.25-1.05.13c-.69.09-1.39.16-2.09.23-.86.09-1.71.17-2.57.24-.67.05-1.34.11-2%20.15s-1.16.08-1.75.1h-.08c-.68%200-1.36.08-2%20.1-.94%200-1.89.07-2.84.09s-1.9%200-2.86%200-1.91%200-2.86%200-1.9%200-2.84-.09c-.69%200-1.37-.06-2.05-.1h-.08c-.59%200-1.17-.06-1.75-.1s-1.34-.1-2-.15c-.86-.07-1.71-.15-2.57-.24-.7-.07-1.4-.14-2.09-.23l-1-.13c-.63-.07-1.26-.16-1.89-.25-.42%200-.83-.11-1.24-.18q-1.27-.18-2.52-.39c-.76-.12-1.52-.26-2.27-.4s-1.65-.31-2.47-.48-1.79-.37-2.68-.57l-1.07-.25c-.64-.14-1.28-.29-1.91-.45-1.68-.41-3.35-.86-5-1.33l-3-.88c-.88-.27-1.75-.55-2.62-.84-2.18-.72-4.33-1.49-6.47-2.31s-4.29-1.67-6.29-2.59c-1-.46-2.08-.94-3.12-1.42s-2.06-1-3.08-1.49-2-1-3-1.52l-.11-.06c-1-.52-2-1.06-3-1.6s-2-1.12-3-1.7-1.79-1.06-2.69-1.65l-.33-.2c-.88-.54-1.76-1.1-2.64-1.67l-.46-.3c-.83-.54-1.67-1.1-2.49-1.66s-1.88-1.29-2.8-1.95-1.85-1.34-2.76-2-1.69-1.27-2.52-1.92l-.2-.16c-.77-.6-1.53-1.21-2.29-1.83l-.36-.29c45.74%2022.75%2069.38-7.16%2081.08-35.44a167.48%20167.48%200%200%200%2010.47-38.35%20167.47%20167.47%200%200%200%2010.46%2038.36c11.7%2028.25%2035.34%2058.16%2081.08%2035.41z%22%20fill%3D%22%23529bba%22%2F%3E%3Cpath%20d%3D%22m184%20451.82c1.68-.41%203.35-.86%205-1.33q-2.44.72-5%201.33z%22%20fill%3D%22%23335f8a%22%2F%3E%3Cpath%20d%3D%22m194.62%20448.77c2.18-.72%204.33-1.49%206.47-2.31q-3.19%201.24-6.47%202.31z%22%20fill%3D%22%23335f8a%22%2F%3E%3Cpath%20d%3D%22m201.09%20446.46c2.13-.82%204.25-1.69%206.34-2.61q-3.13%201.38-6.34%202.61z%22%20fill%3D%22%23335f8a%22%2F%3E%3Cpath%20d%3D%22m301.38%20298.56c0%2048.78-23.19%2094.43-59.14%20123.85-45.74%2022.75-69.38-7.16-81.08-35.44a167.47%20167.47%200%200%201%20-10.47-38.35l146.24-86.51a150.49%20150.49%200%200%201%204.45%2036.45z%22%20fill%3D%22%234b6b9a%22%2F%3E%3C%2Fsvg%3E",supportChains:[E.MAINNET,E.GOERLI],checked:({PORTIS_ID:e})=>!!e,getPackage:Z,connector:(e,t)=>se(e,t)},EM={type:x.Gnosis,showName:"Gnosis",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47074%29%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47074%29%22%3E%3Cmask%20id%3D%22mask0_6996_47074%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%224%22%20y%3D%224%22%20width%3D%2232%22%20height%3D%2232%22%3E%3Cpath%20d%3D%22M36%204H4V36H36V4Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_6996_47074%29%22%3E%3Cmask%20id%3D%22mask1_6996_47074%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%224%22%20y%3D%224%22%20width%3D%2232%22%20height%3D%2232%22%3E%3Cpath%20d%3D%22M20%2036C28.8366%2036%2036%2028.8366%2036%2020C36%2011.1634%2028.8366%204%2020%204C11.1634%204%204%2011.1634%204%2020C4%2028.8366%2011.1634%2036%2020%2036Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask1_6996_47074%29%22%3E%3Cpath%20d%3D%22M36.0641%201.39203H2.46411V38.288H36.0641V1.39203Z%22%20fill%3D%22url%28%23paint1_linear_6996_47074%29%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M28.9623%2019.994H26.7763C26.1235%2019.994%2025.5946%2020.5233%2025.5946%2021.1757V24.3482C25.5946%2025.001%2025.0653%2025.53%2024.4128%2025.53H15.7162C15.0634%2025.53%2014.5344%2026.0593%2014.5344%2026.7117V28.8977C14.5344%2029.5505%2015.0637%2030.0794%2015.7162%2030.0794H24.9162C25.569%2030.0794%2026.0909%2029.5501%2026.0909%2028.8977V27.1441C26.0909%2026.4913%2026.6202%2026.0279%2027.2727%2026.0279H28.9623C29.6151%2026.0279%2030.144%2025.4986%2030.144%2024.8461V21.1617C30.144%2020.5089%2029.6147%2019.994%2028.9623%2019.994Z%22%20fill%3D%22%23121312%22%2F%3E%3Cpath%20d%3D%22M14.5338%2015.6515C14.5338%2014.9987%2015.0631%2014.4698%2015.7156%2014.4698H24.4068C25.0596%2014.4698%2025.5885%2013.9405%2025.5885%2013.288V11.1021C25.5885%2010.4493%2025.0593%209.92035%2024.4068%209.92035H15.2119C14.5591%209.92035%2014.0301%2010.4496%2014.0301%2011.1021V12.7863C14.0301%2013.4391%2013.5009%2013.968%2012.8484%2013.968H11.1661C10.5133%2013.968%209.98438%2014.4973%209.98438%2015.1498V18.8381C9.98438%2019.4909%2010.5156%2019.9933%2011.1684%2019.9933H13.3543C14.0071%2019.9933%2014.5361%2019.464%2014.5361%2018.8115L14.5338%2015.6515Z%22%20fill%3D%22%23121312%22%2F%3E%3Cpath%20d%3D%22M19.0351%2017.6964H21.135C21.8191%2017.6964%2022.3746%2018.2519%2022.3746%2018.936V21.0359C22.3746%2021.72%2021.8191%2022.2755%2021.135%2022.2755H19.0351C18.351%2022.2755%2017.7954%2021.72%2017.7954%2021.0359V18.936C17.7954%2018.2519%2018.351%2017.6964%2019.0351%2017.6964Z%22%20fill%3D%22%23121312%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47074%22%20x1%3D%221.25943%22%20y1%3D%2234.5582%22%20x2%3D%2242.4153%22%20y2%3D%22-3.99282%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2312FF80%22%2F%3E%3Cstop%20offset%3D%220.13%22%20stop-color%3D%22%2315FD85%22%2F%3E%3Cstop%20offset%3D%220.29%22%20stop-color%3D%22%231FF896%22%2F%3E%3Cstop%20offset%3D%220.49%22%20stop-color%3D%22%2330F1B2%22%2F%3E%3Cstop%20offset%3D%220.69%22%20stop-color%3D%22%2348E7D9%22%2F%3E%3Cstop%20offset%3D%220.87%22%20stop-color%3D%22%235FDDFF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47074%22%20x1%3D%223.52203%22%20y1%3D%2233.2685%22%20x2%3D%2241.0897%22%20y2%3D%221.22211%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2312FF80%22%2F%3E%3Cstop%20offset%3D%220.13%22%20stop-color%3D%22%2315FD85%22%2F%3E%3Cstop%20offset%3D%220.29%22%20stop-color%3D%22%231FF896%22%2F%3E%3Cstop%20offset%3D%220.49%22%20stop-color%3D%22%2330F1B2%22%2F%3E%3Cstop%20offset%3D%220.69%22%20stop-color%3D%22%2348E7D9%22%2F%3E%3Cstop%20offset%3D%220.87%22%20stop-color%3D%22%235FDDFF%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47074%22%3E%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22white%22%20transform%3D%22translate%284%204%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportChains:[E.MAINNET,E.GOERLI,E.BSC,E.POLYGON,E.ARBITRUM_ONE,E.AURORA,E.AVALANCHE,E.OPTIMISM],link:"https://app.safe.global/welcome",disabled:async()=>!await(await V()).getIsSafe(),getPackage:V,connector:async(e,t)=>(await V()).default(t)},xM={type:x.uAuth,showName:"Unstoppable",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M33%209.00916V17.8605L7%2028.3194L33%209.00916Z%22%20fill%3D%22%2300C9FF%22%2F%3E%3Cpath%20d%3D%22M28.1258%208.625V23.8942C28.1258%2026.028%2027.2697%2028.0745%2025.7459%2029.5833C24.222%2031.0922%2022.1553%2031.9398%2020.0003%2031.9398C17.8453%2031.9398%2015.7785%2031.0922%2014.2547%2029.5833C12.7308%2028.0745%2011.8748%2026.028%2011.8748%2023.8942V17.4602L16.7492%2014.804V23.8942C16.7036%2024.2909%2016.7431%2024.6928%2016.8652%2025.0732C16.9874%2025.4538%2017.1892%2025.8045%2017.4577%2026.1024C17.7263%2026.4003%2018.0553%2026.6387%2018.4234%2026.8018C18.7914%2026.9651%2019.1901%2027.0495%2019.5934%2027.0495C19.9966%2027.0495%2020.3953%2026.9651%2020.7634%2026.8018C21.1314%2026.6387%2021.4605%2026.4003%2021.729%2026.1024C21.9975%2025.8045%2022.1995%2025.4538%2022.3215%2025.0732C22.4436%2024.6928%2022.4832%2024.2909%2022.4375%2023.8942V11.7064L28.1258%208.625Z%22%20fill%3D%22%230D67FE%22%2F%3E%3C%2Fsvg%3E",getPackage:q,connector:async(e,t)=>(await q()).default({...e,uAuthParams:{walletConnect:()=>vM.connector?vM.connector(e,t):Promise.resolve(void 0),...e.uAuthParams,clientID:e.uAuthParams?.clientID}},t),disconnect:async()=>{const{disconnectWallet:e}=await q();await e()}},kM={type:x.Blocto,showName:"Blocto",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M20.7145%2014.1513C18.4586%2014.1513%2016.2568%2015.0211%2014.6108%2016.5641C12.8053%2018.2569%2011.6628%2020.7569%2011.0078%2023.1086C10.5789%2024.6468%2010.364%2026.2429%2010.364%2027.8406C10.364%2028.3234%2010.3838%2028.8023%2010.4219%2029.2757C10.4687%2029.8513%2011.0292%2030.2502%2011.5874%2030.0995C12.0743%2029.9687%2012.5865%2029.8981%2013.1146%2029.8981C14.1992%2029.8981%2015.2157%2030.1931%2016.0871%2030.7084C16.1085%2030.7211%2016.1291%2030.7339%2016.1505%2030.7457C17.5667%2031.5901%2019.2373%2032.054%2021.0189%2031.9945C25.6661%2031.8407%2029.4625%2028.0594%2029.6337%2023.413C29.8208%2018.3298%2025.7564%2014.1505%2020.7152%2014.1505L20.7145%2014.1513ZM20.7145%2027.154C18.4619%2027.154%2016.6358%2025.3279%2016.6358%2023.0761C16.6358%2020.8243%2018.4619%2018.9975%2020.7145%2018.9975C22.967%2018.9975%2024.7931%2020.8235%2024.7931%2023.0761C24.7931%2025.3287%2022.967%2027.154%2020.7145%2027.154Z%22%20fill%3D%22%2314AAFF%22%2F%3E%3Cpath%20d%3D%22M17.0453%2011.3412C17.0453%2012.5171%2016.4293%2013.6081%2015.4175%2014.2075C14.7824%2014.5842%2014.1869%2015.029%2013.6478%2015.5356C12.4513%2016.6568%2011.5585%2018.0325%2010.8972%2019.3963C10.7664%2019.6642%2010.3628%2019.5691%2010.3628%2019.2709V11.3412C10.3628%209.49618%2011.859%208%2013.7041%208C15.5491%208%2017.0453%209.49618%2017.0453%2011.3412Z%22%20fill%3D%22%230077FF%22%2F%3E%3C%2Fsvg%3E",supportChains:[E.MAINNET,E.GOERLI,E.BSC,E.POLYGON,E.ARBITRUM_ONE,E.AVALANCHE,E.OPTIMISM,E.SCROLL],supportMobile:!0,link:"https://blocto.io/",getPackage:J,connector:ae,mobileDeepLink:"https://blocto.app/link?url=$APP_URL",injected:()=>window.ethereum?.isBlocto,disabled:()=>!1,switchChain:e=>U({...e,provider:e.provider??O.getState().provider}),needReadProvider:!0},TM={type:x.Rainbow,showName:"Rainbow",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2014.133H10.933C19.181%2014.133%2025.867%2020.819%2025.867%2029.067V30.667H29.067C29.4914%2030.667%2029.8983%2030.4984%2030.1984%2030.1984C30.4984%2029.8983%2030.667%2029.4913%2030.667%2029.067C30.667%2018.168%2021.832%209.33398%2010.933%209.33398C10.5087%209.33398%2010.1017%209.50256%209.80164%209.80261C9.50158%2010.1027%209.33301%2010.5096%209.33301%2010.934V14.133Z%22%20fill%3D%22url%28%23paint1_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M26.3999%2029.067H30.6669C30.6669%2029.4914%2030.4983%2029.8983%2030.1983%2030.1984C29.8982%2030.4984%2029.4912%2030.667%2029.0669%2030.667H26.3999V29.067Z%22%20fill%3D%22url%28%23paint2_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M10.934%209.33301V13.6H9.33398V10.934C9.33398%2010.5097%209.50256%2010.1027%209.80261%209.80264C10.1027%209.50258%2010.5096%209.33301%2010.934%209.33301Z%22%20fill%3D%22url%28%23paint3_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2013.6H10.933C19.476%2013.6%2026.4%2020.525%2026.4%2029.067V30.667H21.6V29.067C21.6%2023.176%2016.824%2018.4%2010.933%2018.4H9.33301V13.6Z%22%20fill%3D%22url%28%23paint4_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M22.1331%2029.067H26.4001V30.667H22.1331V29.067Z%22%20fill%3D%22url%28%23paint5_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2017.867V13.6H10.933V17.867H9.33301Z%22%20fill%3D%22url%28%23paint6_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2020.5329C9.33301%2020.7431%209.37439%2020.9511%209.4548%2021.1452C9.53521%2021.3394%209.65306%2021.5157%209.80164%2021.6643C9.95021%2021.8129%2010.1266%2021.9307%2010.3207%2022.0112C10.5148%2022.0916%2010.7229%2022.1329%2010.933%2022.1329C11.8436%2022.1328%2012.7454%2022.3121%2013.5867%2022.6605C14.428%2023.0089%2015.1925%2023.5197%2015.8364%2024.1636C16.4803%2024.8075%2016.991%2025.5719%2017.3395%2026.4133C17.6879%2027.2546%2017.8671%2028.1563%2017.867%2029.0669C17.867%2029.2771%2017.9084%2029.4851%2017.9888%2029.6792C18.0692%2029.8734%2018.1871%2030.0497%2018.3356%2030.1983C18.4842%2030.3469%2018.6606%2030.4647%2018.8547%2030.5452C19.0488%2030.6256%2019.2569%2030.6669%2019.467%2030.6669H22.134V29.0669C22.134%2022.8809%2017.119%2017.8669%2010.934%2017.8669H9.33401L9.33301%2020.5329Z%22%20fill%3D%22url%28%23paint7_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M17.8669%2029.067H22.1329V30.667H19.4669C19.0426%2030.667%2018.6356%2030.4984%2018.3356%2030.1984C18.0355%2029.8983%2017.8669%2029.4914%2017.8669%2029.067Z%22%20fill%3D%22url%28%23paint8_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M10.934%2022.1329C10.5096%2022.1329%2010.1027%2021.9644%209.80261%2021.6643C9.50256%2021.3643%209.33398%2020.9573%209.33398%2020.5329V17.8669H10.934V22.1329Z%22%20fill%3D%22url%28%23paint9_radial_6996_47058%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47058%22%20x1%3D%2220%22%20y1%3D%220%22%20x2%3D%2220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23174299%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23001E59%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22paint1_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.933%2029.067%29%20rotate%28-90%29%20scale%2819.7333%29%22%3E%3Cstop%20offset%3D%220.77%22%20stop-color%3D%22%23FF4000%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47058%22%20x1%3D%2226.1329%22%20y1%3D%2229.867%22%20x2%3D%2230.6669%22%20y2%3D%2229.867%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FF4000%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_6996_47058%22%20x1%3D%2210.133%22%20y1%3D%229.33301%22%20x2%3D%2210.133%22%20y2%3D%2213.867%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238754C9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF4000%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22paint4_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.933%2029.067%29%20rotate%28-90%29%20scale%2815.4667%29%22%3E%3Cstop%20offset%3D%220.724%22%20stop-color%3D%22%23FFF700%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_6996_47058%22%20x1%3D%2222.1331%22%20y1%3D%2229.867%22%20x2%3D%2226.4001%22%20y2%3D%2229.867%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_6996_47058%22%20x1%3D%2210.133%22%20y1%3D%2217.867%22%20x2%3D%2210.133%22%20y2%3D%2213.6%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22paint7_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.933%2029.0669%29%20rotate%28-90%29%20scale%2811.2%29%22%3E%3Cstop%20offset%3D%220.595%22%20stop-color%3D%22%2300AAFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22paint8_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2817.5999%2029.867%29%20scale%284.53333%2012.0889%29%22%3E%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22paint9_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.133%2022.3999%29%20rotate%28-90%29%20scale%284.53333%2085.9653%29%22%3E%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://rainbow.me",getPackage:X,connector:(e,t)=>ce(e,t),needReadProvider:!0},PM={type:x.trust,showName:"TrustWallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47056%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.223%208.63789C19.6801%208.25612%2020.3449%208.25612%2020.802%208.63789C23.9045%2011.229%2027.4422%2011.2092%2028.8199%2011.2015C28.8884%2011.2012%2028.9516%2011.2008%2029.0091%2011.2008C29.3389%2011.2008%2029.655%2011.3331%2029.8865%2011.5681C30.118%2011.8032%2030.2456%2012.1212%2030.2406%2012.4511C30.1753%2016.7785%2030.0018%2019.8711%2029.6607%2022.1401C29.3197%2024.4076%2028.7956%2025.9726%2027.9443%2027.1557C27.0866%2028.3477%2025.9847%2029.0228%2024.8252%2029.6636C24.6238%2029.7749%2024.4186%2029.8862%2024.2089%2030C23.1924%2030.5514%2022.0672%2031.1617%2020.7304%2032.1207C20.3013%2032.4285%2019.7237%2032.4285%2019.2946%2032.1207C17.959%2031.1627%2016.8353%2030.5526%2015.8204%2030.0016C15.6096%2029.8872%2015.4035%2029.7753%2015.2012%2029.6634C14.0426%2029.0224%2012.9421%2028.347%2012.0861%2027.1546C11.2367%2025.9714%2010.7143%2024.4065%2010.3746%2022.1395C10.0347%2019.8708%209.86207%2016.7784%209.79677%2012.4511C9.79179%2012.1212%209.91934%2011.8032%2010.1508%2011.5681C10.3823%2011.3331%2010.6984%2011.2008%2011.0283%2011.2008C11.0852%2011.2008%2011.1477%2011.2012%2011.2156%2011.2015C12.5821%2011.2092%2016.1202%2011.2292%2019.223%208.63789ZM12.2823%2013.6542C12.3602%2017.2983%2012.5276%2019.8846%2012.8108%2021.7745C13.1253%2023.8737%2013.567%2024.9934%2014.0872%2025.7181C14.6008%2026.4335%2015.2757%2026.8894%2016.3937%2027.5079C16.5753%2027.6084%2016.7672%2027.7124%2016.9688%2027.8217C17.8188%2028.2826%2018.843%2028.838%2020.0125%2029.6214C21.1837%2028.837%2022.2094%2028.2812%2023.0609%2027.8199C23.2616%2027.7112%2023.4527%2027.6076%2023.6337%2027.5076C24.7531%2026.8889%2025.4297%2026.4328%2025.9447%2025.717C26.4662%2024.9923%2026.9091%2023.8727%2027.2247%2021.7738C27.5088%2019.8843%2027.677%2017.2982%2027.755%2013.6544C25.9743%2013.5889%2022.9109%2013.2048%2020.0125%2011.1384C17.1177%2013.2023%2014.0588%2013.5879%2012.2823%2013.6542Z%22%20fill%3D%22%233375BB%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47056%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://trustwallet.com/",supportMobile:!0,supportExtension:!0,mobileDeepLink:"https://link.trustwallet.com/open_url?url=$APP_URL",injected:()=>window.ethereum?.isTrust&&!window.safepalProvider,disabled:()=>!(window.ethereum?.isTrust||window.trustWallet),connector:(e,t)=>M(window.trustWallet,t),switchChain:e=>U({...e,provider:e.provider||window.trustWallet}),isInstalled:()=>!!window.trustWallet},AM={type:x.tokenPocket,showName:"TokenPocket",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47055%29%22%3E%3Cpath%20d%3D%22M40%2013.75C40%206.15609%2033.8439%200%2026.25%200H13.75C6.15609%200%200%206.15609%200%2013.75V26.25C0%2033.8439%206.15609%2040%2013.75%2040H26.25C33.8439%2040%2040%2033.8439%2040%2026.25V13.75Z%22%20fill%3D%22%232980FE%22%2F%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%232980FE%22%2F%3E%3Cpath%20d%3D%22M15.8904%2017.1345H15.8955C15.8904%2017.1038%2015.8904%2017.068%2015.8904%2017.0373V17.1345Z%22%20fill%3D%22%2329AEFF%22%2F%3E%3Cpath%20d%3D%22M26.0782%2018.1068H20.4395V28.2842C20.4395%2028.7652%2020.8283%2029.1541%2021.3093%2029.1541H25.2084C25.6894%2029.1541%2026.0782%2028.7652%2026.0782%2028.2842V18.1068Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M17.7173%2010.8203H17.528H7.43238C6.95137%2010.8203%206.5625%2011.2092%206.5625%2011.6902V15.2208C6.5625%2015.7018%206.95137%2016.0907%207.43238%2016.0907H9.80148H10.743V17.1345V28.3098C10.743%2028.7908%2011.1319%2029.1797%2011.6129%2029.1797H15.3175C15.7985%2029.1797%2016.1873%2028.7908%2016.1873%2028.3098V17.1345V17.0373V16.0907H17.1289H17.5126H17.702C19.1552%2016.0907%2020.3371%2014.9087%2020.3371%2013.4555C20.3525%2012.0023%2019.1705%2010.8203%2017.7173%2010.8203Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M26.0835%2018.1068V25.209C26.2779%2025.255%2026.4775%2025.2909%2026.6822%2025.3216C26.9687%2025.3625%2027.2655%2025.3881%2027.5623%2025.3932C27.5776%2025.3932%2027.593%2025.3932%2027.6135%2025.3932V19.7441C26.7589%2019.6878%2026.0835%2018.9766%2026.0835%2018.1068Z%22%20fill%3D%22url%28%23paint0_linear_6996_47055%29%22%2F%3E%3Cpath%20d%3D%22M27.7259%2010.8203C23.704%2010.8203%2020.4395%2014.0849%2020.4395%2018.1068C20.4395%2021.5658%2022.8495%2024.4619%2026.0834%2025.209V18.1068C26.0834%2017.2011%2026.8202%2016.4642%2027.7259%2016.4642C28.6316%2016.4642%2029.3684%2017.2011%2029.3684%2018.1068C29.3684%2018.8692%2028.8516%2019.5088%2028.1455%2019.693C28.0124%2019.7288%2027.8691%2019.7493%2027.7259%2019.7493V25.3932C27.8691%2025.3932%2028.0073%2025.3881%2028.1455%2025.383C31.9729%2025.1629%2035.0123%2021.9905%2035.0123%2018.1068C35.0174%2014.0849%2031.7529%2010.8203%2027.7259%2010.8203Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M27.7258%2025.3932V19.7493C27.6849%2019.7493%2027.6491%2019.7493%2027.6082%2019.7441V25.3932C27.6491%2025.3932%2027.69%2025.3932%2027.7258%2025.3932Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47055%22%20x1%3D%2227.7284%22%20y1%3D%2221.751%22%20x2%3D%2226.0842%22%20y2%3D%2221.751%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22white%22%2F%3E%3Cstop%20offset%3D%220.9667%22%20stop-color%3D%22white%22%20stop-opacity%3D%220.3233%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22white%22%20stop-opacity%3D%220.3%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47055%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://www.tokenpocket.pro/",supportMobile:!0,supportExtension:!0,mobileDeepLink:`tpdapp://open?params=${encodeURI('{\n "url": "$APP_URL"\n }')}`,injected:()=>window.ethereum?.isTokenPocket,disabled:()=>!(window.tokenpocket?.ethereum||window.ethereum?.isTokenPocket),connector:(e,t)=>M(window.tokenpocket?.ethereum,t),switchChain:e=>U({...e,provider:e.provider||window.tokenpocket?.ethereum}),isInstalled:()=>!!window.tokenpocket?.ethereum},_M={type:x.Cyber,showName:"CyberWallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_10558_4010%29%22%3E%3Cpath%20d%3D%22M40%2012C40%205.37258%2034.6274%200%2028%200H12C5.37258%200%200%205.37258%200%2012V28C0%2034.6274%205.37258%2040%2012%2040H28C34.6274%2040%2040%2034.6274%2040%2028V12Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M24.5625%2020.8286L31.3525%2027.4911C31.4334%2027.5695%2031.498%2027.663%2031.5426%2027.7664C31.5872%2027.8698%2031.611%2027.981%2031.6125%2028.0936C31.6136%2028.2063%2031.5921%2028.318%2031.5491%2028.4221C31.5062%2028.5263%2031.4427%2028.6207%2031.3625%2028.6999L30.8625%2029.1874C30.782%2029.2719%2030.6855%2029.3397%2030.5787%2029.3867C30.4718%2029.4337%2030.3567%2029.4591%2030.24%2029.4613C30.1232%2029.4635%2030.0072%2029.4425%2029.8987%2029.3996C29.7901%2029.3566%2029.6911%2029.2926%2029.6075%2029.2111L21.315%2021.0749C21.1719%2020.9346%2021.0581%2020.7674%2020.98%2020.5829C20.9019%2020.3984%2020.8611%2020.2002%2020.86%2019.9999C20.8596%2019.7991%2020.8997%2019.6003%2020.9779%2019.4154C21.0561%2019.2305%2021.1707%2019.0632%2021.315%2018.9236L29.6075%2010.7874C29.7718%2010.6258%2029.9934%2010.5359%2030.2238%2010.5374C30.4534%2010.5377%2030.674%2010.6274%2030.8388%2010.7874L31.3525%2011.2999C31.4328%2011.3787%2031.4967%2011.4726%2031.5404%2011.5762C31.5842%2011.6799%2031.607%2011.7911%2031.6075%2011.9036C31.6076%2012.0162%2031.5851%2012.1277%2031.5413%2012.2314C31.4975%2012.3351%2031.4333%2012.429%2031.3525%2012.5074L24.5613%2019.1724C24.4518%2019.2807%2024.3648%2019.4097%2024.3055%2019.5518C24.2462%2019.694%2024.2157%2019.8465%2024.2157%2020.0005C24.2157%2020.1545%2024.2462%2020.307%2024.3055%2020.4492C24.3648%2020.5913%2024.453%2020.7203%2024.5625%2020.8286ZM15.4375%2019.1786L8.64875%2012.5149C8.56681%2012.4364%208.50137%2012.3424%208.45629%2012.2382C8.41121%2012.1341%208.3874%2012.0221%208.38625%2011.9086C8.38545%2011.7952%208.40763%2011.6828%208.45146%2011.5782C8.49528%2011.4735%208.55985%2011.3789%208.64125%2011.2999L9.1375%2010.8124C9.27986%2010.6686%209.46491%2010.5748%209.665%2010.5449C9.79687%2010.5282%209.9308%2010.5414%2010.0569%2010.5833C10.183%2010.6253%2010.2981%2010.695%2010.3938%2010.7874L18.6838%2018.9249C18.8267%2019.0652%2018.9406%2019.2324%2019.0187%2019.4169C19.0967%2019.6014%2019.1376%2019.7995%2019.1388%2019.9999C19.1388%2020.2004%2019.0986%2020.3989%2019.0204%2020.5836C18.9422%2020.7682%2018.8278%2020.9353%2018.6838%2021.0749L10.3938%2029.2124C10.2292%2029.3736%2010.0078%2029.4634%209.7775%2029.4624C9.5474%2029.4623%209.32636%2029.3726%209.16125%2029.2124L8.64875%2028.7074C8.56825%2028.6284%208.50417%2028.5343%208.46019%2028.4305C8.41621%2028.3266%208.39321%2028.2151%208.3925%2028.1024C8.39294%2027.9898%208.41595%2027.8785%208.46018%2027.775C8.50441%2027.6715%208.56896%2027.578%208.65%2027.4999L15.4375%2020.8374C15.5472%2020.729%2015.6343%2020.6%2015.6937%2020.4577C15.7531%2020.3154%2015.7837%2020.1628%2015.7837%2020.0086C15.7837%2019.8544%2015.7531%2019.7018%2015.6937%2019.5595C15.6343%2019.4173%2015.5472%2019.287%2015.4375%2019.1786Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_10558_4010%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://wallet.cyber.co",disabled:async()=>!await(await Y()).getIsCyber(),getPackage:Y,connector:(e,t)=>le(e,t),supportChains:HS,switchChain:async e=>{const{switchChain:t}=await Y();return t(e)},notSupported:{sign:!0,personalSign:!0,signTypedData:!0,estimateGas:!0},isContractWallet:()=>!0,needReadProvider:!0},DM={type:x.uniPass,showName:"UniPass",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47070%29%22%3E%3Cpath%20d%3D%22M19.1103%2030.3416C21.2844%2027.5455%2024.9114%2026.3075%2028.3414%2027.1909L28.4555%2027.2206L28.377%2027.3096C28.1373%2027.5845%2027.8839%2027.8473%2027.6179%2028.0969L27.5912%2028.1221H27.5541C24.6835%2027.588%2021.7545%2028.6977%2019.9584%2030.9999L19.9124%2031.0607L19.8695%2031.1171H19.8339C19.4682%2031.1111%2019.1031%2031.0879%2018.7397%2031.0473L18.6225%2031.034L18.6877%2030.9347C18.8138%2030.7301%2018.9621%2030.5299%2019.1103%2030.3416ZM26.2775%2028.9271L26.3932%2028.9286H26.6141L26.4347%2029.0561C24.9424%2030.1187%2023.2108%2030.796%2021.3936%2031.0281L21.1757%2031.0548L21.3343%2030.9065C22.6619%2029.629%2024.4351%2028.919%2026.2775%2028.9271ZM23.6902%2025.1537C23.7631%2025.1382%2023.8385%2025.138%2023.9114%2025.1533C23.9844%2025.1686%2024.0533%2025.1991%2024.1138%2025.2427C24.1743%2025.2862%2024.225%2025.342%2024.2626%2025.4064C24.3002%2025.4707%2024.324%2025.5422%2024.3322%2025.6163V25.6015C24.3481%2025.7335%2024.314%2025.8667%2024.2366%2025.9748C24.1592%2026.0829%2024.0442%2026.1581%2023.9141%2026.1857C21.7298%2026.657%2019.7818%2027.884%2018.4135%2029.6507C18.1308%2030.0157%2017.8741%2030.4002%2017.6455%2030.8013L17.6188%2030.8487L17.5668%2030.8368C17.2555%2030.7671%2016.9382%2030.6841%2016.6417%2030.5877L16.5542%2030.5596L16.5957%2030.4824C16.8781%2029.9623%2017.2029%2029.4664%2017.5668%2028.9998C18.9537%2027.2083%2020.8811%2025.9116%2023.0631%2025.302C23.2715%2025.2499%2023.4806%2025.2005%2023.6903%2025.1537H23.6902ZM22.6331%2023.3108C25.2019%2022.6404%2027.9174%2022.8056%2030.386%2023.7823L30.4513%2023.809L30.4275%2023.8757C30.3184%2024.1678%2030.1972%2024.4551%2030.0643%2024.7371L30.0361%2024.7994L29.9723%2024.7742C25.3004%2022.9233%2019.9676%2024.3722%2016.8745%2028.3326C16.4247%2028.9104%2016.0315%2029.53%2015.7002%2030.183L15.669%2030.2438L15.6068%2030.2156C15.3221%2030.094%2015.0389%2029.9591%2014.7646%2029.8108L14.7023%2029.7767L14.7335%2029.7144C15.098%2028.9937%2015.5315%2028.31%2016.0278%2027.6728C17.6867%2025.5284%2020.0096%2023.9944%2022.6331%2023.3108ZM14.2157%2027.0326C14.2948%2027.0246%2014.3747%2027.0343%2014.4496%2027.0609C14.5245%2027.0875%2014.5926%2027.1304%2014.649%2027.1865V27.1895C14.7362%2027.2776%2014.7905%2027.393%2014.8026%2027.5164C14.8148%2027.6398%2014.7841%2027.7636%2014.7157%2027.867C14.4288%2028.304%2014.1679%2028.7575%2013.9343%2029.2252L13.8987%2029.2993L13.8291%2029.2533C13.5671%2029.0774%2013.3124%2028.8909%2013.0655%2028.6943L13.0195%2028.6573L13.0462%2028.6039C13.2801%2028.1453%2013.539%2027.6998%2013.8216%2027.2695C13.8657%2027.2034%2013.9239%2027.1478%2013.9921%2027.1068C14.0602%2027.0659%2014.1366%2027.0405%2014.2157%2027.0326ZM16.2251%2021.8444L16.2621%2021.8578C16.6571%2022.0062%2017.0717%2022.0961%2017.4927%2022.1247L17.7122%2022.1395L17.5268%2022.2581C16.0995%2023.1717%2014.8397%2024.3237%2013.8024%2025.6638C13.2502%2026.3739%2012.7629%2027.1321%2012.3464%2027.9293L12.3019%2028.0153L12.2322%2027.9471C12.0024%2027.7202%2011.7726%2027.4771%2011.5576%2027.2265L11.525%2027.188L11.5487%2027.145C12.6881%2025.0639%2014.2745%2023.2613%2016.1939%2021.8667L16.225%2021.8444H16.2251ZM14.9678%2025.7513C18.9166%2021.2068%2025.3094%2019.6599%2030.899%2021.8964L30.9539%2021.923L30.9435%2021.9809C30.9286%2022.0639%2030.9138%2022.1454%2030.8975%2022.227C30.851%2022.4549%2030.7976%2022.6814%2030.7374%2022.9061L30.7151%2022.9861L30.6395%2022.9535C29.063%2022.2963%2027.3717%2021.9591%2025.6637%2021.9616C25.1145%2021.9617%2024.5659%2021.9959%2024.0209%2022.0639C20.8225%2022.4547%2017.8843%2024.0224%2015.7787%2026.4615C15.7307%2026.5175%2015.6716%2026.563%2015.6052%2026.5951C15.5387%2026.6273%2015.4664%2026.6454%2015.3926%2026.6483C15.3189%2026.6512%2015.2453%2026.6389%2015.1766%2026.6121C15.1078%2026.5853%2015.0453%2026.5446%2014.9929%2026.4926L14.9814%2026.4809C14.8882%2026.3831%2014.8351%2026.2538%2014.8326%2026.1188C14.8301%2025.9837%2014.8783%2025.8525%2014.9678%2025.7513ZM25.5732%2024.9135C26.9255%2024.8631%2028.2749%2025.0725%2029.5483%2025.5304L29.6313%2025.56L29.5868%2025.6356C29.4242%2025.9115%2029.2496%2026.1801%2029.0635%2026.4407L29.0308%2026.4867L28.9804%2026.4689C28.0083%2026.1458%2026.9905%2025.9816%2025.9662%2025.9826H25.6207C25.4851%2025.988%2025.3525%2025.9419%2025.2494%2025.8537C25.1463%2025.7654%2025.0803%2025.6414%2025.0647%2025.5066L25.0631%2025.4883C25.0577%2025.4168%2025.0668%2025.345%2025.0897%2025.2771C25.1126%2025.2092%2025.1489%2025.1466%2025.1965%2025.0929C25.2441%2025.0393%2025.302%2024.9958%2025.3667%2024.965C25.4314%2024.9342%2025.5016%2024.9167%2025.5732%2024.9135ZM14.4696%2020.5901L14.5141%2020.6465C14.7186%2020.879%2014.9467%2021.0896%2015.1946%2021.2751L15.2717%2021.3315L15.1961%2021.3893V21.3789C13.4756%2022.7183%2012.0327%2024.3802%2010.9482%2026.2717L10.8904%2026.371L10.8252%2026.2761C10.6265%2025.993%2010.4397%2025.6905%2010.2707%2025.3865L10.2499%2025.3495L10.2721%2025.3124C10.6206%2024.7446%2010.9997%2024.1962%2011.4079%2023.6696C12.285%2022.5398%2013.2951%2021.5198%2014.4162%2020.6316L14.4696%2020.5901ZM11.1411%2021.0951C11.2142%2021.0929%2011.287%2021.1056%2011.3551%2021.1325C11.4231%2021.1593%2011.485%2021.1998%2011.5369%2021.2513H11.5339C11.6314%2021.3491%2011.6876%2021.4805%2011.6909%2021.6185C11.6942%2021.7564%2011.6444%2021.8904%2011.5517%2021.9927C11.2592%2022.316%2010.9793%2022.6503%2010.7125%2022.995C10.4034%2023.394%2010.1101%2023.8051%209.83327%2024.2271L9.75765%2024.3428L9.70578%2024.2152C9.55906%2023.8563%209.43089%2023.4901%209.32175%2023.1181L9.31135%2023.084L9.33215%2023.0558C9.51007%2022.8052%209.68943%2022.5621%209.86591%2022.3352C10.1509%2021.9723%2010.4476%2021.6187%2010.7555%2021.2751C10.8042%2021.2204%2010.8635%2021.1763%2010.9298%2021.1454C10.9961%2021.1144%2011.068%2021.0973%2011.1411%2021.0951ZM13.4435%2016.2904V17.5773L13.4139%2017.5981C11.8107%2018.7382%2010.3831%2020.1069%209.17647%2021.6606L9.02818%2021.8474L9.00149%2021.6798C8.93393%2021.2379%208.89332%2020.7923%208.8799%2020.3454V20.3173L8.90364%2020.2936C10.1865%2018.7815%2011.6771%2017.4586%2013.3309%2016.3645L13.4435%2016.2904ZM23.5124%2018.9992C26.0674%2018.6791%2028.6619%2018.9849%2031.0725%2019.8903L31.1199%2019.9081V20C31.1199%2020.3084%2031.1066%2020.6272%2031.0799%2020.9459L31.071%2021.0438L30.9806%2021.0068C29.2411%2020.3068%2027.3831%2019.9484%2025.508%2019.9511C24.0908%2019.9496%2022.6806%2020.1493%2021.3195%2020.5442L21.1074%2020.6049L21.2424%2020.43C21.4996%2020.0941%2021.7064%2019.7225%2021.8562%2019.3269L21.8711%2019.2913L21.9081%2019.2824C22.4377%2019.1609%2022.9732%2019.0664%2023.5124%2018.9992ZM13.5429%2018.719L13.5696%2018.8257C13.6452%2019.1366%2013.7556%2019.438%2013.8987%2019.7242L13.921%2019.7776L13.875%2019.8132C13.5021%2020.106%2013.141%2020.4137%2012.7927%2020.7354C12.6908%2020.8283%2012.5572%2020.8787%2012.4194%2020.8762C12.2815%2020.8737%2012.1498%2020.8186%2012.0513%2020.7221L12.0386%2020.7089C11.9903%2020.657%2011.9526%2020.5961%2011.928%2020.5296C11.9033%2020.463%2011.892%2020.3923%2011.8949%2020.3214C11.8977%2020.2505%2011.9146%2020.1809%2011.9445%2020.1166C11.9744%2020.0522%2012.0167%2019.9945%2012.0691%2019.9466C12.5122%2019.538%2012.9743%2019.1506%2013.4539%2018.7857L13.5429%2018.719ZM30.0212%2017.6978C30.0875%2017.6534%2030.163%2017.6243%2030.242%2017.6127C30.321%2017.601%2030.4016%2017.6072%2030.4779%2017.6307C30.6781%2017.6915%2030.8753%2017.7553%2031.071%2017.8234L31.1169%2017.8412V18.9814L31.0191%2018.9458C30.7366%2018.8421%2030.4513%2018.7462%2030.1636%2018.6582C30.0455%2018.622%2029.9434%2018.5462%2029.8746%2018.4436C29.8057%2018.341%2029.7743%2018.2178%2029.7855%2018.0948L29.7874%2018.0776C29.7969%2018.0012%2029.8226%2017.9278%2029.863%2017.8623C29.9033%2017.7968%2029.9573%2017.7407%2030.0212%2017.6978ZM12.9543%2014.1613L12.9943%2014.2147C13.1908%2014.4784%2013.327%2014.7821%2013.3932%2015.1043L13.4035%2015.1487L13.3605%2015.1754C11.7602%2016.1656%2010.2962%2017.3609%209.00594%2018.7308L8.8799%2018.8628V17.3283L8.90214%2017.309C10.1135%2016.1251%2011.4538%2015.0807%2012.8979%2014.1954L12.9543%2014.1613ZM23.1357%2017.0036C24.9708%2016.7694%2026.8313%2016.827%2028.6483%2017.174C28.7791%2017.1996%2028.8956%2017.273%2028.9752%2017.38C29.0547%2017.4869%2029.0914%2017.6197%2029.0783%2017.7523V17.7567C29.0713%2017.831%2029.0489%2017.903%2029.0126%2017.9682C28.9762%2018.0333%2028.9266%2018.0902%2028.8671%2018.1351C28.8075%2018.18%2028.7392%2018.212%2028.6666%2018.2291C28.5939%2018.2462%2028.5185%2018.2479%2028.4452%2018.2342C27.4259%2018.0378%2026.3903%2017.9385%2025.3523%2017.9376C24.6585%2017.9385%2023.9652%2017.9821%2023.2766%2018.0681C22.9207%2018.1132%2022.5661%2018.1691%2022.2136%2018.2357L22.1201%2018.2549V18.1585C22.1364%2018.031%2022.1364%2017.9065%2022.1364%2017.7878V17.1622L22.1972%2017.1518C22.5082%2017.0912%2022.8212%2017.0418%2023.1357%2017.0036ZM22.7607%2015.0064C25.5529%2014.6496%2028.3894%2014.9108%2031.0695%2015.7715L31.1199%2015.7878V16.916L31.0235%2016.8835C29.1473%2016.247%2027.1794%2015.9229%2025.1982%2015.9241C24.4273%2015.9255%2023.6573%2015.975%2022.8926%2016.0724C22.6895%2016.0976%2022.476%2016.1287%2022.2209%2016.1703L22.1364%2016.1836V15.0954L22.1987%2015.0865C22.3857%2015.0573%2022.573%2015.0306%2022.7607%2015.0064ZM11.1617%2013.2969L11.1997%2013.2971C11.4779%2013.3014%2011.753%2013.3566%2012.0113%2013.4599L12.1433%2013.5133L12.0232%2013.5889C10.9552%2014.2711%209.94466%2015.0392%209.00149%2015.8856L8.8799%2015.9939V15.5787C8.87813%2015.0663%209.05067%2014.5685%209.36918%2014.1672C9.58201%2013.8952%209.85413%2013.6755%2010.1648%2013.5247C10.4754%2013.3738%2010.8164%2013.2959%2011.1617%2013.2969ZM22.384%2013.0107C25.0873%2012.6701%2027.831%2012.8569%2030.4631%2013.5608C30.6455%2013.6097%2030.8427%2013.6661%2031.068%2013.7343L31.1185%2013.7491V14.867L31.0235%2014.8374C29.088%2014.2274%2027.0704%2013.9174%2025.041%2013.9181C24.1983%2013.9187%2023.3565%2013.9717%2022.5205%2014.0768L22.2966%2014.1064L22.1394%2014.1286V13.3695C22.1394%2013.2865%2022.1483%2013.2005%2022.1483%2013.1027V13.0433L22.2788%2013.0255L22.384%2013.0107ZM25.4947%2010.846C27.2618%2010.8946%2029.0173%2011.1488%2030.7255%2011.6037L30.7596%2011.6126L30.7745%2011.6452C30.9159%2011.9847%2031.0155%2012.3402%2031.071%2012.7038L31.0843%2012.8269L30.9761%2012.7957C30.8101%2012.7468%2030.6436%2012.6998%2030.4764%2012.6549C28.8409%2012.2181%2027.1601%2011.9733%2025.468%2011.9254C25.3939%2011.9235%2025.321%2011.9064%2025.2538%2011.875C25.1867%2011.8435%2025.1268%2011.7986%2025.0779%2011.7429C25.029%2011.6871%2024.9922%2011.6219%2024.9698%2011.5512C24.9473%2011.4806%2024.9398%2011.4061%2024.9476%2011.3324L24.9492%2011.3173C24.9654%2011.1851%2025.0302%2011.0636%2025.1311%2010.9765C25.2319%2010.8894%2025.3615%2010.8429%2025.4947%2010.846ZM23.6325%2010.8712C23.7095%2010.8671%2023.7866%2010.8796%2023.8584%2010.9078C23.9302%2010.9361%2023.9951%2010.9795%2024.0487%2011.035C24.1023%2011.0906%2024.1433%2011.157%2024.1689%2011.2298C24.1946%2011.3026%2024.2043%2011.38%2024.1974%2011.4569H24.2033C24.1913%2011.5852%2024.1334%2011.7049%2024.0402%2011.794C23.9471%2011.883%2023.8249%2011.9355%2023.6962%2011.9417C23.2811%2011.9654%2022.8644%2011.9996%2022.4493%2012.0455L22.3366%2012.0574L22.3722%2011.9506C22.4857%2011.6001%2022.641%2011.2646%2022.8348%2010.9513L22.8541%2010.9216H22.8911C23.1417%2010.9009%2023.3878%2010.8831%2023.6325%2010.8712ZM26.6408%208.88001C27.2697%208.87952%2027.8917%209.01127%2028.4664%209.2667C29.0411%209.52213%2029.5557%209.89554%2029.9768%2010.3627L30.125%2010.5317L29.9026%2010.4813C28.1999%2010.0953%2026.4593%209.90035%2024.7133%209.9001C24.4687%209.9001%2024.2196%209.90455%2023.972%209.91489H23.7437L23.926%209.78145C24.6405%209.24232%2025.5007%208.93078%2026.3947%208.8874C26.4806%208.88001%2026.5607%208.88001%2026.6408%208.88001Z%22%20fill%3D%22url%28%23paint0_linear_6996_47070%29%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47070%22%20x1%3D%228.87986%22%20y1%3D%229.16911%22%20x2%3D%222232.59%22%20y2%3D%222232.59%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23398BFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238864FF%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47070%22%3E%3Crect%20width%3D%2222.24%22%20height%3D%2222.24%22%20fill%3D%22white%22%20transform%3D%22translate%288.87988%208.88%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://unipass.id",supportChains:tM,getPackage:Q,connector:(e,t)=>ue(e,t),disconnect:async()=>{const{disconnectWallet:e}=await Q();await e()},notSupported:{sign:!0},contract:{signTypedData:async({typedData:e})=>{const{signTypedData:t}=await Q();return t(e)}},switchChain:async e=>{const{switchChain:t}=await Q();return await t(e),{result:!0}},isContractWallet:()=>!0,needReadProvider:!0},FM={type:x.Gate,showName:"Gate Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47059%29%22%3E%3Cpath%20d%3D%22M20%2026.6C18.2496%2026.6%2016.5709%2025.9047%2015.3331%2024.6669C14.0954%2023.4291%2013.4%2021.7504%2013.4%2020C13.4%2018.2496%2014.0954%2016.5709%2015.3331%2015.3331C16.5709%2014.0954%2018.2496%2013.4%2020%2013.4V8C17.6266%208%2015.3065%208.70379%2013.3332%2010.0224C11.3598%2011.3409%209.8217%2013.2151%208.91345%2015.4078C8.0052%2017.6005%207.76756%2020.0133%208.23058%2022.3411C8.69361%2024.6688%209.83649%2026.8071%2011.5147%2028.4853C13.1929%2030.1635%2015.3311%2031.3064%2017.6589%2031.7695C19.9867%2032.2324%2022.3995%2031.9948%2024.5922%2031.0866C26.785%2030.1783%2028.659%2028.6402%2029.9776%2026.6668C31.2962%2024.6934%2032%2022.3734%2032%2020H26.6C26.6%2021.7504%2025.9047%2023.4291%2024.6669%2024.6669C23.4291%2025.9047%2021.7504%2026.6%2020%2026.6Z%22%20fill%3D%22%232354E6%22%2F%3E%3Cpath%20d%3D%22M26.6%2013.4H20V19.9999H26.6V13.4Z%22%20fill%3D%22%2317E6A1%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47059%22%3E%3Crect%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22white%22%20transform%3D%22translate%288%208%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!1,link:"https://chromewebstore.google.com/detail/gate-wallet/cpmkedoipcpimgecpmgpldfpohjplkpp",disabled:()=>!window.gatewallet,connector:(e,t)=>M(window.gatewallet,t),switchChain:e=>U({...e,provider:e.provider||window.gatewallet}),isInstalled:()=>!!window.gatewallet},OM={type:x.Rabby,showName:"Rabby Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M31.6568%2021.4761C32.5816%2019.4024%2028.008%2013.609%2023.6391%2011.1949C20.8846%209.32499%2018.0155%209.58224%2017.4336%2010.403C16.1588%2012.2055%2021.6581%2013.7315%2025.3349%2015.513C24.5448%2015.8577%2023.8001%2016.4755%2023.3618%2017.2665C21.9906%2015.765%2018.9815%2014.4717%2015.45%2015.513C13.07%2016.2156%2011.0925%2017.8702%2010.3286%2020.3701C10.1002%2020.2695%209.85027%2020.2276%209.60151%2020.2479C9.35274%2020.2683%209.11299%2020.3504%208.90395%2020.4868C8.69492%2020.6232%208.52321%2020.8096%208.40438%2021.0291C8.28554%2021.2486%208.22334%2021.4943%208.22339%2021.7439C8.22339%2022.5751%208.89364%2023.2471%209.72051%2023.2471C9.87451%2023.2471%2010.354%2023.1447%2010.354%2023.1447L18.0155%2023.1999C14.9513%2028.0771%2012.5293%2028.7902%2012.5293%2029.6355C12.5293%2030.4799%2014.8463%2030.2506%2015.7169%2029.9365C19.881%2028.428%2024.3531%2023.7292%2025.1214%2022.3765C28.3449%2022.7799%2031.0539%2022.8289%2031.6568%2021.4761Z%22%20fill%3D%22url%28%23paint0_linear_6996_47069%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M25.3358%2015.513C25.5064%2015.4456%2025.4793%2015.1936%2025.432%2014.995C25.3244%2014.5391%2023.4685%2012.6999%2021.7247%2011.8756C19.3499%2010.753%2017.6008%2010.8116%2017.3418%2011.3287C17.8257%2012.3236%2020.0692%2013.2581%2022.4115%2014.2337C23.4108%2014.6502%2024.4284%2015.0737%2025.3358%2015.513Z%22%20fill%3D%22url%28%23paint1_linear_6996_47069%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.3205%2025.5282C21.8402%2025.3445%2021.2977%2025.1747%2020.6808%2025.0207C21.3388%2023.8404%2021.477%2022.0921%2020.8558%2020.987C19.9834%2019.4356%2018.8897%2018.6096%2016.346%2018.6096C14.9478%2018.6096%2011.1818%2019.0821%2011.1144%2022.2365C11.1074%2022.5681%2011.1144%2022.8709%2011.138%2023.15L18.0155%2023.1999C17.088%2024.676%2016.22%2025.7706%2015.4605%2026.6027C16.3723%2026.8372%2017.1257%2027.0341%2017.8169%2027.2152C18.4732%2027.3867%2019.0734%2027.5442%2019.7025%2027.7052C20.6176%2027.0321%2021.4918%2026.3051%2022.3205%2025.5282Z%22%20fill%3D%22url%28%23paint2_linear_6996_47069%29%22%2F%3E%3Cpath%20d%3D%22M10.2367%2022.8263C10.5167%2025.222%2011.8747%2026.16%2014.6484%2026.4383C17.4222%2026.7165%2019.0121%2026.5301%2021.1304%2026.7235C22.8997%2026.8845%2024.4791%2027.7893%2025.0644%2027.4769C25.5921%2027.196%2025.2972%2026.1793%2024.5919%2025.5274C23.6767%2024.6821%2022.4106%2024.0941%2020.1837%2023.8859C20.6273%2022.6661%2020.5031%2020.9564%2019.8136%2020.0271C18.8161%2018.6814%2016.9768%2018.0733%2014.6484%2018.3384C12.2159%2018.6166%209.88406%2019.8189%2010.2367%2022.8263Z%22%20fill%3D%22url%28%23paint3_linear_6996_47069%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47069%22%20x1%3D%2215.1726%22%20y1%3D%2219.6395%22%20x2%3D%2231.4651%22%20y2%3D%2224.2446%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238697FF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23ABB7FF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47069%22%20x1%3D%2228.7159%22%20y1%3D%2219.3289%22%20x2%3D%2216.9262%22%20y2%3D%227.54961%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238697FF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235156D8%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47069%22%20x1%3D%2222.6478%22%20y1%3D%2225.9395%22%20x2%3D%2211.3419%22%20y2%3D%2219.461%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23465EED%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238697FF%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_6996_47069%22%20x1%3D%2216.1447%22%20y1%3D%2219.517%22%20x2%3D%2223.8062%22%20y2%3D%2229.219%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238898FF%22%2F%3E%3Cstop%20offset%3D%220.984%22%20stop-color%3D%22%236277F1%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!1,link:"https://rabby.io",disabled:()=>!window.rabby,connector:(e,t)=>M(window.rabby,t),switchChain:e=>U({...e,provider:e.provider||window.rabby}),isInstalled:()=>!!window.rabby},SM={type:x.SocialLogin,showName:"Social Login",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%2341454F%22%2F%3E%3Cpath%20d%3D%22M7.33317%2016.6666C7.01234%2016.6666%206.73768%2016.5524%206.50921%2016.3239C6.28074%2016.0955%206.1665%2015.8208%206.1665%2015.5V8.49998C6.1665%208.17915%206.28074%207.90449%206.50921%207.67602C6.73768%207.44755%207.01234%207.33331%207.33317%207.33331H16.6665C16.9873%207.33331%2017.262%207.44755%2017.4905%207.67602C17.7189%207.90449%2017.8332%208.17915%2017.8332%208.49998V15.5C17.8332%2015.8208%2017.7189%2016.0955%2017.4905%2016.3239C17.262%2016.5524%2016.9873%2016.6666%2016.6665%2016.6666H7.33317ZM11.9998%2012.5833L16.6665%209.66665V8.49998L11.9998%2011.4166L7.33317%208.49998V9.66665L11.9998%2012.5833Z%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47057%29%22%3E%3Cpath%20d%3D%22M35%2012C35%208.1332%2031.8668%205%2028%205C24.1332%205%2021%208.1332%2021%2012C21%2015.2816%2023.2596%2018.0368%2026.3088%2018.7928V14.1392H24.864V12H26.3088V11.0788C26.3088%208.696%2027.3868%207.5928%2029.7248%207.5928C30.1672%207.5928%2030.9344%207.6796%2031.2452%207.7664V9.704C31.08%209.6872%2030.7944%209.6788%2030.436%209.6788C29.288%209.6788%2028.8456%2010.1128%2028.8456%2011.244V12H31.1332L30.7412%2014.1392H28.8484V18.9496C32.3148%2018.5296%2035%2015.5784%2035%2012Z%22%20fill%3D%22%230866FF%22%2F%3E%3Cpath%20d%3D%22M30.741%2014.1392L31.133%2012H28.8454V11.244C28.8454%2010.1128%2029.2878%209.67877%2030.4358%209.67877C30.7914%209.67877%2031.0798%209.68717%2031.245%209.70397V7.76637C30.9314%207.67957%2030.167%207.59277%2029.7246%207.59277C27.3866%207.59277%2026.3086%208.69597%2026.3086%2011.0788V12H24.8638V14.1392H26.3086V18.7928C26.849%2018.9272%2027.4174%2019%2027.9998%2019C28.2882%2019%2028.571%2018.9832%2028.8482%2018.9496V14.1392H30.741Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cg%20clip-path%3D%22url%28%23clip1_6996_47057%29%22%3E%3Cpath%20d%3D%22M18.16%2028.1458C18.16%2027.6908%2018.1192%2027.2533%2018.0433%2026.8333H12V29.3183H15.4533C15.3017%2030.1175%2014.8467%2030.7941%2014.1642%2031.2491V32.865H16.2467C17.46%2031.745%2018.16%2030.1%2018.16%2028.1458Z%22%20fill%3D%22%234285F4%22%2F%3E%3Cpath%20d%3D%22M11.9998%2034.4166C13.7323%2034.4166%2015.1848%2033.845%2016.2465%2032.865L14.164%2031.2491C13.5923%2031.6341%2012.8632%2031.8675%2011.9998%2031.8675C10.3315%2031.8675%208.91398%2030.7416%208.40648%2029.225H6.27148V30.8816C7.32732%2032.9758%209.49148%2034.4166%2011.9998%2034.4166Z%22%20fill%3D%22%2334A853%22%2F%3E%3Cpath%20d%3D%22M8.40683%2029.2191C8.2785%2028.8341%208.20266%2028.4258%208.20266%2028C8.20266%2027.5741%208.2785%2027.1658%208.40683%2026.7808V25.1241H6.27183C5.83433%2025.9875%205.5835%2026.9616%205.5835%2028C5.5835%2029.0383%205.83433%2030.0125%206.27183%2030.8758L7.93433%2029.5808L8.40683%2029.2191Z%22%20fill%3D%22%23FBBC05%22%2F%3E%3Cpath%20d%3D%22M11.9998%2024.1383C12.9448%2024.1383%2013.7848%2024.465%2014.4557%2025.095L16.2932%2023.2575C15.179%2022.2191%2013.7323%2021.5833%2011.9998%2021.5833C9.49148%2021.5833%207.32732%2023.0241%206.27148%2025.1241L8.40648%2026.7808C8.91398%2025.2641%2010.3315%2024.1383%2011.9998%2024.1383Z%22%20fill%3D%22%23EA4335%22%2F%3E%3C%2Fg%3E%3Cmask%20id%3D%22mask0_6996_47057%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2221%22%20y%3D%2223%22%20width%3D%2214%22%20height%3D%2211%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2023.1875H35V33.1875H21V23.1875Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_6996_47057%29%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M30.4337%2030.0246C30.0063%2030.0701%2029.6594%2029.903%2029.393%2029.5916C29.0418%2029.1808%2028.9574%2028.7127%2029.1402%2028.214C29.3069%2027.7594%2029.6334%2027.4588%2030.1419%2027.3691C30.7188%2027.2672%2031.3177%2027.6378%2031.5221%2028.2202C31.5767%2028.3755%2031.6009%2028.5366%2031.6071%2028.657C31.6027%2029.3858%2031.1069%2029.953%2030.4337%2030.0246M26.4813%2029.7218C25.9785%2030.1611%2025.2701%2030.1317%2024.7948%2029.6635C24.2491%2029.126%2024.2598%2028.2133%2024.8177%2027.6913C25.4058%2027.1412%2026.3517%2027.2859%2026.7543%2027.9895C26.879%2028.2076%2026.9426%2028.4426%2026.9414%2028.7393C26.9325%2029.0949%2026.794%2029.4486%2026.4813%2029.7218M34.9499%2029.4469C34.7791%2027.5043%2034.0783%2025.7445%2032.9424%2024.136C32.8905%2024.0626%2032.834%2023.9963%2032.7464%2023.9592C31.9026%2023.602%2031.0266%2023.3471%2030.1181%2023.1926C29.9989%2023.1723%2029.9355%2023.2133%2029.8877%2023.3095C29.817%2023.4514%2029.7358%2023.5887%2029.6689%2023.732C29.6179%2023.8414%2029.5394%2023.8715%2029.4213%2023.8558C28.4643%2023.7284%2027.5068%2023.726%2026.5498%2023.855C26.4382%2023.8701%2026.3642%2023.842%2026.3176%2023.7379C26.2651%2023.6203%2026.1929%2023.5106%2026.1429%2023.3921C26.0697%2023.2191%2025.9594%2023.1662%2025.7605%2023.2054C24.9295%2023.3688%2024.1234%2023.6042%2023.3407%2023.9169C23.1873%2023.9782%2023.0786%2024.0698%2022.9882%2024.2024C21.8942%2025.8055%2021.2034%2027.5449%2021.0378%2029.4632C20.9846%2030.0796%2020.9897%2030.6961%2021.0396%2031.3123C21.0489%2031.4278%2021.0656%2031.5383%2021.1823%2031.6175C22.1825%2032.2966%2023.2662%2032.8136%2024.4332%2033.1726C24.5437%2033.2065%2024.6147%2033.1837%2024.6808%2033.093C24.8865%2032.811%2025.0771%2032.5207%2025.2499%2032.219C25.3126%2032.1094%2025.2889%2032.0536%2025.1685%2032.0088C24.8908%2031.9053%2024.6174%2031.791%2024.3601%2031.6458C24.2977%2031.6106%2024.1728%2031.5951%2024.2103%2031.5032C24.251%2031.4033%2024.3511%2031.3249%2024.4798%2031.3286C24.5314%2031.33%2024.5828%2031.3608%2024.6331%2031.3809C26.7182%2032.21%2028.8228%2032.2754%2030.9476%2031.528C31.1073%2031.4718%2031.2621%2031.4029%2031.421%2031.3446C31.5272%2031.3056%2031.7282%2031.3859%2031.7557%2031.4856C31.7893%2031.6076%2031.6646%2031.6202%2031.5934%2031.6577C31.3429%2031.7896%2031.0857%2031.9099%2030.8169%2032.004C30.6906%2032.0482%2030.6571%2032.109%2030.7283%2032.2266C30.8989%2032.5089%2031.0738%2032.7881%2031.2685%2033.0563C31.352%2033.1714%2031.4437%2033.1948%2031.58%2033.1525C32.7222%2032.7981%2033.7861%2032.2945%2034.7713%2031.6371C34.8755%2031.5675%2034.9317%2031.4845%2034.9387%2031.365C34.9586%2031.0281%2034.9804%2030.6913%2035%2030.3779C34.983%2030.0513%2034.9764%2029.7483%2034.9499%2029.4469%22%20fill%3D%22%235A6AEF%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47057%22%3E%3Crect%20width%3D%2214%22%20height%3D%2214%22%20fill%3D%22white%22%20transform%3D%22translate%2821%205%29%22%2F%3E%3C%2FclipPath%3E%3CclipPath%20id%3D%22clip1_6996_47057%22%3E%3Crect%20width%3D%2214%22%20height%3D%2214%22%20fill%3D%22white%22%20transform%3D%22translate%285%2021%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,getPackage:ne,connector:he,switchChain:async e=>(await ne()).switchChain(e),disconnect:async()=>(await ne()).disconnect()},MM={type:x.Alchemy,showName:"Alchemy",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M27.9663%2022.8488L20.3716%209.93638C20.3349%209.87262%2020.2815%209.81951%2020.2172%209.7824C20.1528%209.74529%2020.0796%209.72551%2020.005%209.72505C19.9304%209.72458%2019.857%209.74344%2019.7921%209.77974C19.7273%209.81603%2019.6734%209.86847%2019.6358%209.93176L17.3613%2013.8009C17.2867%2013.9275%2017.2476%2014.0712%2017.2476%2014.2174C17.2476%2014.3637%2017.2867%2014.5073%2017.3613%2014.634L22.3134%2023.0577C22.388%2023.1844%2022.4953%2023.2896%2022.6245%2023.3628C22.7536%2023.436%2022.9002%2023.4744%2023.0493%2023.4742H27.5983C27.6728%2023.474%2027.7459%2023.4546%2027.8103%2023.418C27.8748%2023.3813%2027.9283%2023.3287%2027.9655%2023.2654C28.0028%2023.2021%2028.0224%2023.1303%2028.0225%2023.0571C28.0227%2022.9841%2028.0032%2022.9123%2027.9663%2022.8488Z%22%20fill%3D%22url%28%23paint0_linear_6996_47071%29%22%2F%3E%3Cpath%20d%3D%22M8.05856%2029.5973L15.6532%2016.6849C15.6905%2016.6216%2015.7441%2016.5691%2015.8085%2016.5326C15.873%2016.4961%2015.9461%2016.4769%2016.0205%2016.4769C16.095%2016.4769%2016.1681%2016.4961%2016.2326%2016.5326C16.297%2016.5691%2016.3506%2016.6216%2016.3878%2016.6849L18.6636%2020.5505C18.738%2020.6774%2018.7773%2020.8212%2018.7773%2020.9676C18.7773%2021.1141%2018.738%2021.258%2018.6636%2021.3848L13.7113%2029.8085C13.6371%2029.9352%2013.53%2030.0405%2013.401%2030.1137C13.272%2030.1868%2013.1256%2030.2252%2012.9767%2030.225H8.42648C8.35152%2030.2254%208.27781%2030.2063%208.21283%2030.1696C8.14784%2030.1329%208.09392%2030.08%208.05654%2030.0162C8.01916%2029.9524%207.99965%2029.88%208%2029.8065C8.00036%2029.7329%208.02056%2029.6607%208.05856%2029.5973Z%22%20fill%3D%22url%28%23paint1_linear_6996_47071%29%22%2F%3E%3Cpath%20d%3D%22M16.3868%2030.2222H31.5761C31.6506%2030.2221%2031.7238%2030.2028%2031.7883%2030.1662C31.8526%2030.1295%2031.9062%2030.0769%2031.9434%2030.0135C31.9805%2029.9501%2032%2029.8782%2032%2029.8051C32%2029.7319%2031.9803%2029.6601%2031.9429%2029.5968L29.6706%2025.7288C29.5961%2025.6021%2029.4888%2025.4968%2029.3597%2025.4236C29.2305%2025.3506%2029.0839%2025.3121%2028.9348%2025.3123H19.0304C18.8813%2025.3121%2018.7347%2025.3506%2018.6056%2025.4236C18.4764%2025.4968%2018.3691%2025.6021%2018.2946%2025.7288L16.02%2029.5968C15.9827%2029.6601%2015.963%2029.7319%2015.9629%2029.8051C15.9627%2029.8782%2015.9822%2029.9501%2016.0194%2030.0135C16.0566%2030.0769%2016.1101%2030.1295%2016.1746%2030.1662C16.2391%2030.2028%2016.3123%2030.2221%2016.3868%2030.2222Z%22%20fill%3D%22url%28%23paint2_linear_6996_47071%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47071%22%20x1%3D%2220.0001%22%20y1%3D%2211.2488%22%20x2%3D%2217.8821%22%20y2%3D%2230.2265%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2305D5FF%22%2F%3E%3Cstop%20offset%3D%220.723958%22%20stop-color%3D%22%23363FF9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235533FF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47071%22%20x1%3D%2220%22%20y1%3D%2211.2488%22%20x2%3D%2217.882%22%20y2%3D%2230.2265%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2305D5FF%22%2F%3E%3Cstop%20offset%3D%220.723958%22%20stop-color%3D%22%23363FF9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235533FF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47071%22%20x1%3D%2220%22%20y1%3D%2211.2488%22%20x2%3D%2217.882%22%20y2%3D%2230.2264%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2305D5FF%22%2F%3E%3Cstop%20offset%3D%220.723958%22%20stop-color%3D%22%23363FF9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235533FF%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,getPackage:re,connector:me,supportChains:OO,isContractWallet:()=>!0,contract:{signTypedData:async({typedData:e})=>{const{signTypedData:t}=await re();return t(e)}},disconnect:async()=>(await re()).disconnect()},IM={type:x.Bybit,showName:"Bybit Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2288%22%20height%3D%2288%22%20viewBox%3D%220%200%2088%2088%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%20%3Cpath%20%20%20%20d%3D%22M0%2018.7C0%208.37227%208.37228%200%2018.7%200H69.3C79.6277%200%2088%208.37228%2088%2018.7V69.3C88%2079.6277%2079.6277%2088%2069.3%2088H18.7C8.37227%2088%200%2079.6277%200%2069.3V18.7Z%22%20%20%20%20fill%3D%22%23404347%22%20%2F%3E%20%20%3Cpath%20%20%20%20d%3D%22M7.57617%2026.8067C6.78516%2024.0787%208.4775%2021.2531%2011.2559%2020.663L57.6087%2010.8173C59.809%2010.35%2062.0443%2011.4443%2063.0247%2013.4689L83.8443%2056.4657L25.1776%2087.5101L7.57617%2026.8067Z%22%20%20%20%20fill%3D%22url%28%23paint0_linear_312_17534%29%22%20%2F%3E%20%20%3Cpath%20%20%20%20d%3D%22M8.18242%2030.1618C7.35049%2027.2838%209.27925%2024.3413%2012.2502%2023.9559L73.6865%2015.9881C76.2391%2015.6571%2078.6111%2017.3618%2079.1111%2019.8867L88.0003%2064.7771L24.6892%2087.2665L8.18242%2030.1618Z%22%20%20%20%20fill%3D%22white%22%20%2F%3E%20%20%3Cpath%20%20%20%20d%3D%22M0%2034.2222C0%2028.8221%204.37766%2024.4445%209.77778%2024.4445H68.4444C79.2447%2024.4445%2088%2033.1998%2088%2044V68.4445C88%2079.2447%2079.2447%2088%2068.4444%2088H19.5556C8.75532%2088%200%2079.2447%200%2068.4445V34.2222Z%22%20%20%20%20fill%3D%22black%22%20%2F%3E%20%20%3Cpath%20d%3D%22M58.2201%2061.1959V42.8755H61.7937V61.1959H58.2201Z%22%20fill%3D%22%23F7A600%22%20%2F%3E%20%20%3Cpath%20%20%20%20d%3D%22M17.4395%2066.6637H9.77795V48.3434H17.1313C20.7049%2048.3434%2022.7874%2050.3505%2022.7874%2053.4893C22.7874%2055.5215%2021.4504%2056.8345%2020.5257%2057.2721C21.6315%2057.7869%2023.0456%2058.9438%2023.0456%2061.3885C23.0456%2064.8108%2020.7049%2066.6637%2017.4395%2066.6637ZM16.8481%2051.5343H13.3516V55.7548H16.8481C18.3642%2055.7548%2019.2138%2054.9064%2019.2138%2053.6455C19.2138%2052.3826%2018.3662%2051.5343%2016.8481%2051.5343ZM17.0793%2058.9708H13.3516V63.4728H17.0793C18.6994%2063.4728%2019.47%2062.4432%2019.47%2061.2092C19.472%2059.9733%2018.6994%2058.9708%2017.0793%2058.9708Z%22%20%20%20%20fill%3D%22white%22%20%2F%3E%20%20%3Cpath%20%20%20%20d%3D%22M32.8925%2059.1501V66.6637H29.3439V59.1501L23.8419%2048.3434H27.7238L31.1432%2055.7278L34.5107%2048.3434H38.3926L32.8925%2059.1501Z%22%20%20%20%20fill%3D%22white%22%20%2F%3E%20%20%3Cpath%20%20%20%20d%3D%22M48.5633%2066.6637H40.9017V48.3434H48.2551C51.8287%2048.3434%2053.9112%2050.3505%2053.9112%2053.4893C53.9112%2055.5215%2052.5742%2056.8345%2051.6495%2057.2721C52.7553%2057.7869%2054.1693%2058.9438%2054.1693%2061.3885C54.1674%2064.8108%2051.8268%2066.6637%2048.5633%2066.6637ZM47.9719%2051.5343H44.4753V55.7548H47.9719C49.488%2055.7548%2050.3376%2054.9064%2050.3376%2053.6455C50.3357%2052.3826%2049.488%2051.5343%2047.9719%2051.5343ZM48.2031%2058.9708H44.4753V63.4728H48.2031C49.8232%2063.4728%2050.5938%2062.4432%2050.5938%2061.2092C50.5938%2059.9734%2049.8213%2058.9708%2048.2031%2058.9708Z%22%20%20%20%20fill%3D%22white%22%20%2F%3E%20%20%3Cpath%20d%3D%22M73.439%2051.5343V66.6637H69.8654V51.5343H65.0839V48.3434H78.2224V51.5343H73.439Z%22%20fill%3D%22white%22%20%2F%3E%20%20%3Cdefs%3E%20%20%20%20%3ClinearGradient%20id%3D%22paint0_linear_312_17534%22%20x1%3D%227.33308%22%20y1%3D%2225.594%22%20x2%3D%2284.6381%22%20y2%3D%2221.7216%22%20%20%20%20%20%20gradientUnits%3D%22userSpaceOnUse%22%3E%20%20%20%20%20%20%3Cstop%20stop-color%3D%22%23FFD748%22%20%2F%3E%20%20%20%20%20%20%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F7A600%22%20%2F%3E%20%20%20%20%3C%2FlinearGradient%3E%20%20%3C%2Fdefs%3E%3C%2Fsvg%3E",supportChains:[E.MAINNET,E.MANTLE,E.BSC,E.POLYGON,E.OPTIMISM,E.AVALANCHE,E.ARBITRUM_ONE,E.OKCHAIN,E.LINEA,E.BASE,E.MANTA,E.BTR,E.SCROLL],supportMobile:!0,link:"https://bybit-web3.github.io/getting-started",disabled:()=>!(window.bybitWallet||window.ethereum?.isBybit),injected:()=>window.ethereum?.isBybit,connector:(e,t)=>M(window.bybitWallet,t),switchChain:e=>U({...e,provider:e.provider||window.bybitWallet}),isInstalled:()=>!!window.bybitWallet},NM={type:x.Zerion,showName:"Zerion",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_10156_10455%29%22%3E%3Cg%20clip-path%3D%22url%28%23clip1_10156_10455%29%22%3E%3Cmask%20id%3D%22mask0_10156_10455%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%3E%3Cpath%20d%3D%22M40%200H0V40H40V0Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_10156_10455%29%22%3E%3Cpath%20d%3D%22M40%2012C40%205.37258%2034.6274%200%2028%200H12C5.37258%200%200%205.37258%200%2012V28C0%2034.6274%205.37258%2040%2012%2040H28C34.6274%2040%2040%2034.6274%2040%2028V12Z%22%20fill%3D%22%232461ED%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.878%2019.4668C18.9564%2017.3476%2014.1848%2014.5995%2010.5936%2012.3596C9.53404%2011.5962%2010.0718%209.97607%2011.3524%209.97607H29.1216C30.1128%209.97607%2030.776%2011.0812%2030.2791%2011.9175C29.0851%2013.9797%2027.3419%2016.5979%2025.886%2018.6738C25.1044%2019.7881%2023.8305%2019.9795%2022.878%2019.4668ZM17.1585%2020.1549C20.9502%2022.1761%2026.2642%2025.25%2030.0398%2027.5743C31.2089%2028.2943%2030.7417%2030.0216%2029.3792%2030.0216C27.1494%2030.0216%2023.526%2030.0223%2019.9214%2030.0227C16.3541%2030.0234%2012.8052%2030.0238%2010.6437%2030.0238C9.55454%2030.0238%208.99626%2028.8936%209.45883%2028.1052C11.022%2025.4413%2012.7789%2022.7527%2014.2395%2020.7451C14.8889%2019.8496%2016.2106%2019.6491%2017.1585%2020.1549Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_10156_10455%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3CclipPath%20id%3D%22clip1_10156_10455%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://zerion.io/",switchChain:e=>U({...e,provider:e.provider||window.bybitWallet})},UM={type:x.Holdstation,showName:"Holdstation",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_10677_681%29%22%3E%3Cpath%20d%3D%22M40%2012C40%205.37258%2034.6274%200%2028%200H12C5.37258%200%200%205.37258%200%2012V28C0%2034.6274%205.37258%2040%2012%2040H28C34.6274%2040%2040%2034.6274%2040%2028V12Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20d%3D%22M12.9622%2014.4597L12.7066%2016.0422H11.5435L11.7994%2014.4597H10.3906L9.65332%2019.0214H11.0621L11.32%2017.4253H12.4831L12.2249%2019.0214H13.6337L14.371%2014.4597H12.9622Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M15.3385%2019.3443H14.1372L14.1375%2019.3411H12.729L12.7284%2019.3443H11.4724L11.2534%2020.7274H12.5049L11.9917%2023.9027H13.4002L13.9133%2020.7274H15.1198L15.3385%2019.3443Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M23.5343%2023.9027H22.1255L22.8629%2019.3411H24.2716L23.5343%2023.9027Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M22.6403%2019.3443H21.4386L21.4392%2019.3411H20.0304L20.0298%2019.3443H18.7739L18.5552%2020.7274H19.8063L19.2931%2023.9027H20.7019L21.2151%2020.7274H22.4216L22.6403%2019.3443Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M20.4111%2017.6427L20.9256%2014.4597H19.5171L18.7798%2019.0214H20.0505H22.0225L22.2454%2017.6427H20.4111Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M18.521%2015.0573C17.7365%2014.1495%2016.2291%2014.1662%2015.1549%2015.0946C14.0804%2016.0233%2013.8457%2017.512%2014.6302%2018.4199C15.4147%2019.3277%2016.9218%2019.311%2017.9963%2018.3823C19.0708%2017.4539%2019.3055%2015.9651%2018.521%2015.0573ZM17.1562%2017.4102C16.7172%2017.7898%2016.1013%2017.7965%2015.7805%2017.4256C15.4597%2017.0547%2015.5557%2016.4462%2015.995%2016.0666C16.434%2015.687%2017.0499%2015.6803%2017.3707%2016.0512C17.6912%2016.4224%2017.5952%2017.031%2017.1562%2017.4102Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M28.4541%2019.9406C27.6696%2019.0327%2026.1625%2019.0494%2025.088%2019.9781C24.0135%2020.9069%2023.7788%2022.3956%2024.5633%2023.3034C25.3478%2024.2113%2026.8549%2024.1946%2027.9294%2023.2659C29.0036%2022.3372%2029.2386%2020.8484%2028.4541%2019.9406ZM27.0889%2022.2935C26.6501%2022.6731%2026.0341%2022.6798%2025.7133%2022.3089C25.3925%2021.938%2025.4885%2021.3295%2025.9278%2020.9499C26.3667%2020.5703%2026.9827%2020.5636%2027.3035%2020.9345C27.6243%2021.3057%2027.5283%2021.9139%2027.0889%2022.2935Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M25.0412%2014.4597H24.3497H22.9408L22.2036%2019.0214H23.4583H24.3494C25.3663%2019.0214%2026.7402%2018.0262%2026.92%2016.7384C27.1002%2015.4501%2026.2865%2014.4597%2025.0412%2014.4597ZM25.5042%2016.8258C25.3468%2017.4507%2024.7865%2017.6244%2024.5347%2017.6244H23.8384L24.1271%2015.838H24.7762C25.2254%2015.8383%2025.6615%2016.2009%2025.5042%2016.8258Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M11.1909%2019.8248L10.969%2021.4551C10.969%2021.4551%2010.7757%2021.1083%2010.6543%2021.0049C10.5329%2020.9015%2010.1733%2020.6587%209.81361%2020.67C9.45395%2020.6812%209.38875%2020.7891%209.64277%2020.915C9.89679%2021.0409%2010.5127%2021.1892%2010.8027%2021.6388C11.0927%2022.0884%2011.1039%2023.3675%209.84508%2023.835C8.58625%2024.3026%207.84284%2023.5354%207.70508%2023.3614L7.95684%2021.7625C7.95684%2021.7625%208.2205%2022.2406%208.59814%2022.4384C8.97579%2022.6363%209.44624%2022.5913%209.56633%2022.5255C9.68612%2022.4596%209.0869%2022.3036%208.73622%2022.091C8.38554%2021.8781%207.90289%2021.538%208.17264%2020.4365C8.44271%2019.3347%2010.3653%2018.7997%2011.1909%2019.8248Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M32.0831%2019.3411L31.7707%2021.2749L30.8258%2019.3411H29.4174L28.6802%2023.9027H30.0886L30.4081%2021.9268L31.3458%2023.9027H31.3647H32.7545L33.4919%2019.3411H32.0831Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M13.6436%2024.4619C6.45288%2024.6777%206.50587%2025.4869%206.50587%2025.4869C7.2419%2025.4619%209.36616%2025.5023%2012.2907%2025.5428C15.658%2025.5893%2020.087%2025.6362%2024.6815%2025.5826C33.2862%2025.4824%2032.7671%2024.6446%2032.7671%2024.6446C29.002%2024.5694%2018.9034%2024.3809%2018.9034%2024.3809C17.5071%2020.9282%2018.185%2019.3418%2018.185%2019.3418C15.1622%2019.3418%2013.6436%2024.4619%2013.6436%2024.4619Z%22%20fill%3D%22url%28%23paint0_radial_10677_681%29%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CradialGradient%20id%3D%22paint0_radial_10677_681%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2832.9384%2024.7522%29%20rotate%28-178.206%29%20scale%2824.9363%2080.5053%29%22%3E%3Cstop%20stop-color%3D%22%23FFBC95%22%2F%3E%3Cstop%20offset%3D%220.4679%22%20stop-color%3D%22%23FF7A78%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23664EFF%22%2F%3E%3C%2FradialGradient%3E%3CclipPath%20id%3D%22clip0_10677_681%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!1,link:"https://holdstation.com/",disabled:()=>!window.ethereum?.isHoldstation,injected:()=>window.ethereum?.isHoldstation,switchChain:e=>U({...e,provider:e.provider||window.ethereum})},LM={type:x.SafePal,showName:"SafePal",logo:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22none%22%20viewBox%3D%220%200%2040%2040%22%3E%3Cg%20clip-path%3D%22url%28%23a%29%22%3E%3Cpath%20fill%3D%22%234a21ef%22%20d%3D%22M30.37%200H9.63A9.63%209.63%200%200%200%200%209.63v20.74A9.63%209.63%200%200%200%209.63%2040h20.74A9.63%209.63%200%200%200%2040%2030.37V9.63A9.63%209.63%200%200%200%2030.37%200%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M18.627%208.77a2.58%202.58%200%200%200-1.825.755l-7.601%207.602a1.47%201.47%200%200%200-.432%201.042c0%20.378.144.755.432%201.043l4.981%204.981v-8.819c0-.658.53-1.191%201.188-1.191h10.472l5.413-5.414zm-4.444%2017.072H24.65c.658%200%201.192-.534%201.192-1.192v-8.819l4.981%204.982a1.47%201.47%200%200%201%200%202.085L23.222%2030.5a2.58%202.58%200%200%201-1.825.755H8.77z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22%23fff%22%20rx%3D%2212%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://www.safepal.com/",disabled:()=>!window.safepalProvider,injected:()=>window.safepalProvider,switchChain:e=>U({...e,provider:e.provider||window.ethereum}),connector:(e,t)=>M(window.safepalProvider,t)};var BM=Object.freeze({__proto__:null,WalletLink:aM,ImToken:sM,Math:iM,GameStop:oM,Brave:cM,FoxWallet:lM,BSC:uM,KuCoin:dM,Coin98:pM,Frontier:hM,Ledger:mM,OpenBlock:fM,OneKey:yM,Bitkeep:bM,Nabox:gM,OKXWallet:wM,WalletConnect:vM,Portis:CM,Gnosis:EM,UAuth:xM,Blocto:kM,Rainbow:TM,Trust:PM,TokenPocket:AM,Cyber:_M,UniPass:DM,Gate:FM,Rabby:OM,SocialLogin:SM,Alchemy:MM,Bybit:IM,Zerion:NM,Holdstation:UM,SafePal:LM});const RM={type:x.injected,showName:"MetaMask",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M29.3231%2019.9841L30.3121%2018.8232L29.8821%2018.5079L30.57%2017.8773L30.0397%2017.476L30.7277%2016.96L30.2834%2016.616L31%2013.119L29.9107%209.87988M29.9107%209.87988L22.9166%2012.474H17.0834L10.0893%209.87988L9%2013.119L9.73094%2016.616L9.27231%2016.96L9.97459%2017.476L9.4443%2017.8773L10.1322%2018.5079L9.70228%2018.8232L10.6912%2019.9841L9.18632%2024.6278L10.5765%2029.3717L15.4638%2028.0245L16.4098%2028.7984L18.3446%2030.117H21.6554L23.5902%2028.7984L24.5362%2028.0245L29.4378%2029.3717L30.8423%2024.6278L29.3231%2019.9841%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M29.9107%209.87994L21.3257%2016.2005L22.9166%2012.4741L29.9107%209.87994Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M10.0894%209.87994L18.6027%2016.2578L17.0835%2012.4741L10.0894%209.87994Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M26.8293%2024.5422L24.5361%2028.0106L29.4378%2029.3578L30.8423%2024.6138L26.8293%2024.5422Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M9.18652%2024.6138L10.5768%2029.3578L15.464%2028.0106L13.1852%2024.5422L9.18652%2024.6138Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M15.2058%2018.6657L13.8442%2020.7152L18.6885%2020.9302L18.5309%2015.7419L15.2058%2018.6657Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M24.8084%2018.6656L21.426%2015.6845L21.3257%2020.9301L26.17%2020.7151L24.8084%2018.6656Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M15.4639%2028.0107L18.402%2026.6061L15.8652%2024.6569L15.4639%2028.0107Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M21.6123%2026.6061L24.5361%2028.0107L24.1348%2024.6569L21.6123%2026.6061Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M24.5361%2028.0107L21.6123%2026.6061L21.856%2028.498L21.8273%2029.3006L24.5361%2028.0107Z%22%20fill%3D%22%23D7C1B3%22%2F%3E%3Cpath%20d%3D%22M15.4639%2028.0107L18.187%2029.3006L18.1727%2028.498L18.402%2026.6061L15.4639%2028.0107Z%22%20fill%3D%22%23D7C1B3%22%2F%3E%3Cpath%20d%3D%22M18.2298%2023.3953L15.8076%2022.693L17.5275%2021.9047L18.2298%2023.3953Z%22%20fill%3D%22%232F343B%22%2F%3E%3Cpath%20d%3D%22M21.77%2023.3953L22.4866%2021.9047L24.2065%2022.693L21.77%2023.3953Z%22%20fill%3D%22%232F343B%22%2F%3E%3Cpath%20d%3D%22M15.4639%2028.0106L15.8939%2024.5422L13.1851%2024.6138L15.4639%2028.0106Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M24.1206%2024.5422L24.5362%2028.0106L26.8294%2024.6138L24.1206%2024.5422Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M26.17%2020.7155L21.3257%2020.9305L21.77%2023.3956L22.4866%2021.9051L24.2065%2022.6934L26.17%2020.7155Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M15.8078%2022.6934L17.5276%2021.9051L18.2299%2023.3956L18.6885%2020.9305L13.8442%2020.7155L15.8078%2022.6934Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M13.8442%2020.7155L15.8651%2024.6569L15.8078%2022.6934L13.8442%2020.7155Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M24.2064%2022.6934L24.1348%2024.6569L26.1699%2020.7155L24.2064%2022.6934Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M18.6886%2020.9301L18.23%2023.3953L18.8033%2026.319L18.9323%2022.478L18.6886%2020.9301Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M21.3257%2020.9301L21.082%2022.4637L21.1967%2026.319L21.77%2023.3953L21.3257%2020.9301Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M21.7701%2023.3953L21.1968%2026.3191L21.6124%2026.6057L24.1349%2024.6565L24.2065%2022.693L21.7701%2023.3953Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M15.8076%2022.693L15.8649%2024.6565L18.4018%2026.6057L18.8031%2026.3191L18.2298%2023.3953L15.8076%2022.693Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M21.8274%2029.3002L21.8561%2028.4975L21.6267%2028.3112H18.3733L18.1727%2028.4975L18.187%2029.3002L15.4639%2028.0103L16.4098%2028.7842L18.3446%2030.1171H21.6554L23.5903%2028.7842L24.5362%2028.0103L21.8274%2029.3002Z%22%20fill%3D%22%23C0AD9E%22%2F%3E%3Cpath%20d%3D%22M21.6126%2026.6062L21.197%2026.3195H18.8035L18.4022%2026.6062L18.1729%2028.498L18.3735%2028.3117H21.6269L21.8562%2028.498L21.6126%2026.6062Z%22%20fill%3D%22%232F343B%22%2F%3E%3Cpath%20d%3D%22M30.2833%2016.6161L30.9999%2013.119L29.9107%209.87994L21.6123%2015.9855L24.8084%2018.6656L29.3231%2019.9842L30.312%2018.8233L29.882%2018.508L30.57%2017.8917L30.0397%2017.476L30.7276%2016.9601L30.2833%2016.6161Z%22%20fill%3D%22%23763E1A%22%2F%3E%3Cpath%20d%3D%22M9%2013.119L9.73094%2016.616L9.27231%2016.96L9.96026%2017.4903L9.42997%2017.8916L10.1179%2018.5079L9.68795%2018.8232L10.6912%2019.9841L15.2059%2018.6656L18.402%2015.9854L10.0893%209.87988L9%2013.119Z%22%20fill%3D%22%23763E1A%22%2F%3E%3Cpath%20d%3D%22M29.323%2019.9842L24.8084%2018.6656L26.1699%2020.7152L24.1348%2024.6565L26.8292%2024.6135H30.8423L29.323%2019.9842Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M15.2061%2018.6656L10.6914%2019.9842L9.18652%2024.6135H13.1852L15.8654%2024.6565L13.8445%2020.7152L15.2061%2018.6656Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M21.3258%2020.9301L21.6125%2015.9855L22.9167%2012.4741H17.0835L18.4021%2015.9855L18.6887%2020.9301L18.8034%2022.478V26.3191H21.1969L21.2112%2022.478L21.3258%2020.9301Z%22%20fill%3D%22%23F5841F%22%2F%3E%3C%2Fsvg%3E",supportMobile:!0,switchChain:U,disabled:()=>!1,injected:()=>window.ethereum,connector:(e,t)=>pe(e,t),disconnect:async()=>{const e=O.getState().provider;e&&async function(e){try{return I(e,{method:"wallet_revokePermissions",params:[{eth_accounts:{}}]})}catch(e){console.error(e)}}(e)}},jM={MetamaskWallet:RM,...BM},GM=Object.values(BM),HM=Object.values(jM),zM={...fM,disabled:()=>!1,type:x.openBlockIframe,connector:z},$M=[vM.showName,RM.showName,aM.showName];async function VM(e){const t=[],n=[],r=D();[...HM,...e??[]].forEach((e=>{const a=`${e.type}-${e.showName}`;let s=!1;if(s=r?!1===e.supportMobile:!1===e.supportExtension,s)t.includes(a)||t.push(a);else if(e.disabled){const r=e.disabled();"boolean"==typeof r?r&&!t.includes(a)&&t.push(a):n.push((async()=>{await r&&!t.includes(a)&&t.push(a)}))}else if(e.injected){e.injected()||t.includes(a)||t.push(a)}})),await Promise.all(n.map((e=>e()))),O.getState().setDisabledWalletKeyList(t)}function qM(e,t){return!e||!t||t.includes(e)}function ZM({PORTIS_ID:e,chainId:t,includes:n,excludes:r,excludeNames:a,keysSort:s,mobileKeysSort:i,lastConnectedFirst:o,showAllInjected:c,afterHooks:l,extendsWalleObject:u,showNotSupport:d,eip6963WalletList:p,eip6963IgnoreIncludes:h,supportChainIds:m}={}){if("undefined"==typeof window)return[];const f=D(),y=(!n||n.includes(x.injected))&&(!r||!r.includes(x.injected)),b={PORTIS_ID:e},g=p?.filter((e=>![FS,OS].includes(e.info.rdns)));let w,v=[],C=!1;const E={...jM};u&&Object.entries(u).forEach((([e,t])=>{E[e]=t}));const k=Object.values(E),T=k.filter((e=>e.type!==x.injected));if(y){if(f&&(GM.some((e=>!!(e.injected&&e.injected()&&qM(t,e.supportChains))&&(w={...e},!0))),!w&&g?.length)){const[e]=g,n=GM.find((t=>t.type===SS[e.info.rdns])),r=MS(e);n?qM(t,n.supportChains)&&(w={...n,...r,type:n.type,logo:n.logo}):w=r}w||(w=RM),w.connector=w.connectorInjected??w.connector??((e,t)=>M(void 0,t)),w.switchChain=w.switchChain??U,v.push(w),w.injected?C=w.injected():w.disabled&&(C=!w.disabled())}const P=e=>{if(r?.includes(e.type))return!1;if(a?.includes(e.showName))return!1;if(e.checked&&e.type!==x.injected&&!e.checked(b))return!1;if(t&&e.supportChains&&!e.supportChains.includes(t))return!1;if(t&&!f&&e.supportChainsPC&&!e.supportChainsPC.includes(t))return!1;if(m&&(e.supportChains||e.supportChainsPC)){const t=m.some((t=>!!e.supportChains?.includes(t)||!(f||!e.supportChainsPC?.includes(t))));if(!t)return!1}return!!(!n||n.includes(e.type)||h&&e.isEip6963)};if(f)C?P(vM)&&v.push(vM):k.forEach((e=>!(!P(e)||!e.supportMobile&&!d||e.showName===w?.showName)&&(v.push(e),!0)));else{let e=[];T.forEach((t=>{if(!P(t))return!1;if(!1===t.supportExtension)if(t.injected){if(!d&&!c)return!1}else if(!d)return!1;return e.push(t),!0})),v=[...v,...e]}f&&C||!g?.length||g.forEach((e=>{const{info:t}=e,n=SS[t.rdns],r=MS(e);let a=!1;n&&(a=v.some(((e,t)=>e.type===n&&(v.splice(t,1,{...e,...r,type:e.type,logo:e.logo}),!0))),a||(a=GM.some((e=>e.type===n&&(P(e)&&v.push({...e,...r,type:e.type,logo:e.logo}),!0))))),a||v.push(r)}));const A=f?i??s:s;if(A){let e=A.map((e=>{const t=E[e];if(!t)throw new Error(`unknown key ${e}`);return t.showName}));f?C?e=[RM.showName,...e.filter((e=>e!==RM.showName))]:(e=e.filter((e=>!$M.includes(e))),e=[...$M,...e]):e.includes(RM.showName)||(e=[RM.showName,...e]),v.sort(((t,n)=>{let r=e.indexOf(t.showName),a=e.indexOf(n.showName);return-1===r&&(r=999),-1===a&&(a=999),r-a}))}if(o&&"undefined"!=typeof window&&localStorage.getItem(AS)){const e=localStorage.getItem(AS);v.sort(((t,n)=>(e===t.type?1:2)-(e===n.type?1:2)))}return l&&(v=l({isMobile:f,PORTIS_ID:e,chainId:t,includes:n,excludes:r,excludeNames:a,showAllInjected:c,hasInjectedWallet:C,walletList:v,showNotSupport:d})),v.forEach((e=>{e.getPackage&&e.getPackage()})),v}async function WM(){if("undefined"!=typeof window&&window.top!==window){if(await(await Y()).getIsCyber())return _M;if(await(await V()).getIsSafe())return EM;if(await H())return zM}}var KM=[{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"guy",type:"address"},{name:"wad",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];async function JM(e,t){const{account:n=e.account,calls:r,capabilities:a,chain:s=e.chain,version:i="1.0"}=t;if(!n)throw new XF({docsPath:"/experimental/eip5792/sendCalls"});const o=rD(n);if(!s)throw new KF;try{return await e.request({method:"wallet_sendCalls",params:[{calls:r.map((e=>({...e,value:e.value?T_(e.value):void 0}))),capabilities:a,chainId:T_(s.id),from:o.address,version:i}]},{retryCount:0})}catch(e){throw QF(e,{...t,account:o,chain:t.chain})}}function XM(){return e=>({getCallsStatus:t=>async function(e,t){const{id:n}=t,{receipts:r,status:a}=await e.request({method:"wallet_getCallsStatus",params:[n]});return{status:a,receipts:r?.map((e=>({...e,blockNumber:w_(e.blockNumber),gasUsed:w_(e.gasUsed),status:bO[e.status]})))??[]}}(e,t),getCapabilities:t=>async function(...e){const[t,n]=e,r=n?.account??t.account;if(!r)throw new XF;const a=rD(r),s=await t.request({method:"wallet_getCapabilities",params:[a.address]}),i={};for(const[e,t]of Object.entries(s))i[Number(e)]=t;return i}(e,t),sendCalls:t=>JM(e,t),showCallsStatus:t=>async function(e,t){const{id:n}=t;await e.request({method:"wallet_showCallsStatus",params:[n]})}(e,t),writeContracts:t=>async function(e,t){const n=t.contracts.map((e=>{const{address:t,abi:n,functionName:r,args:a,value:s}=e;return{data:iD({abi:n,functionName:r,args:a}),to:t,value:s}}));return qA(e,JM,"sendCalls")({...t,calls:n})}(e,t)})}const YM={contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:{block:kF({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=CF(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?w_(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:EF({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?w_(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:wO({format:e=>({l1GasPrice:e.l1GasPrice?w_(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?w_(e.l1GasUsed):null,l1Fee:e.l1Fee?w_(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},serializers:{transaction:function(e,t){return function(e){return"deposit"===e.type||void 0!==e.sourceHash}(e)?function(e){!function(e){const{from:t,to:n}=e;if(t&&!V_(t))throw new R_({address:t});if(n&&!V_(n))throw new R_({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:a,isSystemTx:s,mint:i,to:o,value:c}=e;return Z_(["0x7e",mO([t,r,o??"0x",i?E_(i):"0x",c?E_(c):"0x",a?E_(a):"0x",s?"0x1":"0x",n??"0x"])])}(e):EO(e,t)}}},QM=lO({...YM,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...YM.contracts,l2OutputOracle:{1:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{1:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{1:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),eI=11155111,tI=lO({...YM,id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://sepolia.basescan.org",apiUrl:"https://api-sepolia.basescan.org/api"}},contracts:{...YM.contracts,l2OutputOracle:{[eI]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[eI]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[eI]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:eI});var nI;function rI(){const{provider:e}=O.getState();if(!e)throw new Error("provider is undefined");return e}!function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.Warning=2]="Warning"}(nI||(nI={}));const aI=async e=>{const{value:t,from:n,to:r,data:a}=e,s={from:n,to:r,value:t,data:a};t&&!/^0x0*$/.test(t)||delete s.value;const i=rI();try{return(await i.estimateGas(s)).add(5e4)}catch(t){i.call(e).then((e=>{if("test"!==process.env.NODE_ENV)throw new Error("Unexpected issue with estimating the gas. Please try again.")})).catch((e=>{if("test"!==process.env.NODE_ENV)throw e}))}return null},sI=async()=>{const e=rI();try{return await e.getGasPrice()}catch(t){e.call({}).then((e=>{throw new Error("Unexpected issue with getting the gas price. Please try again.")})).catch((e=>{throw e}))}return null},iI=async e=>{const t=rI(),n=O.getState().chainId,r=await t.send("eth_chainId",[]);if(Number(r)!==Number(n))throw new Error("Network not matched, please refresh page and try again.");const a=O.getState().connected?.wallet;if(a?.notSupported?.sendTransaction)throw new Error("Not supported sendTransaction.");if(a?.contract?.sendTransaction)return a.contract.sendTransaction(e);const s=a?.getSupportEip5792ChainIds?.();if(s?.includes(n)){let r=QM,a="https://api.developer.coinbase.com/rpc/v1/base/pE-_rU5q_IliJGUVkVI-82ZoyiCeCSFx";84532===n&&(r=tI,a="https://api.developer.coinbase.com/rpc/v1/base-sepolia/pE-_rU5q_IliJGUVkVI-82ZoyiCeCSFx");const s=_O({chain:r,transport:cO(t.provider)}).extend(XM()),i=await s.sendCalls({account:e.from,calls:[e],capabilities:{paymasterService:{url:a}}}),o=()=>new Promise((e=>{setTimeout((async()=>{const t=await s.getCallsStatus({id:i});if("PENDING"===t.status){const t=await o();e(t)}else if(t.receipts?.length){const[n]=t.receipts,r=n.transactionHash;e(r)}else e(i)}),700)}));return{hash:await o()}}try{const n=await t.getSigner().sendTransaction(e);if(O.getState().connected?.isSafe&&O.getState().account){const e=await V(),t=await e.getSafeTxHash(O.getState().chainId,O.getState().account,n.hash);return{...n,hash:t}}return n}catch(e){throw 4001===e?.code?new Error("Transaction rejected."):e}};function oI(e,t,n){if(!ES(e)||e===w)throw Error(`Invalid 'address' parameter '${e}'.`);const r=n??rI(),a=O.getState().account;return new g(e,t,function(e,t){return t?function(e,t){return e.getSigner(t).connectUnchecked()}(e,t):e}(r,a))}const cI=new Map;async function lI(t,n){if(!t||t===O.getState().chainId&&O.getState().provider)return O.getState().provider;if(cI.has(t))return cI.get(t);const r=new e(n,t);return cI.set(t,r),r}const uI=async(e,t,n)=>{const r=oI(e,KM).interface.encodeFunctionData("approve",[t,n]),a={from:O.getState().account,to:e,data:r,value:"0x0",gasLimit:void 0},s=await aI(a);return s&&(a.gasLimit=s),await iI(a)};async function dI(e,t,n,r,a){const s=rI();for(;!t.killSwitch;){try{if(O.getState().connected?.isSafe){const t=await V(),n=await t.getSafeTxStatus(O.getState().chainId,e,O.getState().account);if("rejected"===n)return{status:nI.Warning,transactionReceipt:null};let r;if(n&&(r=n.status?nI.Success:nI.Failed),void 0!==r)return{status:r,transactionReceipt:n?{...n,blockNumber:n.blockNumber||void 0,status:n.status?1:0}:null}}else{const[t,i]=await Promise.all([a?a(e):s.getTransactionReceipt(e),s.getTransactionCount(r??"")]);let o;if(console.log("[TX Watch] Web3",t,"/Current Nonce ",i,"/TX Nonce",n),t&&(o=t.status?nI.Success:nI.Failed),void 0===o&&void 0!==n&&i>n&&(o=nI.Warning),void 0!==o)return{status:o,transactionReceipt:t}}}catch(e){console.error("[TX Watch] Error",e.message)}await new Promise((e=>setTimeout(e,t.interval)))}return null}async function pI(e,t){const n=rI(),r=O.getState().connected?.wallet;if(r?.notSupported?.personalSign)throw new Error("Not supported personalSign.");return r?.contract?.personalSign?r.contract.personalSign(e,t):n.getSigner().signMessage(e)}async function hI(e){const t=rI(),n=O.getState().connected?.wallet,r=O.getState().account;if(n?.notSupported?.sign)throw new Error("Not supported sign.");return n?.contract?.sign?n.contract.sign(e):t.send("eth_sign",[r,e])}async function mI(e){const t=await m(e);delete t.from;const n=hC(v(t)),r=await hI(n);return v(t,r)}async function fI({account:e,typedData:t}){const n=rI(),r=O.getState().connected?.wallet;if(r?.notSupported?.signTypedData)throw new Error("Not supported sign.");if(r?.contract?.signTypedData)return r.contract.signTypedData({account:e,typedData:t});try{if(n){const r=await n.send("eth_signTypedData_v4",[e,JSON.stringify(t)]);return console.log("web3 eth_signTypedData_v4 result: ",r),r}}catch(e){if(console.error("web3 eth_signTypedData_v4 error: ",e),e.message)throw new Error(e.message)}return null}export{vn as $,O as A,xC as B,ve as C,ts as D,Fa as E,BC as F,Ee as G,L as H,dC as I,M as J,wn as K,Sa as L,D as M,_ as N,$P as O,$S as P,RS as Q,zS as R,BO as S,jS as T,Ia as U,HS as V,GS as W,tM as X,nM as Y,rM as Z,Ha as _,PS as a,ds as a$,pr as a0,ya as a1,ba as a2,wa as a3,ga as a4,aa as a5,ia as a6,zn as a7,da as a8,pa as a9,ak as aA,dT as aB,Nk as aC,mk as aD,dk as aE,pk as aF,yk as aG,ZT as aH,KT as aI,qT as aJ,WT as aK,$T as aL,HT as aM,Rx as aN,zT as aO,Uk as aP,Lk as aQ,ss as aR,as as aS,Pc as aT,_i as aU,Zs as aV,Tc as aW,Pu as aX,Di as aY,Zo as aZ,Jc as a_,ha as aa,dr as ab,ma as ac,cr as ad,Tr as ae,ta as af,lr as ag,fa as ah,ca as ai,na as aj,ra as ak,ur as al,sa as am,xr as an,Er as ao,oa as ap,va as aq,x as ar,UO as as,NO as at,lk as au,fk as av,uk as aw,Mx as ax,Kk as ay,mT as az,za as b,BS as b0,jM as b1,GM as b2,HM as b3,zM as b4,VM as b5,ZM as b6,WM as b7,E as b8,BM as b9,z as bA,H as bB,nI as bC,aI as bD,sI as bE,iI as bF,oI as bG,lI as bH,uI as bI,dI as bJ,pI as bK,hI as bL,mI as bM,fI as bN,k as bO,T as bP,P as bQ,A as bR,F as bS,ES as bT,$ as ba,V as bb,q as bc,Z as bd,W as be,K as bf,J as bg,X as bh,Y as bi,Q as bj,ee as bk,te as bl,ne as bm,re as bn,ae as bo,se as bp,ie as bq,oe as br,ce as bs,le as bt,ue as bu,de as bv,pe as bw,he as bx,me as by,U as bz,fe as c,Ca as d,Ea as e,$a as f,yC as g,ge as h,zP as i,Xa as j,hC as k,Ya as l,Ga as m,La as n,qC as o,Qa as p,ZC as q,fC as r,$C as s,Ra as t,VC as u,zC as v,Na as w,be as x,ye as y,S as z};