@dodoex/wallet-web3 0.0.54 → 0.0.55-beta-entry.1
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.
- package/dist/{alchemy-provider-5870b6fa-825833dc.js → alchemy-provider-5870b6fa-b341484c.js} +1 -1
- package/dist/{alchemy-websocket-provider-213da986-0d3bf5da.js → alchemy-websocket-provider-213da986-17357a84.js} +1 -1
- package/dist/{blocto-f0e23298.js → blocto-e1f474f3.js} +1 -1
- package/dist/{ccip-1ddbd4d6.js → ccip-3f0845c7.js} +1 -1
- package/dist/cjs/{alchemy-provider-5870b6fa-c32529ee.cjs → alchemy-provider-5870b6fa-f641f1f1.cjs} +1 -1
- package/dist/cjs/{alchemy-websocket-provider-213da986-4fac79de.cjs → alchemy-websocket-provider-213da986-fa3dddc4.cjs} +1 -1
- package/dist/cjs/{blocto-22382c66.cjs → blocto-05f9e11e.cjs} +1 -1
- package/dist/cjs/{ccip-d888ed7d.cjs → ccip-4ac89cf6.cjs} +1 -1
- package/dist/cjs/controllers/ConnectController.d.ts +11 -6
- package/dist/cjs/core/index.d.ts +4 -2
- package/dist/cjs/{draggabilly-1a4904c7.cjs → draggabilly-e2d8b869.cjs} +1 -1
- package/dist/cjs/id-26ac4af0.cjs +1 -0
- package/dist/cjs/{index-82a0dcdf.cjs → index-0e337447.cjs} +1 -1
- package/dist/cjs/{index-6eeb2839.cjs → index-66688dd4.cjs} +1 -1
- package/dist/cjs/{index-e397195f.cjs → index-69696ac9.cjs} +1 -1
- package/dist/cjs/{index-86b7a3c1.cjs → index-6c4e85f1.cjs} +1 -1
- package/dist/cjs/{index-d28ccb41.cjs → index-966a59e7.cjs} +1 -1
- package/dist/cjs/index-b5a57e06.cjs +6 -0
- package/dist/cjs/{index-eefcf788.cjs → index-bd4b9641.cjs} +2 -2
- package/dist/cjs/{index-8c651aa1.cjs → index-f8fe116e.cjs} +1 -1
- package/dist/cjs/index-f9c2f609.cjs +29 -0
- package/dist/cjs/index-fc8d397a.cjs +1 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{index.es-ef7553ec.cjs → index.es-89e527f8.cjs} +1 -1
- package/dist/cjs/{interface-c6996c01.cjs → interface-424a54f3.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-62582232.cjs → lib-typedarrays-8bfb63bb.cjs} +1 -1
- package/dist/cjs/{portis-cf9f9f48.cjs → portis-ac8d5e11.cjs} +1 -1
- package/dist/cjs/{provider-98f5141e.cjs → provider-47442328.cjs} +1 -1
- package/dist/cjs/providers/wallets/index.d.ts +3 -1
- package/dist/cjs/providers/wallets/types.d.ts +2 -0
- package/dist/cjs/{rainbow-de56ca00.cjs → rainbow-7f46d3b6.cjs} +1 -1
- package/dist/cjs/{sha224-19ef6290.cjs → sha224-e21eed9f.cjs} +1 -1
- package/dist/cjs/{sha256-240b6e58.cjs → sha256-af547e18.cjs} +1 -1
- package/dist/cjs/{typed-data-dbad5718.cjs → typed-data-558df2db.cjs} +1 -1
- package/dist/cjs/uAuth-7252e7ca.cjs +1 -0
- package/dist/cjs/{walletConnect-8fbd36f8.cjs → walletConnect-de6516fe.cjs} +1 -1
- package/dist/cjs/walletLink-f08562df.cjs +3 -0
- package/dist/controllers/ConnectController.d.ts +11 -6
- package/dist/core/index.d.ts +4 -2
- package/dist/{draggabilly-e4e3d8f3.js → draggabilly-8f5521dc.js} +1 -1
- package/dist/id-9aec49ad.js +1 -0
- package/dist/{index-71f98f76.js → index-28dcd6e8.js} +2 -2
- package/dist/{index-8e4d3a91.js → index-352bf4a5.js} +1 -1
- package/dist/index-4dbe54e3.js +1 -0
- package/dist/index-6e0a6776.js +29 -0
- package/dist/{index-4c953d0d.js → index-8b8ad4a7.js} +1 -1
- package/dist/{index-0dca4f3f.js → index-9e1d29f1.js} +1 -1
- package/dist/index-a604a49a.js +1 -0
- package/dist/{index-815eccdf.js → index-b1ba8ce5.js} +1 -1
- package/dist/index-d2ea8b6b.js +6 -0
- package/dist/{index-98e953c6.js → index-d7fc0d54.js} +1 -1
- package/dist/{index.es-1b60a97f.js → index.es-e10aa6e9.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{interface-90345e14.js → interface-1d689049.js} +1 -1
- package/dist/{lib-typedarrays-d96b8ede.js → lib-typedarrays-b810d4b0.js} +1 -1
- package/dist/{portis-85eab92b.js → portis-5012fa3a.js} +1 -1
- package/dist/{provider-0b3740ce.js → provider-aaecb083.js} +1 -1
- package/dist/providers/wallets/index.d.ts +3 -1
- package/dist/providers/wallets/types.d.ts +2 -0
- package/dist/rainbow-1bf6f4e9.js +1 -0
- package/dist/sha224-8c32c00f.js +1 -0
- package/dist/{sha256-3bb3a6aa.js → sha256-466e7a88.js} +1 -1
- package/dist/{typed-data-e0761ff3.js → typed-data-5e1927b3.js} +1 -1
- package/dist/uAuth-9647ccc5.js +1 -0
- package/dist/{walletConnect-b1de3c08.js → walletConnect-2eac23aa.js} +1 -1
- package/dist/{walletLink-c0cf0049.js → walletLink-5196409f.js} +2 -2
- package/package.json +1 -1
- package/dist/cjs/hash-7ce6fed5.cjs +0 -1
- package/dist/cjs/id-f5a23f5e.cjs +0 -1
- package/dist/cjs/index-20d8695e.cjs +0 -1
- package/dist/cjs/index-9929c714.cjs +0 -6
- package/dist/cjs/index-ad58d895.cjs +0 -29
- package/dist/cjs/inherits_browser-50deae74.cjs +0 -1
- package/dist/cjs/uAuth-5619b0a4.cjs +0 -1
- package/dist/cjs/walletLink-d556dda2.cjs +0 -3
- package/dist/hash-b468659c.js +0 -1
- package/dist/id-7eadfe81.js +0 -1
- package/dist/index-5d37822d.js +0 -1
- package/dist/index-844cc2ab.js +0 -6
- package/dist/index-c9ed67e2.js +0 -1
- package/dist/index-ca20f41d.js +0 -29
- package/dist/inherits_browser-51bb8c3c.js +0 -1
- package/dist/rainbow-1c0ae93d.js +0 -1
- package/dist/sha224-7c3ade37.js +0 -1
- package/dist/uAuth-ceaf973b.js +0 -1
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@ethersproject/providers"),t=require("zustand");require("events");var n=require("@ethersproject/address"),r=require("@ethersproject/bytes"),a=require("@ethersproject/properties"),s=require("@ethersproject/abstract-signer"),i=require("buffer");require("@ethersproject/abstract-provider");var o=require("@ethersproject/contracts"),c=require("@ethersproject/constants"),l=require("@ethersproject/transactions");function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var d=function(e,t){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},d(e,t)};var p=function(){return p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},p.apply(this,arguments)};function h(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())}))}var m=Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function f(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 y(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(a)throw a.error}}return i}function b(e){return this instanceof b?(this.v=e,this):new b(e)}var g=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var v,w,x=Object.freeze({__proto__:null,__extends:function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return p},__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},__decorate:function(e,t,n,r){var a,s=arguments.length,i=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(i=(s<3?a(i):s>3?a(t,n,i):a(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i},__param:function(e,t){return function(n,r){t(n,r,e)}},__esDecorate:function(e,t,n,r,a,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,c=r.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),p=!1,h=n.length-1;h>=0;h--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[h])("accessor"===c?{get:d.get,set:d.set}:d[l],m);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(o=i(y.get))&&(d.get=o),(o=i(y.set))&&(d.set=o),(o=i(y.init))&&a.push(o)}else(o=i(y))&&("field"===c?a.push(o):d[l]=o)}u&&Object.defineProperty(u,r.name,d),p=!0},__runInitializers:function(e,t,n){for(var r=arguments.length>2,a=0;a<t.length;a++)n=r?t[a].call(e,n):t[a].call(e);return r?n:void 0},__propKey:function(e){return"symbol"==typeof e?e:"".concat(e)},__setFunctionName:function(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:h,__generator:function(e,t){var n,r,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&o[0]?r.return:o[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;switch(r=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,r=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],r=0}finally{n=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},__createBinding:m,__exportStar:function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||m(t,e,n)},__values:f,__read:y,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),a=0;for(t=0;t<n;t++)for(var s=arguments[t],i=0,o=s.length;i<o;i++,a++)r[a]=s[i];return r},__spreadArray:function(e,t,n){if(n||2===arguments.length)for(var r,a=0,s=t.length;a<s;a++)!r&&a in t||(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))},__await:b,__asyncGenerator:function(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{(n=a[e](t)).value instanceof b?Promise.resolve(n.value.v).then(c,l):u(s[0][2],n)}catch(e){u(s[0][3],e)}var n}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])}},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,a){t[r]=e[r]?function(t){return(n=!n)?{value:b(e[r](t)),done:!1}:a?a(t):t}:a}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=f(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)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&m(t,e,n);return g(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},__classPrivateFieldSet:function(e,t,n,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,n):a?a.value=n:t.set(e,n),n},__classPrivateFieldIn:function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}});exports.ChainId=void 0,(v=exports.ChainId||(exports.ChainId={}))[v.MAINNET=1]="MAINNET",v[v.GOERLI=5]="GOERLI",v[v.BSC=56]="BSC",v[v.POLYGON=137]="POLYGON",v[v.ARBITRUM_ONE=42161]="ARBITRUM_ONE",v[v.AURORA=1313161554]="AURORA",v[v.OKCHAIN=66]="OKCHAIN",v[v.OPTIMISM=10]="OPTIMISM",v[v.AVALANCHE=43114]="AVALANCHE",v[v.CONFLUX=1030]="CONFLUX",v[v.BASE=8453]="BASE",v[v.LINEA=59144]="LINEA",v[v.SCROLL_ALPHA_TESTNET=534353]="SCROLL_ALPHA_TESTNET",v[v.SCROLL=534352]="SCROLL",v[v.MANTLE=5e3]="MANTLE",v[v.MANTA=169]="MANTA",exports.WalletType=void 0,(w=exports.WalletType||(exports.WalletType={})).injected="injected",w.BinanceChain="custom-bsc-injected",w.WalletConnect="walletconnect",w.Portis="portis",w.Gnosis="custom-gnosis",w.WalletLink="custom-walletlink",w.LedgerUSB="custom-ledger-usb",w.Ledger="custom-ledger",w.openBlock="custom-open-block",w.openBlockIframe="custom-open-block-iframe",w.GameStop="custom-game-stop",w.Nabox="custom-nabox",w.Bitkeep="custom-bitkeep",w.OneKey="custom-onekey",w.OKX="custom-okx",w.uAuth="custom-uauth",w.kuCoinWallet="custom-kucoin-wallet",w.frontier="custom-frontier",w.Blocto="custom-blocto",w.Rainbow="custom-rainbow",w.trust="custom-trust",w.tokenPocket="custom-token-pocket",w.Cyber="custom-cyber",w.uniPass="custom-uni-pass",w.Gate="custom-gate",w.Coin98="custom-coin-98",w.FoxWallet="custom-fox-wallet",w.Brave="custom-brave",w.Math="custom-math",w.ImToken="custom-im-token",w.Rabby="custom-rabby",w.SocialLogin="custom-social-login",w.Alchemy="custom-alchemy",w.Bybit="custom-bybit",w.EIP6963Prefix="custom-eip-6963-";const E=()=>{var e;return"undefined"!=typeof navigator&&!!(null===(e=window.navigator)||void 0===e?void 0:e.hid)},C=()=>{var e;return"undefined"!=typeof navigator&&(null===(e=window.navigator)||void 0===e?void 0:e.userAgent)&&/(Android)/i.test(navigator.userAgent)};function k(){return"undefined"!=typeof navigator&&/iPhone|iPod|iOS/.test(navigator.userAgent)}function T(){return"undefined"!=typeof navigator&&(/iPad/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)}const P=()=>k()||T(),A=()=>C()||P(),O=()=>{if("undefined"!=typeof window)return window};function F(e){return h(this,void 0,void 0,(function*(){const{Web3Provider:t}=yield Promise.resolve().then((function(){return u(require("@ethersproject/providers"))}));return new t(e,"any")}))}const D=t.create((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:(e,n,r)=>h(void 0,void 0,void 0,(function*(){t((()=>({provider:e})));const{chainId:a}=yield e.getNetwork(),s=yield e.listAccounts(),[i]=s,{type:o}=n;let c=o===exports.WalletType.Gnosis;if(!c&&o===exports.WalletType.WalletConnect&&i){const e=yield H();c=yield e.getAccountIsSafe(a,i)}t((e=>{var t;return{accounts:s,account:i,chainId:a,walletType:o,connected:{isAutoConnect:r,wallet:n,isSafe:c},connectedWalletSpecial:(null===(t=e.connectedWalletSpecial)||void 0===t?void 0:t.type)===o?e.connectedWalletSpecial:void 0,connectLoading:!1,connectingType:void 0}}))})),connectFailed:()=>{t((()=>({connectLoading:!1,connectingType:void 0})))},accountsChanged:e=>{const[n]=e;t((()=>({accounts:e,account:n})))},chainIdChanged:e=>{t((()=>({chainId:e})))},setRpcUrlProvider:(n,r)=>h(void 0,void 0,void 0,(function*(){const a=new e.JsonRpcProvider(n,r);let s=r;if(!s){const e=yield 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:n=>h(void 0,void 0,void 0,(function*(){if(n){const r=new e.JsonRpcProvider(n),{chainId:a}=yield 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})))}})));function _(e=null,t){return h(this,void 0,void 0,(function*(){let n=e||window.ethereum;if(n)yield 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),F(n)}))}function S(e,t){return e.request?e.request(t):e.send(t.method,t.params)}function I({provider:e,addChainParameters:t}){return h(this,void 0,void 0,(function*(){try{return yield S(e,{method:"wallet_addEthereumChain",params:[t]}),{result:!0}}catch(e){console.error(`[failed to add ${t.chainId}]: `,t,e)}return{result:!1}}))}function M({addChainDirectly:e,addChainParameters:t,provider:n}){var r;return h(this,void 0,void 0,(function*(){const a=null!==(r=null!=n?n:D.getState().provider)&&void 0!==r?r:window.ethereum;if(!a)return{result:!1};if(e)return I({provider:a,addChainParameters:t});const{chainId:s}=t;try{return yield S(a,{method:"wallet_switchEthereumChain",params:[{chainId:s}]}),{result:!0}}catch(e){const{code:n}=e;if(4902===n||-32603===n)return I({provider:a,addChainParameters:t});console.error(`[failed to switch ${s}]: `,t,e)}return{result:!1}}))}let N=!1,B=1;const U={};let R=!1;var j,L;null===(j=O())||void 0===j||j.addEventListener("message",(e=>{"openblock-content-integration"===e.data.from&&(N=!0,Object.values(U).map((e=>e())))})),null===(L=O())||void 0===L||L.addEventListener("load",(()=>{setTimeout((()=>{R=!0,Object.values(U).map((e=>e()))}),1e3)}),{once:!0});const G=()=>h(void 0,void 0,void 0,(function*(){return new Promise((e=>{N?e(!0):window.parent===window||R?e(!1):(B++,U[B]=()=>{e(N),delete U[B]})}))})),z=(e,t)=>h(void 0,void 0,void 0,(function*(){const e=(yield Promise.resolve().then((function(){return require("./provider-98f5141e.cjs")}))).default();return e.on("connect",t.connect),e.on("disconnect",t.disconnect),e.on("accountsChanged",t.accountsChanged),e.on("chainChanged",t.chainChanged),e.on("message",t.message),yield e.request({method:"eth_requestAccounts"}),F(e)}));function $(){return Promise.resolve().then((function(){return require("./index-e397195f.cjs")}))}function H(){return Promise.resolve().then((function(){return require("./index-20d8695e.cjs")}))}function q(){return Promise.resolve().then((function(){return require("./uAuth-5619b0a4.cjs")}))}function V(){return Promise.resolve().then((function(){return require("./portis-cf9f9f48.cjs")}))}function W(){return Promise.resolve().then((function(){return require("./walletLink-d556dda2.cjs")}))}function Z(){return Promise.resolve().then((function(){return require("./walletConnect-8fbd36f8.cjs")}))}function K(){return Promise.resolve().then((function(){return require("./blocto-22382c66.cjs")}))}function J(){return Promise.resolve().then((function(){return require("./rainbow-de56ca00.cjs")}))}function Y(){return Promise.resolve().then((function(){return require("./index-d28ccb41.cjs")}))}function X(){return Promise.resolve().then((function(){return require("./index-6eeb2839.cjs")}))}function Q(){return Promise.resolve().then((function(){return require("./index-9929c714.cjs")}))}function ee(){return Promise.resolve().then((function(){return require("./index-82a0dcdf.cjs")}))}function te(){return Promise.resolve().then((function(){return require("./index-eefcf788.cjs")}))}function ne(){return Promise.resolve().then((function(){return require("./index-8c651aa1.cjs")}))}function re(e,t){return h(this,void 0,void 0,(function*(){return(yield K()).default(e,t)}))}function ae(e,t){return h(this,void 0,void 0,(function*(){return(yield V()).default(e,t)}))}function se(e,t){return h(this,void 0,void 0,(function*(){return(yield W()).default(e,t)}))}function ie(e,t){return h(this,void 0,void 0,(function*(){return(yield Z()).default(e,t)}))}function oe(e,t){return h(this,void 0,void 0,(function*(){return(yield J()).default(e,t)}))}function ce(e,t){return h(this,void 0,void 0,(function*(){return(yield Y()).default(e,t)}))}function le(e,t){return h(this,void 0,void 0,(function*(){return(yield X()).default(e,t)}))}function ue(e,t){return h(this,void 0,void 0,(function*(){return(yield Q()).default(e,t)}))}function de(e,t){return h(this,void 0,void 0,(function*(){return(yield ee()).default(e,t)}))}function pe(e,t){return h(this,void 0,void 0,(function*(){return(yield te()).default(e,t)}))}function he(e,t){return h(this,void 0,void 0,(function*(){return(yield ne()).default(e,t)}))}var me;!function(e){e.Request="request",e.Response="response"}(me||(me={})),exports.ErrorType=void 0,(exports.ErrorType||(exports.ErrorType={})).SendTransactionError="SendTransactionError";class fe{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 ye{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 be 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 be?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof be&&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 ge(this,e)}}function ge(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?ge(e.cause,t):t?null:e}function ve(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 we=ve({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}}}),xe=ve({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 Ee extends be{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 Ce(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 ke(e,t={}){const{signed:n}=t;t.size&&function(e,{size:t}){if(Ce(e)>t)throw new Ee({givenSize:Ce(e),maxSize:t})}(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 Te(e,t={}){return Number(ke(e,t))}function Pe(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 Ae={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559"};function Oe(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Te(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?Te(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Ae[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 Fe=Pe("transaction",Oe);function De(e){const t=e.transactions?.map((e=>"string"==typeof e?e:Oe(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 _e=Pe("block",De);const Se={"0x0":"reverted","0x1":"success"};function Ie(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?Te(e.transactionIndex):null,status:e.status?Se[e.status]:null,type:e.type?Ae[e.type]||e.type:null}}const Me=Pe("transactionReceipt",Ie),Ne={block:_e({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=Oe(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?ke(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:Fe({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?ke(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Me({format:e=>({l1GasPrice:e.l1GasPrice?ke(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?ke(e.l1GasUsed):null,l1Fee:e.l1Fee?ke(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},Be=ve({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:Ne}),Ue=ve({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:Ne}),Re=ve({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}}}),je=ve({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});function Le(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Ge(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 ze(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 $e(e,t){Ge(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const He=BigInt(2**32-1),qe=BigInt(32);function Ve(e,t=!1){return t?{h:Number(e&He),l:Number(e>>qe&He)}:{h:0|Number(e>>qe&He),l:0|Number(e&He)}}function We(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}=Ve(e[a],t);[n[a],r[a]]=[s,i]}return[n,r]}const Ze=e=>e instanceof Uint8Array,Ke=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Je=(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 Ye(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)),!Ze(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class Xe{clone(){return this._cloneInto()}}function Qe(e){const t=t=>e().update(Ye(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const[et,tt,nt]=[[],[],[]],rt=BigInt(0),at=BigInt(1),st=BigInt(2),it=BigInt(7),ot=BigInt(256),ct=BigInt(113);for(let e=0,t=at,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],et.push(2*(5*r+n)),tt.push((e+1)*(e+2)/2%64);let a=rt;for(let e=0;e<7;e++)t=(t<<at^(t>>it)*ct)%ot,t&st&&(a^=at<<(at<<BigInt(e))-at);nt.push(a)}const[lt,ut]=We(nt,!0),dt=(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),pt=(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 ht extends Xe{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,Le(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=dt(s,i,1)^n[r],c=pt(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=tt[n],s=dt(t,a,r),i=pt(t,a,r),o=et[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]^=lt[r],e[1]^=ut[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){ze(this);const{blockLen:t,state:n}=this,r=(e=Ye(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){ze(this,!1),Ge(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 Le(e),this.xofInto(new Uint8Array(e))}digestInto(e){if($e(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 ht(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 mt=((e,t,n)=>Qe((()=>new ht(t,e,n))))(1,136,32);
|
|
3
|
-
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
4
|
-
BigInt(0),BigInt(1),BigInt(2);class ft extends Xe{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=Ke(this.buffer)}update(e){ze(this);const{view:t,buffer:n,blockLen:r}=this,a=(e=Ye(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=Ke(e);for(;r<=a-s;s+=r)this.process(t,s)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){ze(this),$e(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=Ke(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 yt=(e,t,n)=>e&t^~e&n,bt=(e,t,n)=>e&t^e&n^t&n,gt=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]),vt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),wt=new Uint32Array(64);class xt extends ft{constructor(){super(64,32,8,!1),this.A=0|vt[0],this.B=0|vt[1],this.C=0|vt[2],this.D=0|vt[3],this.E=0|vt[4],this.F=0|vt[5],this.G=0|vt[6],this.H=0|vt[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)wt[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=wt[e-15],n=wt[e-2],r=Je(t,7)^Je(t,18)^t>>>3,a=Je(n,17)^Je(n,19)^n>>>10;wt[e]=a+wt[e-7]+r+wt[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+(Je(i,6)^Je(i,11)^Je(i,25))+yt(i,o,c)+gt[e]+wt[e]|0,u=(Je(n,2)^Je(n,13)^Je(n,22))+bt(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(){wt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Et=Qe((()=>new xt)),Ct=ve({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}),kt=ve({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}),Tt=ve({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:Ne}),Pt=ve({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:Ne}),At=ve({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}}}),Ot=ve({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}),Ft=ve({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}),Dt={optimism:Tt,optimismGoerli:Pt,polygon:At,polygonMumbai:Ot,arbitrum:we,arbitrumGoerli:xe,linea:Ct,lineaTestnet:kt,base:Be,baseGoerli:Ue,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:Re.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:je.nativeCurrency},scrollSepolia:Ft};class _t 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 St{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 fe({walletWindow:this.contextWindow,appInfo:t}),this.cyberAccount=null,Object.entries(Dt).forEach((([e,n])=>{this[e]=new ye({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(Dt).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 _t({name:exports.ErrorType.SendTransactionError,details:e.event.data.error,shortMessage:"Transaction failed"})):t(new _t({details:e.event.data.error})):n(e.event.data?.data))}sendTransaction(e){return this.messenger.sendMessage({name:"action",data:{type:me.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:me.Request,method:"getAuthToken"}}),new Promise(((e,t)=>{this.messenger.onMessage((n=>{this.resolveActionResponse(n,t,e)}))}))}}class It{appId;name;cyberWallet;messenger;icon;constructor({appId:e,name:t,icon:n}){this.appId=e,this.name=t,this.icon=n,this.cyberWallet=new St({contextWindow:window.parent,appInfo:{name:t,icon:n,appId:e}}),this.messenger=new fe({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 Mt(e){try{return n.getAddress(e)}catch(e){return!1}}const Nt=0,Bt=2,Ut={};class Rt{constructor({cacheKey:e,rpcUrl:t}){this._rpcUrl="",this.cacheKey=e,this._rpcUrl=null!=t?t:""}setCacheType(e){localStorage.setItem(this.cacheKey,e)}removeCache(){localStorage.removeItem(this.cacheKey)}setRpcUrl(e){this._rpcUrl=e}getCacheType(){return localStorage.getItem(this.cacheKey)}getConnectedWallet(){var e;return h(this,void 0,void 0,(function*(){if(D.getState().connectLoading){let e,t;yield Promise.race([new Promise((e=>{t=D.subscribe((t=>{!1===t.connectLoading&&e(!0)}))})),new Promise((t=>{e=setTimeout((()=>{t(!1)}),4e3)}))]),clearTimeout(e),t&&t()}return null===(e=D.getState().connected)||void 0===e?void 0:e.wallet}))}connectWalletProcess(e,t){return h(this,void 0,void 0,(function*(){if(!e)throw new Error("connector is undefined");const n=yield e(t,{connect:({chainId:e})=>{var n;const r=parseInt(e,16);r&&D.getState().chainIdChanged(r),(null===(n=t.events)||void 0===n?void 0:n.connect)&&t.events.connect({chainId:e})},accountsChanged:e=>{var n;D.getState().accountsChanged(e),e.length||D.getState().disconnect(),(null===(n=t.events)||void 0===n?void 0:n.accountsChanged)&&t.events.accountsChanged(e)},chainChanged:e=>h(this,void 0,void 0,(function*(){var n,r;yield null===(n=D.getState().provider)||void 0===n?void 0:n.detectNetwork();const a=parseInt(e,16);a&&D.getState().chainIdChanged(a),(null===(r=t.events)||void 0===r?void 0:r.chainChanged)&&t.events.chainChanged(e)})),message:(e,n)=>{var r;(null===(r=t.events)||void 0===r?void 0:r.message)&&t.events.message(e,n)},disconnect:e=>{var n;D.getState().disconnect(),(null===(n=t.events)||void 0===n?void 0:n.disconnect)&&t.events.disconnect(e)}});return n}))}connectWallet(e,t,{isAutoConnect:n}={}){var r,a;return h(this,void 0,void 0,(function*(){if(t.chainId&&(null===(r=e.supportChains)||void 0===r?void 0:r.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 s=Object.assign({},e);D.getState().startConnecting(s.type);const{type:i,connector:o,supportMobile:c,supportExtension:l}=s;let u;if(!1===l&&c&&!A()){const{openSingleWalletConnectModal:n,closeSingleWalletConnectModal:r}=t,{connector:i,disconnect:o}=WO;if(s.disconnect=o,n)try{u=yield this.connectWalletProcess(i,Object.assign(Object.assign({},t),{walletConnectParams:Object.assign(Object.assign({},null==t?void 0:t.walletConnectParams),{showQrModal:!1,qrModalOptions:Object.assign(Object.assign({},null===(a=null==t?void 0:t.walletConnectParams)||void 0===a?void 0:a.qrModalOptions),{openCallback:r=>{var a,s,i;(null===(s=null===(a=null==t?void 0:t.walletConnectParams)||void 0===a?void 0:a.qrModalOptions)||void 0===s?void 0:s.openCallback)&&(null===(i=null==t?void 0:t.walletConnectParams)||void 0===i||i.qrModalOptions.openCallback(r)),n({uri:r,wallet:e})}})})}))}finally{r&&r()}else u=yield this.connectWalletProcess(i,t)}else{if(!o)throw new Error(`${e.showName} is not valid.`);try{u=yield this.connectWalletProcess(o,t)}catch(e){throw D.getState().connectFailed(),e}}return u?(this.setCacheType(i),this._wallet=s,yield D.getState().connectSuccess(u,s,!!n)):D.getState().connectFailed(),u}))}disconnectWallet(){var e;return h(this,void 0,void 0,(function*(){this.getCacheType()&&((null===(e=this._wallet)||void 0===e?void 0:e.disconnect)&&(yield this._wallet.disconnect()),this._wallet=void 0,this.removeCache(),D.getState().disconnect(this._rpcUrl))}))}}const jt=/(?:^[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,Lt="io.metamask",Gt={"com.coinbase.wallet":exports.WalletType.WalletLink,"com.bitget.web3":exports.WalletType.Bitkeep,"com.okex.wallet":exports.WalletType.OKX,[Lt]:exports.WalletType.injected,"io.rabby":exports.WalletType.Rabby,"pro.tokenpocket":exports.WalletType.tokenPocket,"coin98.com":exports.WalletType.Coin98,"xyz.frontier.wallet":exports.WalletType.frontier,"com.brave.wallet":exports.WalletType.Brave,"com.trustwallet.app":exports.WalletType.trust,"so.onekey.wallet":exports.WalletType.OneKey,"com.bybit":exports.WalletType.Bybit};function zt(e){const{info:t,provider:n}=e;return{type:exports.WalletType.EIP6963Prefix+t.rdns,showName:t.name,logo:t.icon,supportMobile:!0,supportExtension:!0,switchChain:e=>M(Object.assign(Object.assign({},e),{provider:n})),injected:()=>!0,disabled:()=>!1,connector:(e,t)=>_(n,t),isEip6963:!0}}const $t={cacheKey:"DODO-WALLET-CACHED-PROVIDER"};let Ht,qt,Vt;const Wt=[exports.ChainId.OPTIMISM,exports.ChainId.POLYGON,exports.ChainId.ARBITRUM_ONE,exports.ChainId.LINEA,exports.ChainId.BASE,exports.ChainId.SCROLL_ALPHA_TESTNET];const Zt=80001,Kt=2025,Jt=9527,Yt=534354,Xt=421613,Qt=42161,en=43113,tn=43114,nn=2206132,rn=210425,an=[1,5,137,Zt,56,97,Kt,Jt,Yt,Xt,Qt,en,tn,322,321,65,66,nn];function sn(e){e=atob(e);const t=[];for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));return r.arrayify(t)}function on(e){e=r.arrayify(e);let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}let cn=!1,ln=!1;const un={debug:1,default:2,info:2,warning:3,error:4,off:5};let dn=un.default,pn=null;const hn=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 mn;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(mn||(mn={})),exports.ErrorCode=void 0,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"}(exports.ErrorCode||(exports.ErrorCode={}));const fn="0123456789abcdef";class yn{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==un[n]&&this.throwArgumentError("invalid log level name","logLevel",e),dn>un[n]||console.log.apply(console,t)}debug(...e){this._log(yn.levels.DEBUG,e)}info(...e){this._log(yn.levels.INFO,e)}warn(...e){this._log(yn.levels.WARNING,e)}makeError(e,t,n){if(ln)return this.makeError("censored error",t,{});t||(t=yn.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+=fn[t[e]>>4],n+=fn[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 exports.ErrorCode.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 exports.ErrorCode.CALL_EXCEPTION:case exports.ErrorCode.INSUFFICIENT_FUNDS:case exports.ErrorCode.MISSING_NEW:case exports.ErrorCode.NONCE_EXPIRED:case exports.ErrorCode.REPLACEMENT_UNDERPRICED:case exports.ErrorCode.TRANSACTION_REPLACED:case exports.ErrorCode.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,yn.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){hn&&this.throwError("platform missing String.prototype.normalize",yn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:hn})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,yn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,yn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,yn.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,yn.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",yn.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",yn.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",yn.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return pn||(pn=new yn("logger/5.7.0")),pn}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",yn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),cn){if(!e)return;this.globalLogger().throwError("error censorship permanent",yn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ln=!!e,cn=!!t}static setLogLevel(e){const t=un[e.toLowerCase()];null!=t?dn=t:yn.globalLogger().warn("invalid log level - "+e)}static from(e){return new yn(e)}}yn.errors=exports.ErrorCode,yn.levels=mn;const bn=new yn("strings/5.7.0");var gn,vn;function wn(e,t,n,r,a){if(e===exports.Utf8ErrorReason.BAD_PREFIX||e===exports.Utf8ErrorReason.UNEXPECTED_CONTINUE){let e=0;for(let r=t+1;r<n.length&&n[r]>>6==2;r++)e++;return e}return e===exports.Utf8ErrorReason.OVERRUN?n.length-t-1:0}exports.UnicodeNormalizationForm=void 0,(gn=exports.UnicodeNormalizationForm||(exports.UnicodeNormalizationForm={})).current="",gn.NFC="NFC",gn.NFD="NFD",gn.NFKC="NFKC",gn.NFKD="NFKD",exports.Utf8ErrorReason=void 0,(vn=exports.Utf8ErrorReason||(exports.Utf8ErrorReason={})).UNEXPECTED_CONTINUE="unexpected continuation byte",vn.BAD_PREFIX="bad codepoint prefix",vn.OVERRUN="string overrun",vn.MISSING_CONTINUE="missing continuation byte",vn.OUT_OF_RANGE="out of UTF-8 range",vn.UTF16_SURROGATE="UTF-16 surrogate",vn.OVERLONG="overlong representation";const xn=Object.freeze({error:function(e,t,n,r,a){return bn.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:wn,replace:function(e,t,n,r,a){return e===exports.Utf8ErrorReason.OVERLONG?(r.push(a),0):(r.push(65533),wn(e,t,n))}});function En(e,t){null==t&&(t=xn.error),e=r.arrayify(e);const n=[];let a=0;for(;a<e.length;){const r=e[a++];if(r>>7==0){n.push(r);continue}let s=null,i=null;if(192==(224&r))s=1,i=127;else if(224==(240&r))s=2,i=2047;else{if(240!=(248&r)){a+=t(128==(192&r)?exports.Utf8ErrorReason.UNEXPECTED_CONTINUE:exports.Utf8ErrorReason.BAD_PREFIX,a-1,e,n);continue}s=3,i=65535}if(a-1+s>=e.length){a+=t(exports.Utf8ErrorReason.OVERRUN,a-1,e,n);continue}let o=r&(1<<8-s-1)-1;for(let r=0;r<s;r++){let r=e[a];if(128!=(192&r)){a+=t(exports.Utf8ErrorReason.MISSING_CONTINUE,a,e,n),o=null;break}o=o<<6|63&r,a++}null!==o&&(o>1114111?a+=t(exports.Utf8ErrorReason.OUT_OF_RANGE,a-1-s,e,n,o):o>=55296&&o<=57343?a+=t(exports.Utf8ErrorReason.UTF16_SURROGATE,a-1-s,e,n,o):o<=i?a+=t(exports.Utf8ErrorReason.OVERLONG,a-1-s,e,n,o):n.push(o))}return n}function Cn(e,t=exports.UnicodeNormalizationForm.current){t!=exports.UnicodeNormalizationForm.current&&(bn.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 r.arrayify(n)}function kn(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Tn(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Pn(e,t){return Tn(En(e,t))}var An=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 On(e,t){return An(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 a=yield fetch(e,n),s=yield a.arrayBuffer(),i={};return a.headers.forEach?a.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):a.headers.keys().forEach((e=>{i[e.toLowerCase()]=a.headers.get(e)})),{headers:i,statusCode:a.status,statusMessage:a.statusText,body:r.arrayify(new Uint8Array(s))}}))}var Fn=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 Dn=new yn("web/5.7.1");function _n(e){return new Promise((t=>{setTimeout(t,e)}))}function Sn(e,t){if(null==e)return null;if("string"==typeof e)return e;if(r.isBytesLike(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Pn(e)}catch(e){}return r.hexlify(e)}return e}function In(e,t,n){const r="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Dn.assertArgument(r>0&&r%1==0,"invalid connection throttle limit","connection.throttleLimit",r);const s="object"==typeof e?e.throttleCallback:null,i="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Dn.assertArgument(i>0&&i%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);const o="object"==typeof e&&!!e.errorPassThrough,c={};let l=null;const u={method:"GET"};let d=!1,p=12e4;if("string"==typeof e)l=e;else if("object"==typeof e){if(null!=e&&null!=e.url||Dn.throwArgumentError("missing URL","connection.url",e),l=e.url,"number"==typeof e.timeout&&e.timeout>0&&(p=e.timeout),e.headers)for(const t in e.headers)c[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(d=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==l.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Dn.throwError("basic authentication requires a secure https url",yn.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;c.authorization={key:"Authorization",value:"Basic "+on(Cn(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=a.shallowCopy(e.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),m=l?l.match(h):null;if(m)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":m[1]||"text/plain"},body:m[2]?sn(m[3]):(f=m[3],Cn(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){Dn.throwError("processing response error",yn.errors.SERVER_ERROR,{body:Sn(m[1],m[2]),error:e,requestBody:null,requestMethod:"GET",url:l})}var f;t&&(u.method="POST",u.body=t,null==c["content-type"]&&(c["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==c["content-length"]&&(c["content-length"]={key:"Content-Length",value:String(t.length)}));const y={};Object.keys(c).forEach((e=>{const t=c[e];y[t.key]=t.value})),u.headers=y;const b=function(){let e=null;return{promise:new Promise((function(t,n){p&&(e=setTimeout((()=>{null!=e&&(e=null,n(Dn.makeError("timeout",yn.errors.TIMEOUT,{requestBody:Sn(u.body,y["content-type"]),requestMethod:u.method,timeout:p,url:l})))}),p))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),g=function(){return Fn(this,void 0,void 0,(function*(){for(let e=0;e<r;e++){let t=null;try{if(t=yield On(l,u),e<r)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===u.method&&e.match(/^https:/)){l=t.headers.location;continue}}else if(429===t.statusCode){let n=!0;if(s&&(n=yield s(e,l)),n){let n=0;const r=t.headers["retry-after"];n="string"==typeof r&&r.match(/^[1-9][0-9]*$/)?1e3*parseInt(r):i*parseInt(String(Math.random()*Math.pow(2,e))),yield _n(n);continue}}}catch(e){t=e.response,null==t&&(b.cancel(),Dn.throwError("missing response",yn.errors.SERVER_ERROR,{requestBody:Sn(u.body,y["content-type"]),requestMethod:u.method,serverError:e,url:l}))}let a=t.body;if(d&&304===t.statusCode?a=null:!o&&(t.statusCode<200||t.statusCode>=300)&&(b.cancel(),Dn.throwError("bad response",yn.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Sn(a,t.headers?t.headers["content-type"]:null),requestBody:Sn(u.body,y["content-type"]),requestMethod:u.method,url:l})),n)try{const e=yield n(a,t);return b.cancel(),e}catch(n){if(n.throttleRetry&&e<r){let t=!0;if(s&&(t=yield s(e,l)),t){const t=i*parseInt(String(Math.random()*Math.pow(2,e)));yield _n(t);continue}}b.cancel(),Dn.throwError("processing response error",yn.errors.SERVER_ERROR,{body:Sn(a,t.headers?t.headers["content-type"]:null),error:n,requestBody:Sn(u.body,y["content-type"]),requestMethod:u.method,url:l})}return b.cancel(),a}return Dn.throwError("failed response",yn.errors.SERVER_ERROR,{requestBody:Sn(u.body,y["content-type"]),requestMethod:u.method,url:l})}))}();return Promise.race([b.promise,g])}function Mn(e,t,n){let r=null;if(null!=t){r=Cn(t);const n="string"==typeof e?{url:e}:a.shallowCopy(e);if(n.headers){0!==Object.keys(n.headers).filter((e=>"content-type"===e.toLowerCase())).length||(n.headers=a.shallowCopy(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return In(e,r,((e,t)=>{let r=null;if(null!=e)try{r=JSON.parse(Pn(e))}catch(t){Dn.throwError("invalid JSON",yn.errors.SERVER_ERROR,{body:e,error:t})}return n&&(r=n(r,t)),r}))}function Nn(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 Bn extends e.StaticJsonRpcProvider{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){var n;const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:a.deepCopy(r),provider:this});const s=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(s&&this._cache[e])return this._cache[e];const i=Mn(Object.assign(Object.assign({},this.connection),{url:this.rpcUrl||(null===(n=this.connection)||void 0===n?void 0:n.url)}),JSON.stringify(r),Nn).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return s&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}}function Un(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const Rn=Un({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}),jn=e=>e;class Ln 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 Ln?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof Ln&&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 Gn(this,e)}}function Gn(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?Gn(e.cause,t):t?null:e}class zn extends Ln{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 $n extends Ln{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 Hn extends Ln{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 qn extends Ln{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 Vn(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function Wn(e){return Vn(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function Zn(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 Kn extends Ln{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 Jn extends Ln{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 Yn extends Ln{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 Xn(e,{dir:t,size:n=32}={}){return"string"==typeof e?Qn(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new Jn({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 Qn(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new Jn({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}const er=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function tr(e,t={}){return"number"==typeof e||"bigint"==typeof e?ar(e,t):"string"==typeof e?ir(e,t):"boolean"==typeof e?nr(e,t):rr(e,t)}function nr(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(hr(n,{size:t.size}),Xn(n,{size:t.size})):n}function rr(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=er[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(hr(r,{size:t.size}),Xn(r,{dir:"right",size:t.size})):r}function ar(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 zn({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?Xn(o,{size:r}):o}const sr=new TextEncoder;function ir(e,t={}){return rr(sr.encode(e),t)}const or=new TextEncoder;function cr(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=ar(e,t);return dr(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return hr(n,{size:t.size}),Xn(n,{size:t.size});return n}(e,t):Vn(e)?dr(e,t):pr(e,t)}const lr={zero:48,nine:57,A:65,F:70,a:97,f:102};function ur(e){return e>=lr.zero&&e<=lr.nine?e-lr.zero:e>=lr.A&&e<=lr.F?e-(lr.A-10):e>=lr.a&&e<=lr.f?e-(lr.a-10):void 0}function dr(e,t={}){let n=e;t.size&&(hr(n,{size:t.size}),n=Xn(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=ur(r.charCodeAt(t++)),a=ur(r.charCodeAt(t++));if(void 0===n||void 0===a)throw new Ln(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);s[e]=16*n+a}return s}function pr(e,t={}){const n=or.encode(e);return"number"==typeof t.size?(hr(n,{size:t.size}),Xn(n,{dir:"right",size:t.size})):n}function hr(e,{size:t}){if(Wn(e)>t)throw new qn({givenSize:Wn(e),maxSize:t})}function mr(e,t){const n="string"==typeof t?{to:t}:t,r=n.to;return"number"===r?yr(e,n):"bigint"===r?fr(e,n):"string"===r?function(e,t={}){let n=dr(e);t.size&&(hr(n,{size:t.size}),n=Zn(n,{dir:"right"}));return(new TextDecoder).decode(n)}(e,n):"boolean"===r?function(e,t={}){let n=e;t.size&&(hr(n,{size:t.size}),n=Zn(n));if("0x00"===Zn(n))return!1;if("0x01"===Zn(n))return!0;throw new Hn(n)}(e,n):dr(e,n)}function fr(e,t={}){const{signed:n}=t;t.size&&hr(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 yr(e,t={}){return Number(fr(e,t))}function br(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 gr={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function vr(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?yr(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?yr(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?gr[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 wr=br("transaction",vr);function xr(e){const t=e.transactions?.map((e=>"string"==typeof e?e:vr(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 Er=br("block",xr);function Cr(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 kr={"0x0":"reverted","0x1":"success"};function Tr(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=>Cr(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?yr(e.transactionIndex):null,status:e.status?kr[e.status]:null,type:e.type?gr[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const Pr=br("transactionReceipt",Tr),Ar={block:Er({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=vr(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?fr(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:wr({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?fr(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Pr({format:e=>({l1GasPrice:e.l1GasPrice?fr(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?fr(e.l1GasUsed):null,l1Fee:e.l1Fee?fr(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})};class Or extends Ln{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 Fr 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 Dr(e,t){const n=t||"hex",r=mt(Vn(e,{strict:!1})?cr(e):e);return"bytes"===n?r:tr(r)}function _r(e,t){const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=Dr(pr(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 Sr=/^0x[a-fA-F0-9]{40}$/,Ir=new Fr(8192);function Mr(e,{strict:t=!0}={}){if(Ir.has(e))return Ir.get(e);const n=!(!Sr.test(e)||e.toLowerCase()!==e&&t&&_r(e)!==e);return Ir.set(e,n),n}function Nr(e){return"string"==typeof e[0]?Br(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 Br(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}class Ur extends Error{constructor(e,t={}){const n=t.cause instanceof Ur?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof Ur&&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 Rr(e,t){const n=e.exec(t);return n?.groups}const jr=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Lr=/^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)?$/,Gr=/^\(.+?\).*?$/,zr=/^tuple(?<array>(\[(\d*)\])*)$/;function $r(e){let t=e.type;if(zr.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){t+=$r(e.components[r]),r<n-1&&(t+=", ")}const r=Rr(zr,e.type);return t+=`)${r?.array??""}`,$r({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Hr(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=$r(e[r]),r!==n-1&&(t+=", ")}return t}const qr=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Vr(e){return qr.test(e)}function Wr(e){return Rr(qr,e)}const Zr=new Set(["memory","indexed","storage","calldata"]),Kr=new Set(["calldata","memory","storage"]);class Jr extends Ur{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 Yr extends Ur{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 Xr extends Ur{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 Qr extends Ur{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class ea extends Ur{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 ta extends Ur{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 na extends Ur{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 ra extends Ur{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 aa extends Ur{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class sa extends Ur{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 ia extends Ur{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 oa extends Ur{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 ca=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}]]),la=/^(?<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$_]*))?$/,ua=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,da=/^u?int$/;function pa(e,t){const n=function(e,t){return t?`${t}:${e}`:e}(e,t?.type);if(ca.has(n))return ca.get(n);const r=Gr.test(e),a=Rr(r?ua:la,e);if(!a)throw new Qr({param:e});if(a.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||jr.test(e)||Lr.test(e)||fa.test(e)}(a.name))throw new ea({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=ha(a.type),t=[],n=e.length;for(let r=0;r<n;r++)t.push(pa(e[r],{structs:o}));l={components:t}}else if(a.type in o)c="tuple",l={components:o[a.type]};else if(da.test(a.type))c=`${a.type}256`;else if(c=a.type,"struct"!==t?.type&&!ma(c))throw new Yr({type:c});if(a.modifier){if(!t?.modifiers?.has?.(a.modifier))throw new ta({param:e,type:t?.type,modifier:a.modifier});if(Kr.has(a.modifier)&&!function(e,t){return t||"bytes"===e||"string"===e||"tuple"===e}(c,!!a.array))throw new na({param:e,type:t?.type,modifier:a.modifier})}const u={type:`${c}${a.array??""}`,...s,...i,...l};return ca.set(n,u),u}function ha(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?ha(i,[...t,n.trim()]):ha(i,t,`${n}${a}`,r);case"(":return ha(i,t,`${n}${a}`,r+1);case")":return ha(i,t,`${n}${a}`,r-1);default:return ha(i,t,`${n}${a}`,r)}}if(""===n)return t;if(0!==r)throw new oa({current:n,depth:r});return t.push(n.trim()),t}function ma(e){return"address"===e||"bool"===e||"function"===e||"string"===e||jr.test(e)||Lr.test(e)}const fa=/^(?: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 ya=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function ba(e,t,n=new Set){const r=[],a=e.length;for(let s=0;s<a;s++){const a=e[s];if(Gr.test(a.type))r.push(a);else{const e=Rr(ya,a.type);if(!e?.type)throw new ra({abiParameter:a});const{array:s,type:i}=e;if(i in t){if(n.has(i))throw new ia({type:i});r.push({...a,type:`tuple${s??""}`,components:ba(t[i]??[],t,new Set([...n,i]))})}else{if(!ma(i))throw new Jr({type:i});r.push(a)}}}return r}function ga(e){const t=[];if("string"==typeof e){const n=ha(e),r=n.length;for(let e=0;e<r;e++)t.push(pa(n[e],{modifiers:Zr}))}else{const n=function(e){const t={},n=e.length;for(let r=0;r<n;r++){const n=e[r];if(!Vr(n))continue;const a=Wr(n);if(!a)throw new aa({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=pa(t,{type:"struct"});i.push(n)}if(!i.length)throw new sa({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]=ba(s,t)}return r}(e),r=e.length;for(let a=0;a<r;a++){const r=e[a];if(Vr(r))continue;const s=ha(r),i=s.length;for(let e=0;e<i;e++)t.push(pa(s[e],{modifiers:Zr,structs:n}))}}if(0===t.length)throw new Xr({params:e});return t}function va(e,t,n){return r=>e[t.name||n]?.(r)??t(e,r)}function wa(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new za(e.type);return`${e.name}(${xa(e.inputs,{includeName:t})})`}function xa(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${xa(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}class Ea extends Ln{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 Ca extends Ln{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 ka extends Ln{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${xa(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 Ta extends Ln{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class Pa extends Ln{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 Aa extends Ln{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${Wn(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class Oa extends Ln{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 Fa extends Ln{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 Da extends Ln{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 _a extends Ln{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 Sa extends Ln{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 Ia extends Ln{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 Ma extends Ln{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 Na extends Ln{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${wa(e.abiItem)}\`, and`,`\`${t.type}\` in \`${wa(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 Ba extends Ln{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 Ua extends Ln{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: (${xa(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 Ra extends Ln{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${wa(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 ja extends Ln{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 La extends Ln{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 Ga extends Ln{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 za extends Ln{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 $a extends Ln{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const Ha=e=>Dr(cr(e));const qa=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 Ln("Unable to normalize signature.");return a}("string"==typeof e?e:"function"===(t=e).type?`function ${t.name}(${Hr(t.inputs)})${t.stateMutability&&"nonpayable"!==t.stateMutability?` ${t.stateMutability}`:""}${t.outputs.length?` returns (${Hr(t.outputs)})`:""}`:"event"===t.type?`event ${t.name}(${Hr(t.inputs)})`:"error"===t.type?`error ${t.name}(${Hr(t.inputs)})`:"constructor"===t.type?`constructor(${Hr(t.inputs)})${"payable"===t.stateMutability?" payable":""}`:"fallback"===t.type?"fallback()":"receive() external payable")};function Va(e){return t=qa(e),Ha(t);var t}const Wa=Va;function Za(e,t,n,{strict:r}={}){return Vn(e,{strict:!1})?function(e,t,n,{strict:r}={}){Ka(e,t);const a=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&Ja(a,t,n);return a}(e,t,n,{strict:r}):Ya(e,t,n,{strict:r})}function Ka(e,t){if("number"==typeof t&&t>0&&t>Wn(e)-1)throw new Kn({offset:t,position:"start",size:Wn(e)})}function Ja(e,t,n){if("number"==typeof t&&"number"==typeof n&&Wn(e)!==n-t)throw new Kn({offset:n,position:"end",size:Wn(e)})}function Ya(e,t,n,{strict:r}={}){Ka(e,t);const a=e.slice(t,n);return r&&Ja(a,t,n),a}function Xa(e,t){if(e.length!==t.length)throw new Oa({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(Qa({param:e[r],value:t[r]}));return n}({params:e,values:t}),r=es(n);return 0===r.length?"0x":r}function Qa({param:e,value:t}){const n=ts(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 Ga(e);if(!r&&e.length!==t)throw new Pa({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let a=!1;const s=[];for(let t=0;t<e.length;t++){const r=Qa({param:n,value:e[t]});r.dynamic&&(a=!0),s.push(r)}if(r||a){const e=es(s);if(r){const t=ar(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?Nr([t,e]):t}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:Nr(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=Qa({param:s,value:e[Array.isArray(e)?a:s.name]});r.push(i),i.dynamic&&(n=!0)}return{dynamic:n,encoded:n?es(r):Nr(r.map((({encoded:e})=>e)))}}(t,{param:e});if("address"===e.type)return function(e){if(!Mr(e))throw new Or({address:e});return{dynamic:!1,encoded:Qn(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){return{dynamic:!1,encoded:Qn(nr(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:ar(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=Wn(e);if(!n){let t=e;return r%32!=0&&(t=Qn(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:Nr([Qn(ar(r,{size:32})),t])}}if(r!==parseInt(n))throw new Aa({expectedSize:parseInt(n),value:e});return{dynamic:!1,encoded:Qn(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=ir(e),n=Math.ceil(Wn(t)/32),r=[];for(let e=0;e<n;e++)r.push(Qn(Za(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:Nr([Qn(ar(Wn(t),{size:32})),...r])}}(t);throw new ja(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function es(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:r,encoded:a}=e[n];t+=r?32:Wn(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(ar(t+a,{size:32})),r.push(o),a+=Wn(o)):n.push(o)}return Nr([...n,...r])}function ts(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const ns=e=>Za(Va(e),0,4);function rs(e){const{abi:t,args:n=[],name:r}=e,a=Vn(r,{strict:!1}),s=t.filter((e=>a?"function"===e.type?ns(e)===r:"event"===e.type&&Wa(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&&as(t,r)}));if(t){if(i&&"inputs"in i&&i.inputs){const t=ss(e.inputs,i.inputs,n);if(t)throw new Na({abiItem:e,type:t[0]},{abiItem:i,type:t[1]})}i=e}}return i||s[0]}function as(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Mr(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)=>as(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=>as(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function ss(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 ss(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")))&&Mr(n[r],{strict:!1}))return i}}const is="/docs/contract/encodeEventTopics";function os(e){const{abi:t,eventName:n,args:r}=e;let a=t[0];if(n){const e=rs({abi:t,name:n});if(!e)throw new Sa(n,{docsPath:is});a=e}if("event"!==a.type)throw new Sa(void 0,{docsPath:is});const s=wa(a),i=Wa(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)=>cs({param:e,value:t[n][a]}))):t[n]?cs({param:e,value:t[n]}):null))??[])}return[i,...o]}function cs({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return Dr(cr(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new $a(e.type);return Xa([e],[t])}function ls(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 us(e,t){const{address:n,abi:r,args:a,eventName:s,fromBlock:i,strict:o,toBlock:c}=t,l=ls(e,{method:"eth_newFilter"}),u=s?os({abi:r,args:a,eventName:s}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:"bigint"==typeof i?ar(i):i,toBlock:"bigint"==typeof c?ar(c):c,topics:u}]});return{abi:r,args:a,eventName:s,id:d,request:l(d),strict:Boolean(o),type:"event"}}function ds(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const ps="/docs/contract/encodeFunctionData";function hs(e){const{abi:t,args:n,functionName:r}=e;let a=t[0];if(r){const e=rs({abi:t,args:n,name:r});if(!e)throw new Ia(r,{docsPath:ps});a=e}if("function"!==a.type)throw new Ia(void 0,{docsPath:ps});const s=wa(a);return Br([ns(s),("inputs"in a&&a.inputs?Xa(a.inputs,n??[]):void 0)??"0x"])}const ms={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."},fs={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},ys={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class bs extends Ln{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class gs extends Ln{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 vs extends Ln{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 ws={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 vs({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new gs({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new bs({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 bs({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 xs(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(ws);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Es(e,t={}){void 0!==t.size&&hr(e,{size:t.size});return fr(rr(e,t),t)}function Cs(e,t={}){let n=e;if(void 0!==t.size&&(hr(n,{size:t.size}),n=Zn(n)),n.length>1||n[0]>1)throw new $n(n);return Boolean(n[0])}function ks(e,t={}){void 0!==t.size&&hr(e,{size:t.size});return yr(rr(e,t),t)}function Ts(e,t){const n="string"==typeof t?dr(t):t,r=xs(n);if(0===Wn(n)&&e.length>0)throw new Ta;if(Wn(t)&&Wn(t)<32)throw new ka({data:"string"==typeof t?t:rr(t),params:e,size:Wn(t)});let a=0;const s=[];for(let t=0;t<e.length;++t){const n=e[t];r.setPosition(a);const[i,o]=Ps(r,n,{staticPosition:0});a+=o,s.push(i)}return s}function Ps(e,t,{staticPosition:n}){const r=ts(t.type);if(r){const[a,s]=r;return function(e,t,{length:n,staticPosition:r}){if(!n){const n=r+ks(e.readBytes(Os)),a=n+As;e.setPosition(n);const s=ks(e.readBytes(As)),i=Fs(t);let o=0;const c=[];for(let n=0;n<s;++n){e.setPosition(a+(i?32*n:o));const[r,s]=Ps(e,t,{staticPosition:a});o+=s,c.push(r)}return e.setPosition(r+32),[c,32]}if(Fs(t)){const a=r+ks(e.readBytes(Os)),s=[];for(let r=0;r<n;++r){e.setPosition(a+32*r);const[n]=Ps(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]=Ps(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(Fs(t)){const i=n+ks(e.readBytes(Os));for(let n=0;n<t.components.length;++n){const o=t.components[n];e.setPosition(i+s);const[c,l]=Ps(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]=Ps(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[_r(rr(Ya(t,-20))),32]}(e);if("bool"===t.type)return function(e){return[Cs(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=ks(e.readBytes(32));e.setPosition(n+t);const r=ks(e.readBytes(32));if(0===r)return e.setPosition(n+32),["0x",32];const a=e.readBytes(r);return e.setPosition(n+32),[rr(a),32]}const s=rr(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?Es(a,{signed:n}):ks(a,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=ks(e.readBytes(32)),r=t+n;e.setPosition(r);const a=ks(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&&(hr(n,{size:t.size}),n=Zn(n,{dir:"right"})),(new TextDecoder).decode(n)}(Zn(s));return e.setPosition(t+32),[i,32]}(e,{staticPosition:n});throw new La(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const As=32,Os=32;function Fs(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(Fs);const n=ts(e.type);return!(!n||!Fs({...e,type:n[1]}))}function Ds(e){const{abi:t,data:n}=e,r=Za(n,0,4);if("0x"===r)throw new Ta;const a=[...t||[],fs,ys].find((e=>"error"===e.type&&r===ns(wa(e))));if(!a)throw new Fa(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?Ts(a.inputs,Za(n,4)):void 0,errorName:a.name}}const _s=(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 Ss({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]?_s(t[n]):t[n]}`)).join(", ")})`}const Is={gwei:9,wei:18},Ms={ether:-9,wei:9};function Ns(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 Bs(e,t="wei"){return Ns(e,Is[t])}function Us(e,t="wei"){return Ns(e,Ms[t])}class Rs extends Ln{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 js extends Ln{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function Ls(e){return e.reduce(((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`),"")}function Gs(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 zs extends Ln{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 $s extends Ln{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 Hs extends Ln{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Gs(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 qs extends Ln{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 Vs extends Ln{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=Gs({chain:r&&`${r?.name} (id: ${r?.id})`,from:t?.address,to:u,value:void 0!==d&&`${Bs(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${Us(i)} gwei`,maxFeePerGas:void 0!==o&&`${Us(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Us(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 Ws extends Ln{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 Zs extends Ln{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 Ks extends Ln{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 Js extends Ln{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?ds(t):void 0;let m=Gs({from:h?.address,to:u,value:void 0!==d&&`${Bs(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${Us(i)} gwei`,maxFeePerGas:void 0!==o&&`${Us(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Us(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+=Ls(n.state)),n.stateDiff&&(r+=" stateDiff:\n",r+=Ls(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 Ys extends Ln{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:a,functionName:s,sender:i}){const o=rs({abi:t,args:n,name:s}),c=o?Ss({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=Gs({address:r&&r,function:o?wa(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 Xs extends Ln{constructor({abi:e,data:t,functionName:n,message:r}){let a,s,i,o,c;if(t&&"0x"!==t)try{s=Ds({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=ms[e]}else{const e=n?wa(n,{includeName:!0}):void 0,t=n&&a?Ss({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 Fa&&(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 Qs extends Ln{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 ei extends Ln{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 ti extends Ln{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: ${_s(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 ni extends Ln{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${_s(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 ri extends Ln{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${t}`,`Request body: ${_s(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}class ai extends Ln{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 ni?e.code:t??-1}}class si extends ai{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 ii extends ai{constructor(e){super(e,{code:ii.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(ii,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class oi extends ai{constructor(e){super(e,{code:oi.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(oi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class ci extends ai{constructor(e){super(e,{code:ci.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(ci,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class li extends ai{constructor(e){super(e,{code:li.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(li,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class ui extends ai{constructor(e){super(e,{code:ui.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(ui,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class di extends ai{constructor(e){super(e,{code:di.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(di,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class pi extends ai{constructor(e){super(e,{code:pi.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(pi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class hi extends ai{constructor(e){super(e,{code:hi.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(hi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class mi extends ai{constructor(e){super(e,{code:mi.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(mi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class fi extends ai{constructor(e){super(e,{code:fi.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(fi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class yi extends ai{constructor(e){super(e,{code:yi.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(yi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class bi extends ai{constructor(e){super(e,{code:bi.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(bi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class gi extends si{constructor(e){super(e,{code:gi.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(gi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class vi extends si{constructor(e){super(e,{code:vi.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(vi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class wi extends si{constructor(e){super(e,{code:wi.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(wi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class xi extends si{constructor(e){super(e,{code:xi.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(xi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Ei extends si{constructor(e){super(e,{code:Ei.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(Ei,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Ci extends si{constructor(e){super(e,{code:Ci.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(Ci,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class ki extends ai{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const Ti=3;function Pi(e,{abi:t,address:n,args:r,docsPath:a,functionName:s,sender:i}){const{code:o,data:c,message:l,shortMessage:u}=e instanceof ei?e:e instanceof Ln?e.walk((e=>"data"in e))||e.walk():{},d=e instanceof Ta?new Qs({functionName:s}):[Ti,ui.code].includes(o)&&(c||l||u)?new Xs({abi:t,data:"object"==typeof c?c.data:c,functionName:s,message:u??l}):e;return new Ys(d,{abi:t,args:r,contractAddress:n,docsPath:a,functionName:s,sender:i})}class Ai extends Ln{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=Gs({from:t?.address,to:u,value:void 0!==d&&`${Bs(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${Us(i)} gwei`,maxFeePerGas:void 0!==o&&`${Us(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${Us(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 Oi extends Ln{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(Oi,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(Oi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Fi extends Ln{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Us(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(Fi,"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 Di extends Ln{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Us(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(Di,"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 _i extends Ln{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(_i,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Si extends Ln{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(Si,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Ii extends Ln{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(Ii,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Mi extends Ln{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(Mi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class Ni extends Ln{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(Ni,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Bi extends Ln{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(Bi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Ui extends Ln{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(Ui,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Ri extends Ln{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${Us(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Us(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(Ri,"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 ji extends Ln{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 Li(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof Ln?e.walk((e=>e.code===Oi.code)):e;return r instanceof Ln?new Oi({cause:e,message:r.details}):Oi.nodeMessage.test(n)?new Oi({cause:e,message:e.details}):Fi.nodeMessage.test(n)?new Fi({cause:e,maxFeePerGas:t?.maxFeePerGas}):Di.nodeMessage.test(n)?new Di({cause:e,maxFeePerGas:t?.maxFeePerGas}):_i.nodeMessage.test(n)?new _i({cause:e,nonce:t?.nonce}):Si.nodeMessage.test(n)?new Si({cause:e,nonce:t?.nonce}):Ii.nodeMessage.test(n)?new Ii({cause:e,nonce:t?.nonce}):Mi.nodeMessage.test(n)?new Mi({cause:e}):Ni.nodeMessage.test(n)?new Ni({cause:e,gas:t?.gas}):Bi.nodeMessage.test(n)?new Bi({cause:e,gas:t?.gas}):Ui.nodeMessage.test(n)?new Ui({cause:e}):Ri.nodeMessage.test(n)?new Ri({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new ji({cause:e})}function Gi(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 zi={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function $i(e){const t={...e};return void 0!==e.blobs&&"string"!=typeof e.blobs[0]&&(t.blobs=e.blobs.map((e=>rr(e)))),void 0!==e.gas&&(t.gas=ar(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=ar(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=ar(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=ar(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=ar(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=ar(e.nonce)),void 0!==e.type&&(t.type=zi[e.type]),void 0!==e.value&&(t.value=ar(e.value)),t}const Hi=br("transactionRequest",$i);function qi(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:a,to:s}=e,i=t?ds(t):void 0;if(i&&!Mr(i.address))throw new Or({address:i.address});if(s&&!Mr(s))throw new Or({address:s});if(void 0!==n&&(void 0!==r||void 0!==a))throw new zs;if(r&&r>2n**256n-1n)throw new Fi({maxFeePerGas:r});if(a&&r&&a>r)throw new Ri({maxFeePerGas:r,maxPriorityFeePerGas:a})}class Vi extends Ln{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class Wi extends Ln{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class Zi extends Ln{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Us(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class Ki extends Ln{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 Ji(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:a}={}){const s=r??"latest",i=a??!1,o=void 0!==n?ar(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 Ki({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||xr)(c)}async function Yi(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Xi(e,t){const{block:n,chain:r=e.chain,request:a}=t||{};if("function"==typeof r?.fees?.defaultPriorityFee){const t=n||await va(e,Ji,"getBlock")({});return r.fees.defaultPriorityFee({block:t,client:e,request:a})}if(void 0!==r?.fees?.defaultPriorityFee)return r?.fees?.defaultPriorityFee;try{return fr(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):va(e,Ji,"getBlock")({}),va(e,Yi,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new Wi;const a=r-t.baseFeePerGas;return a<0n?0n:a}}async function Qi(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 Vi;const o=10**(i.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(i*o))/BigInt(o),l=n||await va(e,Ji,"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 Wi;const t="bigint"==typeof a?.maxPriorityFeePerGas?a.maxPriorityFeePerGas:await Xi(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 va(e,Yi,"getGasPrice")({}))}}async function eo(e,{address:t,blockTag:n="latest",blockNumber:r}){return yr(await e.request({method:"eth_getTransactionCount",params:[t,r?ar(r):n]}))}class to extends Ln{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 no(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 Hs({transaction:e})}async function ro(e){return yr(await e.request({method:"eth_chainId"}))}async function ao(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?ds(n):void 0,u=await va(e,Ji,"getBlock")({blockTag:"latest"}),d={...t,...l?{from:l?.address}:{}};if(o.includes("chainId")&&(d.chainId=r?r.id:void 0!==a?a:await va(e,ro,"getChainId")({})),o.includes("nonce")&&void 0===i&&l&&(d.nonce=await va(e,eo,"getTransactionCount")({address:l.address,blockTag:"pending"})),(o.includes("fees")||o.includes("type"))&&void 0===c)try{d.type=no(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 Qi(e,{block:u,chain:r,request:d});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas<a)throw new Zi({maxPriorityFeePerGas:a});d.maxPriorityFeePerGas=a,d.maxFeePerGas=n}else{if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)throw new Wi;const{gasPrice:n}=await Qi(e,{block:u,chain:r,request:d,type:"legacy"});d.gasPrice=n}return o.includes("gas")&&void 0===s&&(d.gas=await va(e,so,"estimateGas")({...d,account:l?{address:l.address,type:"json-rpc"}:void 0})),qi(d),delete d.parameters,d}async function so(e,t){const n=t.account??e.account,r=n?ds(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 ao(e,t):t,b=(s?ar(s):void 0)||i;qi(t);const g=e.chain?.formatters?.transactionRequest?.format,v=(g||$i)({...Gi(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}),w=await e.request({method:"eth_estimateGas",params:b?[v,b]:[v]});return BigInt(w)}catch(n){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=Li(e,n);return t instanceof ji?e:t})();return new Ai(r,{docsPath:t,...n})}(n,{...t,account:r,chain:e.chain})}}async function io(e,t){const{abi:n,address:r,args:a,functionName:s,...i}=t,o=hs({abi:n,args:a,functionName:s});try{return await va(e,so,"estimateGas")({data:o,to:r,...i})}catch(e){const t=i.account?ds(i.account):void 0;throw Pi(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:t?.address})}}const oo="/docs/contract/decodeEventLog";function co(e){const{abi:t,data:n,strict:r,topics:a}=e,s=r??!0,[i,...o]=a;if(!i)throw new Da({docsPath:oo});const c=t.find((e=>"event"===e.type&&i===Wa(wa(e))));if(!c||!("name"in c)||"event"!==c.type)throw new _a(i,{docsPath:oo});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 Ra({abiItem:c,param:t});p[t.name||e]=lo({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=Ts(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 ka||e instanceof gs)throw new Ua({abiItem:c,data:n,params:m,size:Wn(n)});throw e}}else if(s)throw new Ua({abiItem:c,data:"0x",params:m,size:0});return{eventName:l,args:Object.values(p).length>0?p:void 0}}function lo({param:e,value:t}){if("string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))return t;return(Ts([e],t)||[])[0]}function uo({abi:e,eventName:t,logs:n,strict:r=!0}){return n.map((n=>{try{const a=co({...n,abi:e,strict:r});return t&&!t.includes(a.eventName)?null:{...a,...n}}catch(e){let t,a;if(e instanceof _a)return null;if(e instanceof Ua||e instanceof Ra){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 po(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=>os({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?ar(r):r,toBlock:"bigint"==typeof a?ar(a):a}]});const h=d.map((e=>Cr(e)));return u?uo({abi:u,logs:h,strict:l}):h}async function ho(e,t){const{abi:n,address:r,args:a,blockHash:s,eventName:i,fromBlock:o,toBlock:c,strict:l}=t,u=i?rs({abi:n,name:i}):void 0,d=u?void 0:n.filter((e=>"event"===e.type));return va(e,po,"getLogs")({address:r,args:a,blockHash:s,event:u,events:d,fromBlock:o,toBlock:c,strict:l})}const mo="/docs/contract/decodeFunctionResult";function fo(e){const{abi:t,args:n,functionName:r,data:a}=e;let s=t[0];if(r){const e=rs({abi:t,args:n,name:r});if(!e)throw new Ia(r,{docsPath:mo});s=e}if("function"!==s.type)throw new Ia(void 0,{docsPath:mo});if(!s.outputs)throw new Ma(s.name,{docsPath:mo});const i=Ts(s.outputs,a);return i&&i.length>1?i:i&&1===i.length?i[0]:void 0}const yo=[{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"}],bo=[{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"}],go=[...bo,{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"}]}],vo=[...bo,{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"}]}],wo=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],xo=[{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"}]}],Eo=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],Co="0x82ad56cb";class ko extends Ln{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 To extends Ln{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 Po extends Ln{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 Ao extends Ln{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class Oo extends Ln{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 Fo({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new ko({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new ko({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const Do=new Map;function _o({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=()=>Do.delete(t),o=()=>Do.get(t)||[],c=e=>Do.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 So(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,v=n?ds(n):void 0;try{qi(t);const n=(a?ar(a):void 0)||s,w=function(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!Mr(n,{strict:!1}))throw new Or({address:n});if(t[n])throw new Rs({address:n});t[n]=Mo(r)}return t}(b),x=e.chain?.formatters?.transactionRequest?.format,E=(x||$i)({...Gi(g,{format:x}),from:v?.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(Co)&&(!!n&&!(Object.values(r).filter((e=>void 0!==e)).length>0)))}({request:E})&&!w)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 Ao;l=Fo({blockNumber:a,chain:e.chain,contract:"multicall3"})}const u=a?ar(a):void 0,d=u||s,{schedule:p}=_o({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=hs({abi:yo,args:[n],functionName:"aggregate3"}),a=await e.request({method:"eth_call",params:[{data:r,to:l},d]});return fo({abi:yo,args:[n],functionName:"aggregate3",data:a||"0x"})}}),[{returnData:h,success:m}]=await p({data:i,to:c});if(!m)throw new ei({data:h});return"0x"===h?{data:void 0}:{data:h}}(e,{...E,blockNumber:a,blockTag:s})}catch(e){if(!(e instanceof Ao||e instanceof ko))throw e}const C=await e.request({method:"eth_call",params:w?[E,n,w]:[E,n]});return"0x"===C?{data:void 0}:{data:C}}catch(n){const r=function(e){if(!(e instanceof Ln))return;const t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(n),{offchainLookup:a,offchainLookupSignature:s}=await Promise.resolve().then((function(){return require("./ccip-d888ed7d.cjs")}));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=Li(e,n);return t instanceof ji?e:t})();return new Js(r,{docsPath:t,...n})}(n,{...t,account:v,chain:e.chain})}}function Io(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new Yn({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new Yn({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function Mo(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=ar(t,{size:32})),void 0!==n&&(i.nonce=ar(n,{size:8})),void 0!==r&&(i.state=Io(r)),void 0!==a){if(i.state)throw new js;i.stateDiff=Io(a)}return i}async function No(e,t){const{abi:n,address:r,args:a,functionName:s,...i}=t,o=hs({abi:n,args:a,functionName:s});try{const{data:t}=await va(e,So,"call")({...i,data:o,to:r});return fo({abi:n,args:a,functionName:s,data:t||"0x"})}catch(e){throw Pi(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/readContract",functionName:s})}}async function Bo(e,t){const{abi:n,address:r,args:a,dataSuffix:s,functionName:i,...o}=t,c=o.account?ds(o.account):e.account,l=hs({abi:n,args:a,functionName:i});try{const{data:u}=await va(e,So,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:r,...o,account:c}),d=fo({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 Pi(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/simulateContract",functionName:i,sender:c?.address})}}const Uo=new Map,Ro=new Map;let jo=0;function Lo(e,t,n){const r=++jo,a=()=>Uo.get(e)||[],s=()=>{const t=Ro.get(e);1===a().length&&t&&t(),(()=>{const t=a();Uo.set(e,t.filter((e=>e.id!==r)))})()},i=a();if(Uo.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&&Ro.set(e,c),s}async function Go(e){return new Promise((t=>setTimeout(t,e)))}function zo(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 Go(o);const c=async()=>{a&&(await e({unpoll:s}),await Go(r),c())};c()})(),s}const $o=new Map,Ho=new Map;async function qo(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,$o),r=t(e,Ho);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 Vo=e=>`blockNumber.${e}`;async function Wo(e,{cacheTime:t=e.cacheTime}={}){const n=await qo((()=>e.request({method:"eth_blockNumber"})),{cacheKey:Vo(e.uid),cacheTime:t});return BigInt(n)}async function Zo(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=>Cr(e)));return"abi"in t&&t.abi?uo({abi:t.abi,logs:a,strict:n}):a}async function Ko(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function Jo(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=_s(["watchContractEvent",r,a,s,e.uid,i,u]),l=d??!1;return Lo(t,{onLogs:c,onError:o},(t=>{let o,c,d=!1;const p=zo((async()=>{if(d)try{let u;if(c)u=await va(e,Zo,"getFilterChanges")({filter:c});else{const t=await va(e,Wo,"getBlockNumber")({});u=o&&o!==t?await va(e,ho,"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 di&&(d=!1),t.onError?.(e)}else{try{c=await va(e,us,"createContractEventFilter")({abi:n,address:r,args:a,eventName:i,strict:l})}catch{}d=!0}}),{emitOnBegin:!0,interval:u});return async()=>{c&&await va(e,Ko,"uninstallFilter")({filter:c}),p()}}))})():(()=>{let t=!0,s=()=>t=!1;return(async()=>{try{const l=i?os({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}=co({abi:n,data:r.data,topics:r.topics,strict:d}),a=Cr(r,{args:t,eventName:e});c([a])}catch(e){let t,n;if(e instanceof Ua||e instanceof Ra){if(d)return;t=e.abiItem.name,n=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const a=Cr(r,{args:n?[]:{},eventName:t});c([a])}},onError(e){o?.(e)}});s=u,t||s()}catch(e){o?.(e)}})(),s})()}async function Yo(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}async function Xo(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 to({docsPath:"/docs/actions/wallet/sendTransaction"});const y=ds(n);try{let n;if(qi(t),null!==r&&(n=await va(e,ro,"getChainId")({}),function({chain:e,currentChainId:t}){if(!e)throw new Po;if(t!==e.id)throw new To({chain:e,currentChainId:t})}({currentChainId:n,chain:r})),"local"===y.type){const t=await va(e,ao,"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 va(e,Yo,"sendRawTransaction")({serializedTransaction:g})}const b=e.chain?.formatters?.transactionRequest?.format,g=(b||$i)({...Gi(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=Li(e,n);return t instanceof ji?e:t})();return new Vs(r,{docsPath:t,...n})}(e,{...t,account:y,chain:t.chain||void 0})}}async function Qo(e,t){const{abi:n,address:r,args:a,dataSuffix:s,functionName:i,...o}=t,c=hs({abi:n,args:a,functionName:i});return va(e,Xo,"sendTransaction")({data:`${c}${s?s.replace("0x",""):""}`,to:r,...o})}function ec({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}=tc(n);return va(a,No,"readContract")({abi:e,address:t,functionName:r,args:s,...i})}})),u&&(c.simulate=new Proxy({},{get:(n,r)=>(...n)=>{const{args:s,options:i}=tc(n);return va(a,Bo,"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}=nc(n,s);return va(a,us,"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}=nc(n,s);return va(a,ho,"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}=nc(n,s);return va(a,Jo,"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}=tc(n);return va(s,Qo,"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}=tc(n);return va(a??s,io,"estimateContractGas")({abi:e,address:t,functionName:r,args:i,...o,account:o.account??s.account})}})),c.address=t,c.abi=e,c}function tc(e){const t=e.length&&Array.isArray(e[0]);return{args:t?e[0]:[],options:(t?e[1]:e[0])??{}}}function nc(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 rc=256;let ac,sc=rc;function ic(e=11){if(!ac||sc+e>2*rc){ac="",sc=0;for(let e=0;e<rc;e++)ac+=(256+256*Math.random()|0).toString(16).substring(1)}return ac.substring(sc,sc+++e)}function oc(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?ds(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:ic()};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 cc(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 Go(n),i({count:o+1})})({error:e});s(e)}};i()}))}function lc(e,t={}){return async(n,r={})=>{const{retryDelay:a=150,retryCount:s=3}={...t,...r};return cc((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case ii.code:throw new ii(t);case oi.code:throw new oi(t);case ci.code:throw new ci(t);case li.code:throw new li(t);case ui.code:throw new ui(t);case di.code:throw new di(t);case pi.code:throw new pi(t);case hi.code:throw new hi(t);case mi.code:throw new mi(t);case fi.code:throw new fi(t);case yi.code:throw new yi(t);case bi.code:throw new bi(t);case gi.code:throw new gi(t);case vi.code:throw new vi(t);case wi.code:throw new wi(t);case xi.code:throw new xi(t);case Ei.code:throw new Ei(t);case Ci.code:throw new Ci(t);case 5e3:throw new gi(t);default:if(e instanceof Ln)throw e;throw new ki(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof ti){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===yi.code||e.code===ui.code);if(e instanceof ti&&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 uc({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:lc(n,{retryCount:r,retryDelay:a}),value:o}}function dc(e,t={}){const{key:n="custom",name:r="Custom Provider",retryDelay:a}=t;return({retryCount:s})=>uc({key:n,name:r,request:e.request.bind(e),retryCount:t.retryCount??s,retryDelay:a,type:"custom"})}class pc extends Ln{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function hc(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const mc=hc();function fc(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)?_s(r.map((e=>({jsonrpc:"2.0",id:e.id??mc.take(),...e})))):_s({jsonrpc:"2.0",id:r.id??mc.take(),...r}),headers:{...o,"Content-Type":"application/json"},method:c||"POST",signal:l||(i>0?t:void 0)})),{errorInstance:new ri({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 ti({body:r,details:_s(n.error)||t.statusText,headers:t.headers,status:t.status,url:e});return n}catch(t){if(t instanceof ti)throw t;if(t instanceof ri)throw t;throw new ti({body:r,details:t.message,url:e})}}}}function yc(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 pc;const y=fc(f,{fetchOptions:r,onResponse:i,timeout:m});return uc({key:a,name:s,async request({method:t,params:r}){const a={method:t,params:r},{schedule:s}=_o({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 ni({body:a,error:i,url:f});return o},retryCount:h,retryDelay:o,timeout:m,type:"http"},{fetchOptions:r,url:f})}}function bc(e,t){if(!(e instanceof Ln))return!1;const n=e.walk((e=>e instanceof Xs));return n instanceof Xs&&("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===ms[50]))))))}function gc(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 Vn(t)?t:null}function vc(e){let t=new Uint8Array(32).fill(0);if(!e)return rr(t);const n=e.split(".");for(let e=n.length-1;e>=0;e-=1){const r=gc(n[e]),a=r?cr(r):Dr(pr(n[e]),"bytes");t=Dr(Nr([t,a]),"bytes")}return rr(t)}function wc(e){return`[${e.slice(2)}]`}function xc(e){const t=new Uint8Array(32).fill(0);return e?gc(e)||Dr(pr(e)):rr(t)}function Ec(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array(pr(t).byteLength+2);let r=0;const a=t.split(".");for(let e=0;e<a.length;e++){let t=pr(a[e]);t.byteLength>255&&(t=pr(wc(xc(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 Cc extends Ln{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 kc extends Ln{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class Tc extends Ln{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 Pc extends Ln{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 Ac=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Oc=/^(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>\/.*)?$/,Fc=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Dc=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function _c(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Sc({uri:e,gatewayUrls:t}){const n=Fc.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=_c(t?.ipfs,"https://ipfs.io"),a=_c(t?.arweave,"https://arweave.net"),s=e.match(Ac),{protocol:i,subpath:o,target:c,subtarget:l=""}=s?.groups||{},u="ipns:/"===i||"ipns/"===o,d="ipfs:/"===i||"ipfs/"===o||Oc.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(Dc,"");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 Tc({uri:e})}function Ic(e){if("object"!=typeof e||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Cc({data:e});return e.image||e.image_url||e.image_data}async function Mc({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=Sc({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 Tc({uri:t})}async function Nc(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 kc({reason:"Only EIP-155 supported"});if(!i)throw new kc({reason:"Chain ID not found"});if(!c)throw new kc({reason:"Contract address not found"});if(!a)throw new kc({reason:"Token ID not found"});if(!o)throw new kc({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 No(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 No(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 Pc({namespace:t.namespace})}(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:o}=Sc({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 Mc({uri:Ic(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 Mc({gatewayUrls:e,uri:Ic(n)})}catch{throw new Tc({uri:t})}}({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:n}):Mc({uri:n,gatewayUrls:t})}async function Bc(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=Fo({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const i={address:c,abi:go,functionName:"resolve",args:[tr(Ec(r)),hs({abi:wo,functionName:"text",args:[vc(r),a]})],blockNumber:t,blockTag:n},o=va(e,No,"readContract"),l=s?await o({...i,args:[...i.args,s]}):await o(i);if("0x"===l[0])return null;const u=fo({abi:wo,functionName:"text",data:l[0]});return""===u?null:u}catch(e){if(i)throw e;if(bc(e,"resolve"))return null;throw e}}async function Uc(e,{address:t,args:n,event:r,events:a,fromBlock:s,strict:i,toBlock:o}={}){const c=a??(r?[r]:void 0),l=ls(e,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap((e=>os({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?ar(s):s,toBlock:"bigint"==typeof o?ar(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 Rc(e){const t=ls(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function jc(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:a}){const s=n?ar(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:[ar(t),s||r,a]}))}const Lc=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Gc=/^(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 zc(e){const{domain:t={},message:n,primaryType:r}=e,a={EIP712Domain:Zc({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(Gc);if(o&&("number"==typeof i||"bigint"==typeof i)){const[e,t,n]=o;ar(i,{signed:"int"===t,size:parseInt(n)/8})}if("address"===r&&"string"==typeof i&&!Mr(i))throw new Or({address:i});const c=r.match(Lc);if(c){const[e,t]=c;if(t&&Wn(i)!==parseInt(t))throw new Ba({expectedSize:parseInt(t),givenSize:Wn(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 $c({data:e,primaryType:"EIP712Domain",types:t})}({domain:t,types:a})),"EIP712Domain"!==r&&s.push($c({data:n,primaryType:r,types:a})),Dr(Nr(s))}function $c({data:e,primaryType:t,types:n}){return Dr(Hc({data:e,primaryType:t,types:n}))}function Hc({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],a=[qc({primaryType:t,types:n})];for(const s of n[t]){const[t,i]=Wc({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(t),a.push(i)}return Xa(r,a)}function qc({primaryType:e,types:t}){const n=tr(function({primaryType:e,types:t}){let n="";const r=Vc({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 Dr(n)}function Vc({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])Vc({primaryType:e.type,types:t},n);return n}function Wc({types:e,name:t,type:n,value:r}){if(void 0!==e[n])return[{type:"bytes32"},Dr(Hc({data:r,primaryType:n,types:e}))];if("bytes"===n){return[{type:"bytes32"},Dr(r=`0x${(r.length%2?"0":"")+r.slice(2)}`)]}if("string"===n)return[{type:"bytes32"},Dr(tr(r))];if(n.lastIndexOf("]")===n.length-1){const a=n.slice(0,n.lastIndexOf("[")),s=r.map((n=>Wc({name:t,type:a,types:e,value:n})));return[{type:"bytes32"},Dr(Xa(s.map((([e])=>e)),s.map((([,e])=>e))))]}return[{type:n},r]}function Zc({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 Kc="/docs/contract/encodeDeployData";function Jc(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 Ea({docsPath:Kc});if(!("inputs"in a))throw new Ca({docsPath:Kc});if(!a.inputs||0===a.inputs.length)throw new Ca({docsPath:Kc});return Br([r,Xa(a.inputs,n)])}const Yc="/docs/contract/encodeFunctionResult";const Xc="Ethereum Signed Message:\n";function Qc(e,t){const n="string"==typeof e?pr(e):e.raw instanceof Uint8Array?e.raw:cr(e.raw);return Dr(Nr([pr(`${Xc}${n.length}`),n]),t)}const el=1;class tl extends Ln{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 nl extends Ln{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class rl extends Ln{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 al extends Ln{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${el}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}function sl(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:s}=e;if(t<=0)throw new Oo({chainId:t});if(s&&!Mr(s))throw new Or({address:s});if(r)throw new Ln("`gasPrice` is not a valid EIP-1559 Transaction attribute.");if(a&&a>2n**256n-1n)throw new Fi({maxFeePerGas:a});if(n&&a&&n>a)throw new Ri({maxFeePerGas:a,maxPriorityFeePerGas:n})}function il(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=>dr(e))):e.blobs,a=[];for(const e of r)a.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?a:a.map((e=>rr(e)))}function ol(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=>dr(e))):e.blobs,a="string"==typeof e.commitments[0]?e.commitments.map((e=>dr(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=>rr(e)))}const cl=32,ll=4096,ul=cl*ll,dl=2*ul-1-1*ll*2;function pl(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?dr(e.data):e.data,r=Wn(n);if(!r)throw new nl;if(r>dl)throw new tl({maxSize:dl,size:r});const a=[];let s=!0,i=0;for(;s;){const e=xs(new Uint8Array(ul));let t=0;for(;t<ll;){const r=n.slice(i,i+(cl-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=>rr(e.bytes)))}({data:t,to:r}),s=e.commitments??il({blobs:a,kzg:n,to:r}),i=e.proofs??ol({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 hl(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=Et(Vn(e,{strict:!1})?cr(e):e);return"bytes"===n?r:tr(r)}(t,"bytes");return a.set([n],0),"bytes"===r?a:rr(a)}function ml(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 qs({storageKey:a[e]});if(!Mr(r,{strict:!1}))throw new Or({address:r});t.push([r,a])}return t}function fl(e,t){const n=no(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;sl(e);const d=ml(l),p=[tr(n),a?tr(a):"0x",c?tr(c):"0x",o?tr(o):"0x",r?tr(r):"0x",s??"0x",i?tr(i):"0x",u??"0x",d,...yl(e,t)];return Br(["0x02",kl(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 Oo({chainId:t});if(s&&!Mr(s))throw new Or({address:s});if(n||a)throw new Ln("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new Fi({maxFeePerGas:r})}(e);const u=ml(c),d=[tr(n),s?tr(s):"0x",l?tr(l):"0x",r?tr(r):"0x",i??"0x",o?tr(o):"0x",a??"0x",u,...yl(e,t)];return Br(["0x01",kl(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 nl;for(const e of t){const t=Wn(e),n=yr(Za(e,0,1));if(32!==t)throw new rl({hash:e,size:t});if(n!==el)throw new al({hash:e,version:n})}}sl(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=>rr(e))),n=e.kzg,r=il({blobs:t,kzg:n}),a=ol({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(hl({commitment:e,to:r,version:n}));return a}({commitments:r}),!1!==h&&(h=pl({blobs:t,commitments:r,proofs:a}))}const m=ml(u),f=[tr(n),a?tr(a):"0x",l?tr(l):"0x",c?tr(c):"0x",r?tr(r):"0x",s??"0x",i?tr(i):"0x",d??"0x",m,o?tr(o):"0x",p??[],...yl(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 Br(["0x03",kl(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&&!Mr(s))throw new Or({address:s});if(void 0!==t&&t<=0)throw new Oo({chainId:t});if(n||a)throw new Ln("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new Fi({maxFeePerGas:r});if(i)throw new Ln("`accessList` is not a valid Legacy Transaction attribute.")}(e);let l=[s?tr(s):"0x",c?tr(c):"0x",r?tr(r):"0x",i??"0x",o?tr(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 $s({v:t.v});return e})();l=[...l,tr(e),t.r,t.s]}else n>0&&(l=[...l,tr(n),"0x","0x"]);return kl(l)}(e,t)}function yl(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?tr(1):"0x":0n===a?"0x":1n===a?tr(1):27n===a?"0x":tr(1),Zn(n),Zn(r)]}async function bl(e,{address:t,blockNumber:n,blockTag:r,storageKeys:a}){const s=r??"latest",i=void 0!==n?ar(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?yr(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 gl(e,{blockHash:t,blockNumber:n,blockTag:r,hash:a,index:s}){const i=r||"latest",o=void 0!==n?ar(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,ar(s)]}):(o||i)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||i,ar(s)]})),!c)throw new Ws({blockHash:t,blockNumber:n,blockTag:i,hash:a,index:s});return(e.chain?.formatters?.transaction?.format||vr)(c)}async function vl(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!n)throw new Zs({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||Tr)(n)}const wl="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";async function xl(e,{address:t,hash:n,signature:r,...a}){const s=Vn(r)?r:tr(r);try{const{data:r}=await va(e,So,"call")({data:Jc({abi:Eo,args:[t,n,s],bytecode:wl}),...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}(Vn(i=r??"0x0")?cr(i):i,Vn(o)?cr(o):o)}catch(e){if(e instanceof Js)return!1;throw e}var i,o}function El(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)?Lo(_s(["watchBlockNumber",e.uid,t,n,i]),{onBlockNumber:r,onError:a},(r=>zo((async()=>{try{const t=await va(e,Wo,"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}))):Lo(_s(["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=fr(e.result?.number);t.onBlockNumber(r,o),o=r},onError(e){t.onError?.(e)}});r=a,n||r()}catch(e){a?.(e)}})(),r}))}function Cl(e){return{call:t=>So(e,t),createBlockFilter:()=>async function(e){const t=ls(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>us(e,t),createEventFilter:t=>Uc(e,t),createPendingTransactionFilter:()=>Rc(e),estimateContractGas:t=>io(e,t),estimateGas:t=>so(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const a=n?ar(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,a||r]});return BigInt(s)}(e,t),getBlock:t=>Ji(e,t),getBlockNumber:t=>Wo(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const a=void 0!==n?ar(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]}),yr(s)}(e,t),getBytecode:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const a=void 0!==n?ar(n):void 0,s=await e.request({method:"eth_getCode",params:[t,a||r]});if("0x"!==s)return s}(e,t),getChainId:()=>ro(e),getContractEvents:t=>ho(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=Fo({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const i=hs({abi:xo,functionName:"addr",...null!=r?{args:[vc(a),BigInt(r)]}:{args:[vc(a)]}}),o={address:c,abi:go,functionName:"resolve",args:[tr(Ec(a)),i],blockNumber:t,blockTag:n},l=va(e,No,"readContract"),u=s?await l({...o,args:[...o.args,s]}):await l(o);if("0x"===u[0])return null;const d=fo({abi:xo,args:null!=r?[vc(a),BigInt(r)]:void 0,functionName:"addr",data:u[0]});return"0x"===d||"0x00"===Zn(d)?null:d}catch(e){if(i)throw e;if(bc(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 va(e,Bc,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:a,universalResolverAddress:o,gatewayUrls:s,strict:i});if(!c)return null;try{return await Nc(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=Fo({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const s={address:o,abi:vo,functionName:"reverse",args:[tr(Ec(c))],blockNumber:n,blockTag:r},i=va(e,No,"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(bc(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=Fo({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[i]=await va(e,No,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[tr(Ec(r))],blockNumber:t,blockTag:n});return i}(e,t),getEnsText:t=>Bc(e,t),getFeeHistory:t=>jc(e,t),estimateFeesPerGas:t=>async function(e,t){return Qi(e,t)}(e,t),getFilterChanges:e=>Zo(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=>Cr(e)));return t.abi?uo({abi:t.abi,logs:r,strict:n}):r}(0,e),getGasPrice:()=>Yi(e),getLogs:t=>po(e,t),getProof:t=>bl(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return Xi(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:a}){const s=void 0!==n?ar(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,a,s||r]})}(e,t),getTransaction:t=>gl(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,a]=await Promise.all([va(e,Wo,"getBlockNumber")({}),t?va(e,gl,"getBlockNumber")({hash:t}):void 0]),s=n?.blockNumber||a?.blockNumber;return s?r-s+1n:0n}(e,t),getTransactionCount:t=>eo(e,t),getTransactionReceipt:t=>vl(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=Fo({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=hs({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=Pi(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=>va(e,No,"readContract")({abi:yo,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 Ta;if(!s)throw new ei({data:a});const e=fo({abi:o,args:p,data:a,functionName:u});f.push(n?{result:e,status:"success"}:e)}catch(e){const t=Pi(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 Ln("multicall results mismatch");return f}(e,t),prepareTransactionRequest:t=>ao(e,t),readContract:t=>No(e,t),sendRawTransaction:t=>Yo(e,t),simulateContract:t=>Bo(e,t),verifyMessage:t=>async function(e,{address:t,message:n,signature:r,...a}){return xl(e,{address:t,hash:Qc(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 xl(e,{address:n,hash:zc({message:a,primaryType:s,types:i,domain:o}),signature:r,...c})}(e,t),uninstallFilter:e=>Ko(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=_s(["waitForTransactionReceipt",e.uid,n]);let l,u,d,p=!1;return new Promise(((h,m)=>{o&&setTimeout((()=>m(new Ks({hash:n}))),o);const f=Lo(c,{onReplaced:r,resolve:h,reject:m},(r=>{const o=va(e,El,"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 cc((async()=>{l=await va(e,gl,"getTransaction")({hash:n}),l.blockNumber&&(c=l.blockNumber)}),{delay:i,retryCount:s}),p=!1),d=await va(e,vl,"getTransactionReceipt")({hash:n}),t>1&&(!d.blockNumber||c-d.blockNumber+1n<t))return;h((()=>r.resolve(d)))}catch(n){if(n instanceof Ws||n instanceof Zs){if(!l)return void(p=!1);try{u=l,p=!0;const n=await cc((()=>va(e,Ji,"getBlock")({blockNumber:c,includeTransactions:!0})),{delay:i,retryCount:s,shouldRetry:({error:e})=>e instanceof Ki});p=!1;const a=n.transactions.find((({from:e,nonce:t})=>e===u.from&&t===u.nonce));if(!a)return;if(d=await va(e,vl,"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?Lo(_s(["watchBlocks",e.uid,n,r,u,c]),{onBlock:a,onError:s},(a=>zo((async()=>{try{const r=await va(e,Ji,"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 va(e,Ji,"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||xr)(n.result);a(r,d),d=r},onError(e){s?.(e)}});n=r,t||n()}catch(e){s?.(e)}})(),n})()}(e,t),watchBlockNumber:t=>El(e,t),watchContractEvent:t=>Jo(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?Lo(_s(["watchEvent",t,n,r,e.uid,a,l]),{onLogs:o,onError:i},(i=>{let o,c,u=!1;const d=zo((async()=>{if(u)try{let l;if(c)l=await va(e,Zo,"getFilterChanges")({filter:c});else{const r=await va(e,Wo,"getBlockNumber")({});l=o&&o!==r?await va(e,po,"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 di&&(u=!1),i.onError?.(e)}else{try{c=await va(e,Uc,"createEventFilter")({address:t,args:n,event:a,events:s,strict:p})}catch{}u=!0}}),{emitOnBegin:!0,interval:l});return async()=>{c&&await va(e,Ko,"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=>os({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}=co({abi:l??[],data:t.data,topics:t.topics,strict:p}),r=Cr(t,{args:n,eventName:e});o([r])}catch(e){let n,r;if(e instanceof Ua||e instanceof Ra){if(u)return;n=e.abiItem.name,r=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const a=Cr(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)?Lo(_s(["watchPendingTransactions",e.uid,t,s]),{onTransactions:r,onError:n},(n=>{let r;const a=zo((async()=>{try{if(!r)try{return void(r=await va(e,Rc,"createPendingTransactionFilter")({}))}catch(e){throw a(),e}const s=await va(e,Zo,"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 va(e,Ko,"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 kl(e,t="hex"){const n=Tl(e),r=xs(new Uint8Array(n.length));return n.encode(r),"hex"===t?rr(r.bytes):r.bytes}function Tl(e){return Array.isArray(e)?function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=Pl(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=>Tl(e)))):function(e){const t="string"==typeof e?dr(e):e,n=Pl(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 Pl(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 Ln("Length is too large.")}const Al={contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:Ar,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&&!Mr(t))throw new Or({address:t});if(n&&!Mr(n))throw new Or({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:a,isSystemTx:s,mint:i,to:o,value:c}=e;return Br(["0x7e",kl([t,r,o??"0x",i?tr(i):"0x",c?tr(c):"0x",a?tr(a):"0x",s?"0x1":"0x",n??"0x"])])}(e):fl(e,t)}}},Ol=Un({...Al,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:{...Al.contracts,l2OutputOracle:{1:{address:"0xB09DC08428C8b4EFB4ff9C0827386CDF34277996"}},portal:{1:{address:"0x639F2AECE398Aa76b07e59eF6abe2cFe32bacb68",blockCreated:19070571}},l1StandardBridge:{1:{address:"0xd5e3eDf5b68135D559D572E26bF863FBC1950033",blockCreated:19070571}}},sourceId:1}),Fl=11155111,Dl=Un({...Al,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:{...Al.contracts,l2OutputOracle:{[Fl]:{address:"0x942fD5017c0F60575930D8574Eaca13BEcD6e1bB"}},portal:{[Fl]:{address:"0xfa1d9E26A6aCD7b22115D27572c1221B9803c960",blockCreated:4972908}},l1StandardBridge:{[Fl]:{address:"0xF6Bc0146d3c74D48306e79Ae134A260E418C9335",blockCreated:4972908}}},sourceId:Fl}),_l=Un({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"]}}}),Sl=Un({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}),Il=Un({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}}}),Ml=Un({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}),Nl=Un({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}}}),Bl=Un({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}),Ul=Un({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}),Rl=Un({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}),jl=Un({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}),Ll=Un({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}),Gl=Un({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}}}),zl=Un({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}),$l=Un({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}),Hl=Un({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}}}),ql=Un({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}),Vl=Un({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"}}}),Wl=Un({...Al,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:{...Al.contracts,l2OutputOracle:{1:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{1:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{1:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),Zl=Un({...Al,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:{...Al.contracts,l2OutputOracle:{5:{address:"0x2A35891ff30313CcFa6CE88dcf3858bb075A2298"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1376988},portal:{5:{address:"0xe93c8cD0D409341205A592f8c4Ac1A5fe5585cfA"}},l1StandardBridge:{5:{address:"0xfA6D8Ee5BE770F84FC001D098C4bD604Fe01284a"}}},testnet:!0,sourceId:5}),Kl=11155111,Jl=Un({...Al,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:{...Al.contracts,l2OutputOracle:{[Kl]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[Kl]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[Kl]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:Kl}),Yl=Un({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}}}),Xl=Un({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}),Ql=Un({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"}}}),eu=Un({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}),tu=Un({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}),nu=Un({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"}}}),ru=Un({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}),au=Un({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}),su=Un({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}),iu=Un({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}}}),ou=Un({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"}}}),cu=Un({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}),lu=Un({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}}}),uu=Un({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}),du=Un({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}),pu=Un({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"}}}),hu=Un({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"}}}),mu=Un({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 fu(e){return 0===e||0n===e||null==e||"0"===e||""===e||"string"==typeof e&&("0x"===Zn(e).toLowerCase()||"0x00"===Zn(e).toLowerCase())}function yu(e){return!fu(e)}function bu(e){return void 0!==e.maxFeePerGas&&void 0!==e.maxPriorityFeePerGas}function gu(e){return"cip42"===e.type||bu(e)&&(yu(e.feeCurrency)||yu(e.gatewayFeeRecipient)||yu(e.gatewayFee))}function vu(e){return"cip64"===e.type||bu(e)&&yu(e.feeCurrency)&&fu(e.gatewayFee)&&fu(e.gatewayFeeRecipient)}const wu={block:Er({exclude:["difficulty","gasLimit","mixHash","nonce","uncles"],format(e){const t=e.transactions?.map((e=>"string"==typeof e?e:{...vr(e),feeCurrency:e.feeCurrency,..."0x7b"!==e.type?{gatewayFee:e.gatewayFee?fr(e.gatewayFee):null,gatewayFeeRecipient:e.gatewayFeeRecipient||null}:{}}));return{randomness:e.randomness,transactions:t}}}),transaction:wr({format(e){const t={feeCurrency:e.feeCurrency};return"0x7b"===e.type?t.type="cip64":("0x7c"===e.type&&(t.type="cip42"),t.gatewayFee=e.gatewayFee?fr(e.gatewayFee):null,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}}),transactionRequest:Hi({format(e){const t={feeCurrency:e.feeCurrency};return vu(e)?t.type="0x7b":(gu(e)&&(t.type="0x7c"),t.gatewayFee=void 0!==e.gatewayFee?ar(e.gatewayFee):void 0,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}})};const xu={transaction:function(e,t){return vu(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 Oo({chainId:t});if(s&&!Mr(s))throw new Or({address:s});if(r)throw new Ln("`gasPrice` is not a valid CIP-64 Transaction attribute.");if(yu(a)&&a>Eu)throw new Fi({maxFeePerGas:a});if(yu(n)&&yu(a)&&n>a)throw new Ri({maxFeePerGas:a,maxPriorityFeePerGas:n});if(yu(i)&&!Mr(i))throw new Ln("`feeCurrency` MUST be a token address for CIP-64 transactions.");if(fu(i))throw new Ln("`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=[tr(n),a?tr(a):"0x",c?tr(c):"0x",o?tr(o):"0x",r?tr(r):"0x",s??"0x",i?tr(i):"0x",d??"0x",ml(l),u,...yl(e,t)];return Br(["0x7b",kl(p)])}(e,t):gu(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 Oo({chainId:t});if(s&&!Mr(s))throw new Or({address:s});if(r)throw new Ln("`gasPrice` is not a valid CIP-42 Transaction attribute.");if(yu(a)&&a>Eu)throw new Fi({maxFeePerGas:a});if(yu(n)&&yu(a)&&n>a)throw new Ri({maxFeePerGas:a,maxPriorityFeePerGas:n});if(yu(o)&&fu(c)||yu(c)&&fu(o))throw new Ln("`gatewayFee` and `gatewayFeeRecipient` must be provided together.");if(yu(i)&&!Mr(i))throw new Ln("`feeCurrency` MUST be a token address for CIP-42 transactions.");if(yu(c)&&!Mr(c))throw new Or(c);if(fu(i)&&fu(c))throw new Ln("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=[tr(n),a?tr(a):"0x",c?tr(c):"0x",o?tr(o):"0x",r?tr(r):"0x",u??"0x",d??"0x",p?tr(p):"0x",s??"0x",i?tr(i):"0x",h??"0x",ml(l),...yl(e,t)];return Br(["0x7c",kl(m)])}(e,t):fl(e,t)}};const Eu=2n**256n-1n;const Cu={formatters:wu,serializers:xu},ku=Un({...Cu,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}),Tu=Un({...Cu,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}),Pu=Un({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"}}}),Au=Un({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"}}}),Ou=Un({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}}}),Fu=Un({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}}}),Du=Un({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}),_u=Un({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}}}),Su=Un({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}),Iu=Un({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}}}),Mu=Un({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}}}),Nu=Un({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}),Bu=Un({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"}}}),Uu=Un({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"}}}),Ru=Un({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}}}),ju=Un({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"}}}),Lu=Un({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}}}),Gu=Un({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}),zu=Un({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}),$u=Un({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"}}}),Hu=Un({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/"}}}),qu=Un({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"}}}),Vu=Un({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}),Wu=Un({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}}}),Zu=Un({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}),Ku=Un({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}}}),Ju=Un({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"}}}),Yu=Un({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}}}),Xu=Un({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"}}}),Qu=Un({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"}}}),ed=Un({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"}}}),td=Un({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}),nd=Un({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"]}}}),rd=Un({...Al,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:{...Al.contracts,l2OutputOracle:{1:{address:"0x66CC916Ed5C6C2FA97014f7D1cD141528Ae171e4"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{1:{address:"0x36cb65c1967A0Fb0EEE11569C51C2f2aA1Ca6f6D",blockCreated:19135323}},l1StandardBridge:{1:{address:"0x34C0bD5877A5Ee7099D0f5688D65F4bB9158BDE2",blockCreated:19135323}}},sourceId:1}),ad=17e3,sd=Un({...Al,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:{...Al.contracts,l2OutputOracle:{[ad]:{address:"0x715EA64DA13F4d0831ece4Ad3E8c1aa013167F32"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[ad]:{address:"0xB9c64BfA498d5b9a8398Ed6f46eb76d90dE5505d",blockCreated:318416}},l1StandardBridge:{[ad]:{address:"0x0BaafC217162f64930909aD9f2B27125121d6332",blockCreated:318416}}},sourceId:ad}),id=Un({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}}}),od=Un({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"}}}),cd=Un({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}}}),ld=Un({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}),ud=Un({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}),dd=Un({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}),pd=Un({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}),hd=Un({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}),md=Un({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}}}),fd=Un({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}),yd=Un({id:31337,name:"Hardhat",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}}),bd=Un({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}}}),gd=Un({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"}}}),vd=Un({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"}}}),wd=Un({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}),xd=Un({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}),Ed=Un({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}),Cd=Un({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}),kd=Un({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}),Td=Un({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}),Pd=Un({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}),Ad=Un({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}),Od=Un({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}}}),Fd=Un({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}),Dd=Un({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}),_d=Un({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}),Sd=Un({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}),Id=Un({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}),Md=Un({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}),Nd=Un({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}),Bd=11155111,Ud=Un({...Al,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:{...Al.contracts,l2OutputOracle:{[Bd]:{address:"0xA0E35F56C318DE1bD5D9ca6A94Fe7e37C5663348"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[Bd]:{address:"0xe3d90F21490686Ec7eF37BE788E02dfC12787264"}},l1StandardBridge:{[Bd]:{address:"0x1Fb30e446eA791cd1f011675E5F3f5311b70faF5"}}},testnet:!0,sourceId:Bd}),Rd=Un({id:1337,name:"Localhost",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}}),jd=Un({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"}}}),Ld=Un({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}}}),Gd=Un({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}),zd=Un({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}}}),$d=Un({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}),Hd=Un({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}}}),qd=Un({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}),Vd=Un({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"}}}),Wd=Un({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}}}),Zd=Un({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}),Kd=Un({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"}}}),Jd=Un({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"}}}),Yd=Un({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}}}),Xd=Un({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}}}),Qd=Un({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}}}),ep=Un({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}),tp=Un({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}),np=Un({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}}}),rp=Un({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}),ap=Un({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}),sp=Un({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}),ip=Un({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"]}}}),op=Un({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}),cp=Un({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}),lp=Un({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}),up=Un({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}}}),dp=Un({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}}}),pp=Un({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"}}}),hp=Un({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}),mp=Un({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}}}),fp=Un({...Al,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:{...Al.contracts,l2OutputOracle:{1:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{1:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{1:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:1}),yp=Un({...Al,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:{...Al.contracts,l2OutputOracle:{5:{address:"0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461},portal:{5:{address:"0x5b47E1A08Ea6d985D6649300584e6722Ec4B1383"}},l1StandardBridge:{5:{address:"0x636Af16bf2f682dD3109e60102b8E1A089FedAa8"}}},testnet:!0,sourceId:5}),bp=11155111,gp=Un({...Al,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:{...Al.contracts,l2OutputOracle:{[bp]:{address:"0x90E9c4f8a994a250F6aEfd61CAFb4F2e895D458F"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1620204},portal:{[bp]:{address:"0x16Fc5058F25648194471939df75CF27A2fdC48BC"}},l1StandardBridge:{[bp]:{address:"0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1"}}},testnet:!0,sourceId:bp}),vp=Un({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}}}),wp=Un({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}),xp=Un({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"}}}),Ep=Un({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}}}),Cp=Un({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}),kp=Un({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:Ar,sourceId:1}),Tp=11155111,Pp=Un({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:{[Tp]:{address:"0xD5bAc3152ffC25318F848B3DD5dA6C85171BaEEe"}},portal:{[Tp]:{address:"0xF04BdD5353Bb0EFF6CA60CfcC78594278eBfE179"}},l1StandardBridge:{[Tp]:{address:"0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3754925}},formatters:Ar,sourceId:Tp,testnet:!0}),Ap=Un({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}}}),Op=Un({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}}}),Fp=Un({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}),Dp=Un({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}}}),_p=Un({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}),Sp=Un({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}),Ip=Un({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}}}),Mp=Un({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}}}),Np=Un({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}}}),Bp=Un({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}}}),Up=Un({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"}}}),Rp=Un({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}),jp=Un({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}}}),Lp=Un({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}}}),Gp=Un({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}}}),zp=Un({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}}}),$p=Un({...Al,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:{...Al.contracts,l2OutputOracle:{1:{address:"0xE6f24d2C32B3109B18ed33cF08eFb490b1e09C10"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14193},portal:{1:{address:"0x6A12432491bbbE8d3babf75F759766774C778Db4",blockCreated:19387057}},l1StandardBridge:{1:{address:"0x4cbab69108Aa72151EDa5A3c164eA86845f18438"}}},sourceId:1}),Hp=11155111,qp=Un({...Al,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:{...Al.contracts,l2OutputOracle:{[Hp]:{address:"0xDb5c46C3Eaa6Ed6aE8b2379785DF7dd029C0dC81"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:55697},portal:{[Hp]:{address:"0xcBD77E8E1E7F06B25baDe67142cdE82652Da7b57",blockCreated:5345035}},l1StandardBridge:{[Hp]:{address:"0xdDD29bb63B0839FB1cE0eE439Ff027738595D07B"}}},testnet:!0,sourceId:Hp}),Vp=Un({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}),Wp=Un({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}}}),Zp=Un({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}),Kp=Un({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}),Jp=Un({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}),Yp=Un({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}),Xp=Un({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}),Qp=Un({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"}}}),eh=Un({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}),th=Un({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:{}}),nh=Un({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}}}),rh=Un({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}),ah=Un({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:{}}),sh=Un({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:{}}),ih=Un({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}}}),oh=Un({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}),ch=Un({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:{}}),lh=Un({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:{}}),uh=Un({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}}}),dh=Un({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}),ph=Un({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:{}}),hh=Un({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}}}),mh=Un({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}),fh=Un({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"}}}),yh=Un({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}),bh=Un({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}),gh=Un({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}),vh=Un({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}}}),wh=Un({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}}}),xh=Un({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}}}),Eh=Un({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"}}}),Ch=Un({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}),kh=Un({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"}}}),Th=Un({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"}}}),Ph=Un({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}),Ah=Un({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}}}),Oh=Un({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}),Fh=Un({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}),Dh=Un({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}),_h=Un({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"}}}),Sh=Un({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}}}),Ih=Un({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}),Mh=Un({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"}}}),Nh=Un({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}),Bh=Un({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}),Uh=Un({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}}}),Rh=Un({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}}}),jh=Un({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}),Lh=Un({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}),Gh=Un({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}),zh={block:Er({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=zh.transaction?.format(e);return"0x71"===t.typeHex?t.type="eip712":"0xff"===t.typeHex&&(t.type="priority"),t}));return{l1BatchNumber:e.l1BatchNumber?fr(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?fr(e.l1BatchTimestamp):null,transactions:t}}}),transaction:wr({format(e){const t={};return"0x71"===e.type?t.type="eip712":"0xff"===e.type&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?fr(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?fr(e.l1BatchTxIndex):null}}}),transactionReceipt:Pr({format:e=>({l1BatchNumber:e.l1BatchNumber?fr(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?fr(e.l1BatchTxIndex):null,logs:e.logs.map((e=>({...Cr(e),l1BatchNumber:e.l1BatchNumber?fr(e.l1BatchNumber):null,transactionLogIndex:yr(e.transactionLogIndex),logType:e.logType}))),l2ToL1Logs:e.l2ToL1Logs.map((e=>({blockNumber:fr(e.blockHash),blockHash:e.blockHash,l1BatchNumber:fr(e.l1BatchNumber),transactionIndex:fr(e.transactionIndex),shardId:fr(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:fr(e.logIndex)})))})}),transactionRequest:Hi({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format:e=>e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:tr(e.gasPerPubdata)}:{},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(dr(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps}:{},...e.customSignature?{customSignature:Array.from(dr(e.customSignature))}:{}},type:"0x71"}:{}})};class $h extends Ln{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 Hh(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 qh(e){const{chainId:t,to:n,from:r,paymaster:a,paymasterInput:s}=e;if(!Hh(e))throw new $h;if(!t||t<=0)throw new Oo({chainId:t});if(n&&!Mr(n))throw new Or({address:n});if(r&&!Mr(r))throw new Or({address:r});if(a&&!Mr(a))throw new Or({address:a});if(a&&!s)throw new Ln("`paymasterInput` must be provided when `paymaster` is defined");if(!a&&s)throw new Ln("`paymaster` must be provided when `paymasterInput` is defined")}const Vh={formatters:zh,serializers:{transaction:function(e,t){return Hh(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;qh(e);return Br(["0x71",kl([r?tr(r):"0x",c?tr(c):"0x",o?tr(o):"0x",n?tr(n):"0x",a??"0x",i?tr(i):"0x",m??"0x0",tr(t),tr(""),tr(""),tr(t),s??"0x",h?tr(h):"0x",u??[],l??"0x",d&&p?[d,p]:[]])])}(e):fl(e,t)}},custom:{getEip712Domain:e=>{qh(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}}}},Wh=Un({...Vh,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"}}}),Zh=Un({...Vh,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}),Kh=Un({...Vh,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}),Jh=Un({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}),Yh=Un({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}),Xh=Un({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}),Qh=Un({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}),em=Un({...Al,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:{...Al.contracts,l2OutputOracle:{1:{address:"0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:5882},portal:{1:{address:"0x1a0ad011913A150f69f6A19DF447A0CfD9551054"}},l1StandardBridge:{1:{address:"0x3e2Ea9B92B7E48A52296fD261dc26fd995284631"}}},sourceId:1}),tm=11155111,nm=Un({...Al,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:{...Al.contracts,l2OutputOracle:{[tm]:{address:"0x2615B481Bd3E5A1C0C7Ca3Da1bdc663E8615Ade9"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:83160},portal:{[tm]:{address:"0xeffE2C6cA9Ab797D418f0D91eA60807713f3536f"}},l1StandardBridge:{[tm]:{address:"0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB"}}},sourceId:tm,testnet:!0}),rm=Un({...Al,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:{...Al.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:189123},portal:{5:{address:"0xDb9F51790365e7dc196e7D072728df39Be958ACe"}}},sourceId:5,testnet:!0});var am=Object.freeze({__proto__:null,acala:Rn,ancient8:Ol,ancient8Sepolia:Dl,anvil:_l,apexTestnet:Sl,arbitrum:Il,arbitrumGoerli:Ml,arbitrumNova:Nl,astar:Bl,astarZkEVM:Ul,astarZkyoto:Rl,arbitrumSepolia:jl,astarZkatana:Ll,aurora:Gl,auroraTestnet:zl,auroria:$l,avalanche:Hl,avalancheFuji:ql,bahamut:Vl,base:Wl,baseGoerli:Zl,baseSepolia:Jl,beam:Yl,beamTestnet:Xl,bearNetworkChainMainnet:Ql,bearNetworkChainTestnet:eu,berachainTestnet:tu,bitTorrent:nu,bitTorrentTestnet:ru,blast:au,blastSepolia:su,boba:iu,bronos:ou,bronosTestnet:cu,bsc:lu,bscTestnet:uu,bscGreenfield:du,bxn:pu,bxnTestnet:hu,canto:mu,celo:ku,celoAlfajores:Tu,chiliz:Pu,classic:Au,confluxESpace:Ou,confluxESpaceTestnet:Fu,coreDao:Du,cronos:_u,cronosTestnet:Su,crossbell:Iu,defichainEvm:Mu,defichainEvmTestnet:Nu,dfk:Bu,dogechain:Uu,edgeware:Ru,edgewareTestnet:ju,eos:Lu,eosTestnet:Gu,etherlinkTestnet:zu,evmos:$u,evmosTestnet:Hu,ekta:qu,ektaTestnet:Vu,fantom:Wu,fantomSonicTestnet:Zu,fantomTestnet:Ku,fibo:Ju,filecoin:Yu,filecoinCalibration:Xu,filecoinHyperspace:Qu,flare:ed,flareTestnet:td,foundry:nd,fraxtal:rd,fraxtalTestnet:sd,fuse:id,fuseSparknet:od,iotex:cd,iotexTestnet:ld,jbc:ud,karura:dd,gobi:pd,goerli:hd,gnosis:md,gnosisChiado:fd,hardhat:yd,harmonyOne:bd,haqqMainnet:gd,haqqTestedge2:vd,hedera:wd,hederaTestnet:xd,hederaPreviewnet:Ed,holesky:Cd,kakarotSepolia:kd,kava:Td,kavaTestnet:Pd,kcc:Ad,klaytn:Od,klaytnBaobab:Fd,kroma:Dd,kromaSepolia:_d,lightlinkPegasus:Sd,lightlinkPhoenix:Id,linea:Md,lineaTestnet:Nd,liskSepolia:Ud,localhost:Rd,lukso:jd,mainnet:Ld,mandala:Gd,manta:zd,mantaTestnet:$d,mantle:Hd,mantleTestnet:qd,merlin:Vd,metachain:Wd,metachainIstanbul:Zd,meter:Kd,meterTestnet:Jd,metis:Yd,metisGoerli:Xd,mev:Qd,mevTestnet:ep,mintSepoliaTestnet:tp,mode:np,modeTestnet:rp,moonbaseAlpha:ap,moonbeam:sp,moonbeamDev:ip,moonriver:op,neonDevnet:cp,neonMainnet:lp,nexi:up,nexilix:dp,oasys:pp,oasisTestnet:hp,okc:mp,optimism:fp,optimismGoerli:yp,optimismSepolia:gp,opBNB:vp,opBNBTestnet:wp,oortMainnetDev:xp,palm:Ep,palmTestnet:Cp,pgn:kp,pgnTestnet:Pp,phoenix:Ap,plinga:Op,plumeTestnet:Fp,polygon:Dp,polygonAmoy:_p,polygonMumbai:Sp,polygonZkEvmTestnet:Ip,polygonZkEvm:Mp,pulsechain:Np,pulsechainV4:Bp,qMainnet:Up,qTestnet:Rp,rollux:jp,rolluxTestnet:Lp,ronin:Gp,rootstock:zp,rss3:$p,rss3Sepolia:qp,saigon:Vp,sapphire:Wp,sapphireTestnet:Zp,scroll:Kp,scrollSepolia:Jp,scrollTestnet:Yp,sepolia:Xp,shimmer:Qp,shimmerTestnet:eh,skaleBlockBrawlers:th,skaleCalypso:nh,skaleCalypsoTestnet:rh,skaleCryptoBlades:ah,skaleCryptoColosseum:sh,skaleEuropa:ih,skaleEuropaTestnet:oh,skaleExorde:ch,skaleHumanProtocol:lh,skaleNebula:uh,skaleNebulaTestnet:dh,skaleRazor:ph,skaleTitan:hh,skaleTitanTestnet:mh,songbird:fh,songbirdTestnet:yh,spicy:bh,shardeumSphinx:gh,shibarium:vh,syscoin:wh,syscoinTestnet:xh,taraxa:Eh,taikoJolnir:Ch,taikoKatla:kh,taikoTestnetSepolia:Th,taraxaTestnet:Ph,telos:Ah,telosTestnet:Oh,tenet:Fh,thunderTestnet:Dh,vechain:_h,wanchain:Sh,wanchainTestnet:Ih,wemix:Mh,wemixTestnet:Nh,x1Testnet:Bh,xdc:Uh,xdcTestnet:Rh,zhejiang:jh,zkFair:Lh,zkFairTestnet:Gh,zkSync:Wh,zkSyncTestnet:Zh,zkSyncSepoliaTestnet:Kh,zetachain:Jh,zetachainAthensTestnet:Yh,zilliqa:Xh,zilliqaTestnet:Qh,zora:em,zoraSepolia:nm,zoraTestnet:rm});const sm="3.18.2";class im extends Ln{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:sm});const n=t.cause instanceof im&&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 om extends im{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 cm extends im{constructor(e){super(`Invalid RPC URL ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRpcUrlError"})}}class lm extends im{constructor(){super("No chain supplied to the client"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}const um=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 dm(e){if(!e.chain)throw new lm;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":sm}),oc({...o,transport:yc(e,{...i.config,fetchOptions:n})})}return oc(o)})().extend(Cl).extend(um)}class pm extends im{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 hm extends im{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 mm=e=>{const t=Dr(e.initCode),n=Dr(e.callData),r=Dr(e.paymasterAndData);return Xa([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"bytes32"}],[e.sender,fr(e.nonce),t,n,fr(e.callGasLimit),fr(e.verificationGasLimit),fr(e.preVerificationGas),fr(e.maxFeePerGas),fr(e.maxPriorityFeePerGas),r])};const fm=e=>{const t=e.factory&&e.factoryData?Nr([e.factory,e.factoryData]):"0x",n=ym((({verificationGasLimit:e,callGasLimit:t})=>({verificationGasLimit:e,callGasLimit:t}))(e)),r=ym((({maxPriorityFeePerGas:e,maxFeePerGas:t})=>({maxPriorityFeePerGas:e,maxFeePerGas:t}))(e)),a=e.paymaster&&Mr(e.paymaster)?function({paymaster:e,paymasterVerificationGasLimit:t,paymasterPostOpGasLimit:n,paymasterData:r}){if(!(e&&t&&n&&r))return"0x";return Nr([e,Xn(t,{size:16}),Xn(n,{size:16}),r])}((({paymaster:e,paymasterVerificationGasLimit:t,paymasterPostOpGasLimit:n,paymasterData:r})=>({paymaster:e,paymasterVerificationGasLimit:t,paymasterPostOpGasLimit:n,paymasterData:r}))(e)):"0x";return Xa([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"}],[e.sender,fr(e.nonce),Dr(t),Dr(e.callData),n,fr(e.preVerificationGas),r,Dr(a)])};function ym(e){return Nr(Object.values(e).map((e=>Xn(e,{size:16}))))}const bm="0.6.0",gm={"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=Xa([{type:"bytes32"},{type:"address"},{type:"uint256"}],[Dr(mm(e)),t,BigInt(n)]);return Dr(r)},packUserOperation:mm},"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=Xa([{type:"bytes32"},{type:"address"},{type:"uint256"}],[Dr(fm(e)),t,BigInt(n)]);return Dr(r)},packUserOperation:fm}};function vm(e,t){const{version:n=bm,addressOverride:r}=t??{version:bm},a=gm[n??bm],s=r??a.address[e.id]??a.address.default;if(!s)throw new pm(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 pm(e,n)}class wm extends im{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 xm extends im{constructor(){super("getCounterFactualAddress failed"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"GetCounterFactualAddressError"})}}class Em extends im{constructor(e){super(`Upgrades are not supported by ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UpgradesNotSupported"})}}class Cm extends im{constructor(){super("SignTransaction is not supported by smart contracts"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignTransactionNotSupported"})}}class km extends im{constructor(e,t){super(`Failed to get storage slot ${e} (${t})`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FailedToGetStorageSlotError"})}}class Tm extends im{constructor(e){super(`Batch execution is not supported by ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BatchExecutionNotSupportedError"})}}var Pm;!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"}(Pm||(Pm={}));class Am{static setLogLevel(e){this.logLevel=e}static setLogFilter(e){this.logFilter=e}static error(e,...t){this.shouldLog(e,Pm.ERROR)&&console.error(e,...t)}static warn(e,...t){this.shouldLog(e,Pm.WARN)&&console.warn(e,...t)}static debug(e,...t){this.shouldLog(e,Pm.DEBUG)&&console.debug(e,...t)}static info(e,...t){this.shouldLog(e,Pm.INFO)&&console.info(e,...t)}static verbose(e,...t){this.shouldLog(e,Pm.VERBOSE)&&console.log(e,...t)}static shouldLog(e,t){return!(this.logLevel<t)&&!(this.logFilter&&!e.includes(this.logFilter))}}Object.defineProperty(Am,"logLevel",{enumerable:!0,configurable:!0,writable:!0,value:Pm.INFO});const Om=({factoryAddress:e,factoryCalldata:t,signature:n})=>Nr([Xa(ga("address, bytes, bytes"),[e,t,n]),"0x6492649264926492649264926492649264926492649264926492649264926492"]);var Fm,Dm;!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}(Fm||(Fm={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Dm||(Dm={}));const _m=Fm.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Sm=e=>{switch(typeof e){case"undefined":return _m.undefined;case"string":return _m.string;case"number":return isNaN(e)?_m.nan:_m.number;case"boolean":return _m.boolean;case"function":return _m.function;case"bigint":return _m.bigint;case"symbol":return _m.symbol;case"object":return Array.isArray(e)?_m.array:null===e?_m.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?_m.promise:"undefined"!=typeof Map&&e instanceof Map?_m.map:"undefined"!=typeof Set&&e instanceof Set?_m.set:"undefined"!=typeof Date&&e instanceof Date?_m.date:_m.object;default:return _m.unknown}},Im=Fm.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 Mm 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,Fm.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()}}Mm.create=e=>new Mm(e);const Nm=(e,t)=>{let n;switch(e.code){case Im.invalid_type:n=e.received===_m.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Im.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Fm.jsonStringifyReplacer)}`;break;case Im.unrecognized_keys:n=`Unrecognized key(s) in object: ${Fm.joinValues(e.keys,", ")}`;break;case Im.invalid_union:n="Invalid input";break;case Im.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Fm.joinValues(e.options)}`;break;case Im.invalid_enum_value:n=`Invalid enum value. Expected ${Fm.joinValues(e.options)}, received '${e.received}'`;break;case Im.invalid_arguments:n="Invalid function arguments";break;case Im.invalid_return_type:n="Invalid function return type";break;case Im.invalid_date:n="Invalid date";break;case Im.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}"`:Fm.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Im.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 Im.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 Im.custom:n="Invalid input";break;case Im.invalid_intersection_types:n="Intersection results could not be merged";break;case Im.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Im.not_finite:n="Number must be finite";break;default:n=t.defaultError,Fm.assertNever(e)}return{message:n}};let Bm=Nm;function Um(){return Bm}const Rm=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 jm(e,t){const n=Rm({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Um(),Nm].filter((e=>!!e))});e.common.issues.push(n)}class Lm{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 Gm;"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 Lm.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 Gm;if("aborted"===a.status)return Gm;"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 Gm=Object.freeze({status:"aborted"}),zm=e=>({status:"dirty",value:e}),$m=e=>({status:"valid",value:e}),Hm=e=>"aborted"===e.status,qm=e=>"dirty"===e.status,Vm=e=>"valid"===e.status,Wm=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Zm;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Zm||(Zm={}));class Km{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 Jm=(e,t)=>{if(Vm(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 Mm(e.common.issues);return this._error=t,this._error}}};function Ym(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 Xm{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 Sm(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Sm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Lm,ctx:{common:e.parent.common,data:e.data,parsedType:Sm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Wm(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:Sm(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Jm(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:Sm(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(Wm(r)?r:Promise.resolve(r));return Jm(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:Im.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 Gf({schema:this,typeName:Qf.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return zf.create(this,this._def)}nullable(){return $f.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ef.create(this,this._def)}promise(){return Lf.create(this,this._def)}or(e){return Tf.create([this,e],this._def)}and(e){return Ff.create(this,e,this._def)}transform(e){return new Gf({...Ym(this._def),schema:this,typeName:Qf.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Hf({...Ym(this._def),innerType:this,defaultValue:t,typeName:Qf.ZodDefault})}brand(){return new Zf({typeName:Qf.ZodBranded,type:this,...Ym(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new qf({...Ym(this._def),innerType:this,catchValue:t,typeName:Qf.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Kf.create(this,e)}readonly(){return Jf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Qm=/^c[^\s-]{8,}$/i,ef=/^[a-z][a-z0-9]*$/,tf=/^[0-9A-HJKMNP-TV-Z]{26}$/,nf=/^[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,rf=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let af;const sf=/^(((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}))$/,of=/^(([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 cf(e,t){return!("v4"!==t&&t||!sf.test(e))||!("v6"!==t&&t||!of.test(e))}class lf extends Xm{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==_m.string){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.string,received:t.parsedType}),Gm}const t=new Lm;let n;for(const a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),jm(n,{code:Im.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),jm(n,{code:Im.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?jm(n,{code:Im.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&jm(n,{code:Im.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)rf.test(e.data)||(n=this._getOrReturnCtx(e,n),jm(n,{validation:"email",code:Im.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)af||(af=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),af.test(e.data)||(n=this._getOrReturnCtx(e,n),jm(n,{validation:"emoji",code:Im.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)nf.test(e.data)||(n=this._getOrReturnCtx(e,n),jm(n,{validation:"uuid",code:Im.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)Qm.test(e.data)||(n=this._getOrReturnCtx(e,n),jm(n,{validation:"cuid",code:Im.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)ef.test(e.data)||(n=this._getOrReturnCtx(e,n),jm(n,{validation:"cuid2",code:Im.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)tf.test(e.data)||(n=this._getOrReturnCtx(e,n),jm(n,{validation:"ulid",code:Im.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),jm(n,{validation:"url",code:Im.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),jm(n,{validation:"regex",code:Im.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),jm(n,{code:Im.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),jm(n,{code:Im.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),jm(n,{code:Im.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),jm(n,{code:Im.invalid_string,validation:"datetime",message:a.message}),t.dirty())}else"ip"===a.kind?cf(e.data,a.version)||(n=this._getOrReturnCtx(e,n),jm(n,{validation:"ip",code:Im.invalid_string,message:a.message}),t.dirty()):Fm.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:Im.invalid_string,...Zm.errToObj(n)})}_addCheck(e){return new lf({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Zm.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Zm.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Zm.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Zm.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Zm.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Zm.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Zm.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Zm.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,...Zm.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Zm.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...Zm.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Zm.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Zm.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Zm.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Zm.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Zm.errToObj(t)})}nonempty(e){return this.min(1,Zm.errToObj(e))}trim(){return new lf({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new lf({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new lf({...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 uf(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)}lf.create=e=>{var t;return new lf({checks:[],typeName:Qf.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Ym(e)})};class df extends Xm{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)!==_m.number){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.number,received:t.parsedType}),Gm}let t;const n=new Lm;for(const r of this._def.checks)if("int"===r.kind)Fm.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),jm(t,{code:Im.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),jm(t,{code:Im.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),jm(t,{code:Im.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==uf(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),jm(t,{code:Im.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),jm(t,{code:Im.not_finite,message:r.message}),n.dirty()):Fm.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Zm.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Zm.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Zm.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Zm.toString(t))}setLimit(e,t,n,r){return new df({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Zm.toString(r)}]})}_addCheck(e){return new df({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Zm.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Zm.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Zm.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Zm.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Zm.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Zm.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Zm.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Zm.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Zm.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&&Fm.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)}}df.create=e=>new df({checks:[],typeName:Qf.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Ym(e)});class pf extends Xm{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)!==_m.bigint){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.bigint,received:t.parsedType}),Gm}let t;const n=new Lm;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),jm(t,{code:Im.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),jm(t,{code:Im.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),jm(t,{code:Im.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Fm.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Zm.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Zm.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Zm.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Zm.toString(t))}setLimit(e,t,n,r){return new pf({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Zm.toString(r)}]})}_addCheck(e){return new pf({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Zm.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Zm.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Zm.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Zm.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Zm.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}}pf.create=e=>{var t;return new pf({checks:[],typeName:Qf.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Ym(e)})};class hf extends Xm{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==_m.boolean){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.boolean,received:t.parsedType}),Gm}return $m(e.data)}}hf.create=e=>new hf({typeName:Qf.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Ym(e)});class mf extends Xm{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==_m.date){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.date,received:t.parsedType}),Gm}if(isNaN(e.data.getTime())){return jm(this._getOrReturnCtx(e),{code:Im.invalid_date}),Gm}const t=new Lm;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),jm(n,{code:Im.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),jm(n,{code:Im.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Fm.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new mf({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Zm.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Zm.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}}mf.create=e=>new mf({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Qf.ZodDate,...Ym(e)});class ff extends Xm{_parse(e){if(this._getType(e)!==_m.symbol){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.symbol,received:t.parsedType}),Gm}return $m(e.data)}}ff.create=e=>new ff({typeName:Qf.ZodSymbol,...Ym(e)});class yf extends Xm{_parse(e){if(this._getType(e)!==_m.undefined){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.undefined,received:t.parsedType}),Gm}return $m(e.data)}}yf.create=e=>new yf({typeName:Qf.ZodUndefined,...Ym(e)});class bf extends Xm{_parse(e){if(this._getType(e)!==_m.null){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.null,received:t.parsedType}),Gm}return $m(e.data)}}bf.create=e=>new bf({typeName:Qf.ZodNull,...Ym(e)});class gf extends Xm{constructor(){super(...arguments),this._any=!0}_parse(e){return $m(e.data)}}gf.create=e=>new gf({typeName:Qf.ZodAny,...Ym(e)});class vf extends Xm{constructor(){super(...arguments),this._unknown=!0}_parse(e){return $m(e.data)}}vf.create=e=>new vf({typeName:Qf.ZodUnknown,...Ym(e)});class wf extends Xm{_parse(e){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.never,received:t.parsedType}),Gm}}wf.create=e=>new wf({typeName:Qf.ZodNever,...Ym(e)});class xf extends Xm{_parse(e){if(this._getType(e)!==_m.undefined){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.void,received:t.parsedType}),Gm}return $m(e.data)}}xf.create=e=>new xf({typeName:Qf.ZodVoid,...Ym(e)});class Ef extends Xm{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==_m.array)return jm(t,{code:Im.invalid_type,expected:_m.array,received:t.parsedType}),Gm;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(jm(t,{code:e?Im.too_big:Im.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&&(jm(t,{code:Im.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&&(jm(t,{code:Im.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 Km(t,e,t.path,n))))).then((e=>Lm.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>r.type._parseSync(new Km(t,e,t.path,n))));return Lm.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new Ef({...this._def,minLength:{value:e,message:Zm.toString(t)}})}max(e,t){return new Ef({...this._def,maxLength:{value:e,message:Zm.toString(t)}})}length(e,t){return new Ef({...this._def,exactLength:{value:e,message:Zm.toString(t)}})}nonempty(e){return this.min(1,e)}}function Cf(e){if(e instanceof kf){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=zf.create(Cf(r))}return new kf({...e._def,shape:()=>t})}return e instanceof Ef?new Ef({...e._def,type:Cf(e.element)}):e instanceof zf?zf.create(Cf(e.unwrap())):e instanceof $f?$f.create(Cf(e.unwrap())):e instanceof Df?Df.create(e.items.map((e=>Cf(e)))):e}Ef.create=(e,t)=>new Ef({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Qf.ZodArray,...Ym(t)});class kf extends Xm{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=Fm.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==_m.object){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.object,received:t.parsedType}),Gm}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof wf&&"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 Km(n,a,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof wf){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&&(jm(n,{code:Im.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 Km(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=>Lm.mergeObjectSync(t,e))):Lm.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return Zm.errToObj,new kf({...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=Zm.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new kf({...this._def,unknownKeys:"strip"})}passthrough(){return new kf({...this._def,unknownKeys:"passthrough"})}extend(e){return new kf({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new kf({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Qf.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new kf({...this._def,catchall:e})}pick(e){const t={};return Fm.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new kf({...this._def,shape:()=>t})}omit(e){const t={};return Fm.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new kf({...this._def,shape:()=>t})}deepPartial(){return Cf(this)}partial(e){const t={};return Fm.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new kf({...this._def,shape:()=>t})}required(e){const t={};return Fm.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof zf;)e=e._def.innerType;t[n]=e}})),new kf({...this._def,shape:()=>t})}keyof(){return Uf(Fm.objectKeys(this.shape))}}kf.create=(e,t)=>new kf({shape:()=>e,unknownKeys:"strip",catchall:wf.create(),typeName:Qf.ZodObject,...Ym(t)}),kf.strictCreate=(e,t)=>new kf({shape:()=>e,unknownKeys:"strict",catchall:wf.create(),typeName:Qf.ZodObject,...Ym(t)}),kf.lazycreate=(e,t)=>new kf({shape:e,unknownKeys:"strip",catchall:wf.create(),typeName:Qf.ZodObject,...Ym(t)});class Tf extends Xm{_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 Mm(e.ctx.common.issues)));return jm(t,{code:Im.invalid_union,unionErrors:n}),Gm}));{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 Mm(e)));return jm(t,{code:Im.invalid_union,unionErrors:a}),Gm}}get options(){return this._def.options}}Tf.create=(e,t)=>new Tf({options:e,typeName:Qf.ZodUnion,...Ym(t)});const Pf=e=>e instanceof Nf?Pf(e.schema):e instanceof Gf?Pf(e.innerType()):e instanceof Bf?[e.value]:e instanceof Rf?e.options:e instanceof jf?Object.keys(e.enum):e instanceof Hf?Pf(e._def.innerType):e instanceof yf?[void 0]:e instanceof bf?[null]:null;class Af extends Xm{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_m.object)return jm(t,{code:Im.invalid_type,expected:_m.object,received:t.parsedType}),Gm;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}):(jm(t,{code:Im.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Gm)}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=Pf(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 Af({typeName:Qf.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Ym(n)})}}function Of(e,t){const n=Sm(e),r=Sm(t);if(e===t)return{valid:!0,data:e};if(n===_m.object&&r===_m.object){const n=Fm.objectKeys(t),r=Fm.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const n of r){const r=Of(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}if(n===_m.array&&r===_m.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const a=Of(e[r],t[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return n===_m.date&&r===_m.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ff extends Xm{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Hm(e)||Hm(r))return Gm;const a=Of(e.value,r.value);return a.valid?((qm(e)||qm(r))&&t.dirty(),{status:t.value,value:a.data}):(jm(n,{code:Im.invalid_intersection_types}),Gm)};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}))}}Ff.create=(e,t,n)=>new Ff({left:e,right:t,typeName:Qf.ZodIntersection,...Ym(n)});class Df extends Xm{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_m.array)return jm(n,{code:Im.invalid_type,expected:_m.array,received:n.parsedType}),Gm;if(n.data.length<this._def.items.length)return jm(n,{code:Im.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Gm;!this._def.rest&&n.data.length>this._def.items.length&&(jm(n,{code:Im.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 Km(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Lm.mergeArray(t,e))):Lm.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Df({...this._def,rest:e})}}Df.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Df({items:e,typeName:Qf.ZodTuple,rest:null,...Ym(t)})};class _f extends Xm{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!==_m.object)return jm(n,{code:Im.invalid_type,expected:_m.object,received:n.parsedType}),Gm;const r=[],a=this._def.keyType,s=this._def.valueType;for(const e in n.data)r.push({key:a._parse(new Km(n,e,n.path,e)),value:s._parse(new Km(n,n.data[e],n.path,e))});return n.common.async?Lm.mergeObjectAsync(t,r):Lm.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new _f(t instanceof Xm?{keyType:e,valueType:t,typeName:Qf.ZodRecord,...Ym(n)}:{keyType:lf.create(),valueType:e,typeName:Qf.ZodRecord,...Ym(t)})}}class Sf extends Xm{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!==_m.map)return jm(n,{code:Im.invalid_type,expected:_m.map,received:n.parsedType}),Gm;const r=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map((([e,t],s)=>({key:r._parse(new Km(n,e,n.path,[s,"key"])),value:a._parse(new Km(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 Gm;"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 Gm;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}Sf.create=(e,t,n)=>new Sf({valueType:t,keyType:e,typeName:Qf.ZodMap,...Ym(n)});class If extends Xm{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_m.set)return jm(n,{code:Im.invalid_type,expected:_m.set,received:n.parsedType}),Gm;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(jm(n,{code:Im.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&&(jm(n,{code:Im.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 Gm;"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 Km(n,e,n.path,t))));return n.common.async?Promise.all(i).then((e=>s(e))):s(i)}min(e,t){return new If({...this._def,minSize:{value:e,message:Zm.toString(t)}})}max(e,t){return new If({...this._def,maxSize:{value:e,message:Zm.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}If.create=(e,t)=>new If({valueType:e,minSize:null,maxSize:null,typeName:Qf.ZodSet,...Ym(t)});class Mf extends Xm{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_m.function)return jm(t,{code:Im.invalid_type,expected:_m.function,received:t.parsedType}),Gm;function n(e,n){return Rm({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Um(),Nm].filter((e=>!!e)),issueData:{code:Im.invalid_arguments,argumentsError:n}})}function r(e,n){return Rm({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Um(),Nm].filter((e=>!!e)),issueData:{code:Im.invalid_return_type,returnTypeError:n}})}const a={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Lf){const e=this;return $m((async function(...t){const i=new Mm([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw i.addIssue(n(t,e)),i})),c=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(c,a).catch((e=>{throw i.addIssue(r(c,e)),i}))}))}{const e=this;return $m((function(...t){const i=e._def.args.safeParse(t,a);if(!i.success)throw new Mm([n(t,i.error)]);const o=Reflect.apply(s,this,i.data),c=e._def.returns.safeParse(o,a);if(!c.success)throw new Mm([r(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Mf({...this._def,args:Df.create(e).rest(vf.create())})}returns(e){return new Mf({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Mf({args:e||Df.create([]).rest(vf.create()),returns:t||vf.create(),typeName:Qf.ZodFunction,...Ym(n)})}}class Nf extends Xm{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})}}Nf.create=(e,t)=>new Nf({getter:e,typeName:Qf.ZodLazy,...Ym(t)});class Bf extends Xm{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return jm(t,{received:t.data,code:Im.invalid_literal,expected:this._def.value}),Gm}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Uf(e,t){return new Rf({values:e,typeName:Qf.ZodEnum,...Ym(t)})}Bf.create=(e,t)=>new Bf({value:e,typeName:Qf.ZodLiteral,...Ym(t)});class Rf extends Xm{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return jm(t,{expected:Fm.joinValues(n),received:t.parsedType,code:Im.invalid_type}),Gm}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return jm(t,{received:t.data,code:Im.invalid_enum_value,options:n}),Gm}return $m(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 Rf.create(e)}exclude(e){return Rf.create(this.options.filter((t=>!e.includes(t))))}}Rf.create=Uf;class jf extends Xm{_parse(e){const t=Fm.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_m.string&&n.parsedType!==_m.number){const e=Fm.objectValues(t);return jm(n,{expected:Fm.joinValues(e),received:n.parsedType,code:Im.invalid_type}),Gm}if(-1===t.indexOf(e.data)){const e=Fm.objectValues(t);return jm(n,{received:n.data,code:Im.invalid_enum_value,options:e}),Gm}return $m(e.data)}get enum(){return this._def.values}}jf.create=(e,t)=>new jf({values:e,typeName:Qf.ZodNativeEnum,...Ym(t)});class Lf extends Xm{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_m.promise&&!1===t.common.async)return jm(t,{code:Im.invalid_type,expected:_m.promise,received:t.parsedType}),Gm;const n=t.parsedType===_m.promise?t.data:Promise.resolve(t.data);return $m(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Lf.create=(e,t)=>new Lf({type:e,typeName:Qf.ZodPromise,...Ym(t)});class Gf extends Xm{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Qf.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=>{jm(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?Gm:("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?Gm:("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(!Vm(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=>Vm(e)?Promise.resolve(r.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}Fm.assertNever(r)}}Gf.create=(e,t,n)=>new Gf({schema:e,typeName:Qf.ZodEffects,effect:t,...Ym(n)}),Gf.createWithPreprocess=(e,t,n)=>new Gf({schema:t,effect:{type:"preprocess",transform:e},typeName:Qf.ZodEffects,...Ym(n)});class zf extends Xm{_parse(e){return this._getType(e)===_m.undefined?$m(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}zf.create=(e,t)=>new zf({innerType:e,typeName:Qf.ZodOptional,...Ym(t)});class $f extends Xm{_parse(e){return this._getType(e)===_m.null?$m(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$f.create=(e,t)=>new $f({innerType:e,typeName:Qf.ZodNullable,...Ym(t)});class Hf extends Xm{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===_m.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Hf.create=(e,t)=>new Hf({innerType:e,typeName:Qf.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Ym(t)});class qf extends Xm{_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 Wm(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new Mm(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new Mm(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}qf.create=(e,t)=>new qf({innerType:e,typeName:Qf.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Ym(t)});class Vf extends Xm{_parse(e){if(this._getType(e)!==_m.nan){const t=this._getOrReturnCtx(e);return jm(t,{code:Im.invalid_type,expected:_m.nan,received:t.parsedType}),Gm}return{status:"valid",value:e.data}}}Vf.create=e=>new Vf({typeName:Qf.ZodNaN,...Ym(e)});const Wf=Symbol("zod_brand");class Zf extends Xm{_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 Kf extends Xm{_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?Gm:"dirty"===e.status?(t.dirty(),zm(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?Gm:"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 Kf({in:e,out:t,typeName:Qf.ZodPipeline})}}class Jf extends Xm{_parse(e){const t=this._def.innerType._parse(e);return Vm(t)&&(t.value=Object.freeze(t.value)),t}}Jf.create=(e,t)=>new Jf({innerType:e,typeName:Qf.ZodReadonly,...Ym(t)});const Yf=(e,t={},n)=>e?gf.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})}})):gf.create(),Xf={object:kf.lazycreate};var Qf;!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"}(Qf||(Qf={}));const ey=lf.create,ty=df.create,ny=Vf.create,ry=pf.create,ay=hf.create,sy=mf.create,iy=ff.create,oy=yf.create,cy=bf.create,ly=gf.create,uy=vf.create,dy=wf.create,py=xf.create,hy=Ef.create,my=kf.create,fy=kf.strictCreate,yy=Tf.create,by=Af.create,gy=Ff.create,vy=Df.create,wy=_f.create,xy=Sf.create,Ey=If.create,Cy=Mf.create,ky=Nf.create,Ty=Bf.create,Py=Rf.create,Ay=jf.create,Oy=Lf.create,Fy=Gf.create,Dy=zf.create,_y=$f.create,Sy=Gf.createWithPreprocess,Iy=Kf.create,My={string:e=>lf.create({...e,coerce:!0}),number:e=>df.create({...e,coerce:!0}),boolean:e=>hf.create({...e,coerce:!0}),bigint:e=>pf.create({...e,coerce:!0}),date:e=>mf.create({...e,coerce:!0})},Ny=Gm;var By=Object.freeze({__proto__:null,defaultErrorMap:Nm,setErrorMap:function(e){Bm=e},getErrorMap:Um,makeIssue:Rm,EMPTY_PATH:[],addIssueToContext:jm,ParseStatus:Lm,INVALID:Gm,DIRTY:zm,OK:$m,isAborted:Hm,isDirty:qm,isValid:Vm,isAsync:Wm,get util(){return Fm},get objectUtil(){return Dm},ZodParsedType:_m,getParsedType:Sm,ZodType:Xm,ZodString:lf,ZodNumber:df,ZodBigInt:pf,ZodBoolean:hf,ZodDate:mf,ZodSymbol:ff,ZodUndefined:yf,ZodNull:bf,ZodAny:gf,ZodUnknown:vf,ZodNever:wf,ZodVoid:xf,ZodArray:Ef,ZodObject:kf,ZodUnion:Tf,ZodDiscriminatedUnion:Af,ZodIntersection:Ff,ZodTuple:Df,ZodRecord:_f,ZodMap:Sf,ZodSet:If,ZodFunction:Mf,ZodLazy:Nf,ZodLiteral:Bf,ZodEnum:Rf,ZodNativeEnum:jf,ZodPromise:Lf,ZodEffects:Gf,ZodTransformer:Gf,ZodOptional:zf,ZodNullable:$f,ZodDefault:Hf,ZodCatch:qf,ZodNaN:Vf,BRAND:Wf,ZodBranded:Zf,ZodPipeline:Kf,ZodReadonly:Jf,custom:Yf,Schema:Xm,ZodSchema:Xm,late:Xf,get ZodFirstPartyTypeKind(){return Qf},coerce:My,any:ly,array:hy,bigint:ry,boolean:ay,date:sy,discriminatedUnion:by,effect:Fy,enum:Py,function:Cy,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Yf((t=>t instanceof e),t),intersection:gy,lazy:ky,literal:Ty,map:xy,nan:ny,nativeEnum:Ay,never:dy,null:cy,nullable:_y,number:ty,object:my,oboolean:()=>ay().optional(),onumber:()=>ty().optional(),optional:Dy,ostring:()=>ey().optional(),pipeline:Iy,preprocess:Sy,promise:Oy,record:wy,set:Ey,strictObject:fy,string:ey,symbol:iy,transformer:Fy,tuple:vy,undefined:oy,union:yy,unknown:uy,void:py,NEVER:Ny,ZodIssueCode:Im,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Mm});const Uy={...Il,rpcUrls:{...Il.rpcUrls,alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"]}}},Ry={...Ml,rpcUrls:{...Ml.rpcUrls,alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"]}}},jy={...jl,rpcUrls:{...jl.rpcUrls,alchemy:{http:["https://arb-sepolia.g.alchemy.com/v2"]}}},Ly={...hd,rpcUrls:{...hd.rpcUrls,alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"]}}},Gy={...Ld,rpcUrls:{...Ld.rpcUrls,alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"]}}},zy={...fp,rpcUrls:{...fp.rpcUrls,alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"]}}},$y={...yp,rpcUrls:{...yp.rpcUrls,alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"]}}},Hy={...gp,rpcUrls:{...gp.rpcUrls,alchemy:{http:["https://opt-sepolia.g.alchemy.com/v2"]}}},qy={...Xp,rpcUrls:{...Xp.rpcUrls,alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"]}}},Vy={...Wl,rpcUrls:{...Wl.rpcUrls,alchemy:{http:["https://base-mainnet.g.alchemy.com/v2"]}}},Wy={...Zl,rpcUrls:{...Zl.rpcUrls,alchemy:{http:["https://base-goerli.g.alchemy.com/v2"]}}},Zy={...Jl,rpcUrls:{...Jl.rpcUrls,alchemy:{http:["https://base-sepolia.g.alchemy.com/v2"]}}},Ky={...Sp,rpcUrls:{...Sp.rpcUrls,alchemy:{http:["https://polygon-mumbai.g.alchemy.com/v2"]}}},Jy={..._p,rpcUrls:{..._p.rpcUrls,alchemy:{http:["https://polygon-amoy.g.alchemy.com/v2"]}}},Yy={...Dp,rpcUrls:{...Dp.rpcUrls,alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"]}}},Xy={...rd,rpcUrls:{...rd.rpcUrls}},Qy=Un({id:2523,name:"Fraxtal Sepolia",nativeCurrency:{name:"Frax Ether",symbol:"frxETH",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet-sepolia.frax.com"]}}}),eb={...em,rpcUrls:{...em.rpcUrls}},tb={...nm,rpcUrls:{...nm.rpcUrls}};var nb=Object.freeze({__proto__:null,arbitrum:Uy,arbitrumGoerli:Ry,arbitrumSepolia:jy,goerli:Ly,mainnet:Gy,optimism:zy,optimismGoerli:$y,optimismSepolia:Hy,sepolia:qy,base:Vy,baseGoerli:Wy,baseSepolia:Zy,polygonMumbai:Ky,polygonAmoy:Jy,polygon:Yy,fraxtal:Xy,fraxtalSepolia:Qy,zora:eb,zoraSepolia:tb});const rb=By.custom((e=>null!=e&&"object"==typeof e&&"id"in e&&"number"==typeof e.id)),ab=By.custom((e=>Vn(e,{strict:!0}))),sb=By.union([ab,By.number(),By.bigint()]),ib=By.object({min:sb.optional(),max:sb.optional()}).strict(),ob=By.object({multiplier:By.number().refine((e=>(e.toString().split(".")[1]?.length??0)<=4),{message:"Max precision is 4 decimal places"})}).strict();function cb(e){return null!=e&&sb.safeParse(e).success}function lb(e){return null!=e&&ob.safeParse(e).success}const ub=(...e)=>{if(!e.length)throw new Error("bigIntMax requires at least one argument");return e.reduce(((e,t)=>e>t?e:t))},db=(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 pb;!function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_UP=1]="ROUND_UP"}(pb||(pb={}));const hb=(e,t,n=pb.ROUND_UP)=>{if(!lb({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===pb.ROUND_UP?BigInt(e)*BigInt(t*10**r)+BigInt(10**r-1):BigInt(e)*BigInt(t*10**r))/BigInt(10**r)},mb=(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)}`},fb=new Map([[Uy.id,10000000n],[Ry.id,10000000n],[jy.id,10000000n]]),yb=e=>({maxPriorityFeePerGas:{min:fb.get(e.id)??100000000n,multiplier:1.33}});function bb(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 Ab(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 Ab(null==e.factory,null==e.factoryData)}(e)}function gb(e,t,n){return null!=e&&null!=t?function(e,t){return null==t?e:cb(t)?t:null!=e?hb(e,t.multiplier):e}(e,t):function(e,t){return null==t?e:null!=e?db(t.multiplier?hb(e,t.multiplier):e,t.min,t.max):t.min??0n}(e,n)}const vb=e=>!!e&&("paymasterAndData"in e||"paymasterData"in e),wb=e=>void 0!==e&&("paymasterAndData"in e&&"0x"===e.paymasterAndData||"paymasterData"in e&&"0x"===e.paymasterData),xb=({paymaster:e="0x",paymasterData:t="0x"})=>Nr([e,t]),Eb=new Map(Object.values(nb).map((e=>[e.id,e]))),Cb=e=>{for(const t of Object.values(am))if(t.id===e)return Eb.get(t.id)??t;throw new Error("could not find chain")};async function kb(e){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return Pb((await Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{}))}function Tb(e){if("function"!=typeof e)return null==e||"string"==typeof e||"boolean"==typeof e?e:"bigint"==typeof e?tr(e):null!=e._isBigNumber||"object"!=typeof e?tr(e).replace(/^0x0/,"0x"):Array.isArray(e)?e.map((e=>Tb(e))):Object.keys(e).reduce(((t,n)=>({...t,[n]:Tb(e[n])})),{})}function Pb(e){for(const t in e)null==e[t]&&delete e[t];return e}const Ab=(...e)=>{if(0===e.length)throw new Error("no values passed in");return e.every((t=>t===e[0]))},Ob=(e,t)=>e.then((e=>e?t():void 0)),Fb=By.union([By.object({rpcUrl:By.never().optional(),apiKey:By.string(),jwt:By.never().optional()}),By.object({rpcUrl:By.never().optional(),apiKey:By.never().optional(),jwt:By.string()}),By.object({rpcUrl:By.string(),apiKey:By.never().optional(),jwt:By.never().optional()}),By.object({rpcUrl:By.string(),apiKey:By.never().optional(),jwt:By.string()})]),Db=ib.merge(ob).partial(),_b=By.object({maxFeePerGas:Db,maxPriorityFeePerGas:Db,callGasLimit:Db,verificationGasLimit:Db,preVerificationGas:Db}).partial().strict().extend({paymasterVerificationGasLimit:Db,paymasterPostOpGasLimit:Db}).partial().strict(),Sb=By.object({txMaxRetries:By.number().min(0).optional().default(5),txRetryIntervalMs:By.number().min(0).optional().default(2e3),txRetryMultiplier:By.number().min(0).optional().default(1.5),feeOptions:_b.optional()}).strict();var Ib;function Mb(e){if("string"==typeof e){if(!Mr(e,{strict:!1}))throw new Or({address:e});return{address:e,type:"json-rpc"}}if(!Mr(e.address,{strict:!1}))throw new Or({address:e.address});return{address:e.address,signMessage:e.signMessage,signTransaction:e.signTransaction,signTypedData:e.signTypedData,source:"custom",type:"local"}}By.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"}(Ib||(Ib={}));const Nb=e=>"getSigner"in e,Bb=e=>[`0x${e.substring(2,42)}`,`0x${e.substring(42)}`],Ub=async({client:e,entryPoint:t,accountAddress:n,getAccountInitCode:r})=>{if(n)return n;const a=ec({address:t.address,abi:t.abi,client:e}),s=await r();Am.verbose("[BaseSmartContractAccount](getAddress) initCode: ",s);try{await a.simulate.getSenderAddress([s])}catch(e){if(Am.verbose("[BaseSmartContractAccount](getAddress) getSenderAddress err: ",e),"SenderAddressResult"===e.cause?.data?.errorName)return Am.verbose("[BaseSmartContractAccount](getAddress) entryPoint.getSenderAddress result:",e.cause.data.args[0]),e.cause.data.args[0];if("Invalid URL"===e.details)throw new cm}throw new xm};class Rb extends im{constructor(){super("Transaction is missing `to` address set on request"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionMissingToParamError"})}}class jb extends im{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 Lb(e,t,n,r){const{account:a=e.account,...s}=t;if(!a||"string"==typeof a)throw new wm;if(!s.to)throw new Rb;if(!eg(e))throw new om("BaseSmartAccountClient","buildUserOperationFromTx",e);const i={...n,maxFeePerGas:s.maxFeePerGas?s.maxFeePerGas:void 0,maxPriorityFeePerGas:s.maxPriorityFeePerGas?s.maxPriorityFeePerGas:void 0};return tg(e,{uo:{target:s.to,data:s.data??"0x",value:s.value?s.value:0n},account:a,context:r,overrides:i})}async function Gb(e,t){const{account:n=e.account,requests:r,overrides:a,context:s}=t;if(!n)throw new wm;if(!eg(e))throw new om("BaseSmartAccountClient","buildUserOperationFromTxs",e);const i=r.map((e=>{if(!e.to)throw new Rb;return{target:e.to,data:e.data??"0x",value:e.value?mr(e.value,"bigint"):0n}})),o=()=>r.filter((e=>null!=e.maxFeePerGas)).map((e=>mr(e.maxFeePerGas,"bigint"))),c=()=>r.filter((e=>null!=e.maxPriorityFeePerGas)).map((e=>mr(e.maxPriorityFeePerGas,"bigint"))),l={maxFeePerGas:null!=a?.maxFeePerGas?a?.maxFeePerGas:o().length>0?ub(...o()):void 0,maxPriorityFeePerGas:null!=a?.maxPriorityFeePerGas?a?.maxPriorityFeePerGas:c().length>0?ub(...c()):void 0};return{uoStruct:await tg(e,{uo:i,account:n,context:s,overrides:l}),batch:i,overrides:l}}const zb=async e=>e,$b=(...e)=>async(t,n)=>{let r=t;for(const t of e)r=await t(r,n);return r};async function Hb(e,t){const{uo:n,overrides:r,account:a=e.account,context:s}=t;if(!a)throw new wm;const{dummyPaymasterAndData:i,paymasterAndData:o}=vb(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:zb}:{dummyPaymasterAndData:e.middleware.dummyPaymasterAndData,paymasterAndData:e.middleware.paymasterAndData};return kb(await $b(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 qb(e,t){const{account:n=e.account,context:r}=t;if(!n)throw new wm;if(!eg(e))throw new om("BaseSmartAccountClient","signUserOperation",e);if(!e.chain)throw new lm;return await e.middleware.signUserOperation(t.uoStruct,{...t,account:n,client:e,context:r}).then(kb).then(Tb)}async function Vb(e,t){const{account:n=e.account,uoStruct:r,context:a,overrides:s}=t;if(!n)throw new wm;if(!e.chain)throw new lm;const i=n.getEntryPoint(),o=await qb(e,{uoStruct:r,account:n,context:a,overrides:s});return{hash:await e.sendRawUserOperation(o,i.address),request:o}}class Wb extends im{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 Zb extends im{constructor(e,t){super(`Failed to find User Operation: ${t.message}`),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:e})}}const Kb=async(e,t)=>{if(!eg(e))throw new om("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=>{Am.error(`[SmartAccountProvider] waitForUserOperationTransaction error fetching receipt for ${n}: ${e}`)}));if(s)return gl(e,{hash:s.receipt.transactionHash}).then((e=>e.hash))}throw new jb(n)};async function Jb(e,t){const{account:n=e.account,context:r,overrides:a}=t;if(!n)throw new wm;if(!eg(e))throw new om("BaseSmartAccountClient","sendUserOperation",e);return Vb(e,{account:n,uoStruct:await tg(e,{uo:t.uo,account:n,context:r,overrides:a}),context:r,overrides:a})}const Yb=e=>({buildUserOperation:t=>tg(e,t),buildUserOperationFromTx:(t,n,r)=>Lb(e,t,n,r),buildUserOperationFromTxs:t=>Gb(e,t),checkGasSponsorshipEligibility:t=>function(e,t){const{account:n=e.account,overrides:r,context:a}=t;if(!n)throw new wm;if(!eg(e))throw new om("BaseSmartAccountClient","checkGasSponsorshipEligibility",e);return tg(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=>qb(e,t),dropAndReplaceUserOperation:t=>async function(e,t){const{account:n=e.account,uoToDrop:r,overrides:a,context:s}=t;if(!n)throw new wm;if(!eg(e))throw new om("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 Hb(e,{uo:i,overrides:a,account:n}),l={...a,maxFeePerGas:ub(BigInt(o??0n),hb(r.maxFeePerGas,1.1)),maxPriorityFeePerGas:ub(BigInt(c??0n),hb(r.maxPriorityFeePerGas,1.1))};return Vb(e,{uoStruct:await Hb(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 wm;if(!t.to)throw new Rb;if(!eg(e))throw new om("BaseSmartAccountClient","sendTransaction",e);const s=await Lb(e,t,n,r),{hash:i,request:o}=await Vb(e,{account:a,uoStruct:s,context:r,overrides:n});return Kb(e,{hash:i}).catch((e=>{throw new Zb(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 wm;if(!eg(e))throw new om("BaseSmartAccountClient","sendTransactions",e);const{uoStruct:i}=await Gb(e,{requests:n,overrides:r,account:a,context:s}),{hash:o,request:c}=await Vb(e,{account:a,uoStruct:i,context:s,overrides:r});return Kb(e,{hash:o}).catch((e=>{throw new Zb(c,e)}))}(e,t),sendUserOperation:t=>Jb(e,t),waitForUserOperationTransaction:t=>Kb.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 wm;if(!eg(e))throw new om("BaseSmartAccountClient","upgradeAccount",e);const{implAddress:o,initializationData:c}=r,l=await n.encodeUpgradeToAndCall({upgradeToAddress:o,upgradeToInitData:c}),u=await Jb(e,{uo:{target:n.address,data:l},account:n,overrides:a,context:i});let d=u.hash;return s&&(d=await Kb(e,u)),d})(e,t),getAddress:t=>((e,t)=>{const{account:n}=t??{account:e.account};if(!n)throw new wm;return n.address})(e,t),signMessage:t=>(async(e,{account:t=e.account,message:n})=>{if(!t)throw new wm;return t.signMessage({message:n})})(e,t),signTypedData:t=>(async(e,{account:t=e.account,typedData:n})=>{if(!t)throw new wm;return t.signTypedData(n)})(e,t),signMessageWith6492:t=>(async(e,{account:t=e.account,message:n})=>{if(!t)throw new wm;return t.signMessageWith6492({message:n})})(e,t),signTypedDataWith6492:t=>(async(e,{account:t=e.account,typedData:n})=>{if(!t)throw new wm;return t.signTypedDataWith6492(n)})(e,t)}),Xb=Object.keys(Yb(void 0)).reduce(((e,t)=>(e.add(t),e)),new Set);function Qb(e){for(const t of Xb)if(!(t in e))return!1;return e&&"middleware"in e}function eg(e){return e&&"middleware"in e}async function tg(e,t){const{account:n=e.account,overrides:r,context:a}=t;if(!n)throw new wm;if(!eg(e))throw new om("BaseSmartAccountClient","buildUserOperation",e);return async function(e,t){const{account:n=e.account,uo:r,overrides:a}=t;if(!n)throw new wm;if(!e.chain)throw new lm;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:Ob(n.isAccountDeployed().then((e=>!e)),n.getFactoryAddress),factoryData:Ob(n.isAccountDeployed().then((e=>!e)),n.getFactoryData),sender:n.address,nonce:c,callData:i,signature:o}}(e,t).then((t=>Hb(e,{uo:t,overrides:r,account:n,context:a})))}const ng=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=gb(s,n?.maxPriorityFeePerGas,r?.maxPriorityFeePerGas);let i=a.maxFeePerGas-a.maxPriorityFeePerGas+BigInt(s);return i=gb(i,n?.maxFeePerGas,r?.maxFeePerGas),t.maxFeePerGas=i,t.maxPriorityFeePerGas=s,t},rg=e=>async(t,{account:n,overrides:r,feeOptions:a})=>{const s=Tb(await kb(t)),i=await e.estimateUserOperationGas(s,n.getEntryPoint().address,r?.stateOverride),o=gb(i.callGasLimit,r?.callGasLimit,a?.callGasLimit),c=gb(i.verificationGasLimit,r?.verificationGasLimit,a?.verificationGasLimit),l=gb(i.preVerificationGas,r?.preVerificationGas,a?.preVerificationGas);t.callGasLimit=o,t.verificationGasLimit=c,t.preVerificationGas=l;if("0.7.0"===n.getEntryPoint().version){const e=gb(i.paymasterVerificationGasLimit,r?.paymasterVerificationGasLimit,a?.paymasterVerificationGasLimit);t.paymasterVerificationGasLimit=e}return t},ag=async(e,{account:t})=>("0.6.0"===t.getEntryPoint().version&&(e.paymasterAndData="0x"),e),sg=async(e,{client:t,account:n=t.account})=>{if(!n)throw new wm;if(!t?.chain)throw new lm;const r=await kb(e),a=Tb(r);if(!bb(a))throw new Wb(r);return{...r,signature:await n.signUserOperationHash(n.getEntryPoint().getUserOperationHash(a))}},ig=e=>t=>({middleware:{customMiddleware:e.customMiddleware??zb,dummyPaymasterAndData:e.paymasterAndData?.dummyPaymasterAndData?async(t,{account:n})=>{const r=e.paymasterAndData.dummyPaymasterAndData();var a;return{...t,..."0.7.0"===n.getEntryPoint().version?Vn(r)?{paymaster:(a=r).substring(0,42),paymasterData:`0x${a.substring(42)}`}:r:{paymasterAndData:Vn(r)?r:xb(r)}}}:ag,feeEstimator:e.feeEstimator??ng(t),gasEstimator:e.gasEstimator??rg(t),paymasterAndData:e.paymasterAndData?.paymasterAndData??ag,userOperationSimulator:e.userOperationSimulator??zb,signUserOperation:e.signUserOperation??sg}});function og(e){return function(e){const{key:t="account",name:n="account provider",transport:r,type:a="SmartAccountClient",...s}=e,i=dm({...s,key:t,name:n,type:"SmartAccountClient",transport:e=>{const t=r(e);return dc({async request({method:n,params:r}){switch(n){case"eth_sendTransaction":if(!i.account)throw new wm;if(!i.chain)throw new lm;const[a]=r;return i.sendTransaction({...a,account:i.account,chain:i.chain});case"eth_sign":if(!i.account)throw new wm;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 wm;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 wm;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 lm;return e.chain.id;default:return t.request({method:n,params:r})}}})(e)}}).extend((()=>({...Sb.parse(e.opts??{})}))).extend(ig(e)).extend(Yb);return{...i,type:a}}({...e,chain:e.client.chain,transport:dc(e.client)})}const cg=async(e,{account:t=e.account,overrides:n,...r})=>{if(!t)throw new wm;if(!(e=>Qb(e))(e))throw new om("AlchemySmartAccountClient","SimulateUserOperationAssetChanges",e);const a=Tb(await e.buildUserOperation({...r,account:t,overrides:n}));return e.request({method:"alchemy_simulateUserOperationAssetChanges",params:[a,t.getEntryPoint().address]})};var lg="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ug(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function dg(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 pg,hg={exports:{}};
|
|
5
|
-
/**
|
|
6
|
-
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
7
|
-
*
|
|
8
|
-
* @version 0.8.0
|
|
9
|
-
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
10
|
-
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
11
|
-
* @license MIT
|
|
12
|
-
*/pg=hg,function(){var e="input is invalid type",t="object"==typeof window,n=t?window:{};n.JS_SHA3_NO_WINDOW&&(t=!1);var r=!t&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=lg:r&&(n=self);var a=!n.JS_SHA3_NO_COMMON_JS&&pg.exports,s=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,i="0123456789abcdef".split(""),o=[4,1024,262144,67108864],c=[0,8,16,24],l=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],u=[224,256,384,512],d=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],h={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!s||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var m=function(e,t,n){return function(r){return new F(e,t,e).update(r)[n]()}},f=function(e,t,n){return function(r,a){return new F(e,t,a).update(r)[n]()}},y=function(e,t,n){return function(t,r,a,s){return x["cshake"+e].update(t,r,a,s)[n]()}},b=function(e,t,n){return function(t,r,a,s){return x["kmac"+e].update(t,r,a,s)[n]()}},g=function(e,t,n,r){for(var a=0;a<p.length;++a){var s=p[a];e[s]=t(n,r,s)}return e},v=function(e,t){var n=m(e,t,"hex");return n.create=function(){return new F(e,t,e)},n.update=function(e){return n.create().update(e)},g(n,m,e,t)},w=[{name:"keccak",padding:[1,256,65536,16777216],bits:u,createMethod:v},{name:"sha3",padding:[6,1536,393216,100663296],bits:u,createMethod:v},{name:"shake",padding:[31,7936,2031616,520093696],bits:d,createMethod:function(e,t){var n=f(e,t,"hex");return n.create=function(n){return new F(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},g(n,f,e,t)}},{name:"cshake",padding:o,bits:d,createMethod:function(e,t){var n=h[e],r=y(e,0,"hex");return r.create=function(r,a,s){return a||s?new F(e,t,r).bytepad([a,s],n):x["shake"+e].create(r)},r.update=function(e,t,n,a){return r.create(t,n,a).update(e)},g(r,y,e,t)}},{name:"kmac",padding:o,bits:d,createMethod:function(e,t){var n=h[e],r=b(e,0,"hex");return r.create=function(r,a,s){return new D(e,t,a).bytepad(["KMAC",s],n).bytepad([r],n)},r.update=function(e,t,n,a){return r.create(e,n,a).update(t)},g(r,b,e,t)}}],x={},E=[],C=0;C<w.length;++C)for(var k=w[C],T=k.bits,P=0;P<T.length;++P){var A=k.name+"_"+T[P];if(E.push(A),x[A]=k.createMethod(T[P],k.padding),"sha3"!==k.name){var O=k.name+T[P];E.push(O),x[O]=x[A]}}function F(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function D(e,t,n){F.call(this,e,t,n)}F.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var a,i,o=this.blocks,l=this.byteCount,u=t.length,d=this.blockCount,p=0,h=this.s;p<u;){if(this.reset)for(this.reset=!1,o[0]=this.block,a=1;a<d+1;++a)o[a]=0;if(n)for(a=this.start;p<u&&a<l;++p)o[a>>2]|=t[p]<<c[3&a++];else for(a=this.start;p<u&&a<l;++p)(i=t.charCodeAt(p))<128?o[a>>2]|=i<<c[3&a++]:i<2048?(o[a>>2]|=(192|i>>6)<<c[3&a++],o[a>>2]|=(128|63&i)<<c[3&a++]):i<55296||i>=57344?(o[a>>2]|=(224|i>>12)<<c[3&a++],o[a>>2]|=(128|i>>6&63)<<c[3&a++],o[a>>2]|=(128|63&i)<<c[3&a++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++p)),o[a>>2]|=(240|i>>18)<<c[3&a++],o[a>>2]|=(128|i>>12&63)<<c[3&a++],o[a>>2]|=(128|i>>6&63)<<c[3&a++],o[a>>2]|=(128|63&i)<<c[3&a++]);if(this.lastByteIndex=a,a>=l){for(this.start=a-l,this.block=o[d],a=0;a<d;++a)h[a]^=o[a];_(h),this.reset=!0}else this.start=a}return this},F.prototype.encode=function(e,t){var n=255&e,r=1,a=[n];for(n=255&(e>>=8);n>0;)a.unshift(n),n=255&(e>>=8),++r;return t?a.push(r):a.unshift(r),this.update(a),a.length},F.prototype.encodeString=function(t){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var a=0,i=t.length;if(n)a=i;else for(var o=0;o<t.length;++o){var c=t.charCodeAt(o);c<128?a+=1:c<2048?a+=2:c<55296||c>=57344?a+=3:(c=65536+((1023&c)<<10|1023&t.charCodeAt(++o)),a+=4)}return a+=this.encode(8*a),this.update(t),a},F.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var a=t-n%t,s=[];return s.length=a,this.update(s),this},F.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];_(r)}},F.prototype.toString=F.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,r=this.outputBlocks,a=this.extraBytes,s=0,o=0,c="";o<r;){for(s=0;s<t&&o<r;++s,++o)e=n[s],c+=i[e>>4&15]+i[15&e]+i[e>>12&15]+i[e>>8&15]+i[e>>20&15]+i[e>>16&15]+i[e>>28&15]+i[e>>24&15];o%t==0&&(_(n),s=0)}return a&&(e=n[s],c+=i[e>>4&15]+i[15&e],a>1&&(c+=i[e>>12&15]+i[e>>8&15]),a>2&&(c+=i[e>>20&15]+i[e>>16&15])),c},F.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,a=this.extraBytes,s=0,i=0,o=this.outputBits>>3;e=a?new ArrayBuffer(r+1<<2):new ArrayBuffer(o);for(var c=new Uint32Array(e);i<r;){for(s=0;s<t&&i<r;++s,++i)c[i]=n[s];i%t==0&&_(n)}return a&&(c[s]=n[s],e=e.slice(0,o)),e},F.prototype.buffer=F.prototype.arrayBuffer,F.prototype.digest=F.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,r=this.s,a=this.outputBlocks,s=this.extraBytes,i=0,o=0,c=[];o<a;){for(i=0;i<n&&o<a;++i,++o)e=o<<2,t=r[i],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;o%n==0&&_(r)}return s&&(e=o<<2,t=r[i],c[e]=255&t,s>1&&(c[e+1]=t>>8&255),s>2&&(c[e+2]=t>>16&255)),c},D.prototype=new F,D.prototype.finalize=function(){return this.encode(this.outputBits,!0),F.prototype.finalize.call(this)};var _=function(e){var t,n,r,a,s,i,o,c,u,d,p,h,m,f,y,b,g,v,w,x,E,C,k,T,P,A,O,F,D,_,S,I,M,N,B,U,R,j,L,G,z,$,H,q,V,W,Z,K,J,Y,X,Q,ee,te,ne,re,ae,se,ie,oe,ce,le,ue;for(r=0;r<48;r+=2)a=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],p=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(i<<1|o>>>31),n=(m=e[9]^e[19]^e[29]^e[39]^e[49])^(o<<1|i>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=a^(c<<1|u>>>31),n=s^(u<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=i^(d<<1|p>>>31),n=o^(p<<1|d>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(h<<1|m>>>31),n=u^(m<<1|h>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=d^(a<<1|s>>>31),n=p^(s<<1|a>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,f=e[0],y=e[1],W=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,F=e[20]<<3|e[21]>>>29,D=e[21]<<3|e[20]>>>29,oe=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,$=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,B=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,K=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,_=e[33]<<13|e[32]>>>19,S=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ue=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,R=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,I=e[45]<<29|e[44]>>>3,M=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,P=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ae=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,L=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,q=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,A=e[18]<<20|e[19]>>>12,O=e[19]<<20|e[18]>>>12,se=e[29]<<7|e[28]>>>25,ie=e[28]<<7|e[29]>>>25,G=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,C=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=f^~b&v,e[1]=y^~g&w,e[10]=T^~A&F,e[11]=P^~O&D,e[20]=N^~U&j,e[21]=B^~R&L,e[30]=q^~W&K,e[31]=V^~Z&J,e[40]=te^~re&se,e[41]=ne^~ae&ie,e[2]=b^~v&x,e[3]=g^~w&E,e[12]=A^~F&_,e[13]=O^~D&S,e[22]=U^~j&G,e[23]=R^~L&z,e[32]=W^~K&Y,e[33]=Z^~J&X,e[42]=re^~se&oe,e[43]=ae^~ie&ce,e[4]=v^~x&C,e[5]=w^~E&k,e[14]=F^~_&I,e[15]=D^~S&M,e[24]=j^~G&$,e[25]=L^~z&H,e[34]=K^~Y&Q,e[35]=J^~X&ee,e[44]=se^~oe&le,e[45]=ie^~ce&ue,e[6]=x^~C&f,e[7]=E^~k&y,e[16]=_^~I&T,e[17]=S^~M&P,e[26]=G^~$&N,e[27]=z^~H&B,e[36]=Y^~Q&q,e[37]=X^~ee&V,e[46]=oe^~le&te,e[47]=ce^~ue&ne,e[8]=C^~f&b,e[9]=k^~y&g,e[18]=I^~T&A,e[19]=M^~P&O,e[28]=$^~N&U,e[29]=H^~B&R,e[38]=Q^~q&W,e[39]=ee^~V&Z,e[48]=le^~te&re,e[49]=ue^~ne&ae,e[0]^=l[r],e[1]^=l[r+1]};if(a)pg.exports=x;else for(C=0;C<E.length;++C)n[E[C]]=x[E[C]]}();var mg=hg.exports;function fg(e){return"0x"+mg.keccak_256(r.arrayify(e))}var yg={exports:{}},bg=dg(Object.freeze({__proto__:null,default:{}}));!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var s;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:bg.Buffer}catch(e){}function i(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function o(e,t,n){var r=i(e,n);return n-1>=t&&(r|=i(e,n-1)<<4),r}function c(e,t,r,a){for(var s=0,i=0,o=Math.min(e.length,r),c=t;c<o;c++){var l=e.charCodeAt(c)-48;s*=a,i=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&i<a,"Invalid character"),s+=i}return s}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a<e.length&&(16===t?this._parseHex(e,a,r):(this._parseBase(e,t,a),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var s,i,o=0;if("be"===r)for(a=e.length-1,s=0;a>=0;a-=3)i=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[s]|=i<<o&67108863,this.words[s+1]=i>>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);else if("le"===r)for(a=0,s=0;a<e.length;a+=3)i=e[a]|e[a+1]<<8|e[a+2]<<16,this.words[s]|=i<<o&67108863,this.words[s+1]=i>>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);return this._strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var a,s=0,i=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)a=o(e,t,r)<<s,this.words[i]|=67108863&a,s>=18?(s-=18,i+=1,this.words[i]|=a>>>26):s+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)a=o(e,t,r)<<s,this.words[i]|=67108863&a,s>=18?(s-=18,i+=1,this.words[i]|=a>>>26):s+=8;this._strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=t)r++;r--,a=a/t|0;for(var s=e.length-n,i=s%r,o=Math.min(s,s-i)+n,l=0,u=n;u<o;u+=r)l=c(e,u,u+r,t),this.imuln(a),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==i){var d=1;for(l=c(e,u,e.length,t),u=0;u<i;u++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype._move=function(e){l(e,this)},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(e){a.prototype.inspect=u}else a.prototype.inspect=u;function u(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var a=0|e.words[0],s=0|t.words[0],i=a*s,o=67108863&i,c=i/67108864|0;n.words[0]=o;for(var l=1;l<r;l++){for(var u=c>>>26,d=67108863&c,p=Math.min(l,t.length-1),h=Math.max(0,l-e.length+1);h<=p;h++){var m=l-h|0;u+=(i=(a=0|e.words[m])*(s=0|t.words[h])+d)/67108864|0,d=67108863&i}n.words[l]=0|d,c=0|u}return 0!==c?n.words[l]=0|c:n.length--,n._strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,s=0,i=0;i<this.length;i++){var o=this.words[i],c=(16777215&(o<<a|s)).toString(16);s=o>>>24-a&16777215,(a+=2)>=26&&(a-=26,i--),r=0!==s||i!==this.length-1?d[6-c.length]+c+r:c+r}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=p[e],u=h[e];r="";var m=this.clone();for(m.negative=0;!m.isZero();){var f=m.modrn(u).toString(e);r=(m=m.idivn(u)).isZero()?f+r:d[l-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},s&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){this._strip();var a=this.byteLength(),s=r||Math.max(1,a);n(a<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0");var i=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,s);return this["_toArrayLike"+("le"===t?"LE":"BE")](i,a),i},a.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,a=0,s=0;a<this.length;a++){var i=this.words[a]<<s|r;e[n++]=255&i,n<e.length&&(e[n++]=i>>8&255),n<e.length&&(e[n++]=i>>16&255),6===s?(n<e.length&&(e[n++]=i>>24&255),r=0,s=0):(r=i>>>24,s+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},a.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,a=0,s=0;a<this.length;a++){var i=this.words[a]<<s|r;e[n--]=255&i,n>=0&&(e[n--]=i>>8&255),n>=0&&(e[n--]=i>>16&255),6===s?(n>=0&&(e[n--]=i>>24&255),r=0,s=0):(r=i>>>24,s+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},a.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},a.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},a.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a<t;a++)this.words[a]=67108863&~this.words[a];return r>0&&(this.words[a]=~this.words[a]&67108863>>26-r),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<a:this.words[r]&~(1<<a),this._strip()},a.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var a=0,s=0;s<r.length;s++)t=(0|n.words[s])+(0|r.words[s])+a,this.words[s]=67108863&t,a=t>>>26;for(;0!==a&&s<n.length;s++)t=(0|n.words[s])+a,this.words[s]=67108863&t,a=t>>>26;if(this.length=n.length,0!==a)this.words[this.length]=a,this.length++;else if(n!==this)for(;s<n.length;s++)this.words[s]=n.words[s];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(n=this,r=e):(n=e,r=this);for(var s=0,i=0;i<r.length;i++)s=(t=(0|n.words[i])-(0|r.words[i])+s)>>26,this.words[i]=67108863&t;for(;0!==s&&i<n.length;i++)s=(t=(0|n.words[i])+s)>>26,this.words[i]=67108863&t;if(0===s&&i<n.length&&n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this.length=Math.max(this.length,i),n!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,n){var r,a,s,i=e.words,o=t.words,c=n.words,l=0,u=0|i[0],d=8191&u,p=u>>>13,h=0|i[1],m=8191&h,f=h>>>13,y=0|i[2],b=8191&y,g=y>>>13,v=0|i[3],w=8191&v,x=v>>>13,E=0|i[4],C=8191&E,k=E>>>13,T=0|i[5],P=8191&T,A=T>>>13,O=0|i[6],F=8191&O,D=O>>>13,_=0|i[7],S=8191&_,I=_>>>13,M=0|i[8],N=8191&M,B=M>>>13,U=0|i[9],R=8191&U,j=U>>>13,L=0|o[0],G=8191&L,z=L>>>13,$=0|o[1],H=8191&$,q=$>>>13,V=0|o[2],W=8191&V,Z=V>>>13,K=0|o[3],J=8191&K,Y=K>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],ne=8191&te,re=te>>>13,ae=0|o[6],se=8191&ae,ie=ae>>>13,oe=0|o[7],ce=8191&oe,le=oe>>>13,ue=0|o[8],de=8191&ue,pe=ue>>>13,he=0|o[9],me=8191&he,fe=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(l+(r=Math.imul(d,G))|0)+((8191&(a=(a=Math.imul(d,z))+Math.imul(p,G)|0))<<13)|0;l=((s=Math.imul(p,z))+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(m,G),a=(a=Math.imul(m,z))+Math.imul(f,G)|0,s=Math.imul(f,z);var be=(l+(r=r+Math.imul(d,H)|0)|0)+((8191&(a=(a=a+Math.imul(d,q)|0)+Math.imul(p,H)|0))<<13)|0;l=((s=s+Math.imul(p,q)|0)+(a>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(b,G),a=(a=Math.imul(b,z))+Math.imul(g,G)|0,s=Math.imul(g,z),r=r+Math.imul(m,H)|0,a=(a=a+Math.imul(m,q)|0)+Math.imul(f,H)|0,s=s+Math.imul(f,q)|0;var ge=(l+(r=r+Math.imul(d,W)|0)|0)+((8191&(a=(a=a+Math.imul(d,Z)|0)+Math.imul(p,W)|0))<<13)|0;l=((s=s+Math.imul(p,Z)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(w,G),a=(a=Math.imul(w,z))+Math.imul(x,G)|0,s=Math.imul(x,z),r=r+Math.imul(b,H)|0,a=(a=a+Math.imul(b,q)|0)+Math.imul(g,H)|0,s=s+Math.imul(g,q)|0,r=r+Math.imul(m,W)|0,a=(a=a+Math.imul(m,Z)|0)+Math.imul(f,W)|0,s=s+Math.imul(f,Z)|0;var ve=(l+(r=r+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,Y)|0)+Math.imul(p,J)|0))<<13)|0;l=((s=s+Math.imul(p,Y)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(C,G),a=(a=Math.imul(C,z))+Math.imul(k,G)|0,s=Math.imul(k,z),r=r+Math.imul(w,H)|0,a=(a=a+Math.imul(w,q)|0)+Math.imul(x,H)|0,s=s+Math.imul(x,q)|0,r=r+Math.imul(b,W)|0,a=(a=a+Math.imul(b,Z)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,Z)|0,r=r+Math.imul(m,J)|0,a=(a=a+Math.imul(m,Y)|0)+Math.imul(f,J)|0,s=s+Math.imul(f,Y)|0;var we=(l+(r=r+Math.imul(d,Q)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(p,Q)|0))<<13)|0;l=((s=s+Math.imul(p,ee)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(P,G),a=(a=Math.imul(P,z))+Math.imul(A,G)|0,s=Math.imul(A,z),r=r+Math.imul(C,H)|0,a=(a=a+Math.imul(C,q)|0)+Math.imul(k,H)|0,s=s+Math.imul(k,q)|0,r=r+Math.imul(w,W)|0,a=(a=a+Math.imul(w,Z)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,Z)|0,r=r+Math.imul(b,J)|0,a=(a=a+Math.imul(b,Y)|0)+Math.imul(g,J)|0,s=s+Math.imul(g,Y)|0,r=r+Math.imul(m,Q)|0,a=(a=a+Math.imul(m,ee)|0)+Math.imul(f,Q)|0,s=s+Math.imul(f,ee)|0;var xe=(l+(r=r+Math.imul(d,ne)|0)|0)+((8191&(a=(a=a+Math.imul(d,re)|0)+Math.imul(p,ne)|0))<<13)|0;l=((s=s+Math.imul(p,re)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(F,G),a=(a=Math.imul(F,z))+Math.imul(D,G)|0,s=Math.imul(D,z),r=r+Math.imul(P,H)|0,a=(a=a+Math.imul(P,q)|0)+Math.imul(A,H)|0,s=s+Math.imul(A,q)|0,r=r+Math.imul(C,W)|0,a=(a=a+Math.imul(C,Z)|0)+Math.imul(k,W)|0,s=s+Math.imul(k,Z)|0,r=r+Math.imul(w,J)|0,a=(a=a+Math.imul(w,Y)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Y)|0,r=r+Math.imul(b,Q)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,ee)|0,r=r+Math.imul(m,ne)|0,a=(a=a+Math.imul(m,re)|0)+Math.imul(f,ne)|0,s=s+Math.imul(f,re)|0;var Ee=(l+(r=r+Math.imul(d,se)|0)|0)+((8191&(a=(a=a+Math.imul(d,ie)|0)+Math.imul(p,se)|0))<<13)|0;l=((s=s+Math.imul(p,ie)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(S,G),a=(a=Math.imul(S,z))+Math.imul(I,G)|0,s=Math.imul(I,z),r=r+Math.imul(F,H)|0,a=(a=a+Math.imul(F,q)|0)+Math.imul(D,H)|0,s=s+Math.imul(D,q)|0,r=r+Math.imul(P,W)|0,a=(a=a+Math.imul(P,Z)|0)+Math.imul(A,W)|0,s=s+Math.imul(A,Z)|0,r=r+Math.imul(C,J)|0,a=(a=a+Math.imul(C,Y)|0)+Math.imul(k,J)|0,s=s+Math.imul(k,Y)|0,r=r+Math.imul(w,Q)|0,a=(a=a+Math.imul(w,ee)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,ee)|0,r=r+Math.imul(b,ne)|0,a=(a=a+Math.imul(b,re)|0)+Math.imul(g,ne)|0,s=s+Math.imul(g,re)|0,r=r+Math.imul(m,se)|0,a=(a=a+Math.imul(m,ie)|0)+Math.imul(f,se)|0,s=s+Math.imul(f,ie)|0;var Ce=(l+(r=r+Math.imul(d,ce)|0)|0)+((8191&(a=(a=a+Math.imul(d,le)|0)+Math.imul(p,ce)|0))<<13)|0;l=((s=s+Math.imul(p,le)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(N,G),a=(a=Math.imul(N,z))+Math.imul(B,G)|0,s=Math.imul(B,z),r=r+Math.imul(S,H)|0,a=(a=a+Math.imul(S,q)|0)+Math.imul(I,H)|0,s=s+Math.imul(I,q)|0,r=r+Math.imul(F,W)|0,a=(a=a+Math.imul(F,Z)|0)+Math.imul(D,W)|0,s=s+Math.imul(D,Z)|0,r=r+Math.imul(P,J)|0,a=(a=a+Math.imul(P,Y)|0)+Math.imul(A,J)|0,s=s+Math.imul(A,Y)|0,r=r+Math.imul(C,Q)|0,a=(a=a+Math.imul(C,ee)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,ee)|0,r=r+Math.imul(w,ne)|0,a=(a=a+Math.imul(w,re)|0)+Math.imul(x,ne)|0,s=s+Math.imul(x,re)|0,r=r+Math.imul(b,se)|0,a=(a=a+Math.imul(b,ie)|0)+Math.imul(g,se)|0,s=s+Math.imul(g,ie)|0,r=r+Math.imul(m,ce)|0,a=(a=a+Math.imul(m,le)|0)+Math.imul(f,ce)|0,s=s+Math.imul(f,le)|0;var ke=(l+(r=r+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,pe)|0)+Math.imul(p,de)|0))<<13)|0;l=((s=s+Math.imul(p,pe)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,G),a=(a=Math.imul(R,z))+Math.imul(j,G)|0,s=Math.imul(j,z),r=r+Math.imul(N,H)|0,a=(a=a+Math.imul(N,q)|0)+Math.imul(B,H)|0,s=s+Math.imul(B,q)|0,r=r+Math.imul(S,W)|0,a=(a=a+Math.imul(S,Z)|0)+Math.imul(I,W)|0,s=s+Math.imul(I,Z)|0,r=r+Math.imul(F,J)|0,a=(a=a+Math.imul(F,Y)|0)+Math.imul(D,J)|0,s=s+Math.imul(D,Y)|0,r=r+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,ee)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,ee)|0,r=r+Math.imul(C,ne)|0,a=(a=a+Math.imul(C,re)|0)+Math.imul(k,ne)|0,s=s+Math.imul(k,re)|0,r=r+Math.imul(w,se)|0,a=(a=a+Math.imul(w,ie)|0)+Math.imul(x,se)|0,s=s+Math.imul(x,ie)|0,r=r+Math.imul(b,ce)|0,a=(a=a+Math.imul(b,le)|0)+Math.imul(g,ce)|0,s=s+Math.imul(g,le)|0,r=r+Math.imul(m,de)|0,a=(a=a+Math.imul(m,pe)|0)+Math.imul(f,de)|0,s=s+Math.imul(f,pe)|0;var Te=(l+(r=r+Math.imul(d,me)|0)|0)+((8191&(a=(a=a+Math.imul(d,fe)|0)+Math.imul(p,me)|0))<<13)|0;l=((s=s+Math.imul(p,fe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(R,H),a=(a=Math.imul(R,q))+Math.imul(j,H)|0,s=Math.imul(j,q),r=r+Math.imul(N,W)|0,a=(a=a+Math.imul(N,Z)|0)+Math.imul(B,W)|0,s=s+Math.imul(B,Z)|0,r=r+Math.imul(S,J)|0,a=(a=a+Math.imul(S,Y)|0)+Math.imul(I,J)|0,s=s+Math.imul(I,Y)|0,r=r+Math.imul(F,Q)|0,a=(a=a+Math.imul(F,ee)|0)+Math.imul(D,Q)|0,s=s+Math.imul(D,ee)|0,r=r+Math.imul(P,ne)|0,a=(a=a+Math.imul(P,re)|0)+Math.imul(A,ne)|0,s=s+Math.imul(A,re)|0,r=r+Math.imul(C,se)|0,a=(a=a+Math.imul(C,ie)|0)+Math.imul(k,se)|0,s=s+Math.imul(k,ie)|0,r=r+Math.imul(w,ce)|0,a=(a=a+Math.imul(w,le)|0)+Math.imul(x,ce)|0,s=s+Math.imul(x,le)|0,r=r+Math.imul(b,de)|0,a=(a=a+Math.imul(b,pe)|0)+Math.imul(g,de)|0,s=s+Math.imul(g,pe)|0;var Pe=(l+(r=r+Math.imul(m,me)|0)|0)+((8191&(a=(a=a+Math.imul(m,fe)|0)+Math.imul(f,me)|0))<<13)|0;l=((s=s+Math.imul(f,fe)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(R,W),a=(a=Math.imul(R,Z))+Math.imul(j,W)|0,s=Math.imul(j,Z),r=r+Math.imul(N,J)|0,a=(a=a+Math.imul(N,Y)|0)+Math.imul(B,J)|0,s=s+Math.imul(B,Y)|0,r=r+Math.imul(S,Q)|0,a=(a=a+Math.imul(S,ee)|0)+Math.imul(I,Q)|0,s=s+Math.imul(I,ee)|0,r=r+Math.imul(F,ne)|0,a=(a=a+Math.imul(F,re)|0)+Math.imul(D,ne)|0,s=s+Math.imul(D,re)|0,r=r+Math.imul(P,se)|0,a=(a=a+Math.imul(P,ie)|0)+Math.imul(A,se)|0,s=s+Math.imul(A,ie)|0,r=r+Math.imul(C,ce)|0,a=(a=a+Math.imul(C,le)|0)+Math.imul(k,ce)|0,s=s+Math.imul(k,le)|0,r=r+Math.imul(w,de)|0,a=(a=a+Math.imul(w,pe)|0)+Math.imul(x,de)|0,s=s+Math.imul(x,pe)|0;var Ae=(l+(r=r+Math.imul(b,me)|0)|0)+((8191&(a=(a=a+Math.imul(b,fe)|0)+Math.imul(g,me)|0))<<13)|0;l=((s=s+Math.imul(g,fe)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(R,J),a=(a=Math.imul(R,Y))+Math.imul(j,J)|0,s=Math.imul(j,Y),r=r+Math.imul(N,Q)|0,a=(a=a+Math.imul(N,ee)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,ee)|0,r=r+Math.imul(S,ne)|0,a=(a=a+Math.imul(S,re)|0)+Math.imul(I,ne)|0,s=s+Math.imul(I,re)|0,r=r+Math.imul(F,se)|0,a=(a=a+Math.imul(F,ie)|0)+Math.imul(D,se)|0,s=s+Math.imul(D,ie)|0,r=r+Math.imul(P,ce)|0,a=(a=a+Math.imul(P,le)|0)+Math.imul(A,ce)|0,s=s+Math.imul(A,le)|0,r=r+Math.imul(C,de)|0,a=(a=a+Math.imul(C,pe)|0)+Math.imul(k,de)|0,s=s+Math.imul(k,pe)|0;var Oe=(l+(r=r+Math.imul(w,me)|0)|0)+((8191&(a=(a=a+Math.imul(w,fe)|0)+Math.imul(x,me)|0))<<13)|0;l=((s=s+Math.imul(x,fe)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(R,Q),a=(a=Math.imul(R,ee))+Math.imul(j,Q)|0,s=Math.imul(j,ee),r=r+Math.imul(N,ne)|0,a=(a=a+Math.imul(N,re)|0)+Math.imul(B,ne)|0,s=s+Math.imul(B,re)|0,r=r+Math.imul(S,se)|0,a=(a=a+Math.imul(S,ie)|0)+Math.imul(I,se)|0,s=s+Math.imul(I,ie)|0,r=r+Math.imul(F,ce)|0,a=(a=a+Math.imul(F,le)|0)+Math.imul(D,ce)|0,s=s+Math.imul(D,le)|0,r=r+Math.imul(P,de)|0,a=(a=a+Math.imul(P,pe)|0)+Math.imul(A,de)|0,s=s+Math.imul(A,pe)|0;var Fe=(l+(r=r+Math.imul(C,me)|0)|0)+((8191&(a=(a=a+Math.imul(C,fe)|0)+Math.imul(k,me)|0))<<13)|0;l=((s=s+Math.imul(k,fe)|0)+(a>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,r=Math.imul(R,ne),a=(a=Math.imul(R,re))+Math.imul(j,ne)|0,s=Math.imul(j,re),r=r+Math.imul(N,se)|0,a=(a=a+Math.imul(N,ie)|0)+Math.imul(B,se)|0,s=s+Math.imul(B,ie)|0,r=r+Math.imul(S,ce)|0,a=(a=a+Math.imul(S,le)|0)+Math.imul(I,ce)|0,s=s+Math.imul(I,le)|0,r=r+Math.imul(F,de)|0,a=(a=a+Math.imul(F,pe)|0)+Math.imul(D,de)|0,s=s+Math.imul(D,pe)|0;var De=(l+(r=r+Math.imul(P,me)|0)|0)+((8191&(a=(a=a+Math.imul(P,fe)|0)+Math.imul(A,me)|0))<<13)|0;l=((s=s+Math.imul(A,fe)|0)+(a>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(R,se),a=(a=Math.imul(R,ie))+Math.imul(j,se)|0,s=Math.imul(j,ie),r=r+Math.imul(N,ce)|0,a=(a=a+Math.imul(N,le)|0)+Math.imul(B,ce)|0,s=s+Math.imul(B,le)|0,r=r+Math.imul(S,de)|0,a=(a=a+Math.imul(S,pe)|0)+Math.imul(I,de)|0,s=s+Math.imul(I,pe)|0;var _e=(l+(r=r+Math.imul(F,me)|0)|0)+((8191&(a=(a=a+Math.imul(F,fe)|0)+Math.imul(D,me)|0))<<13)|0;l=((s=s+Math.imul(D,fe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(R,ce),a=(a=Math.imul(R,le))+Math.imul(j,ce)|0,s=Math.imul(j,le),r=r+Math.imul(N,de)|0,a=(a=a+Math.imul(N,pe)|0)+Math.imul(B,de)|0,s=s+Math.imul(B,pe)|0;var Se=(l+(r=r+Math.imul(S,me)|0)|0)+((8191&(a=(a=a+Math.imul(S,fe)|0)+Math.imul(I,me)|0))<<13)|0;l=((s=s+Math.imul(I,fe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(R,de),a=(a=Math.imul(R,pe))+Math.imul(j,de)|0,s=Math.imul(j,pe);var Ie=(l+(r=r+Math.imul(N,me)|0)|0)+((8191&(a=(a=a+Math.imul(N,fe)|0)+Math.imul(B,me)|0))<<13)|0;l=((s=s+Math.imul(B,fe)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863;var Me=(l+(r=Math.imul(R,me))|0)+((8191&(a=(a=Math.imul(R,fe))+Math.imul(j,me)|0))<<13)|0;return l=((s=Math.imul(j,fe))+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,c[0]=ye,c[1]=be,c[2]=ge,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ee,c[7]=Ce,c[8]=ke,c[9]=Te,c[10]=Pe,c[11]=Ae,c[12]=Oe,c[13]=Fe,c[14]=De,c[15]=_e,c[16]=Se,c[17]=Ie,c[18]=Me,0!==l&&(c[19]=l,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,a=0,s=0;s<n.length-1;s++){var i=a;a=0;for(var o=67108863&r,c=Math.min(s,t.length-1),l=Math.max(0,s-e.length+1);l<=c;l++){var u=s-l,d=(0|e.words[u])*(0|t.words[l]),p=67108863&d;o=67108863&(p=p+o|0),a+=(i=(i=i+(d/67108864|0)|0)+(p>>>26)|0)>>>26,i&=67108863}n.words[s]=o,r=i,i=a}return 0!==r?n.words[s]=r:n.length--,n._strip()}function b(e,t,n){return y(e,t,n)}Math.imul||(f=m),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?f(this,e,t):n<63?m(this,e,t):n<1024?y(this,e,t):b(this,e,t)},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),b(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,a=0;a<this.length;a++){var s=(0|this.words[a])*e,i=(67108863&s)+(67108863&r);r>>=26,r+=s/67108864|0,r+=i>>>26,this.words[a]=67108863&i}return 0!==r&&(this.words[a]=r,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,a=n%26;t[n]=e.words[r]>>>a&1}return t}(e);if(0===t.length)return new a(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var s=n.sqr();r<t.length;r++,s=s.sqr())0!==t[r]&&(n=n.mul(s));return n},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,a=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var i=0;for(t=0;t<this.length;t++){var o=this.words[t]&s,c=(0|this.words[t])-o<<r;this.words[t]=c|i,i=o>>>26-r}i&&(this.words[t]=i,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t<a;t++)this.words[t]=0;this.length+=a}return this._strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var a;n("number"==typeof e&&e>=0),a=t?(t-t%26)/26:0;var s=e%26,i=Math.min((e-s)/26,this.length),o=67108863^67108863>>>s<<s,c=r;if(a-=i,a=Math.max(0,a),c){for(var l=0;l<i;l++)c.words[l]=this.words[l];c.length=i}if(0===i);else if(this.length>i)for(this.length-=i,l=0;l<this.length;l++)this.words[l]=this.words[l+i];else this.words[0]=0,this.length=1;var u=0;for(l=this.length-1;l>=0&&(0!==u||l>=a);l--){var d=0|this.words[l];this.words[l]=u<<26-s|d>>>s,u=d&o}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<<t;return!(this.length<=r||!(this.words[r]&a))},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<<t;this.words[this.length-1]&=a}return this._strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var a,s,i=e.length+r;this._expand(i);var o=0;for(a=0;a<e.length;a++){s=(0|this.words[a+r])+o;var c=(0|e.words[a])*t;o=((s-=67108863&c)>>26)-(c/67108864|0),this.words[a+r]=67108863&s}for(;a<this.length-r;a++)o=(s=(0|this.words[a+r])+o)>>26,this.words[a+r]=67108863&s;if(0===o)return this._strip();for(n(-1===o),o=0,a=0;a<this.length;a++)o=(s=-(0|this.words[a])+o)>>26,this.words[a]=67108863&s;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),s=e,i=0|s.words[s.length-1];0!=(n=26-this._countBits(i))&&(s=s.ushln(n),r.iushln(n),i=0|s.words[s.length-1]);var o,c=r.length-s.length;if("mod"!==t){(o=new a(null)).length=c+1,o.words=new Array(o.length);for(var l=0;l<o.length;l++)o.words[l]=0}var u=r.clone()._ishlnsubmul(s,1,c);0===u.negative&&(r=u,o&&(o.words[c]=1));for(var d=c-1;d>=0;d--){var p=67108864*(0|r.words[s.length+d])+(0|r.words[s.length+d-1]);for(p=Math.min(p/i|0,67108863),r._ishlnsubmul(s,p,d);0!==r.negative;)p--,r.negative=0,r._ishlnsubmul(s,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=p)}return o&&o._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:o||null,mod:r}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(s=o.div.neg()),"div"!==t&&(i=o.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:s,mod:i}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(s=o.div.neg()),{div:s,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(i=o.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:o.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t);var s,i,o},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),a=e.andln(1),s=n.cmp(r);return s<0||1===a&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,a=0,s=this.length-1;s>=0;s--)a=(r*a+(0|this.words[s]))%e;return t?-a:a},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,a=this.length-1;a>=0;a--){var s=(0|this.words[a])+67108864*r;this.words[a]=s/e|0,r=s%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var s=new a(1),i=new a(0),o=new a(0),c=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var p=0,h=1;0==(t.words[0]&h)&&p<26;++p,h<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(s.isOdd()||i.isOdd())&&(s.iadd(u),i.isub(d)),s.iushrn(1),i.iushrn(1);for(var m=0,f=1;0==(r.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(r.iushrn(m);m-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(u),c.isub(d)),o.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o),i.isub(c)):(r.isub(t),o.isub(s),c.isub(i))}return{a:o,b:c,gcd:r.iushln(l)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var s,i=new a(1),o=new a(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,u=1;0==(t.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(c),i.iushrn(1);for(var d=0,p=1;0==(r.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o)):(r.isub(t),o.isub(i))}return(s=0===t.cmpn(1)?i:o).cmpn(0)<0&&s.iadd(e),s},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var a=t.cmp(n);if(a<0){var s=t;t=n,n=s}else if(0===a||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,a=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var s=a,i=r;0!==s&&i<this.length;i++){var o=0|this.words[i];s=(o+=s)>>>26,o&=67108863,this.words[i]=o}return 0!==s&&(this.words[i]=s,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:a<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],a=0|e.words[n];if(r!==a){r<a?t=-1:r>a&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new k(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function C(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},r(w,v),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),a=0;a<r;a++)t.words[a]=e.words[a];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(t.words[t.length++]=s&n,a=10;a<e.length;a++){var i=0|e.words[a];e.words[a-10]=(i&n)<<4|s>>>22,s=i}s>>>=22,e.words[a-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(x,v),r(E,v),r(C,v),C.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,a=67108863&r;r>>>=26,e.words[n]=a,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new x;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new C}return g[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},k.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var s=this.m.subn(1),i=0;!s.isZero()&&0===s.andln(1);)i++,s.iushrn(1);n(!s.isZero());var o=new a(1).toRed(this),c=o.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,l).cmp(c);)u.redIAdd(c);for(var d=this.pow(u,s),p=this.pow(e,s.addn(1).iushrn(1)),h=this.pow(e,s),m=i;0!==h.cmp(o);){for(var f=h,y=0;0!==f.cmp(o);y++)f=f.redSqr();n(y<m);var b=this.pow(d,new a(1).iushln(m-y-1));p=p.redMul(b),d=b.redSqr(),h=h.redMul(d),m=y}return p},k.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},k.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new a(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var s=n[0],i=0,o=0,c=t.bitLength()%26;for(0===c&&(c=26),r=t.length-1;r>=0;r--){for(var l=t.words[r],u=c-1;u>=0;u--){var d=l>>u&1;s!==n[0]&&(s=this.sqr(s)),0!==d||0!==i?(i<<=1,i|=d,(4==++o||0===r&&0===u)&&(s=this.mul(s,n[i]),o=0,i=0)):o=0}c=26}return s},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new T(e)},r(T,k),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=n.isub(r).iushrn(this.shift),i=s;return s.cmp(this.m)>=0?i=s.isub(this.m):s.cmpn(0)<0&&(i=s.iadd(this.m)),i._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(yg,lg);var gg=yg.exports;const vg="bignumber/5.7.0";var wg=gg.BN;const xg=new yn(vg),Eg={},Cg=9007199254740991;let kg=!1;class Tg{constructor(e,t){e!==Eg&&xg.throwError("cannot call constructor directly; use BigNumber.from",yn.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Ag(Og(this).fromTwos(e))}toTwos(e){return Ag(Og(this).toTwos(e))}abs(){return"-"===this._hex[0]?Tg.from(this._hex.substring(1)):this}add(e){return Ag(Og(this).add(Og(e)))}sub(e){return Ag(Og(this).sub(Og(e)))}div(e){return Tg.from(e).isZero()&&Fg("division-by-zero","div"),Ag(Og(this).div(Og(e)))}mul(e){return Ag(Og(this).mul(Og(e)))}mod(e){const t=Og(e);return t.isNeg()&&Fg("division-by-zero","mod"),Ag(Og(this).umod(t))}pow(e){const t=Og(e);return t.isNeg()&&Fg("negative-power","pow"),Ag(Og(this).pow(t))}and(e){const t=Og(e);return(this.isNegative()||t.isNeg())&&Fg("unbound-bitwise-result","and"),Ag(Og(this).and(t))}or(e){const t=Og(e);return(this.isNegative()||t.isNeg())&&Fg("unbound-bitwise-result","or"),Ag(Og(this).or(t))}xor(e){const t=Og(e);return(this.isNegative()||t.isNeg())&&Fg("unbound-bitwise-result","xor"),Ag(Og(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Fg("negative-width","mask"),Ag(Og(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Fg("negative-width","shl"),Ag(Og(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Fg("negative-width","shr"),Ag(Og(this).shrn(e))}eq(e){return Og(this).eq(Og(e))}lt(e){return Og(this).lt(Og(e))}lte(e){return Og(this).lte(Og(e))}gt(e){return Og(this).gt(Og(e))}gte(e){return Og(this).gte(Og(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Og(this).isZero()}toNumber(){try{return Og(this).toNumber()}catch(e){Fg("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return xg.throwError("this platform does not support BigInt",yn.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?kg||(kg=!0,xg.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?xg.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",yn.errors.UNEXPECTED_ARGUMENT,{}):xg.throwError("BigNumber.toString does not accept parameters",yn.errors.UNEXPECTED_ARGUMENT,{})),Og(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Tg)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Tg(Eg,Pg(e)):e.match(/^-?[0-9]+$/)?new Tg(Eg,Pg(new wg(e))):xg.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&Fg("underflow","BigNumber.from",e),(e>=Cg||e<=-Cg)&&Fg("overflow","BigNumber.from",e),Tg.from(String(e));const t=e;if("bigint"==typeof t)return Tg.from(t.toString());if(r.isBytes(t))return Tg.from(r.hexlify(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Tg.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(r.isHexString(e)||"-"===e[0]&&r.isHexString(e.substring(1))))return Tg.from(e)}return xg.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Pg(e){if("string"!=typeof e)return Pg(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&xg.throwArgumentError("invalid hex","value",e),"0x00"===(e=Pg(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Ag(e){return Tg.from(Pg(e))}function Og(e){const t=Tg.from(e).toHexString();return"-"===t[0]?new wg("-"+t.substring(3),16):new wg(t.substring(2),16)}function Fg(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),xg.throwError(e,yn.errors.NUMERIC_FAULT,r)}const Dg=new yn(vg),_g={},Sg=Tg.from(0),Ig=Tg.from(-1);function Mg(e,t,n,r){const a={fault:t,operation:n};return void 0!==r&&(a.value=r),Dg.throwError(e,yn.errors.NUMERIC_FAULT,a)}let Ng="0";for(;Ng.length<256;)Ng+=Ng;function Bg(e){if("number"!=typeof e)try{e=Tg.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+Ng.substring(0,e):Dg.throwArgumentError("invalid decimal size","decimals",e)}function Ug(e,t){null==t&&(t=0);const n=Bg(t),r=(e=Tg.from(e)).lt(Sg);r&&(e=e.mul(Ig));let a=e.mod(n).toString();for(;a.length<n.length-1;)a="0"+a;a=a.match(/^([0-9]*[1-9]|0)(0*)/)[1];const s=e.div(n).toString();return e=1===n.length?s:s+"."+a,r&&(e="-"+e),e}function Rg(e,t){null==t&&(t=0);const n=Bg(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||Dg.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&Dg.throwArgumentError("missing value","value",e);const a=e.split(".");a.length>2&&Dg.throwArgumentError("too many decimal points","value",e);let s=a[0],i=a[1];for(s||(s="0"),i||(i="0");"0"===i[i.length-1];)i=i.substring(0,i.length-1);for(i.length>n.length-1&&Mg("fractional component exceeds decimals","underflow","parseFixed"),""===i&&(i="0");i.length<n.length-1;)i+="0";const o=Tg.from(s),c=Tg.from(i);let l=o.mul(n).add(c);return r&&(l=l.mul(Ig)),l}class jg{constructor(e,t,n,r){e!==_g&&Dg.throwError("cannot use FixedFormat constructor; use FixedFormat.from",yn.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=Bg(r),Object.freeze(this)}static from(e){if(e instanceof jg)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,n=128,r=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const a=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);a||Dg.throwArgumentError("invalid fixed format","format",e),t="u"!==a[1],n=parseInt(a[2]),r=parseInt(a[3])}else if(e){const a=(t,n,r)=>null==e[t]?r:(typeof e[t]!==n&&Dg.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=a("signed","boolean",t),n=a("width","number",n),r=a("decimals","number",r)}return n%8&&Dg.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&Dg.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new jg(_g,t,n,r)}}class Lg{constructor(e,t,n,r){e!==_g&&Dg.throwError("cannot use FixedNumber constructor; use FixedNumber.from",yn.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Dg.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=Rg(this._value,this.format.decimals),n=Rg(e._value,e.format.decimals);return Lg.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=Rg(this._value,this.format.decimals),n=Rg(e._value,e.format.decimals);return Lg.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=Rg(this._value,this.format.decimals),n=Rg(e._value,e.format.decimals);return Lg.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=Rg(this._value,this.format.decimals),n=Rg(e._value,e.format.decimals);return Lg.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Lg.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(Gg.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Lg.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(Gg.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&Dg.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=Lg.from("1"+Ng.substring(0,e),this.format),r=zg.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&Dg.throwArgumentError("invalid byte width","width",e);const t=Tg.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return r.hexZeroPad(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Lg.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||function(e){return null!=e&&(Tg.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||r.isHexString(e)||"bigint"==typeof e||r.isBytes(e))}(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),Lg.fromString(Ug(e,t),jg.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=jg.from(t),a=Rg(e,n.decimals);!n.signed&&a.lt(Sg)&&Mg("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=a.toTwos(n.width).toHexString():(s=a.toHexString(),s=r.hexZeroPad(s,n.width/8));const i=Ug(a,n.decimals);return new Lg(_g,s,i,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=jg.from(t);if(r.arrayify(e).length>n.width/8)throw new Error("overflow");let a=Tg.from(e);n.signed&&(a=a.fromTwos(n.width));const s=a.toTwos((n.signed?0:1)+n.width).toHexString(),i=Ug(a,n.decimals);return new Lg(_g,s,i,n)}static from(e,t){if("string"==typeof e)return Lg.fromString(e,t);if(r.isBytes(e))return Lg.fromBytes(e,t);try{return Lg.fromValue(e,0,t)}catch(e){if(e.code!==yn.errors.INVALID_ARGUMENT)throw e}return Dg.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const Gg=Lg.from(1),zg=Lg.from("0.5"),$g=new yn("units/5.7.0"),Hg=["wei","kwei","mwei","gwei","szabo","finney","ether"];function qg(e,t){if("string"==typeof t){const e=Hg.indexOf(t);-1!==e&&(t=3*e)}return Ug(e,null!=t?t:18)}function Vg(e,t){if("string"!=typeof e&&$g.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=Hg.indexOf(t);-1!==e&&(t=3*e)}return Rg(e,null!=t?t:18)}function Wg(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zg}=Object.prototype,{getPrototypeOf:Kg}=Object,Jg=(Yg=Object.create(null),e=>{const t=Zg.call(e);return Yg[t]||(Yg[t]=t.slice(8,-1).toLowerCase())});var Yg;const Xg=e=>(e=e.toLowerCase(),t=>Jg(t)===e),Qg=e=>t=>typeof t===e,{isArray:ev}=Array,tv=Qg("undefined");const nv=Xg("ArrayBuffer");const rv=Qg("string"),av=Qg("function"),sv=Qg("number"),iv=e=>null!==e&&"object"==typeof e,ov=e=>{if("object"!==Jg(e))return!1;const t=Kg(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},cv=Xg("Date"),lv=Xg("File"),uv=Xg("Blob"),dv=Xg("FileList"),pv=Xg("URLSearchParams");function hv(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,a;if("object"!=typeof e&&(e=[e]),ev(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),s=a.length;let i;for(r=0;r<s;r++)i=a[r],t.call(null,e[i],i,e)}}function mv(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,a=n.length;for(;a-- >0;)if(r=n[a],t===r.toLowerCase())return r;return null}const fv="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,yv=e=>!tv(e)&&e!==fv;const bv=(gv="undefined"!=typeof Uint8Array&&Kg(Uint8Array),e=>gv&&e instanceof gv);var gv;const vv=Xg("HTMLFormElement"),wv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),xv=Xg("RegExp"),Ev=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};hv(n,((n,a)=>{let s;!1!==(s=t(n,a,e))&&(r[a]=s||n)})),Object.defineProperties(e,r)},Cv="abcdefghijklmnopqrstuvwxyz",kv="0123456789",Tv={DIGIT:kv,ALPHA:Cv,ALPHA_DIGIT:Cv+Cv.toUpperCase()+kv};const Pv=Xg("AsyncFunction");var Av={isArray:ev,isArrayBuffer:nv,isBuffer:function(e){return null!==e&&!tv(e)&&null!==e.constructor&&!tv(e.constructor)&&av(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||av(e.append)&&("formdata"===(t=Jg(e))||"object"===t&&av(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&nv(e.buffer),t},isString:rv,isNumber:sv,isBoolean:e=>!0===e||!1===e,isObject:iv,isPlainObject:ov,isUndefined:tv,isDate:cv,isFile:lv,isBlob:uv,isRegExp:xv,isFunction:av,isStream:e=>iv(e)&&av(e.pipe),isURLSearchParams:pv,isTypedArray:bv,isFileList:dv,forEach:hv,merge:function e(){const{caseless:t}=yv(this)&&this||{},n={},r=(r,a)=>{const s=t&&mv(n,a)||a;ov(n[s])&&ov(r)?n[s]=e(n[s],r):ov(r)?n[s]=e({},r):ev(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&hv(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(hv(t,((t,r)=>{n&&av(t)?e[r]=Wg(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let a,s,i;const o={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),s=a.length;s-- >0;)i=a[s],r&&!r(i,e,t)||o[i]||(t[i]=e[i],o[i]=!0);e=!1!==n&&Kg(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Jg,kindOfTest:Xg,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(ev(e))return e;let t=e.length;if(!sv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:vv,hasOwnProperty:wv,hasOwnProp:wv,reduceDescriptors:Ev,freezeMethods:e=>{Ev(e,((t,n)=>{if(av(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];av(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return ev(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:mv,global:fv,isContextDefined:yv,ALPHABET:Tv,generateString:(e=16,t=Tv.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&av(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(iv(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const a=ev(e)?[]:{};return hv(e,((e,t)=>{const s=n(e,r+1);!tv(s)&&(a[t]=s)})),t[r]=void 0,a}}return e};return n(e,0)},isAsyncFn:Pv,isThenable:e=>e&&(iv(e)||av(e))&&av(e.then)&&av(e.catch)};function Ov(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a)}Av.inherits(Ov,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Av.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Fv=Ov.prototype,Dv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Dv[e]={value:e}})),Object.defineProperties(Ov,Dv),Object.defineProperty(Fv,"isAxiosError",{value:!0}),Ov.from=(e,t,n,r,a,s)=>{const i=Object.create(Fv);return Av.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ov.call(i,e.message,t,n,r,a),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};function _v(e){return Av.isPlainObject(e)||Av.isArray(e)}function Sv(e){return Av.endsWith(e,"[]")?e.slice(0,-2):e}function Iv(e,t,n){return e?e.concat(t).map((function(e,t){return e=Sv(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Mv=Av.toFlatObject(Av,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Nv(e,t,n){if(!Av.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Av.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Av.isUndefined(t[e])}))).metaTokens,a=n.visitor||l,s=n.dots,i=n.indexes,o=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Av.isSpecCompliantForm(t);if(!Av.isFunction(a))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Av.isDate(e))return e.toISOString();if(!o&&Av.isBlob(e))throw new Ov("Blob is not supported. Use a Buffer instead.");return Av.isArrayBuffer(e)||Av.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,a){let o=e;if(e&&!a&&"object"==typeof e)if(Av.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Av.isArray(e)&&function(e){return Av.isArray(e)&&!e.some(_v)}(e)||(Av.isFileList(e)||Av.endsWith(n,"[]"))&&(o=Av.toArray(e)))return n=Sv(n),o.forEach((function(e,r){!Av.isUndefined(e)&&null!==e&&t.append(!0===i?Iv([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!_v(e)||(t.append(Iv(a,n,s),c(e)),!1)}const u=[],d=Object.assign(Mv,{defaultVisitor:l,convertValue:c,isVisitable:_v});if(!Av.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Av.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Av.forEach(n,(function(n,s){!0===(!(Av.isUndefined(n)||null===n)&&a.call(t,n,Av.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])})),u.pop()}}(e),t}function Bv(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Uv(e,t){this._pairs=[],e&&Nv(e,this,t)}const Rv=Uv.prototype;function jv(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Lv(e,t,n){if(!t)return e;const r=n&&n.encode||jv,a=n&&n.serialize;let s;if(s=a?a(t,n):Av.isURLSearchParams(t)?t.toString():new Uv(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}Rv.append=function(e,t){this._pairs.push([e,t])},Rv.toString=function(e){const t=e?function(t){return e.call(this,t,Bv)}:Bv;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Gv=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Av.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},zv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$v={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Uv,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Hv="undefined"!=typeof window&&"undefined"!=typeof document,qv=(Vv="undefined"!=typeof navigator&&navigator.product,Hv&&["ReactNative","NativeScript","NS"].indexOf(Vv)<0);var Vv;const Wv="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var Zv={...Object.freeze({__proto__:null,hasBrowserEnv:Hv,hasStandardBrowserWebWorkerEnv:Wv,hasStandardBrowserEnv:qv}),...$v};function Kv(e){function t(e,n,r,a){let s=e[a++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),o=a>=e.length;if(s=!s&&Av.isArray(r)?r.length:s,o)return Av.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&Av.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],a)&&Av.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const a=n.length;let s;for(r=0;r<a;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(Av.isFormData(e)&&Av.isFunction(e.entries)){const n={};return Av.forEachEntry(e,((e,r)=>{t(function(e){return Av.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const Jv={transitional:zv,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=Av.isObject(e);a&&Av.isHTMLForm(e)&&(e=new FormData(e));if(Av.isFormData(e))return r?JSON.stringify(Kv(e)):e;if(Av.isArrayBuffer(e)||Av.isBuffer(e)||Av.isStream(e)||Av.isFile(e)||Av.isBlob(e))return e;if(Av.isArrayBufferView(e))return e.buffer;if(Av.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Nv(e,new Zv.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Zv.isNode&&Av.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=Av.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Nv(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||r?(t.setContentType("application/json",!1),function(e,t,n){if(Av.isString(e))try{return(t||JSON.parse)(e),Av.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Jv.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&Av.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Ov.from(e,Ov.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Zv.classes.FormData,Blob:Zv.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Av.forEach(["delete","get","head","post","put","patch"],(e=>{Jv.headers[e]={}}));var Yv=Jv;const Xv=Av.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Qv=Symbol("internals");function ew(e){return e&&String(e).trim().toLowerCase()}function tw(e){return!1===e||null==e?e:Av.isArray(e)?e.map(tw):String(e)}function nw(e,t,n,r,a){return Av.isFunction(r)?r.call(this,t,n):(a&&(t=n),Av.isString(t)?Av.isString(r)?-1!==t.indexOf(r):Av.isRegExp(r)?r.test(t):void 0:void 0)}class rw{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function a(e,t,n){const a=ew(t);if(!a)throw new Error("header name must be a non-empty string");const s=Av.findKey(r,a);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=tw(e))}const s=(e,t)=>Av.forEach(e,((e,n)=>a(e,n,t)));return Av.isPlainObject(e)||e instanceof this.constructor?s(e,t):Av.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let n,r,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),n=e.substring(0,a).trim().toLowerCase(),r=e.substring(a+1).trim(),!n||t[n]&&Xv[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&a(t,e,n),this}get(e,t){if(e=ew(e)){const n=Av.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Av.isFunction(t))return t.call(this,e,n);if(Av.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ew(e)){const n=Av.findKey(this,e);return!(!n||void 0===this[n]||t&&!nw(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function a(e){if(e=ew(e)){const a=Av.findKey(n,e);!a||t&&!nw(0,n[a],a,t)||(delete n[a],r=!0)}}return Av.isArray(e)?e.forEach(a):a(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const a=t[n];e&&!nw(0,this[a],a,e,!0)||(delete this[a],r=!0)}return r}normalize(e){const t=this,n={};return Av.forEach(this,((r,a)=>{const s=Av.findKey(n,a);if(s)return t[s]=tw(r),void delete t[a];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(a):String(a).trim();i!==a&&delete t[a],t[i]=tw(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Av.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Av.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Qv]=this[Qv]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ew(e);t[r]||(!function(e,t){const n=Av.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,a){return this[r].call(this,t,e,n,a)},configurable:!0})}))}(n,e),t[r]=!0)}return Av.isArray(e)?e.forEach(r):r(e),this}}rw.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Av.reduceDescriptors(rw.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Av.freezeMethods(rw);var aw=rw;function sw(e,t){const n=this||Yv,r=t||n,a=aw.from(r.headers);let s=r.data;return Av.forEach(e,(function(e){s=e.call(n,s,a.normalize(),t?t.status:void 0)})),a.normalize(),s}function iw(e){return!(!e||!e.__CANCEL__)}function ow(e,t,n){Ov.call(this,null==e?"canceled":e,Ov.ERR_CANCELED,t,n),this.name="CanceledError"}Av.inherits(ow,Ov,{__CANCEL__:!0});var cw=Zv.hasStandardBrowserEnv?{write(e,t,n,r,a,s){const i=[e+"="+encodeURIComponent(t)];Av.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Av.isString(r)&&i.push("path="+r),Av.isString(a)&&i.push("domain="+a),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function lw(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var uw=Zv.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=Av.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function dw(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a,s=0,i=0;return t=void 0!==t?t:1e3,function(o){const c=Date.now(),l=r[i];a||(a=c),n[s]=o,r[s]=c;let u=i,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-a<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}(50,250);return a=>{const s=a.loaded,i=a.lengthComputable?a.total:void 0,o=s-n,c=r(o);n=s;const l={loaded:s,total:i,progress:i?s/i:void 0,bytes:o,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:a};l[t?"download":"upload"]=!0,e(l)}}const pw={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const a=aw.from(e.headers).normalize();let s,i,{responseType:o,withXSRFToken:c}=e;function l(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(Av.isFormData(r))if(Zv.hasStandardBrowserEnv||Zv.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if(!1!==(i=a.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(t+":"+n))}const d=lw(e.baseURL,e.url);function p(){if(!u)return;const r=aw.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ov("Request failed with status code "+n.status,[Ov.ERR_BAD_REQUEST,Ov.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),l()}),(function(e){n(e),l()}),{data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),Lv(d,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(p)},u.onabort=function(){u&&(n(new Ov("Request aborted",Ov.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new Ov("Network Error",Ov.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||zv;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new Ov(t,r.clarifyTimeoutError?Ov.ETIMEDOUT:Ov.ECONNABORTED,e,u)),u=null},Zv.hasStandardBrowserEnv&&(c&&Av.isFunction(c)&&(c=c(e)),c||!1!==c&&uw(d))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&cw.read(e.xsrfCookieName);t&&a.set(e.xsrfHeaderName,t)}void 0===r&&a.setContentType(null),"setRequestHeader"in u&&Av.forEach(a.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),Av.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),o&&"json"!==o&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",dw(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",dw(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{u&&(n(!t||t.type?new ow(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const h=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);h&&-1===Zv.protocols.indexOf(h)?n(new Ov("Unsupported protocol "+h+":",Ov.ERR_BAD_REQUEST,e)):u.send(r||null)}))}};Av.forEach(pw,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const hw=e=>`- ${e}`,mw=e=>Av.isFunction(e)||null===e||!1===e;var fw={getAdapter:e=>{e=Av.isArray(e)?e:[e];const{length:t}=e;let n,r;const a={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!mw(n)&&(r=pw[(t=String(n)).toLowerCase()],void 0===r))throw new Ov(`Unknown adapter '${t}'`);if(r)break;a[t||"#"+s]=r}if(!r){const e=Object.entries(a).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Ov("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(hw).join("\n"):" "+hw(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r},adapters:pw};function yw(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ow(null,e)}function bw(e){yw(e),e.headers=aw.from(e.headers),e.data=sw.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return fw.getAdapter(e.adapter||Yv.adapter)(e).then((function(t){return yw(e),t.data=sw.call(e,e.transformResponse,t),t.headers=aw.from(t.headers),t}),(function(t){return iw(t)||(yw(e),t&&t.response&&(t.response.data=sw.call(e,e.transformResponse,t.response),t.response.headers=aw.from(t.response.headers))),Promise.reject(t)}))}const gw=e=>e instanceof aw?e.toJSON():e;function vw(e,t){t=t||{};const n={};function r(e,t,n){return Av.isPlainObject(e)&&Av.isPlainObject(t)?Av.merge.call({caseless:n},e,t):Av.isPlainObject(t)?Av.merge({},t):Av.isArray(t)?t.slice():t}function a(e,t,n){return Av.isUndefined(t)?Av.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!Av.isUndefined(t))return r(void 0,t)}function i(e,t){return Av.isUndefined(t)?Av.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function o(n,a,s){return s in t?r(n,a):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:o,headers:(e,t)=>a(gw(e),gw(t),!0)};return Av.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||a,i=s(e[r],t[r],r);Av.isUndefined(i)&&s!==o||(n[r]=i)})),n}const ww="1.6.7",xw={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{xw[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ew={};xw.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.7] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,s)=>{if(!1===e)throw new Ov(r(a," has been removed"+(t?" in "+t:"")),Ov.ERR_DEPRECATED);return t&&!Ew[a]&&(Ew[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,s)}};var Cw={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ov("options must be an object",Ov.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const s=r[a],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new Ov("option "+s+" must be "+n,Ov.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ov("Unknown option "+s,Ov.ERR_BAD_OPTION)}},validators:xw};const kw=Cw.validators;class Tw{constructor(e){this.defaults=e,this.interceptors={request:new Gv,response:new Gv}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=vw(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:a}=t;void 0!==n&&Cw.assertOptions(n,{silentJSONParsing:kw.transitional(kw.boolean),forcedJSONParsing:kw.transitional(kw.boolean),clarifyTimeoutError:kw.transitional(kw.boolean)},!1),null!=r&&(Av.isFunction(r)?t.paramsSerializer={serialize:r}:Cw.assertOptions(r,{encode:kw.function,serialize:kw.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&Av.merge(a.common,a[t.method]);a&&Av.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete a[e]})),t.headers=aw.concat(s,a);const i=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!o){const e=[bw.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let p=t;for(d=0;d<u;){const e=i[d++],t=i[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=bw.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return Lv(lw((e=vw(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}Av.forEach(["delete","get","head","options"],(function(e){Tw.prototype[e]=function(t,n){return this.request(vw(n||{},{method:e,url:t,data:(n||{}).data}))}})),Av.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,a){return this.request(vw(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Tw.prototype[e]=t(),Tw.prototype[e+"Form"]=t(!0)}));var Pw=Tw;class Aw{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,a){n.reason||(n.reason=new ow(e,r,a),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new Aw((function(t){e=t}));return{token:t,cancel:e}}}var Ow=Aw;const Fw={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fw).forEach((([e,t])=>{Fw[t]=e}));var Dw=Fw;const _w=function e(t){const n=new Pw(t),r=Wg(Pw.prototype.request,n);return Av.extend(r,Pw.prototype,n,{allOwnKeys:!0}),Av.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(vw(t,n))},r}(Yv);_w.Axios=Pw,_w.CanceledError=ow,_w.CancelToken=Ow,_w.isCancel=iw,_w.VERSION=ww,_w.toFormData=Nv,_w.AxiosError=Ov,_w.Cancel=_w.CanceledError,_w.all=function(e){return Promise.all(e)},_w.spread=function(e){return function(t){return e.apply(null,t)}},_w.isAxiosError=function(e){return Av.isObject(e)&&!0===e.isAxiosError},_w.mergeConfig=vw,_w.AxiosHeaders=aw,_w.formToJSON=e=>Kv(Av.isHTMLForm(e)?new FormData(e):e),_w.getAdapter=fw.getAdapter,_w.HttpStatusCode=Dw,_w.default=_w;var Sw,Iw,Mw,Nw,Bw,Uw,Rw,jw,Lw,Gw,zw,$w,Hw,qw,Vw,Ww,Zw,Kw,Jw,Yw,Xw,Qw,ex,tx,nx=_w;
|
|
13
|
-
/*! *****************************************************************************
|
|
14
|
-
Copyright (c) Microsoft Corporation.
|
|
15
|
-
|
|
16
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
17
|
-
purpose with or without fee is hereby granted.
|
|
18
|
-
|
|
19
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
20
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
21
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
22
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
23
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
24
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
25
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
26
|
-
***************************************************************************** */
|
|
27
|
-
function rx(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 ax(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 sx(e){return this instanceof sx?(this.v=e,this):new sx(e)}function ix(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{(n=a[e](t)).value instanceof sx?Promise.resolve(n.value.v).then(c,l):u(s[0][2],n)}catch(e){u(s[0][3],e)}var n}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 ox(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=ax(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)}))}}}exports.Network=void 0,(Sw=exports.Network||(exports.Network={})).ETH_MAINNET="eth-mainnet",Sw.ETH_GOERLI="eth-goerli",Sw.ETH_SEPOLIA="eth-sepolia",Sw.OPT_MAINNET="opt-mainnet",Sw.OPT_GOERLI="opt-goerli",Sw.OPT_SEPOLIA="opt-sepolia",Sw.ARB_MAINNET="arb-mainnet",Sw.ARB_GOERLI="arb-goerli",Sw.ARB_SEPOLIA="arb-sepolia",Sw.MATIC_MAINNET="polygon-mainnet",Sw.MATIC_MUMBAI="polygon-mumbai",Sw.MATIC_AMOY="polygon-amoy",Sw.ASTAR_MAINNET="astar-mainnet",Sw.POLYGONZKEVM_MAINNET="polygonzkevm-mainnet",Sw.POLYGONZKEVM_TESTNET="polygonzkevm-testnet",Sw.BASE_MAINNET="base-mainnet",Sw.BASE_GOERLI="base-goerli",Sw.BASE_SEPOLIA="base-sepolia",function(e){e.DEFAULT_TOKENS="DEFAULT_TOKENS",e.ERC20="erc20"}(Iw||(Iw={})),function(e){e.EXTERNAL="external",e.INTERNAL="internal",e.ERC20="erc20",e.ERC721="erc721",e.ERC1155="erc1155",e.SPECIALNFT="specialnft"}(Mw||(Mw={})),function(e){e.TO="TO",e.FROM="FROM"}(Nw||(Nw={})),function(e){e.ASCENDING="asc",e.DESCENDING="desc"}(Bw||(Bw={})),function(e){e.VERIFIED="verified",e.APPROVED="approved",e.REQUESTED="requested",e.NOT_REQUESTED="not_requested"}(Uw||(Uw={})),exports.AlchemySubscription=void 0,(Rw=exports.AlchemySubscription||(exports.AlchemySubscription={})).PENDING_TRANSACTIONS="alchemy_pendingTransactions",Rw.MINED_TRANSACTIONS="alchemy_minedTransactions",function(e){e.NATIVE="NATIVE",e.ERC20="ERC20",e.ERC721="ERC721",e.ERC1155="ERC1155",e.SPECIAL_NFT="SPECIAL_NFT"}(jw||(jw={})),function(e){e.APPROVE="APPROVE",e.TRANSFER="TRANSFER"}(Lw||(Lw={})),function(e){e.ETHERSCAN="ETHERSCAN"}(Gw||(Gw={})),function(e){e.CREATE="CREATE",e.CALL="CALL",e.STATICCALL="STATICCALL",e.DELEGATECALL="DELEGATECALL"}(zw||(zw={})),function(e){e.UNSPECIFIED="TRANSACTION_JOB_STATUS_UNSPECIFIED",e.IN_PROGRESS="IN_PROGRESS",e.COMPLETE="COMPLETE",e.ABANDONED="ABANDONED"}($w||($w={})),function(e){e.V1="V1",e.V2="V2"}(Hw||(Hw={})),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"}(qw||(qw={})),function(e){e.PENDING="pending",e.LATEST="latest",e.SAFE="safe",e.FINALIZED="finalized",e.EARLIEST="earliest"}(Vw||(Vw={})),function(e){e.CALL_TRACER="callTracer",e.PRESTATE_TRACER="prestateTracer"}(Ww||(Ww={})),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"}(Zw||(Zw={})),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"}(Kw||(Kw={})),function(e){e.SPAM="SPAM",e.AIRDROPS="AIRDROPS"}(Jw||(Jw={})),function(e){e.TRANSFERTIME="TRANSFERTIME"}(Yw||(Yw={})),function(e){e.SEAPORT="seaport",e.LOOKSRARE="looksrare",e.X2Y2="x2y2",e.WYVERN="wyvern",e.CRYPTOPUNKS="cryptopunks",e.BLUR="blur",e.UNKNOWN="unknown"}(Xw||(Xw={})),function(e){e.BUYER="buyer",e.SELLER="seller"}(Qw||(Qw={})),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"}(ex||(ex={})),function(e){e.OPENSEA="OpenSea"}(tx||(tx={}));const cx="demo",lx=exports.Network.ETH_MAINNET;function ux(e,t){return`https://${e}.g.alchemy.com/v2/${t}`}var dx;!function(e){e[e.BASE=0]="BASE",e[e.NFT=1]="NFT",e[e.WEBHOOK=2]="WEBHOOK"}(dx||(dx={}));const px={[exports.Network.ETH_MAINNET]:"mainnet",[exports.Network.ETH_GOERLI]:"goerli",[exports.Network.ETH_SEPOLIA]:"sepolia",[exports.Network.OPT_MAINNET]:"optimism",[exports.Network.OPT_GOERLI]:"optimism-goerli",[exports.Network.OPT_SEPOLIA]:"optimism-sepolia",[exports.Network.ARB_MAINNET]:"arbitrum",[exports.Network.ARB_GOERLI]:"arbitrum-goerli",[exports.Network.ARB_SEPOLIA]:"arbitrum-sepolia",[exports.Network.MATIC_MAINNET]:"matic",[exports.Network.MATIC_MUMBAI]:"maticmum",[exports.Network.MATIC_AMOY]:"maticamoy",[exports.Network.ASTAR_MAINNET]:"astar-mainnet",[exports.Network.POLYGONZKEVM_MAINNET]:"polygonzkevm-mainnet",[exports.Network.POLYGONZKEVM_TESTNET]:"polygonzkevm-testnet",[exports.Network.BASE_MAINNET]:"base-mainnet",[exports.Network.BASE_GOERLI]:"base-goerli",[exports.Network.BASE_SEPOLIA]:"base-sepolia"};class hx{constructor(e){this.apiKey=(null==e?void 0:e.apiKey)||cx,this.network=(null==e?void 0:e.network)||lx,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===dx.NFT?(t=this.network,n=this.apiKey,`https://${t}.g.alchemy.com/nft/v3/${n}`):e===dx.WEBHOOK?"https://dashboard.alchemy.com/api":ux(this.network,this.apiKey);var t,n}getProvider(){return this._baseAlchemyProvider||(this._baseAlchemyProvider=(()=>rx(this,void 0,void 0,(function*(){const{AlchemyProvider:e}=yield Promise.resolve().then((function(){return require("./alchemy-provider-5870b6fa-c32529ee.cjs")})).then((function(e){return e.alchemyProvider5870b6fa}));return new e(this)})))()),this._baseAlchemyProvider}getWebSocketProvider(){return this._baseAlchemyWssProvider||(this._baseAlchemyWssProvider=(()=>rx(this,void 0,void 0,(function*(){const{AlchemyWebSocketProvider:e}=yield Promise.resolve().then((function(){return require("./alchemy-websocket-provider-213da986-4fac79de.cjs")}));return new e(this)})))()),this._baseAlchemyWssProvider}}let mx=!1,fx=!1;const yx={debug:1,default:2,info:2,warning:3,error:4,off:5};let bx=yx.default,gx=null;const vx=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 wx,xx;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(wx||(wx={})),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"}(xx||(xx={}));const Ex="0123456789abcdef";class Cx{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==yx[n]&&this.throwArgumentError("invalid log level name","logLevel",e),bx>yx[n]||console.log.apply(console,t)}debug(...e){this._log(Cx.levels.DEBUG,e)}info(...e){this._log(Cx.levels.INFO,e)}warn(...e){this._log(Cx.levels.WARNING,e)}makeError(e,t,n){if(fx)return this.makeError("censored error",t,{});t||(t=Cx.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+=Ex[t[e]>>4],n+=Ex[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 xx.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 xx.CALL_EXCEPTION:case xx.INSUFFICIENT_FUNDS:case xx.MISSING_NEW:case xx.NONCE_EXPIRED:case xx.REPLACEMENT_UNDERPRICED:case xx.TRANSACTION_REPLACED:case xx.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,Cx.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){vx&&this.throwError("platform missing String.prototype.normalize",Cx.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:vx})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,Cx.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,Cx.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,Cx.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,Cx.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",Cx.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",Cx.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",Cx.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return gx||(gx=new Cx("logger/5.7.0")),gx}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Cx.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),mx){if(!e)return;this.globalLogger().throwError("error censorship permanent",Cx.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}fx=!!e,mx=!!t}static setLogLevel(e){const t=yx[e.toLowerCase()];null!=t?bx=t:Cx.globalLogger().warn("invalid log level - "+e)}static from(e){return new Cx(e)}}Cx.errors=xx,Cx.levels=wx;var kx=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 Tx=new Cx("properties/5.7.0");function Px(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function Ax(e){return kx(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 Ox={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Fx(e){if(null==e||Ox[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(!Fx(r))return!1}return!0}return Tx.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Dx(e){if(Fx(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>_x(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&Px(t,n,_x(r))}return t}return Tx.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function _x(e){return Dx(e)}function Sx(e){return Tg.from(e).toNumber()}function Ix(e){return Tg.from(e).toHexString()}function Mx(e){return"string"==typeof e?e:Number.isInteger(e)?Ix(e):e.toString()}function Nx(e,t){return Object.values(t).includes(e)?e:null}function Bx(e){return Vx(Object.assign(Object.assign({},Ux(e)),{displayNft:e.displayNft,image:e.image,totalBalance:e.totalBalance,numDistinctTokensOwned:e.numDistinctTokensOwned,isSpam:e.isSpam}))}function Ux(e){return Vx(Object.assign(Object.assign({},e),{tokenType:Hx(e.tokenType),openSeaMetadata:Object.assign(Object.assign({},e.openSeaMetadata),{safelistRequestStatus:null!==e.openSeaMetadata.safelistRequestStatus?Nx(e.openSeaMetadata.safelistRequestStatus,Uw):null})}))}function Rx(e,t){return{contractAddress:t||e.contractAddress,tokenId:e.tokenId}}function jx(e){return Vx(Object.assign(Object.assign({},e),{contract:(t=e.contract,Vx(Object.assign(Object.assign({},Ux(t)),{spamClassifications:t.spamClassifications.map($x)}))),tokenType:Hx(e.tokenType),acquiredAt:e.acquiredAt,collection:e.collection,mint:e.mint}));var t}function Lx(e){switch(e){case"looksrare":return Xw.LOOKSRARE;case"seaport":return Xw.SEAPORT;case"x2y2":return Xw.X2Y2;case"wyvern":return Xw.WYVERN;case"cryptopunks":return Xw.CRYPTOPUNKS;case"blur":return Xw.BLUR;default:return Xw.UNKNOWN}}function Gx(e){if("OpenSea"===e)return tx.OPENSEA}function zx(e){switch(e.toLowerCase()){case"buyer":return Qw.BUYER;case"seller":return Qw.SELLER;default:throw new Error(`Unsupported NftSaleTakerType ${e}`)}}function $x(e){const t=Nx(e,Kw);return null==t?Kw.Unknown:t}function Hx(e){switch(e){case"erc721":case"ERC721":return Zw.ERC721;case"erc1155":case"ERC1155":return Zw.ERC1155;case"no_supported_nft_standard":case"NO_SUPPORTED_NFT_STANDARD":return Zw.NO_SUPPORTED_NFT_STANDARD;case"not_a_contract":case"NOT_A_CONTRACT":return Zw.NOT_A_CONTRACT;default:return Zw.UNKNOWN}}const qx="undefined"!=typeof window&&null!==window;function Vx(e){if(null!=e){if("Object"===e.constructor.name||Array.isArray(e))for(const t in e)e[t]=Vx(e[t]);return e}}function Wx(e,t,n="getAssetTransfers"){return rx(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?Mx(t.fromBlock):void 0,toBlock:null!=t.toBlock?Mx(t.toBlock):void 0,maxCount:null!=t.maxCount?Ix(t.maxCount):void 0})],n)}))}function Zx(e,t,n="getTransactionReceipts"){return rx(this,void 0,void 0,(function*(){return(yield e.getProvider())._send("alchemy_getTransactionReceipts",[t],n)}))}function Kx(e,t){return rx(this,void 0,void 0,(function*(){const n=yield e.getProvider();yield n.getNetwork();const r=yield Ax({filter:Jx(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 Jx(e,t){return rx(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 Ax(a)),Array.isArray(r.address)?a.address=yield Promise.all(r.address.map((e=>rx(this,void 0,void 0,(function*(){return n._getAddress(e)}))))):null!=r.address&&(a.address=yield n._getAddress(r.address)),a}))}class Yx{constructor(e){this.config=e}getBalance(e,t){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBalance(e,t)}))}isContractAddress(e){return rx(this,void 0,void 0,(function*(){const t=yield this.config.getProvider();return"0x"!==(yield t.getCode(e))}))}getCode(e,t){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getCode(e,t)}))}getStorageAt(e,t,n){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getStorageAt(e,t,n)}))}getTransactionCount(e,t){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransactionCount(e,t)}))}getBlock(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlock(e)}))}getBlockWithTransactions(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlockWithTransactions(e)}))}getNetwork(){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getNetwork()}))}getBlockNumber(){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlockNumber()}))}getGasPrice(){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getGasPrice()}))}getFeeData(){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getFeeData()}))}ready(){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).ready}))}call(e,t){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).call(e,t)}))}estimateGas(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).estimateGas(e)}))}getTransaction(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransaction(e)}))}getTransactionReceipt(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransactionReceipt(e)}))}sendTransaction(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).sendTransaction(e)}))}waitForTransaction(e,t,n){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).waitForTransaction(e,t,n)}))}getLogs(e){return rx(this,void 0,void 0,(function*(){return Kx(this.config,e)}))}send(e,t){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).send(e,t)}))}findContractDeployer(e){var t;return rx(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 Xx(0,r+1,e,this.config),s=yield Zx(this.config,{blockNumber:Ix(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 rx(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?Iw.ERC20:t.type];return(null==t?void 0:t.type)===Iw.ERC20&&t.pageKey&&e.push({pageKey:t.pageKey}),n._send("alchemy_getTokenBalances",e,"getTokenBalances")}}))}getTokensForOwner(e,t){var n;return rx(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:Iw.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:Tg.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?qg(e.rawBalance,o[t].decimals):void 0})));return{tokens:c.map((e=>Vx(e))),pageKey:s.pageKey}}))}getTokenMetadata(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_getTokenMetadata",[e],"getTokenMetadata")}))}getAssetTransfers(e){return rx(this,void 0,void 0,(function*(){return Wx(this.config,e)}))}getTransactionReceipts(e){return rx(this,void 0,void 0,(function*(){return Zx(this.config,e)}))}resolveName(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).resolveName(e)}))}lookupAddress(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).lookupAddress(e)}))}}function Xx(e,t,n,r){return rx(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))?Xx(a+1,t,n,r):Xx(e,a,n,r)}))}class Qx{constructor(e){this.config=e}traceCall(e,t,n){return rx(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[e,t,eE(n)];return r._send("debug_traceCall",a,"traceCall")}))}traceTransaction(e,t,n){return rx(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[e,eE(t,n)];return r._send("debug_traceTransaction",a,"traceTransaction")}))}traceBlock(e,t){return rx(this,void 0,void 0,(function*(){const n=yield this.config.getProvider();let a,s;if(r.isHexString(e,32))a="debug_traceBlockByHash",s=[e,eE(t)];else{a="debug_traceBlockByNumber";s=["number"==typeof e?r.hexStripZeros(r.hexValue(e)):e,eE(t)]}return n._send(a,s,"traceBlock")}))}}function eE(e,t){return Object.assign({tracer:e.type},void 0!==e.onlyTopCall&&{tracerConfig:{onlyTopCall:e.onlyTopCall,timeout:t}})}function tE(e){if(e===Zw.ERC1155||e===Zw.ERC721)return e}var nE;!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"}(nE||(nE={})),nE.DEBUG,nE.INFO,nE.WARN,nE.ERROR,nE.SILENT;const rE={[nE.DEBUG]:"log",[nE.INFO]:"info",[nE.WARN]:"warn",[nE.ERROR]:"error"},aE=nE.INFO;function sE(e,...t){cE.debug(e,t)}function iE(e,...t){cE.info(e,t)}function oE(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return e}}const cE=new class{constructor(){this._logLevel=aE}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in nE))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}debug(...e){this._log(nE.DEBUG,...e)}info(...e){this._log(nE.INFO,...e)}warn(...e){this._log(nE.WARN,...e)}error(...e){this._log(nE.ERROR,...e)}_log(e,...t){if(e<this._logLevel)return;const n=(new Date).toISOString(),r=rE[e];if(!r)throw new Error(`Logger received an invalid logLevel (value: ${e})`);console[r](`[${n}] Alchemy:`,...t.map(oE))}},lE="3.2.0";function uE(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),!qx&&{"Accept-Encoding":"gzip"}),{"Alchemy-Ethers-Sdk-Version":lE,"Alchemy-Ethers-Sdk-Method":n}),method:null!==(s=null==a?void 0:a.method)&&void 0!==s?s:"GET",url:i,params:r});return nx(o)}class dE{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&&sE("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 pE(e,t,n,r,a,s){return rx(this,void 0,void 0,(function*(){let i;const o=new dE(e.maxRetries);for(let c=0;c<e.maxRetries+1;c++)try{void 0!==i&&iE("requestHttp",`Retrying after error: ${i.message}`);try{yield o.backoff()}catch(e){break}const c=yield uE(e._getRequestUrl(t),n,r,a,Object.assign(Object.assign({},s),{timeout:e.requestTimeout}));if(200===c.status)return sE(n,`Successful request: ${n}`),c.data;iE(n,`Request failed: ${n}, ${c.status}, ${c.data}`),i=new Error(c.status+": "+c.data)}catch(e){if(!nx.isAxiosError(e)||void 0===e.response)throw e;if(i=new Error(e.response.status+": "+e.response.data),!hE(e,t))break}return Promise.reject(i)}))}function hE(e,t){const n=t===dx.WEBHOOK?[429,500]:[429];return void 0!==e.response&&n.includes(e.response.status)}function mE(e,t,n,r,a,s,i){return ix(this,arguments,(function*(){let o=!0;const c=Object.assign({},i);for(;o;){const i=yield sx(pE(e,t,n,r,c));yield yield sx(i),null!==i[s]?c[a]=i[s]:o=!1}}))}function fE(e,t,n,r,a="getNftMetadata"){return rx(this,void 0,void 0,(function*(){return jx(yield pE(e,dx.NFT,"getNFTMetadata",a,{contractAddress:t,tokenId:Tg.from(n).toString(),tokenType:tE(null==r?void 0:r.tokenType),tokenUriTimeoutInMs:null==r?void 0:r.tokenUriTimeoutInMs,refreshCache:null==r?void 0:r.refreshCache}))}))}function yE(e,t,n){return rx(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 pE(e,dx.NFT,"getNFTMetadataBatch","getNftMetadataBatch",{},{method:"POST",data:r})).nfts.map((e=>jx(e)))}}))}function bE(e,t,n="getCollectionMetadata"){return rx(this,void 0,void 0,(function*(){const r=yield pE(e,dx.NFT,"getCollectionMetadata",n,{collectionSlug:t});return a=r,Vx(Object.assign(Object.assign({},a),{floorPrice:Object.assign(Object.assign({},a.floorPrice),{marketplace:Gx(a.floorPrice.marketplace)})}));var a}))}function gE(e,t,n,r="getNftsForOwner"){return rx(this,void 0,void 0,(function*(){const a=PE(null==n?void 0:n.omitMetadata),s=yield pE(e,dx.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 Vx(a?{ownedNfts:s.ownedNfts.map((e=>Object.assign(Object.assign({},jx(e)),{balance:e.balance}))),pageKey:s.pageKey,totalCount:s.totalCount,validAt:s.validAt}:{ownedNfts:s.ownedNfts.map((e=>Object.assign(Object.assign({},Rx(e)),{balance:e.balance}))),pageKey:s.pageKey,totalCount:s.totalCount,validAt:s.validAt})}))}function vE(e){switch(e){case Zw.ERC721:return[Mw.ERC721];case Zw.ERC1155:return[Mw.ERC1155];default:return[Mw.ERC721,Mw.ERC1155,Mw.SPECIALNFT]}}function wE(e,t={},n="getNftSales"){return rx(this,void 0,void 0,(function*(){const r=Object.assign({},t),a=yield pE(e,dx.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)?Tg.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 Vx({nftSales:(s=a).nftSales.map((e=>Object.assign(Object.assign({},e),{marketplace:Lx(e.marketplace),taker:zx(e.taker)}))),validAt:s.validAt,pageKey:s.pageKey});var s}))}function xE(e,t,n,r="refreshNftMetadata"){return rx(this,void 0,void 0,(function*(){const a=Tg.from(n).toString(),s=yield fE(e,t,a,void 0,r),i=yield function(e,t,n,r){return rx(this,void 0,void 0,(function*(){return jx(yield pE(e,dx.NFT,"getNFTMetadata",r,{contractAddress:t,tokenId:Tg.from(n).toString(),refreshCache:!0}))}))}(e,t,a,r);return s.timeLastUpdated!==i.timeLastUpdated}))}function EE(e){return kE(e)?jx(e):Rx(e)}function CE(e,t){return kE(e)?jx(e):Rx(e,t)}function kE(e){return void 0!==e.name}function TE(e,t){return rx(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===Mw.ERC1155?function(e){return e.erc1155Metadata.map((t=>({contractAddress:e.rawContract.address,tokenId:t.tokenId,tokenType:Zw.ERC1155})))}(e):[{contractAddress:e.rawContract.address,tokenId:e.tokenId,tokenType:e.category===Mw.ERC721?Zw.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=>yE(e,t.map((e=>e.token))))))).map((e=>e.nfts)).flat(),s=new Map;a.forEach((e=>{const t=`${e.contract.address.toLowerCase()}-${Tg.from(e.tokenId).toString()}`;s.set(t,e)}));return{nfts:n.map((e=>{const t=`${e.token.contractAddress.toLowerCase()}-${Tg.from(e.token.tokenId).toString()}`;return Object.assign(Object.assign({},s.get(t)),e.metadata)})),pageKey:t.pageKey}}))}function PE(e){return void 0===e||!e}function AE(e){switch(e){case"does_not_exist":return ex.DOES_NOT_EXIST;case"already_queued":return ex.ALREADY_QUEUED;case"in_progress":return ex.IN_PROGRESS;case"finished":return ex.FINISHED;case"queued":return ex.QUEUED;case"queue_failed":return ex.QUEUE_FAILED;default:throw new Error("Unknown reingestion state: "+e)}}class OE{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},fE(this.config,e,t,a)}getNftMetadataBatch(e,t){return yE(this.config,e,t)}getContractMetadata(e){return function(e,t,n="getContractMetadata"){return rx(this,void 0,void 0,(function*(){return Ux(yield pE(e,dx.NFT,"getContractMetadata",n,{contractAddress:t}))}))}(this.config,e)}getContractMetadataBatch(e){return function(e,t){return rx(this,void 0,void 0,(function*(){return{contracts:(yield pE(e,dx.NFT,"getContractMetadataBatch","getContractMetadataBatch",{},{method:"POST",data:{contractAddresses:t}})).contracts.map(Ux)}}))}(this.config,e)}getCollectionMetadata(e){return bE(this.config,e)}getNftsForOwnerIterator(e,t){return function(e,t,n,r="getNftsForOwnerIterator"){return ix(this,arguments,(function*(){var a,s;const i=PE(null==n?void 0:n.omitMetadata);try{for(var o,c=ox(mE(e,dx.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 sx(c.next())).done;){const e=o.value;for(const t of e.ownedNfts)yield yield sx(Object.assign(Object.assign({},EE(t)),{balance:t.balance}))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(s=c.return)&&(yield sx(s.call(c)))}finally{if(a)throw a.error}}}))}(this.config,e,t)}getNftsForOwner(e,t){return gE(this.config,e,t)}getNftsForContract(e,t){return function(e,t,n,r="getNftsForContract"){var a;return rx(this,void 0,void 0,(function*(){const s=PE(null==n?void 0:n.omitMetadata),i=yield pE(e,dx.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 Vx(s?{nfts:i.nfts.map((e=>jx(e))),pageKey:i.pageKey}:{nfts:i.nfts.map((e=>Rx(e,t))),pageKey:i.pageKey})}))}(this.config,e,t)}getNftsForContractIterator(e,t){return function(e,t,n,r="getNftsForContractIterator"){return ix(this,arguments,(function*(){var a,s;const i=PE(null==n?void 0:n.omitMetadata);try{for(var o,c=ox(mE(e,dx.NFT,"getNFTsForContract",r,"pageKey","pageKey",{contractAddress:t,pageKey:null==n?void 0:n.pageKey,withMetadata:i}));!(o=yield sx(c.next())).done;){const e=o.value;for(const n of e.nfts)yield yield sx(CE(n,t))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(s=c.return)&&(yield sx(s.call(c)))}finally{if(a)throw a.error}}}))}(this.config,e,t)}getOwnersForContract(e,t){return function(e,t,n,r="getOwnersForContract"){return rx(this,void 0,void 0,(function*(){const a=yield pE(e,dx.NFT,"getOwnersForContract",r,Object.assign(Object.assign({},n),{contractAddress:t}));return null==n||n.withTokenBalances,Vx({owners:a.owners,pageKey:a.pageKey})}))}(this.config,e,t)}getOwnersForNft(e,t,n){return function(e,t,n,r,a="getOwnersForNft"){return rx(this,void 0,void 0,(function*(){return pE(e,dx.NFT,"getOwnersForNFT",a,Object.assign({contractAddress:t,tokenId:Tg.from(n).toString()},r))}))}(this.config,e,t,n)}getContractsForOwner(e,t){return function(e,t,n,r="getContractsForOwner"){return rx(this,void 0,void 0,(function*(){const a=yield pE(e,dx.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 Vx({contracts:a.contracts.map(Bx),pageKey:a.pageKey,totalCount:a.totalCount})}))}(this.config,e,t)}getTransfersForOwner(e,t,n){return function(e,t,n,r){return rx(this,void 0,void 0,(function*(){const a=yield e.getProvider(),s=yield a._getAddress(t),i=vE(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===Nw.TO?o.toAddress=s:o.fromAddress=s;const c=yield Wx(e,o,"getTransfersForOwner");return TE(e,c)}))}(this.config,e,t,n)}getTransfersForContract(e,t){return function(e,t,n){return rx(this,void 0,void 0,(function*(){const r=[Mw.ERC721,Mw.ERC1155,Mw.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 Wx(e,s,"getTransfersForContract");return TE(e,i)}))}(this.config,e,t)}getMintedNfts(e,t){return rx(this,void 0,void 0,(function*(){return function(e,t,n){return rx(this,void 0,void 0,(function*(){const r=yield e.getProvider(),a=yield r._getAddress(t),s=vE(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 Wx(e,i,"getMintedNfts");return TE(e,o)}))}(this.config,e,t)}))}verifyNftOwnership(e,t){return function(e,t,n,r="verifyNftOwnership"){return rx(this,void 0,void 0,(function*(){if("string"==typeof n)return(yield gE(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 gE(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 rx(this,void 0,void 0,(function*(){return pE(e,dx.NFT,"isSpamContract",n,{contractAddress:t})}))}(this.config,e)}getSpamContracts(){return function(e,t="getSpamContracts"){return rx(this,void 0,void 0,(function*(){return pE(e,dx.NFT,"getSpamContracts",t,void 0)}))}(this.config)}reportSpam(e){return function(e,t,n="reportSpam"){return rx(this,void 0,void 0,(function*(){pE(e,dx.NFT,"reportSpam",n,{contractAddress:t})}))}(this.config,e)}isAirdropNft(e,t){return function(e,t,n,r="isAirdropNft"){return rx(this,void 0,void 0,(function*(){return pE(e,dx.NFT,"isAirdropNFT",r,{contractAddress:t,tokenId:n})}))}(this.config,e,t)}getFloorPrice(e){return function(e,t,n="getFloorPrice"){return rx(this,void 0,void 0,(function*(){return Vx(yield pE(e,dx.NFT,"getFloorPrice",n,{contractAddress:t}))}))}(this.config,e)}getNftSales(e){return wE(this.config,e)}computeRarity(e,t){return function(e,t,n,r="computeRarity"){return rx(this,void 0,void 0,(function*(){return Vx(yield pE(e,dx.NFT,"computeRarity",r,{contractAddress:t,tokenId:Tg.from(n).toString()}))}))}(this.config,e,t)}searchContractMetadata(e){return function(e,t,n="searchContractMetadata"){return rx(this,void 0,void 0,(function*(){return{contracts:(yield pE(e,dx.NFT,"searchContractMetadata",n,{query:t})).contracts.map(Ux)}}))}(this.config,e)}summarizeNftAttributes(e){return function(e,t,n="summarizeNftAttributes"){return rx(this,void 0,void 0,(function*(){return pE(e,dx.NFT,"summarizeNFTAttributes",n,{contractAddress:t})}))}(this.config,e)}refreshNftMetadata(e,t){return xE(this.config,e,t)}refreshContract(e){return function(e,t,n="refreshContract"){return rx(this,void 0,void 0,(function*(){const r=yield pE(e,dx.NFT,"reingestContract",n,{contractAddress:t});return{contractAddress:r.contractAddress,refreshState:AE(r.reingestionState),progress:r.progress}}))}(this.config,e)}}class FE{constructor(e){this.config=e}getAllWebhooks(){return rx(this,void 0,void 0,(function*(){this.verifyConfig();const e=yield this.sendWebhookRequest("team-webhooks","getAllWebhooks",{});return{webhooks:SE(e),totalCount:e.data.length}}))}getAddresses(e,t){return rx(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 rx(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 rx(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:Tg.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 rx(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(ME):[],nft_filters_to_remove:t.removeFilters?t.removeFilters.map(ME):[]};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(ME):[],nft_metadata_filters_to_remove:t.removeMetadataFilters?t.removeMetadataFilters.map(ME):[]};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 rx(this,void 0,void 0,(function*(){let r;if(t===qw.MINED_TRANSACTION||t===qw.DROPPED_TRANSACTION){if(!("appId"in n))throw new Error("Transaction Webhooks require an app id.");r=n.appId}let a,s,i,o=_E.get(this.config.network);if(t===qw.NFT_ACTIVITY||t===qw.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?_E.get(n.network):o;const e=n.filters.map((e=>e.tokenId?{contract_address:e.contractAddress,token_id:Tg.from(e.tokenId).toString()}:{contract_address:e.contractAddress}));a=t===qw.NFT_ACTIVITY?{nft_filters:e}:{nft_metadata_filters:e}}else if(t===qw.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?_E.get(n.network):o,s=yield this.resolveAddresses(n.addresses)}else if(t==qw.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?_E.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 IE((yield this.sendWebhookRequest("create-webhook","createWebhook",{},{method:"POST",data:c})).data)}))}deleteWebhook(e){return rx(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 pE(this.config,dx.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 rx(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 DE={ETH_MAINNET:exports.Network.ETH_MAINNET,ETH_GOERLI:exports.Network.ETH_GOERLI,ETH_SEPOLIA:exports.Network.ETH_SEPOLIA,MATIC_MAINNET:exports.Network.MATIC_MAINNET,MATIC_MUMBAI:exports.Network.MATIC_MUMBAI,MATIC_AMOY:exports.Network.MATIC_AMOY,ARB_MAINNET:exports.Network.ARB_MAINNET,ARB_GOERLI:exports.Network.ARB_GOERLI,OPT_MAINNET:exports.Network.OPT_MAINNET,OPT_GOERLI:exports.Network.OPT_GOERLI,BASE_MAINNET:exports.Network.BASE_MAINNET,BASE_GOERLI:exports.Network.BASE_GOERLI,BASE_SEPOLIA:exports.Network.BASE_SEPOLIA},_E=Object.keys(exports.Network).reduce(((e,t)=>(t in DE&&e.set(DE[t],t),e)),new Map);function SE(e){return e.data.map(IE)}function IE(e){return Object.assign({id:e.id,network:DE[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 ME(e){return e.tokenId?{contract_address:e.contractAddress,token_id:Tg.from(e.tokenId).toString()}:{contract_address:e.contractAddress}}const NE=[.9,1,1.1,1.2,1.3];class BE{constructor(e){this.config=e}sendPrivateTransaction(e,t,n){return rx(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=t?Ix(t):void 0;return r._send("eth_sendPrivateTransaction",[{tx:e,maxBlockNumber:a,preferences:n}],"sendPrivateTransaction")}))}cancelPrivateTransaction(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("eth_cancelPrivateTransaction",[{txHash:e}],"cancelPrivateTransaction")}))}simulateAssetChangesBundle(e,t){return rx(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Vx(yield n._send("alchemy_simulateAssetChangesBundle",r,"simulateAssetChangesBundle"))}))}simulateAssetChanges(e,t){return rx(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Vx(yield n._send("alchemy_simulateAssetChanges",r,"simulateAssetChanges"))}))}simulateExecutionBundle(e,t){return rx(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Vx(n._send("alchemy_simulateExecutionBundle",r,"simulateExecutionBundle"))}))}simulateExecution(e,t){return rx(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Vx(n._send("alchemy_simulateExecution",r,"simulateExecution"))}))}getTransaction(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransaction(e)}))}sendTransaction(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).sendTransaction(e)}))}estimateGas(e){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).estimateGas(e)}))}getMaxPriorityFeePerGas(){return rx(this,void 0,void 0,(function*(){const e=yield this.config.getProvider();return Sx(yield e._send("eth_maxPriorityFeePerGas",[],"getMaxPriorityFeePerGas"))}))}waitForTransaction(e,t,n){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).waitForTransaction(e,t,n)}))}sendGasOptimizedTransaction(e,t){return rx(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 NE.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 rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_getGasOptimizedTransactionStatus",[e],"getGasOptimizedTransactionStatus")}))}_sendGasOptimizedTransaction(e,t){return rx(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_sendGasOptimizedTransaction",[{rawTransactions:e}],t)}))}}const UE="alchemy-pending-transactions",RE="alchemy-mined-transactions",jE=[UE,RE];class LE{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}}function GE(e){return"object"==typeof e&&"method"in e}function zE(e){return void 0===e?"*":Array.isArray(e)?e.join("|"):e}function $E(e){return void 0===e?"*":e.toString()}function HE(e){if(""===e)return;const t=e.split("|");return 1===t.length?t[0]:t}class qE{constructor(e){this.config=e}on(e,t){return(()=>{rx(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(()=>{rx(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(()=>{rx(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(()=>{rx(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 rx(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 rx(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 rx(this,void 0,void 0,(function*(){if(!GE(e))return e;if(e.method===exports.AlchemySubscription.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===exports.AlchemySubscription.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 rx(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 VE=By.custom((e=>{const t=rb.parse(e);let n;try{n=Cb(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`"),WE=Fb.and(By.object({chain:VE,opts:Sb.optional().default(Sb.parse({}))}));By.instanceof(class{constructor(e){this.config=new hx(e),this.core=new Yx(this.config),this.nft=new OE(this.config),this.ws=new qE(this.config),this.transact=new BE(this.config),this.notify=new FE(this.config),this.debug=new Qx(this.config)}});const ZE=e=>({simulateUserOperation:async t=>cg(e,t)}),KE=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=gb(s,n?.maxPriorityFeePerGas,r?.maxPriorityFeePerGas);return{...t,maxPriorityFeePerGas:o,maxFeePerGas:gb(i+BigInt(o),n?.maxFeePerGas,r?.maxFeePerGas)}},JE=(e,t)=>()=>Nr([t.paymasterAddress??(e=>{switch(e.id){case Jy.id:case Hy.id:case Zy.id:case eb.id:case tb.id:case Xy.id:case Qy.id:return"0x4f84a207A80c39E9e8BaE717c1F25bA7AD1fB08F";case Gy.id:case Uy.id:case zy.id:case Yy.id:case Vy.id:return"0x4Fd9098af9ddcB41DA48A1d78F91F1398965addc";case jy.id:return"0x0804Afe6EEFb73ce7F93CD0d5e7079a5a8068592";case qy.id:case Ky.id:return"0xc03aac639bb21233e0139381970328db8bceeb67";default:throw new Error(`Unsupported chain: ${e}`)}})(e.chain),t.dummyData??"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"]);function YE(e,t){const n=t.gasEstimationOptions,r=n?.disableGasEstimation??!1,a=n?.fallbackFeeDataGetter??KE(e),s=n?.fallbackGasEstimator??rg(e);return{gasEstimator:r?s:async(t,{overrides:n,account:r,feeOptions:a})=>wb(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(wb(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?eC(e,t):QE(e,t)}}const XE=(e,t,n,r)=>{let a=e;if(null!=t?.[a])return cb(t[a])?Tb(t[a]):{multiplier:Number(t[a].multiplier)};if(lb(n?.[e]))return{multiplier:Number(n[e].multiplier)};const s=r[e];return Vn(s)&&mr(s,"bigint")>0n?s:void 0};function QE(e,t){return{dummyPaymasterAndData:JE(e,t),paymasterAndData:async(n,{overrides:r,feeOptions:a,account:s})=>{const i=Tb(await kb(n)),o=Pb({maxFeePerGas:XE("maxFeePerGas",r,a,i),maxPriorityFeePerGas:XE("maxPriorityFeePerGas",r,a,i),callGasLimit:XE("callGasLimit",r,a,i),verificationGasLimit:XE("verificationGasLimit",r,a,i),preVerificationGas:XE("preVerificationGas",r,a,i)});if("0.7.0"===s.getEntryPoint().version){const e=XE("paymasterVerificationGasLimit",r,a,i);null!=e&&(o.paymasterVerificationGasLimit=e);const t=XE("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 eC=(e,t)=>({dummyPaymasterAndData:JE(e,t),paymasterAndData:async(n,{account:r})=>{const a=await e.request({method:"alchemy_requestPaymasterAndData",params:[{policyId:t.policyId,entryPoint:r.getEntryPoint().address,userOperation:Tb(await kb(n))}]});return{...n,...a}}});function tC(e){return async(t,{account:n})=>{const r=await e.request({method:"alchemy_simulateUserOperationAssetChanges",params:[Tb(await kb(t)),n.getEntryPoint().address]});if(r.error)throw new Error(r.error.message);return t}}function nC(e){return{"Alchemy-Aa-Sdk-Signer":e.getSigner().signerType}}const rC=[{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"}],aC=[{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"}],sC=[{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}],iC=[{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"}],oC=[{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:[]}],cC=e=>({getExecutionFunctionConfig:async({selector:t,account:n=e.account})=>{if(!n)throw new wm;if(!Qb(e))throw new om("SmartAccountClient","getExecutionFunctionConfig",e);return e.readContract({address:n.address,abi:rC,functionName:"getExecutionFunctionConfig",args:[t]})},getExecutionHooks:async({selector:t,account:n=e.account})=>{if(!n)throw new wm;if(!Qb(e))throw new om("SmartAccountClient","getExecutionHooks",e);return e.readContract({address:n.address,abi:rC,functionName:"getExecutionHooks",args:[t]})},getPreValidationHooks:async({selector:t,account:n=e.account})=>{if(!n)throw new wm;if(!Qb(e))throw new om("SmartAccountClient","getPreValidationHooks",e);return e.readContract({address:n.address,abi:rC,functionName:"getPreValidationHooks",args:[t]})},getInstalledPlugins:async({account:t=e.account})=>{if(!t)throw new wm;if(!Qb(e))throw new om("SmartAccountClient","getInstalledPlugins",e);return e.readContract({address:t.address,abi:rC,functionName:"getInstalledPlugins"}).catch((()=>[]))}});async function lC(e,{overrides:t,context:n,account:r=e.account,...a}){if(!r)throw new wm;if(!Qb(e))throw new om("SmartAccountClient","installPlugin",e);const s=await async function(e,t){const n=await e.readContract({abi:aC,address:t.pluginAddress,functionName:"pluginManifest"}),r=t.manifestHash??Dr(function(e){const{abi:t,functionName:n,result:r}=e;let a=t[0];if(n){const e=rs({abi:t,name:n});if(!e)throw new Ia(n,{docsPath:Yc});a=e}if("function"!==a.type)throw new Ia(void 0,{docsPath:Yc});if(!a.outputs)throw new Ma(a.name,{docsPath:Yc});let s=Array.isArray(r)?r:[r];return 0!==a.outputs.length||s[0]||(s=[]),Xa(a.outputs,s)}({abi:aC,functionName:"pluginManifest",result:n}));return hs({abi:sC,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 uC={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"},dC={meta:{name:"Multi Owner Plugin",version:"1.0.0",addresses:uC},getContract:(e,t)=>{if(!e.chain)throw new lm;return ec({address:t||uC[e.chain.id],abi:mC,client:e})}},pC=e=>({updateOwners({args:t,overrides:n,context:r,account:a=e.account}){if(!a)throw new wm;if(!Qb(e))throw new om("SmartAccountClient","updateOwners",e);const s=hs({abi:hC,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 wm;if(!Qb(e))throw new om("SmartAccountClient","installMultiOwnerPlugin",e);const s=e.chain;if(!s)throw new lm;const i=a.dependencyOverrides??[],o=a.pluginAddress??dC.meta.addresses[s.id];if(!o)throw new Error("missing MultiOwnerPlugin address for chain "+s.name);return lC(e,{pluginAddress:o,pluginInitData:Xa([{type:"address[]"}],a.args),dependencies:i,overrides:n,account:t,context:r})},encodeUpdateOwners:({args:e})=>hs({abi:hC,functionName:"updateOwners",args:e}),encodeEip712Domain:()=>hs({abi:hC,functionName:"eip712Domain"}),async readEip712Domain({account:t=e.account}){if(!t)throw new wm;if(!Qb(e))throw new om("SmartAccountClient","readEip712Domain",e);return e.readContract({address:t.address,abi:hC,functionName:"eip712Domain"})},encodeIsValidSignature:({args:e})=>hs({abi:hC,functionName:"isValidSignature",args:e}),async readIsValidSignature({args:t,account:n=e.account}){if(!n)throw new wm;if(!Qb(e))throw new om("SmartAccountClient","readIsValidSignature",e);return e.readContract({address:n.address,abi:hC,functionName:"isValidSignature",args:t})}}),hC=[{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"}]}],mC=[{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"}],fC=(e,t,n,r=dC.meta.addresses[e.chain.id])=>{const a=async a=>{const[,s,i,o,c,l]=await e.readContract({abi:mC,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(Qc(e)),signTypedData:e=>a(zc(e))}},yC=e=>(e.id,"0x000000e92D78D90000007F0082006FDA09BD5f11"),bC={encodeExecute:async({target:e,data:t,value:n})=>hs({abi:iC,functionName:"execute",args:[e,n??0n,t]}),encodeBatchExecute:async e=>hs({abi:iC,functionName:"executeBatch",args:[e.map((e=>({target:e.target,data:e.data,value:e.value??0n})))]})};async function gC({transport:e,chain:t,signer:n,accountAddress:r,initCode:a,entryPoint:s=vm(t,{version:"0.6.0"}),factoryAddress:i=yC(t),owners:o=[],salt:c=0n}){const l=dm({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!==fr(e))).sort(((e,t)=>{const n=fr(e),r=fr(t);return n<r?-1:n>r?1:0}));return Br([i,hs({abi:oC,functionName:"createAccount",args:[c,t]})])},d=await Ub({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=dm({transport:n=>e({...n,chain:t,retryCount:0}),chain:t}),m=ec({address:n.address,abi:n.abi,client:h}),f=await Ub({client:h,entryPoint:n,accountAddress:a,getAccountInitCode:s});let y=Ib.UNDEFINED;const b=async()=>{if(y===Ib.DEPLOYED)return"0x";const e=await h.getBytecode({address:f});return(e?.length??0)>2?(y=Ib.DEPLOYED,"0x"):(y=Ib.NOT_DEPLOYED,s())},g=d??(async e=>i({message:{raw:dr(e)}})),v=p??(()=>{throw new Em(r)}),w=async()=>"0x"===await b(),x=Mb({address:f,signMessage:i,signTypedData:o,signTransaction:()=>{throw new Cm}}),E=async(e,t)=>{if(e)return t;const[n,r]=Bb(await s());return Om({factoryAddress:n,factoryCalldata:r,signature:t})};if("0.6.0"!==n.version&&"0.7.0"!==n.version)throw new hm(t,n.version);return{...x,source:r,signUserOperationHash:g,getFactoryAddress:async()=>Bb(await s())[0],getFactoryData:async()=>Bb(await s())[1],encodeBatchExecute:c??(()=>{throw new Tm(r)}),encodeExecute:l,getDummySignature:u,getInitCode:b,encodeUpgradeToAndCall:v,getEntryPoint:()=>n,isAccountDeployed:w,getNonce:async(e=0n)=>await w()?m.read.getNonce([f,e]):0n,signMessageWith6492:async e=>{const[t,n]=await Promise.all([w(),x.signMessage(e)]);return E(t,n)},signTypedDataWith6492:async e=>{const[t,n]=await Promise.all([w(),x.signTypedData(e)]);return E(t,n)},getImplementationAddress:async()=>{const e=await h.getStorageAt({address:x.address,slot:"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"});if(null==e)throw new km("0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc","Proxy Implementation Address");return Zn(e)}}}({transport:e,chain:t,entryPoint:s,accountAddress:d,source:"MultiOwnerModularAccount",getAccountInitCode:u,...bC,...fC(l,d,(()=>n))});return{...p,publicKey:await n.getAddress(),getSigner:()=>n}}async function vC(e,{overrides:t,account:n=e.account,context:r,...a}){if(!n)throw new wm;if(!Qb(e))throw new om("SmartAccountClient","uninstallPlugin",e);const s=await async function(e){return hs({abi:sC,functionName:"uninstallPlugin",args:[e.pluginAddress,e.config??"0x",e.pluginUninstallData??"0x"]})}(a);return e.sendUserOperation({uo:s,overrides:t,account:n,context:r})}const wC=e=>({installPlugin:async t=>lC(e,t),uninstallPlugin:async t=>vC(e,t)}),xC=e=>({...pC(e),async readOwners(t){const n=t?.account??e.account;if(!n)throw new wm;return dC.getContract(e,t?.pluginAddress).read.ownersOf([n.address])},async isOwnerOf(t){const n=t.account??e.account;if(!n)throw new wm;return dC.getContract(e,t.pluginAddress).read.isOwnerOf([n.address,t.address])}}),EC=({chain:e,connectionConfig:t,fetchOptions:n={}})=>{const r=VE.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}`}),dm({chain:r,transport:yc(a,{fetchOptions:n})}).extend((()=>({updateHeaders(e){n.headers={...n.headers,...e}}})))};async function CC(e){const{chain:t,opts:n,...r}=WE.parse(e),a=EC({chain:t,connectionConfig:r}),s=await gC({transport:dc(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??yb(c.chain),u=og({account:t,client:c,type:"AlchemySmartAccountClient",opts:{...e,feeOptions:l},customMiddleware:async(e,t)=>(Nb(t.account)&&c.updateHeaders(nC(t.account)),i?i(e,t):e),feeEstimator:a??KE(c),userOperationSimulator:n?tC(c):void 0,gasEstimator:s,...r&&YE(c,{...r,gasEstimationOptions:{...r.gasEstimationOptions,disableGasEstimation:r.gasEstimationOptions?.disableGasEstimation??!1,fallbackFeeDataGetter:r.gasEstimationOptions?.fallbackFeeDataGetter??a,fallbackGasEstimator:r.gasEstimationOptions?.fallbackGasEstimator??s}}),signUserOperation:o}).extend(ZE);return t&&Nb(t)&&c.updateHeaders(nC(t)),u}({...e,client:a,account:s,opts:n}).extend(xC).extend(wC).extend(cC)}const kC=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 TC(e,t){let n;try{n=e()}catch(e){return}const r={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)};return r}const PC=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>PC(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>PC(t)(e)}}},AC=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(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=PC(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 PC(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:TC((()=>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 PC(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),OC=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:()=>{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},FC=e=>e?OC(e):OC;class DC extends im{constructor(){super(["Signer not authenticated","Please authenticate to use this signer"].join("\n"),{docsPath:"/signers/alchemy-signer/introduction.html"})}}var _C={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}(_C);var SC=_C.exports;const IC=By.object({sessionKey:By.string().default("alchemy-signer-session"),storage:By.enum(["localStorage","sessionStorage"]).default("localStorage").or(By.custom()),expirationTimeMs:By.number().default(9e5).describe("The time in milliseconds that a session should last before expiring [default: 15 minutes]"),client:By.custom()});class MC{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}=IC.parse(e);this.sessionKey=t;const s="string"==typeof n?"localStorage"===n?localStorage:sessionStorage:n;this.expirationTimeMs=r,this.client=a,this.eventEmitter=new SC,this.store=FC(kC(AC(this.getInitialState,{name:this.sessionKey,storage:TC((()=>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 NC;!function(e){e.INITIALIZING="INITIALIZING",e.CONNECTED="CONNECTED",e.DISCONNECTED="DISCONNECTED",e.AUTHENTICATING="AUTHENTICATING",e.AWAITING_EMAIL_AUTH="AWAITING_EMAIL_AUTH"}(NC||(NC={}));class BC{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===NC.CONNECTED&&t(this.store.getState().user)),{fireImmediately:!0});case"disconnected":return this.store.subscribe((({status:e})=>e),(e=>e===NC.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=Qc(e);return this.inner.signRawMessage(t)}}),Object.defineProperty(this,"signTypedData",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=zc(e);return this.inner.signRawMessage(t)}}),Object.defineProperty(this,"signTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{const n=t?.serializer??fl,r=n(e),a=await this.inner.signRawMessage(Dr(r));return n(e,{r:mb(a,{count:32}),s:mb(a,{count:32,offset:32}),v:BigInt(mb(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 DC;return Mb({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:NC.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:NC.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:NC.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:NC.CONNECTED})})),this.sessionManager.on("disconnected",(()=>{this.store.setState({user:null,status:NC.DISCONNECTED})})),this.sessionManager.on("initialized",(()=>{this.store.setState((e=>({status:e.user?NC.CONNECTED:NC.DISCONNECTED})))})),this.inner.on("authenticating",(()=>{this.store.setState({status:NC.AUTHENTICATING})}))}}),this.inner=e,this.store=FC(kC((()=>({user:null,status:NC.INITIALIZING})))),this.sessionManager=new MC({...t,client:this.inner}),this.store=FC(kC((()=>({user:null,status:NC.INITIALIZING})))),this.registerListeners(),this.sessionManager.initialize()}}"undefined"!=typeof process&&null!=process.versions&&process.versions.node;var UC={exports:{}};!function(e,t){var n="undefined"!=typeof self?self:lg,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 v(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)}))}v.polyfill=!0,e.fetch||(e.fetch=v,e.Headers=c,e.Request=f,e.Response=b),t.Headers=c,t.Request=f,t.Response=b,t.fetch=v,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}(UC,UC.exports);var RC=ug(UC.exports);const jC=UC.exports.fetch;function LC(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 GC="copy",zC="convert";function $C(e,t,n){if(t===GC)return n;if(t===zC)return e(n);if(t instanceof Array)return n.map((n=>$C(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]=$C(e,s.schema,n[a]):r[a]=null;else if(s.required)throw new Error(`Missing key: ${a}`)}return r}}function HC(e,t){return{required:!0,schema:e,derive:t}}function qC(e){return{required:!0,schema:e}}function VC(e){return{required:!1,schema:e}}const WC={appid:VC(GC),appidExclude:VC(GC),credProps:VC(GC)},ZC={type:qC(GC),id:qC(GC),rawId:qC(zC),authenticatorAttachment:VC(GC),response:qC({clientDataJSON:qC(zC),attestationObject:qC(zC),transports:HC(GC,(e=>e.getTransports?.()||[]))}),clientExtensionResults:HC(WC,(e=>e.getClientExtensionResults()))};function KC(e){return $C(LC,ZC,e)}function JC(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 YC(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=()=>KC(t),t}(e);return{credentialId:(n=t.toJSON()).rawId,attestationObject:n.response.attestationObject,clientDataJson:n.response.clientDataJSON,transports:n.response.transports.map(JC)};var n}class XC 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 QC{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 jC(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 XC(e)}return await s.json()}}var ek;!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"}(ek||(ek={}));class tk{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===ek.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:ek.InjectCredentialBundle,value:e},"*"),window.addEventListener("message",(e=>{e.origin===this.iframeOrigin&&(e.data?.type===ek.BundleInjected&&t(e.data.value),e.data?.type===ek.Error&&n(e.data.value))}),!1)}))}async injectKeyExportBundle(e){return this.iframe.contentWindow?.postMessage({type:ek.InjectKeyExportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===ek.BundleInjected&&e(n.data.value),n.data?.type===ek.Error&&t(n.data.value))}),!1)}))}async injectWalletExportBundle(e){return this.iframe.contentWindow?.postMessage({type:ek.InjectWalletExportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===ek.BundleInjected&&e(n.data.value),n.data?.type===ek.Error&&t(n.data.value))}),!1)}))}async injectImportBundle(e){return this.iframe.contentWindow?.postMessage({type:ek.InjectImportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===ek.BundleInjected&&e(n.data.value),n.data?.type===ek.Error&&t(n.data.value))}),!1)}))}async extractWalletEncryptedBundle(){return this.iframe.contentWindow?.postMessage({type:ek.ExtractWalletEncryptedBundle},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===ek.EncryptedBundleExtracted&&e(n.data.value),n.data?.type===ek.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:ek.StampRequest,value:e},"*"),new Promise((function(e,n){window.addEventListener("message",(r=>{r.origin===t&&(r.data?.type===ek.Stamp&&e({stampHeaderName:"X-Stamp",stampHeaderValue:r.data.value}),r.data?.type===ek.Error&&n(r.data.value))}),!1)}))}}function nk(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 rk="copy",ak="convert";function sk(e,t,n){if(t===rk)return n;if(t===ak)return e(n);if(t instanceof Array)return n.map((n=>sk(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]=sk(e,s.schema,n[a]):r[a]=null;else if(s.required)throw new Error(`Missing key: ${a}`)}return r}}function ik(e){return{required:!0,schema:e}}function ok(e){return{required:!1,schema:e}}const ck={appid:ok(rk),appidExclude:ok(rk),credProps:ok(rk)},lk={type:ik(rk),id:ik(rk),rawId:ik(ak),authenticatorAttachment:ok(rk),response:ik({clientDataJSON:ik(ak),authenticatorData:ik(ak),signature:ik(ak),userHandle:ik(ak)}),clientExtensionResults:(uk=ck,dk=e=>e.getClientExtensionResults(),{required:!0,schema:uk,derive:dk})};var uk,dk;function pk(e){return sk(nk,lk,e)}let hk;function mk(e,...t){if(!((n=e)instanceof Uint8Array||null!=n&&"object"==typeof n&&"Uint8Array"===n.constructor.name))throw new Error("Uint8Array expected");var n;if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function fk(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")}hk=void 0!==globalThis?.Buffer?globalThis.Buffer:i.Buffer;
|
|
28
|
-
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
29
|
-
const yk=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),bk=(e,t)=>e<<32-t|e>>>t;function gk(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)),mk(e),e}new Uint8Array(new Uint32Array([287454020]).buffer)[0];class vk{clone(){return this._cloneInto()}}function wk(e){const t=t=>e().update(gk(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const xk=(e,t,n)=>e&t^~e&n,Ek=(e,t,n)=>e&t^e&n^t&n;class Ck extends vk{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=yk(this.buffer)}update(e){fk(this);const{view:t,buffer:n,blockLen:r}=this,a=(e=gk(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=yk(e);for(;r<=a-s;s+=r)this.process(t,s)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){fk(this),function(e,t){mk(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=yk(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 kk=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]),Tk=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pk=new Uint32Array(64);class Ak extends Ck{constructor(){super(64,32,8,!1),this.A=0|Tk[0],this.B=0|Tk[1],this.C=0|Tk[2],this.D=0|Tk[3],this.E=0|Tk[4],this.F=0|Tk[5],this.G=0|Tk[6],this.H=0|Tk[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)Pk[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Pk[e-15],n=Pk[e-2],r=bk(t,7)^bk(t,18)^t>>>3,a=bk(n,17)^bk(n,19)^n>>>10;Pk[e]=a+Pk[e-7]+r+Pk[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+(bk(i,6)^bk(i,11)^bk(i,25))+xk(i,o,c)+kk[e]+Pk[e]|0,u=(bk(n,2)^bk(n,13)^bk(n,22))+Ek(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(){Pk.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Ok=wk((()=>new Ak));class Fk{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=Ok(t),r=hk.from(n).toString("hex"),a=hk.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=()=>pk(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 Dk=e=>Buffer.from(e).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),_k=()=>{const e=new Uint8Array(32);return crypto.getRandomValues(e),e.buffer};class Sk{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 DC;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:Dk(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 DC;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 DC;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))))).find((e=>e.address===this.user.address));if(!n)throw new Error(`Could not find wallet associated with ${this.user.address}`);const{activity:r}=await this.turnkeyClient.exportWallet({organizationId:this.user.orgId,type:"ACTIVITY_TYPE_EXPORT_WALLET",timestampMs:Date.now().toString(),parameters:{walletId:n.walletId,targetPublicKey:e.publicKey()}}),{exportBundle:a}=await this.pollActivityCompletion(r,this.user.orgId,"exportWalletResult"),s=await e.injectWalletExportBundle(a);if(!s)throw new Error("Failed to inject wallet export bundle");return s}}),Object.defineProperty(this,"exportAsPrivateKey",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{if(!this.user)throw new DC;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 SC,this.connectionConfig=Fb.parse(n),this.turnkeyClient=new QC({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 Ik=By.object({connection:Fb,iframeConfig:By.object({iframeElementId:By.string().default("turnkey-iframe"),iframeContainerId:By.string()}),rpId:By.string().optional(),rootOrgId:By.string().optional().default("24c1acf5-810f-41e0-a503-d5d13fa8e830")});class Mk extends Sk{constructor(e){const{connection:t,iframeConfig:n,rpId:r,rootOrgId:a}=Ik.parse(e),s=new tk({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:Dk(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 tk({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=_k(),r=_k(),a=await YC({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 Fk({rpId:r??window.location.hostname})}}const Nk=By.object({client:By.custom().or(Ik)}).extend({sessionConfig:IC.omit({client:!0}).optional()});class Bk extends BC{constructor(e){const{sessionConfig:t,...n}=Nk.parse(e);let r;r="connection"in n.client?new Mk(n.client):n.client,super({client:r,sessionConfig:t})}}const Uk=/^tuple(?<array>(\[(\d*)\])*)$/;function Rk(e){let t=e.type;if(Uk.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){t+=Rk(e.components[r]),r<n-1&&(t+=", ")}const r=function(e,t){const n=e.exec(t);return n?.groups}(Uk,e.type);return t+=`)${r?.array??""}`,Rk({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function jk(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=Rk(e[r]),r!==n-1&&(t+=", ")}return t}function Lk(e,t,n){return r=>e[t.name]?.(r)??e[n]?.(r)??t(e,r)}function Gk(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new rT(e.type);return`${e.name}(${zk(e.inputs,{includeName:t})})`}function zk(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${zk(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}function $k(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function Hk(e){return $k(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}class qk 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 qk?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof qk&&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 Vk(this,e)}}function Vk(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?Vk(e.cause,t):t?null:e}class Wk extends qk{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 Zk extends qk{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 Kk extends qk{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 Jk extends qk{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${Hk(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class Yk extends qk{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 Xk extends qk{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 Qk extends qk{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Gk(e.abiItem)}\`, and`,`\`${t.type}\` in \`${Gk(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 eT extends qk{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 tT extends qk{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 nT extends qk{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 rT extends qk{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 aT extends qk{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 sT extends qk{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 iT extends qk{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 oT(e,{dir:t,size:n=32}={}){return"string"==typeof e?cT(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new sT({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 cT(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new sT({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}class lT extends qk{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 uT extends qk{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 dT(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 pT(e,{size:t}){if(Hk(e)>t)throw new uT({givenSize:Hk(e),maxSize:t})}function hT(e,t={}){const{signed:n}=t;t.size&&pT(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 mT(e,t={}){return Number(hT(e,t))}const fT=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function yT(e,t={}){return"number"==typeof e||"bigint"==typeof e?vT(e,t):"string"==typeof e?xT(e,t):"boolean"==typeof e?bT(e,t):gT(e,t)}function bT(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(pT(n,{size:t.size}),oT(n,{size:t.size})):n}function gT(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=fT[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(pT(r,{size:t.size}),oT(r,{dir:"right",size:t.size})):r}function vT(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 lT({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?oT(o,{size:r}):o}const wT=new TextEncoder;function xT(e,t={}){return gT(wT.encode(e),t)}const ET=new TextEncoder;function CT(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=vT(e,t);return PT(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return pT(n,{size:t.size}),oT(n,{size:t.size});return n}(e,t):$k(e)?PT(e,t):AT(e,t)}const kT={zero:48,nine:57,A:65,F:70,a:97,f:102};function TT(e){return e>=kT.zero&&e<=kT.nine?e-kT.zero:e>=kT.A&&e<=kT.F?e-(kT.A-10):e>=kT.a&&e<=kT.f?e-(kT.a-10):void 0}function PT(e,t={}){let n=e;t.size&&(pT(n,{size:t.size}),n=oT(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=TT(r.charCodeAt(t++)),a=TT(r.charCodeAt(t++));if(void 0===n||void 0===a)throw new qk(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);s[e]=16*n+a}return s}function AT(e,t={}){const n=ET.encode(e);return"number"==typeof t.size?(pT(n,{size:t.size}),oT(n,{dir:"right",size:t.size})):n}function OT(e,t){const n=t||"hex",r=mt($k(e,{strict:!1})?CT(e):e);return"bytes"===n?r:yT(r)}const FT=e=>OT(CT(e));const DT=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 qk("Unable to normalize signature.");return a}("string"==typeof e?e:"function"===(t=e).type?`function ${t.name}(${jk(t.inputs)})${t.stateMutability&&"nonpayable"!==t.stateMutability?` ${t.stateMutability}`:""}${t.outputs.length?` returns (${jk(t.outputs)})`:""}`:"event"===t.type?`event ${t.name}(${jk(t.inputs)})`:"error"===t.type?`error ${t.name}(${jk(t.inputs)})`:"constructor"===t.type?`constructor(${jk(t.inputs)})${"payable"===t.stateMutability?" payable":""}`:"fallback"===t.type?"fallback()":"receive() external payable")};function _T(e){return t=DT(e),FT(t);var t}const ST=_T;class IT extends qk{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 MT 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 NT=new MT(8192);function BT(e,t){if(NT.has(`${e}.${t}`))return NT.get(`${e}.${t}`);const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=OT(AT(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 NT.set(`${e}.${t}`,s),s}const UT=/^0x[a-fA-F0-9]{40}$/,RT=new MT(8192);function jT(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(RT.has(r))return RT.get(r);const a=!(!UT.test(e)||e.toLowerCase()!==e&&n&&BT(e)!==e);return RT.set(r,a),a}function LT(e){return"string"==typeof e[0]?GT(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 GT(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}function zT(e,t,n,{strict:r}={}){return $k(e,{strict:!1})?function(e,t,n,{strict:r}={}){$T(e,t);const a=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&HT(a,t,n);return a}(e,t,n,{strict:r}):function(e,t,n,{strict:r}={}){$T(e,t);const a=e.slice(t,n);r&&HT(a,t,n);return a}(e,t,n,{strict:r})}function $T(e,t){if("number"==typeof t&&t>0&&t>Hk(e)-1)throw new aT({offset:t,position:"start",size:Hk(e)})}function HT(e,t,n){if("number"==typeof t&&"number"==typeof n&&Hk(e)!==n-t)throw new aT({offset:n,position:"end",size:Hk(e)})}function qT(e,t){if(e.length!==t.length)throw new Yk({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(VT({param:e[r],value:t[r]}));return n}({params:e,values:t}),r=WT(n);return 0===r.length?"0x":r}function VT({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 nT(e);if(!r&&e.length!==t)throw new Kk({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let a=!1;const s=[];for(let t=0;t<e.length;t++){const r=VT({param:n,value:e[t]});r.dynamic&&(a=!0),s.push(r)}if(r||a){const e=WT(s);if(r){const t=vT(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?LT([t,e]):t}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:LT(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=VT({param:s,value:e[Array.isArray(e)?a:s.name]});r.push(i),i.dynamic&&(n=!0)}return{dynamic:n,encoded:n?WT(r):LT(r.map((({encoded:e})=>e)))}}(t,{param:e});if("address"===e.type)return function(e){if(!jT(e))throw new IT({address:e});return{dynamic:!1,encoded:cT(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){if("boolean"!=typeof e)throw new qk(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:cT(bT(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:vT(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=Hk(e);if(!n){let t=e;return r%32!=0&&(t=cT(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:LT([cT(vT(r,{size:32})),t])}}if(r!==Number.parseInt(n))throw new Jk({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:cT(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=xT(e),n=Math.ceil(Hk(t)/32),r=[];for(let e=0;e<n;e++)r.push(cT(zT(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:LT([cT(vT(Hk(t),{size:32})),...r])}}(t);throw new tT(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function WT(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:r,encoded:a}=e[n];t+=r?32:Hk(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(vT(t+a,{size:32})),r.push(o),a+=Hk(o)):n.push(o)}return LT([...n,...r])}const ZT=e=>zT(_T(e),0,4);function KT(e,t){const n=typeof e,r=t.type;switch(r){case"address":return jT(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)=>KT(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=>KT(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function JT(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 JT(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")))&&jT(n[r],{strict:!1}))return i}}function YT(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const XT="/docs/contract/encodeFunctionData";function QT(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=$k(r,{strict:!1}),s=t.filter((e=>a?"function"===e.type?ZT(e)===r:"event"===e.type&&ST(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&&KT(t,r)}));if(t){if(i&&"inputs"in i&&i.inputs){const t=JT(e.inputs,i.inputs,n);if(t)throw new Qk({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 Xk(r,{docsPath:XT});a=e}if("function"!==a.type)throw new Xk(void 0,{docsPath:XT});return{abi:[a],functionName:ZT(Gk(a))}}function eP(e){const{args:t}=e,{abi:n,functionName:r}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:QT(e),a=n[0];return GT([r,("inputs"in a&&a.inputs?qT(a.inputs,t??[]):void 0)??"0x"])}class tP extends qk{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class nP extends qk{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 rP extends qk{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 aP={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 rP({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new nP({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new tP({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 tP({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 sP(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(aP);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}const iP=(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),oP={gwei:9,wei:18},cP={ether:-9,wei:9};function lP(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 uP(e,t="wei"){return lP(e,oP[t])}function dP(e,t="wei"){return lP(e,cP[t])}class pP extends qk{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 hP extends qk{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function mP(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 fP extends qk{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 yP extends qk{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 bP extends qk{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",mP(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 gP extends qk{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 vP extends qk{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=mP({chain:r&&`${r?.name} (id: ${r?.id})`,from:t?.address,to:u,value:void 0!==d&&`${uP(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${dP(i)} gwei`,maxFeePerGas:void 0!==o&&`${dP(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${dP(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 wP extends qk{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: ${iP(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 xP extends qk{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${iP(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 EP extends qk{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 xP?e.code:t??-1}}class CP extends EP{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 kP extends EP{constructor(e){super(e,{code:kP.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(kP,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class TP extends EP{constructor(e){super(e,{code:TP.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(TP,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class PP extends EP{constructor(e){super(e,{code:PP.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(PP,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class AP extends EP{constructor(e){super(e,{code:AP.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(AP,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class OP extends EP{constructor(e){super(e,{code:OP.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(OP,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class FP extends EP{constructor(e){super(e,{code:FP.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(FP,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class DP extends EP{constructor(e){super(e,{code:DP.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(DP,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class _P extends EP{constructor(e){super(e,{code:_P.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(_P,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class SP extends EP{constructor(e){super(e,{code:SP.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(SP,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class IP extends EP{constructor(e){super(e,{code:IP.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(IP,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class MP extends EP{constructor(e){super(e,{code:MP.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(MP,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class NP extends EP{constructor(e){super(e,{code:NP.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(NP,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class BP extends CP{constructor(e){super(e,{code:BP.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(BP,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class UP extends CP{constructor(e){super(e,{code:UP.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(UP,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class RP extends CP{constructor(e){super(e,{code:RP.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(RP,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class jP extends CP{constructor(e){super(e,{code:jP.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(jP,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class LP extends CP{constructor(e){super(e,{code:LP.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(LP,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class GP extends CP{constructor(e){super(e,{code:GP.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(GP,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class zP extends EP{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}class $P extends qk{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=mP({from:t?.address,to:u,value:void 0!==d&&`${uP(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:s,gasPrice:void 0!==i&&`${dP(i)} gwei`,maxFeePerGas:void 0!==o&&`${dP(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${dP(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 HP extends qk{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(HP,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(HP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class qP extends qk{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${dP(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(qP,"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 VP extends qk{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${dP(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(VP,"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 WP extends qk{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(WP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class ZP extends qk{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(ZP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class KP extends qk{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(KP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class JP extends qk{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(JP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class YP extends qk{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(YP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class XP extends qk{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(XP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class QP extends qk{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(QP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class eA extends qk{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${dP(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${dP(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(eA,"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 tA extends qk{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 nA(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof qk?e.walk((e=>e.code===HP.code)):e;return r instanceof qk?new HP({cause:e,message:r.details}):HP.nodeMessage.test(n)?new HP({cause:e,message:e.details}):qP.nodeMessage.test(n)?new qP({cause:e,maxFeePerGas:t?.maxFeePerGas}):VP.nodeMessage.test(n)?new VP({cause:e,maxFeePerGas:t?.maxFeePerGas}):WP.nodeMessage.test(n)?new WP({cause:e,nonce:t?.nonce}):ZP.nodeMessage.test(n)?new ZP({cause:e,nonce:t?.nonce}):KP.nodeMessage.test(n)?new KP({cause:e,nonce:t?.nonce}):JP.nodeMessage.test(n)?new JP({cause:e}):YP.nodeMessage.test(n)?new YP({cause:e,gas:t?.gas}):XP.nodeMessage.test(n)?new XP({cause:e,gas:t?.gas}):QP.nodeMessage.test(n)?new QP({cause:e}):eA.nodeMessage.test(n)?new eA({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new tA({cause:e})}function rA(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 aA(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 sA={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function iA(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=>gT(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=vT(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=vT(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=vT(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=vT(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=vT(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=vT(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=sA[e.type]),void 0!==e.value&&(t.value=vT(e.value)),t}function oA(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new iT({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new iT({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function cA(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=vT(t)),void 0!==n&&(i.nonce=vT(n)),void 0!==r&&(i.state=oA(r)),void 0!==a){if(i.state)throw new hP;i.stateDiff=oA(a)}return i}function lA(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:a,to:s}=e,i=t?YT(t):void 0;if(i&&!jT(i.address))throw new IT({address:i.address});if(s&&!jT(s))throw new IT({address:s});if(void 0!==n&&(void 0!==r||void 0!==a))throw new fP;if(r&&r>2n**256n-1n)throw new qP({maxFeePerGas:r});if(a&&r&&a>r)throw new eA({maxFeePerGas:r,maxPriorityFeePerGas:a})}class uA extends qk{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class dA extends qk{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class pA extends qk{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${dP(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class hA extends qk{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 mA={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function fA(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?mT(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?mT(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?mA[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 yA=aA("transaction",fA);function bA(e){const t=e.transactions?.map((e=>"string"==typeof e?e:fA(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 gA=aA("block",bA);async function vA(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:a}={}){const s=r??"latest",i=a??!1,o=void 0!==n?vT(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 hA({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||bA)(c)}async function wA(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function xA(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 uA;const o=10**(i.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(i*o))/BigInt(o),l=n||await Lk(e,vA,"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 dA;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 Lk(e,vA,"getBlock")({});return r.fees.defaultPriorityFee({block:t,client:e,request:a})}if(void 0!==r?.fees?.defaultPriorityFee)return r?.fees?.defaultPriorityFee;try{return hT(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):Lk(e,vA,"getBlock")({}),Lk(e,wA,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new dA;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 Lk(e,wA,"getGasPrice")({}))}}async function EA(e,{address:t,blockTag:n="latest",blockNumber:r}){return mT(await e.request({method:"eth_getTransactionCount",params:[t,r?vT(r):n]}))}function CA(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=>PT(e))):e.blobs,a=[];for(const e of r)a.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?a:a.map((e=>gT(e)))}function kA(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=>PT(e))):e.blobs,a="string"==typeof e.commitments[0]?e.commitments.map((e=>PT(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=>gT(e)))}function TA(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=Et($k(e,{strict:!1})?CT(e):e);return"bytes"===n?r:yT(r)}(t,"bytes");return a.set([n],0),"bytes"===r?a:gT(a)}function PA(e){const{commitments:t,version:n}=e,r=e.to??("string"==typeof t[0]?"hex":"bytes"),a=[];for(const e of t)a.push(TA({commitment:e,to:r,version:n}));return a}const AA=32,OA=4096,FA=AA*OA,DA=6*FA-1-1*OA*6,_A=1;class SA extends qk{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 IA extends qk{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class MA extends qk{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 NA extends qk{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${_A}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}function BA(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?PT(e.data):e.data,r=Hk(n);if(!r)throw new IA;if(r>DA)throw new SA({maxSize:DA,size:r});const a=[];let s=!0,i=0;for(;s;){const e=sP(new Uint8Array(FA));let t=0;for(;t<OA;){const r=n.slice(i,i+(AA-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=>gT(e.bytes)))}({data:t,to:r}),s=e.commitments??CA({blobs:a,kzg:n,to:r}),i=e.proofs??kA({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 UA(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 bP({transaction:e})}async function RA(e){return mT(await e.request({method:"eth_chainId"}))}const jA=["blobVersionedHashes","chainId","fees","gas","nonce","type"];async function LA(e,t){const{account:n=e.account,blobs:r,chain:a,chainId:s,gas:i,kzg:o,nonce:c,parameters:l=jA,type:u}=t,d=n?YT(n):void 0,p={...t,...d?{from:d?.address}:{}};let h;async function m(){return h||(h=await Lk(e,vA,"getBlock")({blockTag:"latest"}),h)}if((l.includes("blobVersionedHashes")||l.includes("sidecars"))&&r&&o){const e=CA({blobs:r,kzg:o});if(l.includes("blobVersionedHashes")){const t=PA({commitments:e,to:"hex"});p.blobVersionedHashes=t}if(l.includes("sidecars")){const t=BA({blobs:r,commitments:e,proofs:kA({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 Lk(e,RA,"getChainId")({})),l.includes("nonce")&&void 0===c&&d&&(p.nonce=await Lk(e,EA,"getTransactionCount")({address:d.address,blockTag:"pending"})),(l.includes("fees")||l.includes("type"))&&void 0===u)try{p.type=UA(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 xA(e,{block:n,chain:a,request:p});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas<s)throw new pA({maxPriorityFeePerGas:s});p.maxPriorityFeePerGas=s,p.maxFeePerGas=r}}else{if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)throw new dA;const n=await m(),{gasPrice:r}=await xA(e,{block:n,chain:a,request:p,type:"legacy"});p.gasPrice=r}return l.includes("gas")&&void 0===i&&(p.gas=await Lk(e,GA,"estimateGas")({...p,account:d?{address:d.address,type:"json-rpc"}:void 0})),lA(p),delete p.parameters,p}async function GA(e,t){const n=t.account??e.account,r=n?YT(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 LA(e,{...t,parameters:"local"===r?.type?void 0:["blobVersionedHashes"]}),v=(i?vT(i):void 0)||o,w=function(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!jT(n,{strict:!1}))throw new IT({address:n});if(t[n])throw new pP({address:n});t[n]=cA(r)}return t}(b);lA(t);const x=e.chain?.formatters?.transactionRequest?.format,E=(x||iA)({...rA(g,{format:x}),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}),C=await e.request({method:"eth_estimateGas",params:w?[E,v??"latest",w]:v?[E,v]:[E]});return BigInt(C)}catch(n){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=nA(e,n);return t instanceof tA?e:t})();return new $P(r,{docsPath:t,...n})}(n,{...t,account:r,chain:e.chain})}}class zA extends qk{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 $A extends qk{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 HA extends qk{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 qA extends qk{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 VA({chain:e,currentChainId:t}){if(!e)throw new $A;if(t!==e.id)throw new zA({chain:e,currentChainId:t})}function WA(e,{docsPath:t,...n}){const r=(()=>{const t=nA(e,n);return t instanceof tA?e:t})();return new vP(r,{docsPath:t,...n})}async function ZA(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}async function KA(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 qA({docsPath:"/docs/actions/wallet/sendTransaction"});const y=YT(n);try{let n;if(lA(t),null!==r&&(n=await Lk(e,RA,"getChainId")({}),VA({currentChainId:n,chain:r})),"local"===y.type){const t=await Lk(e,LA,"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:[...jA,"sidecars"],to:h,value:m,...f}),b=r?.serializers?.transaction,g=await y.signTransaction(t,{serializer:b});return await Lk(e,ZA,"sendRawTransaction")({serializedTransaction:g})}const b=e.chain?.formatters?.transactionRequest?.format,g=(b||iA)({...rA(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 WA(e,{...t,account:y,chain:t.chain||void 0})}}const JA=256;let YA,XA=JA;function QA(e=11){if(!YA||XA+e>2*JA){YA="",XA=0;for(let e=0;e<JA;e++)YA+=(256+256*Math.random()|0).toString(16).substring(1)}return YA.substring(XA,XA+++e)}function eO(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 tO(e,t={}){return async(n,r={})=>{const{retryDelay:a=150,retryCount:s=3}={...t,...r};return eO((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case kP.code:throw new kP(t);case TP.code:throw new TP(t);case PP.code:throw new PP(t);case AP.code:throw new AP(t);case OP.code:throw new OP(t);case FP.code:throw new FP(t);case DP.code:throw new DP(t);case _P.code:throw new _P(t);case SP.code:throw new SP(t);case IP.code:throw new IP(t);case MP.code:throw new MP(t);case NP.code:throw new NP(t);case BP.code:throw new BP(t);case UP.code:throw new UP(t);case RP.code:throw new RP(t);case jP.code:throw new jP(t);case LP.code:throw new LP(t);case GP.code:throw new GP(t);case 5e3:throw new BP(t);default:if(e instanceof qk)throw e;throw new zP(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof wP){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===MP.code||e.code===OP.code);if(e instanceof wP&&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 nO(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:tO(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 rO(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const aO=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,sO=/^(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 iO({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 oO="/docs/contract/encodeDeployData";function cO(e,t="hex"){const n=lO(e),r=sP(new Uint8Array(n.length));return n.encode(r),"hex"===t?gT(r.bytes):r.bytes}function lO(e){return Array.isArray(e)?function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=uO(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=>lO(e)))):function(e){const t="string"==typeof e?PT(e):e,n=uO(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 uO(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 qk("Length is too large.")}const dO={"0x0":"reverted","0x1":"success"};function pO(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?mT(e.transactionIndex):null,status:e.status?dO[e.status]:null,type:e.type?mA[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const hO=aA("transactionReceipt",pO);function mO(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:a}=e;if(t<=0)throw new HA({chainId:t});if(a&&!jT(a))throw new IT({address:a});if(r&&r>2n**256n-1n)throw new qP({maxFeePerGas:r});if(n&&r&&n>r)throw new eA({maxFeePerGas:r,maxPriorityFeePerGas:n})}function fO(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 gP({storageKey:a[e]});if(!jT(r,{strict:!1}))throw new IT({address:r});t.push([r,a])}return t}function yO(e,t){const n=UA(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;mO(e);const d=fO(l),p=[yT(n),a?yT(a):"0x",c?yT(c):"0x",o?yT(o):"0x",r?yT(r):"0x",s??"0x",i?yT(i):"0x",u??"0x",d,...bO(e,t)];return GT(["0x02",cO(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 HA({chainId:t});if(s&&!jT(s))throw new IT({address:s});if(n||a)throw new qk("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new qP({maxFeePerGas:r})}(e);const u=fO(c),d=[yT(n),s?yT(s):"0x",l?yT(l):"0x",r?yT(r):"0x",i??"0x",o?yT(o):"0x",a??"0x",u,...bO(e,t)];return GT(["0x01",cO(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 IA;for(const e of t){const t=Hk(e),n=mT(zT(e,0,1));if(32!==t)throw new MA({hash:e,size:t});if(n!==_A)throw new NA({hash:e,version:n})}}mO(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=>gT(e))),n=e.kzg,r=CA({blobs:t,kzg:n});if(void 0===p&&(p=PA({commitments:r})),void 0===h){h=BA({blobs:t,commitments:r,proofs:kA({blobs:t,commitments:r,kzg:n})})}}const m=fO(u),f=[yT(n),a?yT(a):"0x",l?yT(l):"0x",c?yT(c):"0x",r?yT(r):"0x",s??"0x",i?yT(i):"0x",d??"0x",m,o?yT(o):"0x",p??[],...bO(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 GT(["0x03",cO(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&&!jT(s))throw new IT({address:s});if(void 0!==t&&t<=0)throw new HA({chainId:t});if(n||a)throw new qk("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new qP({maxFeePerGas:r});if(i)throw new qk("`accessList` is not a valid Legacy Transaction attribute.")}(e);let l=[s?yT(s):"0x",c?yT(c):"0x",r?yT(r):"0x",i??"0x",o?yT(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 yP({v:t.v});return e})();l=[...l,yT(e),t.r,t.s]}else n>0&&(l=[...l,yT(n),"0x","0x"]);return cO(l)}(e,t)}function bO(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?yT(1):"0x":0n===a?"0x":1n===a?yT(1):27n===a?"0x":yT(1),dT(n),dT(r)]}function gO(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 Wk({docsPath:oO});if(!("inputs"in a))throw new Zk({docsPath:oO});if(!a.inputs||0===a.inputs.length)throw new Zk({docsPath:oO});return GT([r,qT(a.inputs,n)])}({abi:n,args:r,bytecode:a});return KA(e,{...s,data:i})}async function vO(e){return(await e.request({method:"eth_requestAccounts"},{retryCount:0})).map((e=>function(e,t){if(!jT(e,{strict:!1}))throw new IT({address:e});return BT(e,t)}(e)))}async function wO(e,t){const{account:n=e.account,domain:r,message:a,primaryType:s}=t;if(!n)throw new qA({docsPath:"/docs/actions/wallet/signTypedData"});const i=YT(n),o={EIP712Domain:iO({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(sO);if(o&&("number"==typeof i||"bigint"==typeof i)){const[e,t,n]=o;vT(i,{signed:"int"===t,size:Number.parseInt(n)/8})}if("address"===r&&"string"==typeof i&&!jT(i))throw new IT({address:i});const c=r.match(aO);if(c){const[e,t]=c;if(t&&Hk(i)!==Number.parseInt(t))throw new eT({expectedSize:Number.parseInt(t),givenSize:Hk(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 iP({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 xO(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:vT(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=>gO(e,t),getAddresses:()=>async function(e){return"local"===e.account?.type?[e.account.address]:(await e.request({method:"eth_accounts"})).map((e=>BT(e)))}(e),getChainId:()=>RA(e),getPermissions:()=>async function(e){return await e.request({method:"wallet_getPermissions"})}(e),prepareTransactionRequest:t=>LA(e,t),requestAddresses:()=>vO(e),requestPermissions:t=>async function(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}(e,t),sendRawTransaction:t=>ZA(e,t),sendTransaction:t=>KA(e,t),signMessage:t=>async function(e,{account:t=e.account,message:n}){if(!t)throw new qA({docsPath:"/docs/actions/wallet/signMessage"});const r=YT(t);if("local"===r.type)return r.signMessage({message:n});const a="string"==typeof n?xT(n):n.raw instanceof Uint8Array?yT(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 qA({docsPath:"/docs/actions/wallet/signTransaction"});const s=YT(n);lA({account:s,...t});const i=await Lk(e,RA,"getChainId")({});null!==r&&VA({currentChainId:i,chain:r});const o=r?.formatters||e.chain?.formatters,c=o?.transactionRequest?.format||iA;return"local"===s.type?s.signTransaction({...a,chainId:i},{serializer:e.chain?.serializers?.transaction}):await e.request({method:"eth_signTransaction",params:[{...c(a),chainId:vT(i),from:s.address}]},{retryCount:0})}(e,t),signTypedData:t=>wO(e,t),switchChain:t=>async function(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:vT(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=eP({abi:n,args:a,functionName:i});return Lk(e,KA,"sendTransaction")({data:`${c}${s?s.replace("0x",""):""}`,to:r,...o})}(e,t)}}function EO(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?YT(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:QA()};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(xO)}const CO=e=>{if(null!=e)return r.hexlify(e)};class kO extends s.Signer{constructor(e,t,n,r,a){super(),this._address=t,this._index=null!=n?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.")}getAddress(){return h(this,void 0,void 0,(function*(){if(!this.smartAccountClient)throw new wm;return Promise.resolve(n.getAddress(this.smartAccountClient.account.address))}))}signMessage(e){return h(this,void 0,void 0,(function*(){if(!this.smartAccountClient)throw new wm;return this.smartAccountClient.account.signMessageWith6492({message:"string"!=typeof e||$k(e)?{raw:$k(e)?CT(e):e}:e})}))}_signTypedData(e,t,n){return h(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}signTransaction(e){return h(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}sendTransaction(e){return h(this,void 0,void 0,(function*(){if(!this.smartAccountClient)throw new wm;const t=yield a.resolveProperties(e),n=yield this.smartAccountClient.sendUserOperation({uo:{target:t.to,data:CO(t.data),value:BigInt(parseInt(t.value,16))}});return{hash:yield this.smartAccountClient.waitForUserOperationTransaction({hash:n.hash})}}))}connect(e){return new kO(null!=e?e:this.provider,this._address,this._index,this.smartAccountClient,this.signer)}connectUnchecked(){return new kO(this.provider,this._address,this._index,this.smartAccountClient,this.signer)}}const TO=[exports.ChainId.MAINNET,exports.ChainId.OPTIMISM,exports.ChainId.ARBITRUM_ONE,exports.ChainId.POLYGON,exports.ChainId.BASE];let PO={};const AO="alchemy-iframe-container",OO={8453:"jyz6JtQyNc0FbvoDPLTeuDuXgYcCDtr1",1:"XemgnyY-Z2mVZGUUYQf1F1859JQPcZvu",10:"MJ4klYhwlvGQXbW2vE-dcdLIlrrQR9Ib",137:"cQfkVz2j_AG9brnAxTI36vC1IhuLp_ce",42161:"gGR_llD3f41k46L7EKlaP3SjmHtJaG1k"};function FO(){if(!document.getElementById(AO)){const e=document.createElement("iframe");e.setAttribute("id",AO),e.style.display="none",document.body.appendChild(e)}}function DO(e){const t=e,n=PO[t];if(n)return n;const r=OO[e];if(!r)throw new Error(`ChainId ${e} is not support`);FO();try{const e=new Bk({client:{connection:{apiKey:r},iframeConfig:{iframeContainerId:AO}}});return PO[t]=e,e}catch(e){const n=document.getElementById(AO);if(n){n.remove(),FO();const e=new Bk({client:{connection:{apiKey:r},iframeConfig:{iframeContainerId:AO}}});return PO[t]=e,e}throw e}}const _O={type:exports.WalletType.WalletLink,showName:"Coinbase 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%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%2216%22%20fill%3D%22url%28%23paint0_linear_3075_80236%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M16%2025C20.9706%2025%2025%2020.9706%2025%2016C25%2011.0294%2020.9706%207%2016%207C11.0294%207%207%2011.0294%207%2016C7%2020.9706%2011.0294%2025%2016%2025ZM14%2013C13.4477%2013%2013%2013.4477%2013%2014V18C13%2018.5523%2013.4477%2019%2014%2019H18C18.5523%2019%2019%2018.5523%2019%2018V14C19%2013.4477%2018.5523%2013%2018%2013H14Z%22%20fill%3D%22white%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_3075_80236%22%20x1%3D%2216%22%20y1%3D%220%22%20x2%3D%2216%22%20y2%3D%2232%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%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,getPackage:W,connector:se,mobileAndroidDeepLink:"https://go.cb-w.com/dapp?cburl=$formattedAPPUrl",mobileIOSDeepLink:"cbwallet://dapp?url=$formattedAPPUrl",isContractWallet:()=>{const e=D.getState().provider.provider;return!(!e||(null==e?void 0:e.isWalletLink)||(null==e?void 0:e.isToshi))},disabled:()=>!!A(),injected:()=>{var e,t;return A()&&((null===(e=window.ethereum)||void 0===e?void 0:e.isWalletLink)||(null===(t=window.ethereum)||void 0===t?void 0:t.isToshi))},connectorInjected:(e,t)=>_(void 0,t),switchChain:e=>{var t;return M(Object.assign(Object.assign({},e),{provider:null!==(t=e.provider)&&void 0!==t?t:D.getState().provider}))},getSupportEip5792ChainIds:()=>{const e=D.getState().provider.provider;return!e||(null==e?void 0:e.isWalletLink)||(null==e?void 0:e.isToshi)?[]:[exports.ChainId.BASE,84532]}},SO={type:exports.WalletType.ImToken,showName:"imToken",logo:"data:image/svg+xml,%3Csvg%20enable-background%3D%22new%200%200%2064%2064%22%20viewBox%3D%220%200%2064%2064%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3ClinearGradient%20id%3D%22a%22%20gradientTransform%3D%22matrix%2823.9866%200%200%20-16.946%206597.1353%205695.4907%29%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%22-272.5272%22%20x2%3D%22-275.1207%22%20y1%3D%22335.5532%22%20y2%3D%22332.9597%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%2311c4d1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%230062ad%22%2F%3E%3C%2FlinearGradient%3E%3Cpath%20d%3D%22m63.8%2010.9c2.1%2028.6-16.2%2042.1-32.7%2043.6-15.3%201.3-29.7-8.1-31-22.5-1-11.9%206.3-17%2012.1-17.5%206-.5%2011%203.6%2011.4%208.6.4%204.8-2.6%207-4.6%207.2-1.6.1-3.7-.9-3.9-3-.2-1.8.5-2.1.4-4-.3-3.5-3.3-3.9-5-3.7-2%20.2-5.7%202.5-5.1%208.4.5%205.9%206.2%2010.6%2013.6%209.9%208-.7%2013.6-6.9%2014-15.7%200-.5.1-.9.3-1.3.1-.2.2-.4.3-.5.2-.3.4-.5.7-.8.2-.2.5-.5.7-.8%203.5-3.3%2016.1-11.1%2028-8.6.4-.2.8.2.8.7%22%20fill%3D%22url%28%23a%29%22%2F%3E%3C%2Fsvg%3E",link:"https://token.im/",supportMobile:!0,supportExtension:!1,switchChain:M,mobileDeepLink:"imtokenv2://navigate/DappView?url=$formattedAPPUrl",injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isImToken}},IO={type:exports.WalletType.Math,showName:"Math Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2272%22%20height%3D%2272%22%20viewBox%3D%220%200%2072%2072%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20cx%3D%2236%22%20cy%3D%2236%22%20r%3D%2236%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14.25%2046.4721C15.1398%2046.4721%2015.8611%2047.1934%2015.8611%2048.0832C15.8611%2048.973%2015.1398%2049.6943%2014.25%2049.6943C13.3602%2049.6943%2012.6389%2048.973%2012.6389%2048.0832C12.6389%2047.1934%2013.3602%2046.4721%2014.25%2046.4721ZM36%2046.4721C36.8898%2046.4721%2037.6111%2047.1934%2037.6111%2048.0832C37.6111%2048.973%2036.8898%2049.6943%2036%2049.6943C35.1102%2049.6943%2034.3889%2048.973%2034.3889%2048.0832C34.3889%2047.1934%2035.1102%2046.4721%2036%2046.4721ZM57.75%2046.4721C58.6398%2046.4721%2059.3611%2047.1934%2059.3611%2048.0832C59.3611%2048.973%2058.6398%2049.6943%2057.75%2049.6943C56.8602%2049.6943%2056.1389%2048.973%2056.1389%2048.0832C56.1389%2047.1934%2056.8602%2046.4721%2057.75%2046.4721ZM19.0833%2040.0276C20.418%2040.0276%2021.5%2041.1096%2021.5%2042.4443C21.5%2043.779%2020.418%2044.861%2019.0833%2044.861C17.7486%2044.861%2016.6667%2043.779%2016.6667%2042.4443C16.6667%2041.1096%2017.7486%2040.0276%2019.0833%2040.0276ZM30.3611%2040.0276C31.6958%2040.0276%2032.7778%2041.1096%2032.7778%2042.4443C32.7778%2043.779%2031.6958%2044.861%2030.3611%2044.861C29.0264%2044.861%2027.9444%2043.779%2027.9444%2042.4443C27.9444%2041.1096%2029.0264%2040.0276%2030.3611%2040.0276ZM41.6389%2040.0276C42.9736%2040.0276%2044.0556%2041.1096%2044.0556%2042.4443C44.0556%2043.779%2042.9736%2044.861%2041.6389%2044.861C40.3042%2044.861%2039.2222%2043.779%2039.2222%2042.4443C39.2222%2041.1096%2040.3042%2040.0276%2041.6389%2040.0276ZM52.9167%2040.0276C54.2514%2040.0276%2055.3333%2041.1096%2055.3333%2042.4443C55.3333%2043.779%2054.2514%2044.861%2052.9167%2044.861C51.582%2044.861%2050.5%2043.779%2050.5%2042.4443C50.5%2041.1096%2051.582%2040.0276%2052.9167%2040.0276ZM8.61111%2040.8332C9.5009%2040.8332%2010.2222%2041.5545%2010.2222%2042.4443C10.2222%2043.3341%209.5009%2044.0554%208.61111%2044.0554C7.72132%2044.0554%207%2043.3341%207%2042.4443C7%2041.5545%207.72132%2040.8332%208.61111%2040.8332ZM63.3889%2040.8332C64.2787%2040.8332%2065%2041.5545%2065%2042.4443C65%2043.3341%2064.2787%2044.0554%2063.3889%2044.0554C62.4991%2044.0554%2061.7778%2043.3341%2061.7778%2042.4443C61.7778%2041.5545%2062.4991%2040.8332%2063.3889%2040.8332ZM24.7222%2033.5832C26.5018%2033.5832%2027.9444%2035.0258%2027.9444%2036.8054C27.9444%2038.585%2026.5018%2040.0276%2024.7222%2040.0276C22.9426%2040.0276%2021.5%2038.585%2021.5%2036.8054C21.5%2035.0258%2022.9426%2033.5832%2024.7222%2033.5832ZM47.2778%2033.5832C49.0574%2033.5832%2050.5%2035.0258%2050.5%2036.8054C50.5%2038.585%2049.0574%2040.0276%2047.2778%2040.0276C45.4982%2040.0276%2044.0556%2038.585%2044.0556%2036.8054C44.0556%2035.0258%2045.4982%2033.5832%2047.2778%2033.5832ZM14.25%2034.3888C15.5847%2034.3888%2016.6667%2035.4707%2016.6667%2036.8054C16.6667%2038.1401%2015.5847%2039.2221%2014.25%2039.2221C12.9153%2039.2221%2011.8333%2038.1401%2011.8333%2036.8054C11.8333%2035.4707%2012.9153%2034.3888%2014.25%2034.3888ZM36%2034.3888C37.3347%2034.3888%2038.4167%2035.4707%2038.4167%2036.8054C38.4167%2038.1401%2037.3347%2039.2221%2036%2039.2221C34.6653%2039.2221%2033.5833%2038.1401%2033.5833%2036.8054C33.5833%2035.4707%2034.6653%2034.3888%2036%2034.3888ZM57.75%2034.3888C59.0847%2034.3888%2060.1667%2035.4707%2060.1667%2036.8054C60.1667%2038.1401%2059.0847%2039.2221%2057.75%2039.2221C56.4153%2039.2221%2055.3333%2038.1401%2055.3333%2036.8054C55.3333%2035.4707%2056.4153%2034.3888%2057.75%2034.3888ZM19.0833%2027.9443C20.8629%2027.9443%2022.3056%2029.3869%2022.3056%2031.1665C22.3056%2032.9461%2020.8629%2034.3888%2019.0833%2034.3888C17.3037%2034.3888%2015.8611%2032.9461%2015.8611%2031.1665C15.8611%2029.3869%2017.3037%2027.9443%2019.0833%2027.9443ZM30.3611%2027.9443C32.1407%2027.9443%2033.5833%2029.3869%2033.5833%2031.1665C33.5833%2032.9461%2032.1407%2034.3888%2030.3611%2034.3888C28.5815%2034.3888%2027.1389%2032.9461%2027.1389%2031.1665C27.1389%2029.3869%2028.5815%2027.9443%2030.3611%2027.9443ZM41.6389%2027.9443C43.4185%2027.9443%2044.8611%2029.3869%2044.8611%2031.1665C44.8611%2032.9461%2043.4185%2034.3888%2041.6389%2034.3888C39.8593%2034.3888%2038.4167%2032.9461%2038.4167%2031.1665C38.4167%2029.3869%2039.8593%2027.9443%2041.6389%2027.9443ZM52.9167%2027.9443C54.6963%2027.9443%2056.1389%2029.3869%2056.1389%2031.1665C56.1389%2032.9461%2054.6963%2034.3888%2052.9167%2034.3888C51.1371%2034.3888%2049.6944%2032.9461%2049.6944%2031.1665C49.6944%2029.3869%2051.1371%2027.9443%2052.9167%2027.9443ZM24.7222%2022.3054C26.5018%2022.3054%2027.9444%2023.7481%2027.9444%2025.5276C27.9444%2027.3072%2026.5018%2028.7499%2024.7222%2028.7499C22.9426%2028.7499%2021.5%2027.3072%2021.5%2025.5276C21.5%2023.7481%2022.9426%2022.3054%2024.7222%2022.3054ZM47.2778%2022.3054C49.0574%2022.3054%2050.5%2023.7481%2050.5%2025.5276C50.5%2027.3072%2049.0574%2028.7499%2047.2778%2028.7499C45.4982%2028.7499%2044.0556%2027.3072%2044.0556%2025.5276C44.0556%2023.7481%2045.4982%2022.3054%2047.2778%2022.3054Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E",link:"https://mathwallet.org",supportMobile:!0,supportExtension:!0,switchChain:M,injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isMathWallet}},MO={type:exports.WalletType.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:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isGamestop},disabled:()=>!window.gamestop,connector:(e,t)=>_(window.gamestop,t),switchChain:e=>M(Object.assign(Object.assign({},e),{provider:e.provider||window.gamestop}))},NO={type:exports.WalletType.Brave,showName:"Brave",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_3137_121266%29%22%3E%3Cpath%20d%3D%22M29.6863%2011.3521L28.6996%208.67214L29.3858%207.13367C29.429%207.03662%2029.4417%206.92881%2029.4225%206.82436C29.4033%206.71991%2029.353%206.6237%2029.2782%206.54834L27.4123%204.66226C27.0117%204.25582%2026.504%203.97153%2025.9481%203.84249C25.3923%203.71346%2024.8112%203.74498%2024.2726%203.9334L23.75%204.11505L20.8996%201.02691L16.0644%201H16.033L11.1665%201.03812L8.31828%204.15094L7.81144%203.97152C7.26932%203.78088%206.68406%203.74882%206.12435%203.87911C5.56465%204.00941%205.05372%204.29664%204.65153%204.70712L2.752%206.62907C2.69238%206.68915%202.65234%206.76586%202.63713%206.84911C2.62192%206.93237%202.63226%207.01828%202.66678%207.09555L3.38219%208.69232L2.3999%2011.3701L3.03458%2013.7854L5.92985%2024.7924C6.2634%2026.0603%207.03075%2027.1713%208.0985%2027.9321C8.0985%2027.9321%2011.6127%2030.4102%2015.0799%2032.6619C15.3541%2032.8808%2015.6945%2033%2016.0454%2033C16.3962%2033%2016.7366%2032.8808%2017.0108%2032.6619C20.9063%2030.1097%2023.9877%2027.9231%2023.9877%2027.9231C25.0547%2027.1619%2025.8212%2026.051%2026.1542%2024.7834L29.0337%2013.7719L29.6863%2011.3521Z%22%20fill%3D%22url%28%23paint0_linear_3137_121266%29%22%2F%3E%3Cpath%20d%3D%22M16.8402%2020.8365C16.6556%2020.7538%2016.4652%2020.6849%2016.2706%2020.6301H15.9274C15.7328%2020.6849%2015.5424%2020.7538%2015.3578%2020.8365L14.4944%2021.1953C14.2208%2021.3097%2013.7812%2021.5137%2013.5188%2021.6438L11.931%2022.4713C11.8735%2022.49%2011.8229%2022.5254%2011.7857%2022.5731C11.7485%2022.6208%2011.7265%2022.6785%2011.7224%2022.7388C11.7183%2022.7991%2011.7323%2022.8593%2011.7627%2022.9115C11.7931%2022.9638%2011.8384%2023.0057%2011.8929%2023.032L13.2721%2024.0053C13.5143%2024.1758%2013.8956%2024.4763%2014.1198%2024.6781L14.5078%2025.0123C14.7321%2025.2052%2015.0976%2025.5259%2015.3197%2025.7232L15.6875%2026.0484C15.8011%2026.1431%2015.9443%2026.1949%2016.0923%2026.1949C16.2402%2026.1949%2016.3834%2026.1431%2016.4971%2026.0484L16.8828%2025.712L17.6946%2025.0033L18.0849%2024.6624C18.3091%2024.4673%2018.6881%2024.1668%2018.9303%2023.9896L20.3096%2023.0029C20.3641%2022.9767%2020.4095%2022.9346%2020.4398%2022.8822C20.47%2022.8298%2020.4838%2022.7694%2020.4792%2022.7091C20.4746%2022.6487%2020.4518%2022.5912%2020.414%2022.544C20.3761%2022.4967%2020.3249%2022.4621%2020.267%2022.4444L18.6814%2021.6393C18.4168%2021.5048%2017.9772%2021.3029%2017.7014%2021.1908L16.8402%2020.8365Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M26.6182%2011.9512L26.663%2011.8077C26.6657%2011.6157%2026.6537%2011.4238%2026.6271%2011.2336C26.4936%2010.8939%2026.3221%2010.5704%2026.1158%2010.2692L25.2188%208.95278C25.0528%208.70609%2024.7702%208.31587%2024.5796%208.08488L23.3775%206.58005C23.2679%206.43338%2023.1488%206.29405%2023.0209%206.16292H22.9963C22.9963%206.16292%2022.7541%206.20553%2022.4625%206.26159L20.6258%206.61593L19.8207%206.77068C19.5534%206.78324%2019.2862%206.74441%2019.0335%206.6563L17.5825%206.18758C17.2999%206.09563%2016.8334%205.96332%2016.5441%205.90052C16.2393%205.86812%2015.9318%205.86812%2015.6269%205.90052C15.3376%205.9678%2014.8711%206.09788%2014.5885%206.18983L13.1375%206.66079C12.8849%206.74889%2012.6177%206.78772%2012.3504%206.77516L11.5453%206.62266L9.70627%206.27056C9.41473%206.2145%209.17476%206.16964%209.17252%206.17189H9.14785C9.02003%206.30301%208.90091%206.44236%208.79127%206.58902L7.59144%208.09384C7.40754%208.31811%207.11824%208.71731%206.95229%208.96176L6.05522%2010.2782C5.90029%2010.5052%205.75876%2010.7411%205.63136%2010.9846C5.55451%2011.2562%205.51379%2011.5367%205.51025%2011.8189L5.55511%2011.9624C5.5767%2012.0546%205.60442%2012.1453%205.63809%2012.2338C5.82423%2012.4581%206.14268%2012.8303%206.34677%2013.0479L9.48649%2016.385C9.59072%2016.5066%209.66047%2016.654%209.68847%2016.8118C9.71647%2016.9695%209.70171%2017.1319%209.64572%2017.282L9.13215%2018.4998C9.01537%2018.8224%209.00671%2019.1743%209.10748%2019.5023L9.21064%2019.7848C9.3792%2020.2438%209.66814%2020.6489%2010.0472%2020.9577L10.5405%2021.3592C10.6687%2021.4516%2010.8183%2021.51%2010.9752%2021.5288C11.1321%2021.5477%2011.2912%2021.5263%2011.4376%2021.4668L13.1914%2020.6303C13.5133%2020.4692%2013.8145%2020.2696%2014.0884%2020.036L15.4923%2018.7689C15.5483%2018.7184%2015.5935%2018.6572%2015.6253%2018.5889C15.6571%2018.5207%2015.6749%2018.4467%2015.6777%2018.3714C15.6804%2018.2961%2015.668%2018.221%2015.6411%2018.1506C15.6143%2018.0802%2015.5736%2018.0159%2015.5215%2017.9615L12.3526%2015.8265C12.2326%2015.7414%2012.1472%2015.616%2012.1118%2015.4732C12.0764%2015.3304%2012.0934%2015.1797%2012.1597%2015.0483L13.3887%2012.7384C13.4586%2012.597%2013.4999%2012.4432%2013.5103%2012.2858C13.5207%2012.1284%2013.5%2011.9705%2013.4493%2011.8211C13.2967%2011.5362%2013.0503%2011.3128%2012.7518%2011.1887L8.89891%209.73323C8.62082%209.62783%208.63652%209.50897%208.93031%209.49102L11.1932%209.26676C11.548%209.24419%2011.9042%209.27596%2012.2494%209.36095L14.2185%209.9104C14.3583%209.95254%2014.4781%2010.0439%2014.5556%2010.1677C14.6331%2010.2914%2014.6632%2010.439%2014.6401%2010.5832L13.8664%2014.8084C13.8147%2015.0424%2013.8018%2015.2833%2013.8283%2015.5215C13.8597%2015.6225%2014.1243%2015.7458%2014.4136%2015.8176L15.6134%2016.0732C15.9619%2016.1373%2016.3191%2016.1373%2016.6675%2016.0732L17.7462%2015.8288C18.0355%2015.7637%2018.2979%2015.6269%2018.3315%2015.526C18.3574%2015.2877%2018.3437%2015.0467%2018.2912%2014.8129L17.513%2010.5877C17.4899%2010.4435%2017.52%2010.2959%2017.5975%2010.1721C17.675%2010.0484%2017.7948%209.95702%2017.9346%209.91489L19.9036%209.36319C20.2489%209.27816%2020.6051%209.2464%2020.9599%209.269L23.2228%209.47981C23.5188%209.50672%2023.5323%209.61661%2023.2564%209.72202L19.4058%2011.182C19.1073%2011.3061%2018.8609%2011.5295%2018.7083%2011.8144C18.6062%2012.1161%2018.628%2012.446%2018.7689%2012.7317L20.0001%2015.0416C20.0664%2015.1729%2020.0834%2015.3237%2020.048%2015.4665C20.0127%2015.6093%2019.9272%2015.7347%2019.8072%2015.8198L16.6406%2017.9593C16.5884%2018.0137%2016.5478%2018.078%2016.5209%2018.1484C16.4941%2018.2188%2016.4817%2018.2939%2016.4844%2018.3692C16.4871%2018.4444%2016.5049%2018.5184%2016.5368%2018.5867C16.5686%2018.655%2016.6138%2018.7162%2016.6697%2018.7667L18.0759%2020.0338C18.3499%2020.2666%2018.6511%2020.4654%2018.9729%2020.6258L20.7267%2021.4601C20.8733%2021.5193%2021.0325%2021.5403%2021.1894%2021.521C21.3463%2021.5018%2021.4958%2021.443%2021.6238%2021.3502L22.1172%2020.9465C22.4966%2020.6371%2022.7856%2020.2312%2022.9537%2019.7714L23.0568%2019.4888C23.1576%2019.1608%2023.1489%2018.809%2023.0322%2018.4863L22.5163%2017.2686C22.4604%2017.1184%2022.4456%2016.9561%2022.4736%2016.7983C22.5016%2016.6406%2022.5713%2016.4932%2022.6756%2016.3715L25.8153%2013.0299C26.0194%2012.8057%2026.3356%2012.4468%2026.5217%2012.2159C26.5597%2012.1299%2026.5919%2012.0415%2026.6182%2011.9512Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_3137_121266%22%20x1%3D%222.40887%22%20y1%3D%2217.0014%22%20x2%3D%2229.6774%22%20y2%3D%2217.0014%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_3137_121266%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,switchChain:M,link:"https://wallet-docs.brave.com/",injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isBraveWallet}},BO={type:exports.WalletType.FoxWallet,showName:"FoxWallet",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%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M12.9519%2018.0638C13.0185%2018.0852%2013.0879%2018.1012%2013.1572%2018.1092C13.1572%2018.1092%2012.8665%2018.2185%2012.2665%2018.0132C12.2665%2018.0132%2011.8159%2017.8292%2011.4799%2017.8612C11.0879%2017.8958%2010.8185%2018.4052%2010.8185%2018.4052C10.8959%2018.3625%2010.9785%2018.3305%2011.0639%2018.3092C11.3305%2018.2558%2011.2399%2018.3012%2011.2399%2018.3012C11.2399%2018.3012%2010.7279%2018.5172%2010.6932%2018.7065C10.6852%2018.7545%2010.8292%2018.6185%2011.2079%2018.6318C11.6745%2018.6452%2012.0799%2018.9172%2012.2452%2018.9625C12.5865%2019.0532%2013.0745%2019.0745%2013.5252%2018.7225C13.5252%2018.7225%2013.9385%2018.4638%2014.0665%2017.9838C14.0985%2017.8505%2014.1199%2017.7145%2014.1252%2017.5785C14.1279%2017.4585%2014.1145%2017.3385%2014.0879%2017.2185C14.0852%2017.2158%2013.8425%2017.7785%2012.9519%2018.0638Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.7627%2023.3305C22.6667%2022.1971%2023.1573%2020.7918%2023.1573%2019.3411C23.1573%2017.8931%2022.664%2016.4851%2021.7627%2015.3518L27.552%2014.7145C27.552%2014.7145%2028.1547%2016.3651%2028.312%2017.2478C28.3333%2017.3598%2028.368%2017.5891%2028.368%2017.5891C28.368%2017.5891%2027.4693%2019.7705%2026.0907%2020.9678C24.24%2022.5785%2021.7627%2023.3305%2021.7627%2023.3305ZM8.05332%2023.2505L5.83466%2023.6611C5.13066%2021.8771%204.87199%2019.9491%205.08532%2018.0451C5.29599%2016.1385%205.97332%2014.3145%207.05066%2012.7305C7.09866%2012.6611%207.19466%2012.5251%207.19466%2012.5251L9.64532%2019.4291L8.05332%2023.2505Z%22%20fill%3D%22url%28%23paint0_linear_6878_209605%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M16.0829%209.09051C16.0909%209.07984%2016.0962%209.07717%2016.1042%209.06651C16.1629%209.00251%2017.5415%207.52251%2015.8989%205.01317C14.6855%203.16517%2011.6002%203.21584%2010.3389%202.25317C10.4322%202.99451%2011.1575%203.66384%2011.0802%204.67717C11.0482%205.01317%2010.9869%205.34384%2010.8935%205.66651C10.7442%206.24517%2010.6055%206.79717%2010.8135%207.87717C10.9762%208.71984%2011.3602%209.33317%2011.9549%209.70384C12.6375%2010.1252%2013.5815%2010.2185%2014.5495%209.95717C15.1949%209.78117%2015.7709%209.45584%2016.0829%209.09051Z%22%20fill%3D%22url%28%23paint1_linear_6878_209605%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.1389%208.00793C18.4936%207.39727%2018.5603%206.68527%2018.3416%205.89593C18.0376%204.79193%2017.4616%204.0666%2016.9949%203.48527C16.8483%203.30127%2016.7123%203.1306%2016.6003%202.96793C16.1576%202.31727%2015.9656%201.52793%2016.0616%200.749268C15.4989%201.1546%2014.4163%201.91727%2013.7256%202.7306C14.7256%203.2106%2015.5069%203.73327%2016.1229%204.6746C17.1763%206.27993%2017.1576%207.57593%2016.9576%208.38127C16.9016%208.6026%2017.3256%208.79993%2017.2483%208.9706C17.6083%208.7146%2017.9096%208.3866%2018.1389%208.00793Z%22%20fill%3D%22url%28%23paint2_linear_6878_209605%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M25.8052%2014.6745C24.6292%2014.5625%2022.2479%2014.2718%2022.2479%2014.2718C16.8905%2013.9732%2013.8505%2015.5812%2011.5572%2017.6852C9.78653%2019.4452%208.20786%2024.0052%208.20786%2024.0052L6.29053%2023.9012C6.29053%2023.9012%206.90119%2022.0825%207.60786%2020.7572C8.41853%2019.2398%208.59986%2019.3625%208.41586%2019.1118C7.55986%2017.9358%207.15719%2017.0105%206.81319%2015.0318C6.81319%2015.0318%207.21586%2015.3492%207.51986%2015.1545C7.51986%2015.1545%206.82919%2013.9545%206.72253%2012.6585C6.53319%2010.3625%207.60786%207.22649%207.63453%207.15449C7.62386%207.18649%207.56786%207.45582%208.19719%207.85849C8.24253%207.66916%208.29053%207.48249%208.34119%207.30115C8.56253%206.21849%209.15719%203.85315%2010.3439%202.25049C10.3439%202.25049%2011.0079%204.56782%2012.6745%205.61849C15.9199%207.66649%2017.9519%207.67716%2017.9519%207.67716C22.5359%208.18916%2024.4932%2010.4398%2024.4932%2010.4398C27.7839%2013.9892%2030.7732%2013.9572%2030.7732%2013.9572C29.6985%2014.9838%2025.8052%2014.6745%2025.8052%2014.6745Z%22%20fill%3D%22url%28%23paint3_linear_6878_209605%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M30.8295%2013.9572C30.8295%2013.9572%2030.3628%2016.5385%2027.9175%2016.8398C27.9175%2016.8398%2019.0482%2016.7838%2018.4002%2024.8398L18.2508%2027.1038L7.61084%2024.0025C7.61084%2024.0025%208.61351%2020.5812%2010.8082%2017.8345C10.8082%2017.8345%2014.5335%2012.5732%2025.1468%2013.9598C25.1468%2013.9598%2026.3868%2014.2105%2028.1255%2014.3732C29.5922%2014.5092%2030.8295%2013.9572%2030.8295%2013.9572Z%22%20fill%3D%22url%28%23paint4_linear_6878_209605%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M24.7947%2012.728C24.7947%2012.728%2022.4907%2011.5307%2019.624%2011.6427C19.624%2011.6427%2021.184%2010.424%2023.2907%2010.7227L24.7947%2012.728Z%22%20fill%3D%22%23722B00%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.968%2023.7359C18.968%2023.7359%2019.7174%2024.2532%2020.9067%2023.9786C20.9067%2023.9786%2018.984%2025.0932%2014.9307%2023.5652C14.9307%2023.5652%2010.752%2021.6959%207.81069%2022.1226C5.92002%2022.3972%204.25069%2023.8986%203.23735%2025.0399C2.01602%2026.4212%202.16802%2025.7759%205.23735%2025.3946C5.97602%2025.3039%205.54935%2025.5119%205.54935%2025.5119C5.54935%2025.5119%201.45069%2027.2319%201.17335%2028.7599C1.10402%2029.1412%202.25335%2028.0639%205.28535%2028.1599C9.00802%2028.2772%2012.2454%2030.4372%2013.576%2030.7946C16.3014%2031.5226%2020.2107%2031.6906%2023.7974%2028.8772C23.7974%2028.8772%2027.1067%2026.7999%2028.1307%2022.9626C28.3974%2021.8986%2028.5547%2020.8079%2028.6%2019.7119C28.6534%2018.2826%2028.2187%2016.7786%2028.2187%2016.7786C28.2187%2016.7786%2025.8027%2022.1412%2018.968%2023.7359Z%22%20fill%3D%22url%28%23paint5_linear_6878_209605%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6878_209605%22%20x1%3D%2216.4324%22%20y1%3D%2212.1528%22%20x2%3D%2216.8954%22%20y2%3D%2223.6425%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_6878_209605%22%20x1%3D%2216.7001%22%20y1%3D%226.18018%22%20x2%3D%2211.071%22%20y2%3D%226.18018%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_6878_209605%22%20x1%3D%2216.2435%22%20y1%3D%227.12663%22%20x2%3D%2215.9108%22%20y2%3D%221.69157%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_6878_209605%22%20x1%3D%226.16155%22%20y1%3D%2212.2252%22%20x2%3D%2225.9606%22%20y2%3D%2220.045%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_6878_209605%22%20x1%3D%2210.5984%22%20y1%3D%2223.6578%22%20x2%3D%2229.3992%22%20y2%3D%2215.3943%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_6878_209605%22%20x1%3D%228.65975%22%20y1%3D%2229.7403%22%20x2%3D%2224.9372%22%20y2%3D%2219.5912%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%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!1,switchChain:M,link:"https://foxwallet.com/",mobileDeepLink:"foxwallet://dapp?url=$APP_URL",injected:()=>{var e;return null===(e=window.foxwallet)||void 0===e?void 0:e.ethereum}},UO={type:exports.WalletType.BinanceChain,showName:"Binance Web3 Wallet",logo:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%227.5in%22%20height%3D%227.5in%22%20version%3D%221.1%22%20style%3D%22shape-rendering%3AgeometricPrecision%3B%20text-rendering%3AgeometricPrecision%3B%20image-rendering%3AoptimizeQuality%3B%20fill-rule%3Aevenodd%3B%20clip-rule%3Aevenodd%22%20viewBox%3D%220%200%207500%207500%22%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%20%20%20%20%20%20%20%20%20%20%20%20.fil0%20%7Bfill%3Anone%7D%20%20%20%20%20%20%20%20%20%20%20%20.fil1%20%7Bfill%3A%234D4D4D%7D%20%20%20%20%20%20%20%20%20%20%20%20.fil2%20%7Bfill%3A%23F3BA2F%7D%20%20%20%20%20%20%20%20%3C%2Fstyle%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Layer_x0020_1%22%3E%20%20%20%20%20%20%20%20%3Cmetadata%20id%3D%22CorelCorpID_0Corel-Layer%22%2F%3E%20%20%20%20%20%20%20%20%3Crect%20class%3D%22fil0%22%20width%3D%227500%22%20height%3D%227500%22%2F%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22_2419820813232%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Ccircle%20class%3D%22fil1%22%20cx%3D%223750%22%20cy%3D%223750%22%20r%3D%223500%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20class%3D%22fil2%22%20d%3D%22M2779%203351l971%20-971%20971%20972%20565%20-565%20-1536%20-1537%20-1536%201536%20565%20565%200%200zm-1529%20399l565%20-565%20565%20565%20-565%20565%20-565%20-565zm1529%20399l971%20971%20971%20-972%20566%20565%200%200%20-1537%201537%20-1536%20-1536%20-1%20-1%20566%20-564%200%200zm2341%20-399l565%20-565%20565%20565%20-565%20565%20-565%20-565z%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20class%3D%22fil2%22%20d%3D%22M4380%203750l0%200%20-630%20-632%20-466%20467%200%200%20-54%2054%20-111%20111%20-1%201%201%201%20630%20630%20631%20-631%200%200%200%200%200%20-1zm0%200l0%200%200%200z%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3Cstyle%20xmlns%3D%22%22%3E%23yddContainer%7Bdisplay%3Ablock%3Bfont-family%3AMicrosoft%20YaHei%3Bposition%3Arelative%3Bwidth%3A100%25%3Bheight%3A100%25%3Btop%3A-4px%3Bleft%3A-4px%3Bfont-size%3A12px%3Bborder%3A1px%20solid%7D%23yddTop%7Bdisplay%3Ablock%3Bheight%3A22px%7D%23yddTopBorderlr%7Bdisplay%3Ablock%3Bposition%3Astatic%3Bheight%3A17px%3Bpadding%3A2px%2028px%3Bline-height%3A17px%3Bfont-size%3A12px%3Bcolor%3A%235079bb%3Bfont-weight%3Abold%3Bborder-style%3Anone%20solid%3Bborder-width%3A1px%7D%23yddTopBorderlr%20.ydd-sp%7Bposition%3Aabsolute%3Btop%3A2px%3Bheight%3A0%3Boverflow%3Ahidden%7D.ydd-icon%7Bleft%3A5px%3Bwidth%3A17px%3Bpadding%3A0px%200px%200px%200px%3Bpadding-top%3A17px%3Bbackground-position%3A-16px%20-44px%7D.ydd-close%7Bright%3A5px%3Bwidth%3A16px%3Bpadding-top%3A16px%3Bbackground-position%3Aleft%20-44px%7D%23yddKeyTitle%7Bfloat%3Aleft%3Btext-decoration%3Anone%7D%23yddMiddle%7Bdisplay%3Ablock%3Bmargin-bottom%3A10px%7D.ydd-tabs%7Bdisplay%3Ablock%3Bmargin%3A5px%200%3Bpadding%3A0%205px%3Bheight%3A18px%3Bborder-bottom%3A1px%20solid%7D.ydd-tab%7Bdisplay%3Ablock%3Bfloat%3Aleft%3Bheight%3A18px%3Bmargin%3A0%205px%20-1px%200%3Bpadding%3A0%204px%3Bline-height%3A18px%3Bborder%3A1px%20solid%3Bborder-bottom%3Anone%7D.ydd-trans-container%7Bdisplay%3Ablock%3Bline-height%3A160%25%7D.ydd-trans-container%20a%7Btext-decoration%3Anone%3B%7D%23yddBottom%7Bposition%3Aabsolute%3Bbottom%3A0%3Bleft%3A0%3Bwidth%3A100%25%3Bheight%3A22px%3Bline-height%3A22px%3Boverflow%3Ahidden%3Bbackground-position%3Aleft%20-22px%7D.ydd-padding010%7Bpadding%3A0%2010px%7D%23yddWrapper%7Bcolor%3A%23252525%3Bz-index%3A10001%3Bbackground%3Aurl%28chrome-extension%3A%2F%2Feopjamdnofihpioajgfdikhhbobonhbb%2Fab20.png%29%3B%7D%23yddContainer%7Bbackground%3A%23fff%3Bborder-color%3A%234b7598%7D%23yddTopBorderlr%7Bborder-color%3A%23f0f8fc%7D%23yddWrapper%20.ydd-sp%7Bbackground-image%3Aurl%28chrome-extension%3A%2F%2Feopjamdnofihpioajgfdikhhbobonhbb%2Fydd-sprite.png%29%7D%23yddWrapper%20a%2C%23yddWrapper%20a%3Ahover%2C%23yddWrapper%20a%3Avisited%7Bcolor%3A%2350799b%7D%23yddWrapper%20.ydd-tabs%7Bcolor%3A%23959595%7D.ydd-tabs%2C.ydd-tab%7Bbackground%3A%23fff%3Bborder-color%3A%23d5e7f3%7D%23yddBottom%7Bcolor%3A%23363636%7D%23yddWrapper%7Bmin-width%3A250px%3Bmax-width%3A400px%3B%7D%3C%2Fstyle%3E%3C%2Fsvg%3E",supportChains:[exports.ChainId.MAINNET,exports.ChainId.BSC,exports.ChainId.OPTIMISM,exports.ChainId.ARBITRUM_ONE,exports.ChainId.POLYGON,exports.ChainId.AVALANCHE,exports.ChainId.CONFLUX,exports.ChainId.AURORA],link:"https://www.bnbchain.world/en/binance-wallet",supportMobile:!0,disabled:()=>!1,injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isBinance},connector:(e,t)=>ue(e,t),switchChain:e=>{var t;return M(Object.assign(Object.assign({},e),{provider:null!==(t=e.provider)&&void 0!==t?t:D.getState().provider}))}},RO={type:exports.WalletType.kuCoinWallet,showName:"Halo 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%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Crect%20width%3D%2231.9003%22%20height%3D%2232%22%20fill%3D%22url%28%23pattern0%29%22%2F%3E%3Cdefs%3E%3Cpattern%20id%3D%22pattern0%22%20patternContentUnits%3D%22objectBoundingBox%22%20width%3D%221%22%20height%3D%221%22%3E%3Cuse%20xlink%3Ahref%3D%22%23image0_5586_181316%22%20transform%3D%22scale%280.003125%200.00311526%29%22%2F%3E%3C%2Fpattern%3E%3Cimage%20id%3D%22image0_5586_181316%22%20width%3D%22320%22%20height%3D%22321%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAUAAAAFBCAMAAAAxEoY9AAAAh1BMVEUAAAAIwoMIwoQIwoMMv4AHwoQIwoQIwYIIv4AIv4MFv4UIwoUHwoQIwYMGwIMHwoQIxIMIv4QLv4UIwoT%2F%2F%2F%2Fg%2BPDB8ODv%2B%2FgXxotl2bInyZOD4cInypNG0aOT5ck2zZui6NF03brw%2B%2FfQ9Oh03Lmy7NlV1qvR9OhG0aKj6NF13bpF0aKi6NBpmcGFAAAAE3RSTlMA37%2BAEO%2BgYCBAMLBwkFDQkHAwbIn3WAAADpZJREFUeNrs2Q1uwjAMBWAndv4ziJT733VogwkNxtq57aB53xGe7NhuaQEScwqhMnvviz0xF%2F0pmLOjPSnee%2BYaDilFoX8lOdTmj8b112VsafWQhTYWQytPUl7LcLYdMm0jsX3lmnuYIidalwS%2F0%2FAuXAlCa0ll5%2Bmd%2BUQrEB4jvQ8mRMSnYzgiPm2EQgsJA8b32ci0hGz7sEwkLXnrQ2PSybu6N7YvwtpBUYRx4Nfvmo1oXx2T6Q%2FqoMvLXZVm4w6ah3Dw7eVWo1l8h288TScYv3dYoamQ310W%2FavkMT%2BUGvYXJcb5u%2FZGnTs84jI9FHH%2F%2FsJELDA6FgNkvWcwdpgg00%2FwAE5iBA2s09DAShkNvMIkDh0mC3RDUIAzOMEE0WHccDpO8BFVh1GAOk4wgnUYO6COoyupw2wJI0Sn0BfpMJ8TjJCl7rnSQfWf%2FZ1dO8FtGwaiAIqsbrYW6Hwu2k07khs49z9fC6SNndQxyRlRptK%2BEwgfQ86Q4v%2BXgCxXJ%2BnBtmwK1z71eqOUwQullNb9U%2BWGpqQEbNFuFACl24FGdDPtPUJZuKeNgs9Gt66xNJ5tb7BjliWN5WKqf5m2%2BxWdQQyj26GjEdQa740W4fkUW6AdWm3AY3TVkIwz%2BNvK0QheN8HvlIrdthtIadcRl33GYS2N4uWVwldKwjptMA61HCwx2A0%2BsqQxLJK9B7ROY1y6KClWD6RN8CFBD%2FGkJ8vQUowKxziSu0vRQ7YayZhlE%2FEhOK4ksbPRbxJsZZCWCl7KCsdpkrsUnUN4xScXVoYFfByJ3Y7YhK1bYyq6IC8Fn5UlqQX3UbRw7copX4Q%2F4NeS1D1rijl9fAERtgjQkNBD%2FGVgJvF5I1wjgCahu9gxMKP4PBEiSEEy3%2BR%2FNAcFhuQRdgiiLDHtBkGS2GqcWl9SdA%2FZqUhGNkfbFjlYltwA5aPMpeRhrzPIgyqYAcpL8Av%2FIFKffvUeWccdpinB25AA8y6%2Fw5VUY5oSvOGe5J6RG1XSPjNNCS48rxLmk9%2F7y4F%2BmhJc8I7CeXTfozvhIyYpwXvWT2GHTKmB%2FrAGoR6J74ITYJ1Z%2F9hXMVbJmvguOE8Dl8iYLqP7MBpiu2YEWCNrqosuQU0erADnWYB73dgqhLLEdc24zcp4B3y7ETYTTDJ38QEOyF%2F%2FUlIagVbEdf5xgDObAQ8dS2ojaiOJAszpDsGXYCVrI2kCVJgF1UVN05Z4zuNv9DETqy6mBB%2BJ5%2BzzBohVQWSNYA3%2F6wECRUQJluQRFeAn2AN%2FJ2gNfxRMFOAaM1JQxV%2FDkgDnPge%2Baqxh9%2BFEARaYk1VXsftwogBt%2FmfhtwmK1rA%2FQDps9keRV2qd8mb%2FihFgg1Bzatjc87AnQEEJmqqbV4AtMbACrIPis928Nsuf3JwJjtswDEV7hy95d5yJm3S9%2F%2FlatBgYBdoQzBNtq%2B8AE82TaFKrY2uECtTXZOvTt8r8OQoZLFBXS19t1c4vHnLABHbrU33VVYvOjyAXqK7597ZifdW2oxJkAu2LaHmucLYCPoJAoOb8lyD43YTa8u87ixxggVL%2FrnB7jaBqf87pMBcozZf13d797T0AppzK0Obc%2FGTNe3XIVX4%2BiLLM87wMksr5a5tL%2Fxj%2B%2FJG3S4M98lLaFMjpMpT35W3QP1j6e6xEOYkQeE%2BA9jLLYL7mFMYgFxECR25PtsMURC8XAQLfXtc3Oqqwqc8pglEOIgQu6UVyLychCq9ywwWKJ%2BDWUYCFKlzlhgvki%2F1jp5foxlSYm5xwgTyBNIMcBF836%2BSgtMAHj14%2FX9t0WB3DBfIP4Kch4GcBDznAAnkFfenEGY8pBLlAXgGi8LW3aCJbxAXyyyPtokKU2z%2B9yAESyA%2B95UEA9CHklXRxgWOkvx0N3uWgoMAp1t9%2BBhs5KCiwCfa3m8EsD8UE9sf7k6a2WoH%2Bzl8UwFKtwCuotkrydf%2FVBCAQZJBRQVwSRk78AvkcLiuKbk1POKtAbwZpBwFAIjmrwJwcoA8g%2FAyeVKB3ADYCoIr0pAJz8jEIgIL4nAK9A3AUgszKzykwJxe5E6bcPaAT1IHeAdiLUTiPHD8TyaB9UeSKBJ5wALoadfhyVvgAHOZ5kZe2GoHRA3DMxrkZmIgPX5FukgGqAadPxvIhTsRH74l8Dm3dlN0LsHxVZpQBEMjXAWdtOPz5Dc7JwXH7whMrEWx%2FhkGeRg4%2B2tGjCLb9GQZZDPMg4QIzaZztzzbIY%2FjQ01mfyTTT9gcMghiWARCIU8hdG7Y%2FYBA8FJ5lAATiYqvXhumPGvyYDMBEBAhEM85FG5Y%2FYBC9NHyRARBIZyE3bZj%2BuEEjPmgZyAVOIDpMf7ZB1r%2B8UOACexAdhj9gkFWC8Xfl7B4m0bH5sw2iDuaVFhfYkeiw%2FXGDj4AkTATy9i2Swx82OIUmYS7wmrzI5Y8bTAZoKYELzMnJrejfzJ0C6pgdX%2B34nLxkFf3sjwLdAToZCIQzpVUWGf2v%2FK3cXV8uamDj%2BAHdATQRr%2BdzgbR3%2BVdhBgLpPIQL%2FPx%2FCpQBEMg3XhuVLdwW7fSVAQJB48KTSJZAEgGTTSCQ1VhZUsFh3csiJx%2FBr%2FjaCZPXWCvpDt7JWQZQoD0Rrnwqd5UBEsjX2gYZsMUEHiW9XiDgIW4wUSfLWbzS6mQABOIcYnQwX1Dlk81GBkygvZha%2B5J%2BLwMm0I6O2jeVBhkwgXZ0VL6t2ciEC9yig6bh8I31JSCCgUAQHcZMKepoRx%2BXg7nANW2AQjX0cNE9oHFYoF3j13u8bZYBEOhadzrJAUtvoZBlAASCxoFdV3jE9xqXQrjARyoYw%2ByQ%2BRkuMRsC3WXgKa45RF5g4QLHFBbD%2FKJN%2FAUWLvB7epVbJw9TdvgjaW6VARBISiy%2B8drn52%2Bcn%2BESriGQTUT42Yllngf9kzPcAi8vsLoL16RRzwWe4Ub9U04wAJlAP28qyBkGoCHQmGayRMw5wQA0BJK1hEoe3ulF2F%2FgbVAA5BIzIlZgDY%2BP%2FeDu3nabiKEoDDspFCoQSKztsT2eQ46NoLz%2F80EbKlFVUG%2BvJtnud181%2BjM%2BjDNKEii1Ac2uI%2BszX4B1Ae0O4iGc%2BwLkA%2BodcDL%2B3PMJEZAw4USyKPUgVe4DjU6Da1FagXWeOxGrX8Tte7BqA1pcSAZ%2FgaONcwU0%2BWMEHXh1x1kWC%2Br7SQ9e3Ym0wYIV%2FTLAq%2FtMxF7Bin4eDCbgJK%2FEz3glc5ALDWDqc2Ez%2B8H1eY%2FV2IBJ%2FmbgdHC64JlQ%2FbMxZibC4UD8Wxr7dBZvswZlHaTCLQhswCgUCz%2BPm0GgAyLIPQMzYczh8udp%2FCO%2BwvMJFVK4%2FAa0KuBPEbl8wuRtHAU5qGU5BZ96FGAG79EOHD5gkhNZjShyNwU7H0w7qA1yMv7lhnc5CGEPFh8Qckphn2b8Q5%2B%2BB6H4CBofcCsnFrppPT7J2I9p6sKr3vjEeRzHGXp8wJ9yHsEfut8OPrz2jWNc74McHaYROnzAnbQpzHgwTIHZQ%2FEBR2nTsV%2FM8owfoUAHjNKkhHt3nt3d8AHRSYMS%2Fnv6sI9QIANO0p700g3MQVGQDXgrzUnHfMSDHuqAb2kSDKnk9GGNCg41ttKUMMccqAdO9AHf0iToxz%2F57HwRd1s7wYOUGqHm3qNCDFLk4KUpHdTcAjU6KTMGackmQmlRGXAnZfLcVsEEBSZgLH5L29ozTniGCsiP4YwkDdlCgQqYiy%2FBpgp6KFABBymU0FRBKCgCEmN4E5sqCAUu4E4KZQDtrMVQWrgl6kQptIkA5kZ21B5Ky4KA7KlqBoChjYIdFMiAoxTa9O0UnKBABkTQva1xL%2FbdQmnpPqFWllLj4x%2BYF6G0dNeoFaWUj3jwQ4xbQeuaCIhOVOtIA4txDwU%2B4Kh%2FZYPpDwNWULt2V6i3Va1u5ifC0EPtigq4E9Vu%2BujW7DDeQe%2FKfUa9GGpe3GD0wYYJFT67DyBkKbUHYHsYr1DjgyIgdQlu8MjobckKVb64GzCyZh22fBHuUOfGfYMCcQnOuGd0JuxmVLpxH0HJmtu5p5KVcRx2qPbRvQMlhuqAGFZiwSqi3jvnwMmqgPbGcTeC4ZxbgBK9Zg60No59AmXhnPsKTpIiAMwlDDmCs3TOfQKpkwJbPLCU8Fc7d4ObOAxEAfjFdn6cEFA1xHFIQ4tQWbH3P%2BAWKJtdFVFiO5TCfDfgaSZjT4A%2BPncFgJI8dQPvSbcRYR%2BfjxLAhHy9OsyQgRHeZnxEEwAp%2BbJ1iNeFzfVWhb9WlsKYAn5XkUtX9Q1doLvOudB0FIwGoMifCfS%2B%2Bnn0Tq7bBQWk8C4iby8eT8De%2BGVoOkshxYDvOeaiJm5pCNuY%2BRjMylJgAjsleTs%2FiQ0N9Rw8Q9MuKLwSOyn5O5Og44%2FQbPNazcOow9deP4T7MexrOT%2FtzZKrrvUvxPWyszSWHHsxBfG7DrXq7e1DrN3D21gaUYwDQSGc3O%2BZBQXwslkOTXG9XXWWRiZwICmU%2FyOsTUfhvHSrpanmX6nX27ZZ0FVIHGgKx24On7JaLxtLI1h0m1W7fTOm6v%2FMo6oq87Zdts1mYemKND7ExBzEOEqIOShwlBJzkOJIcQ%2B7UPhLEBssQU8TG2yKdzyHnUX4lyTmMkJ4jDiLMnAJeo4QLkHPAuQS9CABLkEPkcInT8RcRjBfR%2FzOgHwdcZHhpJKYwwTpqYjYpQ3MTRyggXkS%2BzUwT2InAudk%2FBgcdIf7LCd2Vo49fgw6muAT3ioEGiD8lvhrJcAJekhwGTUjdsIM4AQ9zBR2uItD9y9vZlzy49OM%2F%2FmFT9QDTOAg53vxhyiHk4x3M3siwxE%2FCEdoX15vnRVp7HERuikVdrgI3QiNENIHjTCeIBAlHzDCWCqEkyUPFmEfXyjZIzVyH19Q08fY0cRCYywqLe78a4RxkSqMS0txpyHGQmpcR56W95ViJMo0x5UpPZVlIX70bIlmRfmU5grfSmVaT1MpZZIkYic6uJkajT7MhBBFkiRSPqWpzjMF9u3%2BAIgAByAE7Z9hAAAAAElFTkSuQmCC%22%2F%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://halo.social/",disabled:()=>{var e;return!(null!==(e=window.haloEthereum)&&void 0!==e?e:window.kucoin)},injected:()=>{var e,t;return(null===(e=window.ethereum)||void 0===e?void 0:e.isKuCoinWallet)||(null===(t=window.ethereum)||void 0===t?void 0:t.isHaloWallet)},connector:(e,t)=>{var n;return _(null!==(n=window.haloEthereum)&&void 0!==n?n:window.kucoin,t)},switchChain:e=>{var t;return M(Object.assign(Object.assign({},e),{provider:e.provider||(null!==(t=window.haloEthereum)&&void 0!==t?t:window.kucoin)}))}},jO={type:exports.WalletType.Coin98,showName:"Coin98",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%3Cpath%20d%3D%22M26.1569%200H5.84389C2.60226%200%200%202.6016%200%205.8432V26.1568C0%2029.3984%202.60226%2032%205.84389%2032H26.1561C29.3522%2032%2032%2029.3984%2032%2026.1568V5.8432C32%202.6016%2029.3985%200%2026.1569%200ZM21.2273%207.9888C23.601%207.9888%2025.5183%209.9056%2025.5183%2012.28C25.5183%2013.0096%2025.3353%2013.6944%2025.0156%2014.3336C24.4681%2013.9232%2023.8751%2013.5576%2023.2357%2013.3296C23.418%2013.0096%2023.5099%2012.6448%2023.5099%2012.28C23.5099%2011.0472%2022.5053%2010.0432%2021.2729%2010.0432C20.0397%2010.0432%2019.0358%2011.0472%2019.0358%2012.28C19.0358%2012.6448%2019.127%2013.0096%2019.31%2013.3296C18.6706%2013.5576%2018.0312%2013.8776%2017.5293%2014.3336C17.1641%2013.6944%2017.0266%2013.0096%2017.0266%2012.2792C16.9363%209.9056%2018.8536%207.9888%2021.2273%207.9888ZM10.7727%2024.0112C8.3998%2024.0112%206.48247%2022.0944%206.48247%2019.7208H8.53648C8.53648%2020.9528%209.54109%2021.9576%2010.7735%2021.9576C12.0059%2021.9576%2013.0105%2020.9528%2013.0105%2019.7208H15.0645C15.0645%2022.0944%2013.1464%2024.0112%2010.7727%2024.0112ZM10.7727%2017.9856C8.03456%2017.9856%205.79755%2015.7488%205.79755%2013.0096C5.79755%2010.2712%208.03456%207.9888%2010.7735%207.9888C13.5124%207.9888%2015.795%2010.2256%2015.795%2013.0096C15.7494%2015.7488%2013.5116%2017.9856%2010.7727%2017.9856ZM21.2273%2024.0112C18.4884%2024.0112%2016.2058%2021.7744%2016.2058%2019.0352C16.2058%2016.2512%2018.4428%2014.0144%2021.2273%2014.0144C23.9662%2014.0144%2026.2032%2016.2512%2026.2032%2019.036C26.2032%2021.7744%2023.9662%2024.0112%2021.2273%2024.0112ZM24.194%2018.9904C24.194%2020.6336%2022.8705%2021.9112%2021.2273%2021.9112C19.5841%2021.9112%2018.2598%2020.588%2018.2598%2018.9904C18.2598%2017.3464%2019.5841%2016.0224%2021.2273%2016.0224C22.8705%2016.0688%2024.194%2017.392%2024.194%2018.9904ZM13.6946%2013.0096C13.6946%2014.6536%2012.3711%2015.9776%2010.7279%2015.9776C9.08395%2015.9776%207.76043%2014.6536%207.76043%2013.0096C7.76043%2011.3664%209.08395%2010.0424%2010.7279%2010.0424C12.4167%2010.0424%2013.6946%2011.3664%2013.6946%2013.0104V13.0096Z%22%20fill%3D%22%23D9B432%22%2F%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://coin98.com/wallet",disabled:()=>{var e,t;return!((null===(e=window.coin98)||void 0===e?void 0:e.provider)||(null===(t=window.ethereum)||void 0===t?void 0:t.isCoin98))},injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isCoin98},connector:(e,t)=>{var n;return _(null===(n=window.coin98)||void 0===n?void 0:n.provider,t)},switchChain:e=>{var t;return M(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.coin98)||void 0===t?void 0:t.provider)}))}},LO={type:exports.WalletType.frontier,showName:"Frontier",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%3Cpath%20d%3D%22M32%2016C32%207.16344%2024.8366%200%2016%200C7.16344%200%200%207.16344%200%2016C0%2024.8366%207.16344%2032%2016%2032C24.8366%2032%2032%2024.8366%2032%2016Z%22%20fill%3D%22%23CC703C%22%2F%3E%3Cpath%20d%3D%22M23.3502%208L23.2615%208.23476L22.971%208.9853L22.778%209.46909C21.3121%2013.0968%2020.1721%2014.8183%2018.9598%2014.8183C18.6535%2014.8264%2018.3488%2014.7706%2018.0652%2014.6546C17.7816%2014.5385%2017.5253%2014.3646%2017.3127%2014.1441L17.158%2014.0038C16.773%2013.6485%2016.611%2013.5609%2016.2402%2013.5609C16.0472%2013.5609%2015.7015%2013.807%2015.2647%2014.3853C14.6796%2015.214%2014.182%2016.1012%2013.7801%2017.0326L13.7308%2017.1418H18.9308L18.2832%2018.4879H13.428V24H12V8H23.3502ZM21.3268%209.34359H13.428V14.6751C14.3744%2013.0338%2015.2741%2012.2099%2016.2417%2012.2099C16.5671%2012.1995%2016.8911%2012.2568%2017.1932%2012.3781C17.4953%2012.4994%2017.7689%2012.6821%2017.9966%2012.9147L18.1562%2013.0594C18.5156%2013.3911%2018.654%2013.4674%2018.9612%2013.4674C19.2991%2013.4679%2020.1977%2012.0406%2021.3268%209.34359Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E",link:"https://www.frontier.xyz/download",injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isFrontier},disabled:()=>{var e;return!(null===(e=window.frontier)||void 0===e?void 0:e.ethereum)},connector:(e,t)=>{var n;return _(null===(n=window.frontier)||void 0===n?void 0:n.ethereum,t)},switchChain:e=>{var t;return M(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.frontier)||void 0===t?void 0:t.ethereum)}))}},GO={type:exports.WalletType.LedgerUSB,showName:"Ledger",logo:"data:image/svg+xml,%3Csvg%20width%3D%22146%22%20height%3D%22128%22%20viewBox%3D%220%200%20146%20128%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M90.262%20119.94V127.998H145.57V91.6548H137.511V119.94H90.262ZM90.262%200V8.05844H137.511V36.3452H145.57V0H90.262ZM63.4464%2036.3452H55.3879V91.6529H91.7332V84.3842H63.4464V36.3452ZM0%2091.6548V128H55.3076V119.94H8.05844V91.6548H0ZM0%200V36.3452H8.05844V8.05844H55.3076V0H0Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E",supportChains:[exports.ChainId.MAINNET,exports.ChainId.BSC,exports.ChainId.POLYGON],disabled:()=>!E(),getPackage:$,connector:e=>h(void 0,void 0,void 0,(function*(){return E()&&e?(yield $()).default(e):void 0})),needReadProvider:!0},zO={type:exports.WalletType.openBlock,showName:"OpenBlock",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%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.4526%204.41003C27.117%204.41003%2030.8983%208.19129%2030.8983%2012.8557V13.0548L27.9485%2016.0021L30.8983%2018.9466V19.1486C30.8983%2023.813%2027.117%2027.5943%2022.4526%2027.5943H1.08997L7.91802%2022.6262H19.3062C22.9645%2022.6262%2025.9302%2019.6605%2025.9302%2016.0021C25.9302%2012.3438%2022.9645%209.37809%2019.3062%209.37809H7.91802L1.08997%204.41003H22.4526ZM9.50802%2013.1867C7.95322%2013.1867%206.69279%2014.4472%206.69279%2016.002C6.69279%2017.5568%207.95319%2018.8172%209.50802%2018.8172H19.316C20.8708%2018.8172%2022.1312%2017.5568%2022.1312%2016.002C22.1312%2014.4472%2020.8708%2013.1867%2019.316%2013.1867H9.50802Z%22%20fill%3D%22%234A3DE6%22%2F%3E%3C%2Fsvg%3E",supportChains:[exports.ChainId.MAINNET,exports.ChainId.GOERLI,exports.ChainId.BSC,exports.ChainId.POLYGON,exports.ChainId.ARBITRUM_ONE,exports.ChainId.OKCHAIN,exports.ChainId.OPTIMISM,exports.ChainId.AVALANCHE],link:"https://openblock.com/#/download",disabled:()=>!window.openblock,connector:(e,t)=>_(window.openblock,t),switchChain:e=>M(Object.assign(Object.assign({},e),{provider:e.provider||window.openblock}))},$O={type:exports.WalletType.OneKey,showName:"OneKey",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_3105_80246%29%22%3E%3Cpath%20d%3D%22M32%2016C32%2027.0458%2027.0458%2032%2016%2032C4.95431%2032%200%2027.0458%200%2016C0%204.95431%204.95431%200%2016%200C27.0458%200%2032%204.95431%2032%2016Z%22%20fill%3D%22%2344D62C%22%2F%3E%3Cpath%20d%3D%22M17.4456%206.78467H12.9945L12.2136%209.14578H14.6858V14.1196H17.4456V6.78467Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.0764%2020.1391C21.0764%2022.9426%2018.8035%2025.2153%2016%2025.2153C13.1964%2025.2153%2010.9238%2022.9426%2010.9238%2020.1391C10.9238%2017.3355%2013.1964%2015.0629%2016%2015.0629C18.8035%2015.0629%2021.0764%2017.3355%2021.0764%2020.1391ZM18.7718%2020.1391C18.7718%2021.67%2017.5309%2022.9109%2016%2022.9109C14.4693%2022.9109%2013.2284%2021.67%2013.2284%2020.1391C13.2284%2018.6084%2014.4693%2017.3673%2016%2017.3673C17.5309%2017.3673%2018.7718%2018.6084%2018.7718%2020.1391Z%22%20fill%3D%22black%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_3105_80246%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",link:"https://onekey.so",supportMobile:!0,injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isOneKey},disabled:()=>{var e,t;return!(null!==(t=null===(e=window.$onekey)||void 0===e?void 0:e.ethereum)&&void 0!==t?t:window.onekey)},connector:(e,t)=>{var n,r;return _(null!==(r=null===(n=window.$onekey)||void 0===n?void 0:n.ethereum)&&void 0!==r?r:window.onekey,t)},switchChain:e=>{var t,n;return M(Object.assign(Object.assign({},e),{provider:e.provider||(null!==(n=null===(t=window.$onekey)||void 0===t?void 0:t.ethereum)&&void 0!==n?n:window.onekey)}))}},HO={type:exports.WalletType.Bitkeep,showName:"Bitget 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_4482_24780%29%22%3E%3Cmask%20id%3D%22mask0_4482_24780%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2232%22%20height%3D%2232%22%3E%3Cpath%20d%3D%22M29.44%200H2.56C1.14615%200%200%201.14615%200%202.56V29.44C0%2030.8538%201.14615%2032%202.56%2032H29.44C30.8538%2032%2032%2030.8538%2032%2029.44V2.56C32%201.14615%2030.8538%200%2029.44%200Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_4482_24780%29%22%3E%3Cpath%20d%3D%22M29.44%200H2.56C1.14615%200%200%201.14615%200%202.56V29.44C0%2030.8538%201.14615%2032%202.56%2032H29.44C30.8538%2032%2032%2030.8538%2032%2029.44V2.56C32%201.14615%2030.8538%200%2029.44%200Z%22%20fill%3D%22%2354FFF5%22%2F%3E%3Cg%20filter%3D%22url%28%23filter0_f_4482_24780%29%22%3E%3Cpath%20d%3D%22M1.68486%2024.826C-3.66616%2039.8807%2024.9574%2035.6286%2039.9381%2031.6209C55.2704%2026.5327%2044.6731%204.10367%2033.6766%203.60729C22.6801%203.11088%2035.04%2013.9784%2025.6992%2017.0823C16.3583%2020.1862%208.37363%206.00761%201.68486%2024.826Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cg%20filter%3D%22url%28%23filter1_f_4482_24780%29%22%3E%3Cpath%20d%3D%22M10.6888%20-5.72745C7.88183%20-13.3967%20-2.11506%20-2.99905%20-6.76264%203.15841C-11.1958%209.85638%200.375973%2015.6443%204.9149%2012.505C9.45385%209.36571%200.971613%208.75491%203.67115%204.6727C6.37069%200.590466%2014.1975%203.85906%2010.6888%20-5.72745Z%22%20fill%3D%22%2300FFF0%22%20fill-opacity%3D%220.67%22%2F%3E%3C%2Fg%3E%3Cg%20filter%3D%22url%28%23filter2_f_4482_24780%29%22%3E%3Cpath%20d%3D%22M12.0598%2028.1776C8.23109%2015.2951%20-8.26041%2022.0793%20-16.0276%2027.0817C-23.4988%2033.0049%20-5.75907%2050.0432%201.60888%2049.1716C8.97682%2048.3001%20-4.30167%2040.8829%200.248192%2037.271C4.79805%2033.6592%2016.8456%2044.2809%2012.0598%2028.1776Z%22%20fill%3D%22%239D81FF%22%2F%3E%3C%2Fg%3E%3Cg%20filter%3D%22url%28%23filter3_f_4482_24780%29%22%3E%3Cpath%20d%3D%22M35.2648%20-13.419C27.0056%20-23.2538%2015.1825%20-15.1211%2010.3034%20-9.82547C6.03395%20-3.83046%2028.0341%207.15403%2034.1399%205.27156C40.2457%203.38906%2025.8137%20-0.506166%2028.4119%20-4.16087C31.0101%20-7.81557%2045.5886%20-1.12558%2035.2648%20-13.419Z%22%20fill%3D%22%234D94FF%22%2F%3E%3C%2Fg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.6484%2019.1045H17.084L10.9009%2012.8814L17.1635%206.65828L18.8692%205H13.2272L6.04181%2012.2222C5.67918%2012.5862%205.68104%2013.1752%206.04552%2013.5373L11.6484%2019.1045ZM14.9161%2012.8959H14.8742L14.9156%2012.8954L14.9161%2012.8959ZM14.9161%2012.8959L21.0987%2019.1185L14.8361%2025.3417L13.1304%2026.9999H18.7724L25.9578%2019.7782C26.3204%2019.4142%2026.3185%2018.8252%2025.9542%2018.463L20.3512%2012.8959H14.9161Z%22%20fill%3D%22black%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3Cfilter%20id%3D%22filter0_f_4482_24780%22%20x%3D%22-11.2804%22%20y%3D%22-8.71689%22%20width%3D%2271.195%22%20height%3D%2256.4289%22%20filterUnits%3D%22userSpaceOnUse%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeFlood%20flood-opacity%3D%220%22%20result%3D%22BackgroundImageFix%22%2F%3E%3CfeBlend%20mode%3D%22normal%22%20in%3D%22SourceGraphic%22%20in2%3D%22BackgroundImageFix%22%20result%3D%22shape%22%2F%3E%3CfeGaussianBlur%20stdDeviation%3D%226.15386%22%20result%3D%22effect1_foregroundBlur_4482_24780%22%2F%3E%3C%2Ffilter%3E%3Cfilter%20id%3D%22filter1_f_4482_24780%22%20x%3D%22-20.0641%22%20y%3D%22-20.7481%22%20width%3D%2243.9494%22%20height%3D%2246.4387%22%20filterUnits%3D%22userSpaceOnUse%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeFlood%20flood-opacity%3D%220%22%20result%3D%22BackgroundImageFix%22%2F%3E%3CfeBlend%20mode%3D%22normal%22%20in%3D%22SourceGraphic%22%20in2%3D%22BackgroundImageFix%22%20result%3D%22shape%22%2F%3E%3CfeGaussianBlur%20stdDeviation%3D%226.15386%22%20result%3D%22effect1_foregroundBlur_4482_24780%22%2F%3E%3C%2Ffilter%3E%3Cfilter%20id%3D%22filter2_f_4482_24780%22%20x%3D%22-30.1349%22%20y%3D%228.45498%22%20width%3D%2255.6066%22%20height%3D%2253.0563%22%20filterUnits%3D%22userSpaceOnUse%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeFlood%20flood-opacity%3D%220%22%20result%3D%22BackgroundImageFix%22%2F%3E%3CfeBlend%20mode%3D%22normal%22%20in%3D%22SourceGraphic%22%20in2%3D%22BackgroundImageFix%22%20result%3D%22shape%22%2F%3E%3CfeGaussianBlur%20stdDeviation%3D%226.15386%22%20result%3D%22effect1_foregroundBlur_4482_24780%22%2F%3E%3C%2Ffilter%3E%3Cfilter%20id%3D%22filter3_f_4482_24780%22%20x%3D%22-2.5499%22%20y%3D%22-30.3448%22%20width%3D%2253.7741%22%20height%3D%2248.1384%22%20filterUnits%3D%22userSpaceOnUse%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeFlood%20flood-opacity%3D%220%22%20result%3D%22BackgroundImageFix%22%2F%3E%3CfeBlend%20mode%3D%22normal%22%20in%3D%22SourceGraphic%22%20in2%3D%22BackgroundImageFix%22%20result%3D%22shape%22%2F%3E%3CfeGaussianBlur%20stdDeviation%3D%226.15386%22%20result%3D%22effect1_foregroundBlur_4482_24780%22%2F%3E%3C%2Ffilter%3E%3CclipPath%20id%3D%22clip0_4482_24780%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",link:"https://bitkeep.com/download?type=2",mobileDeepLink:"https://bkcode.vip?action=dapp&url=$APP_URL",supportMobile:!0,injected:()=>{var e;return A()&&((null===(e=window.bitkeep)||void 0===e?void 0:e.ethereum)||window.isBitKeep)},disabled:()=>{var e;return!((null===(e=window.bitkeep)||void 0===e?void 0:e.ethereum)||window.isBitKeep)},connector:(e,t)=>{var n;return _(null===(n=window.bitkeep)||void 0===n?void 0:n.ethereum,t)},connectorInjected:(e,t)=>{var n;return _(null===(n=window.bitkeep)||void 0===n?void 0:n.ethereum,t)},switchChain:e=>{var t;return M(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.bitkeep)||void 0===t?void 0:t.ethereum)}))}},qO={type:exports.WalletType.Nabox,showName:"Nabox",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%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M2%208.98682V23.8908L6.31535%2026.3785V15.717L10.6153%2018.2006V28.8551L14.932%2031.3428V16.4374L2%208.98682Z%22%20fill%3D%22%232AC98B%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.8024%207.62299L16.1261%205.089L21.4983%208.23266L17.1773%2010.7554L11.8024%207.62299ZM16.1317%200L3.09741%207.62579L17.1535%2015.8669V32L21.417%2029.5165V13.1955L25.7253%2010.6727V26.9797L30.0519%2024.4331V8.14436L16.1317%200Z%22%20fill%3D%22%232AC98B%22%2F%3E%3C%2Fsvg%3E",link:"https://nabox.io/",supportMobile:!0,disabled:()=>!window.NaboxWallet,injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isNabox},connector:(e,t)=>_(window.NaboxWallet,t),switchChain:e=>M(Object.assign(Object.assign({},e),{provider:e.provider||window.NaboxWallet}))},VO={type:exports.WalletType.OKX,showName:"OKX 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_1443_44689%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%22M12.6063%206.99255H7.39351C7.17207%206.99255%206.99255%207.17207%206.99255%207.39351V12.6063C6.99255%2012.8278%207.17207%2013.0073%207.39351%2013.0073H12.6063C12.8278%2013.0073%2013.0073%2012.8278%2013.0073%2012.6063V7.39351C13.0073%207.17207%2012.8278%206.99255%2012.6063%206.99255ZM18.6237%2013.0073H13.4109C13.1895%2013.0073%2013.0099%2013.1869%2013.0099%2013.4083V18.6211C13.0099%2018.8426%2013.1895%2019.0221%2013.4109%2019.0221H18.6237C18.8452%2019.0221%2019.0247%2018.8426%2019.0247%2018.6211V13.4083C19.0247%2013.1869%2018.8452%2013.0073%2018.6237%2013.0073ZM19.4231%206.99255H24.6359C24.8574%206.99255%2025.0369%207.17207%2025.0369%207.39351V12.6063C25.0369%2012.8278%2024.8574%2013.0073%2024.6359%2013.0073H19.4231C19.2016%2013.0073%2019.0221%2012.8278%2019.0221%2012.6063V7.39351C19.0221%207.17207%2019.2016%206.99255%2019.4231%206.99255ZM12.6063%2019.0221H7.39351C7.17207%2019.0221%206.99255%2019.2016%206.99255%2019.4231V24.6359C6.99255%2024.8574%207.17207%2025.0369%207.39351%2025.0369H12.6063C12.8278%2025.0369%2013.0073%2024.8574%2013.0073%2024.6359V19.4231C13.0073%2019.2016%2012.8278%2019.0221%2012.6063%2019.0221ZM19.4231%2019.0221H24.6359C24.8574%2019.0221%2025.0369%2019.2016%2025.0369%2019.4231V24.6359C25.0369%2024.8574%2024.8574%2025.0369%2024.6359%2025.0369H19.4231C19.2016%2025.0369%2019.0221%2024.8574%2019.0221%2024.6359V19.4231C19.0221%2019.2016%2019.2016%2019.0221%2019.4231%2019.0221Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_1443_44689%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:!0,link:"https://www.okx.com/",mobileDeepLink:"okx://wallet/dapp/details?dappUrl=$APP_URL",injected:()=>A()&&!!window.okxwallet,disabled:()=>!window.okxwallet,connector:(e,t)=>_(window.okxwallet,t),switchChain:e=>M(Object.assign(Object.assign({},e),{provider:e.provider||window.okxwallet}))},WO={type:exports.WalletType.WalletConnect,showName:"WalletConnect",logo:"data:image/svg+xml,%3Csvg%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%20width%3D%22512%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3CradialGradient%20id%3D%22a%22%20cx%3D%220%25%22%20cy%3D%2250%25%22%20r%3D%22100%25%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%235d9df6%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23006fff%22%2F%3E%3C%2FradialGradient%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22m256%200c141.384896%200%20256%20114.615104%20256%20256s-114.615104%20256-256%20256-256-114.615104-256-256%20114.615104-256%20256-256z%22%20fill%3D%22url%28%23a%29%22%2F%3E%3Cpath%20d%3D%22m64.6917558%2037.7088298c51.5328072-50.2784397%20135.0839942-50.2784397%20186.6167992%200l6.202057%206.0510906c2.57664%202.5139218%202.57664%206.5897948%200%209.1037177l-21.215998%2020.6995759c-1.288321%201.2569619-3.3771%201.2569619-4.665421%200l-8.534766-8.3270205c-35.950573-35.0754962-94.237969-35.0754962-130.188544%200l-9.1400282%208.9175519c-1.2883217%201.2569609-3.3771016%201.2569609-4.6654208%200l-21.2159973-20.6995759c-2.5766403-2.5139229-2.5766403-6.5897958%200-9.1037177zm230.4934852%2042.8089117%2018.882279%2018.4227262c2.576627%202.5139103%202.576642%206.5897593.000032%209.1036863l-85.141498%2083.070358c-2.576623%202.513941-6.754182%202.513969-9.33084.000066-.00001-.00001-.000023-.000023-.000033-.000034l-60.428256-58.957451c-.64416-.628481-1.68855-.628481-2.33271%200-.000004.000004-.000008.000007-.000012.000011l-60.4269683%2058.957408c-2.5766141%202.513947-6.7541746%202.51399-9.3308408.000092-.0000151-.000014-.0000309-.000029-.0000467-.000046l-85.14386774-83.071463c-2.57663928-2.513921-2.57663928-6.589795%200-9.1037163l18.88231264-18.4226955c2.5766393-2.5139222%206.7541993-2.5139222%209.3308397%200l60.4291347%2058.9582758c.6441608.62848%201.6885495.62848%202.3327103%200%20.0000095-.000009.0000182-.000018.0000277-.000025l60.4261065-58.9582508c2.576581-2.51398%206.754142-2.5140743%209.33084-.0002103.000037.0000354.000072.0000709.000107.0001063l60.429056%2058.9583548c.644159.628479%201.688549.628479%202.332709%200l60.428079-58.9571925c2.57664-2.5139231%206.754199-2.5139231%209.330839%200z%22%20fill%3D%22%23fff%22%20fill-rule%3D%22nonzero%22%20transform%3D%22translate%2898%20160%29%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",supportMobile:!0,getPackage:Z,connector:(e,t)=>ie(e,t),disconnect:()=>h(void 0,void 0,void 0,(function*(){return(yield Z()).disconnect()})),needReadProvider:!0},ZO={type:exports.WalletType.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:[exports.ChainId.MAINNET,exports.ChainId.GOERLI],checked:({PORTIS_ID:e})=>!!e,getPackage:V,connector:(e,t)=>ae(e,t)},KO={type:exports.WalletType.Gnosis,showName:"Gnosis",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_2721_64477%29%22%3E%3Cmask%20id%3D%22mask0_2721_64477%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2232%22%20height%3D%2232%22%3E%3Cpath%20d%3D%22M16%2032C24.8366%2032%2032%2024.8366%2032%2016C32%207.16344%2024.8366%200%2016%200C7.16344%200%200%207.16344%200%2016C0%2024.8366%207.16344%2032%2016%2032Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_2721_64477%29%22%3E%3Cpath%20d%3D%22M32.064%20-2.60797H-1.53601V34.288H32.064V-2.60797Z%22%20fill%3D%22url%28%23paint0_linear_2721_64477%29%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M24.9623%2015.994H22.7763C22.1235%2015.994%2021.5946%2016.5233%2021.5946%2017.1757V20.3482C21.5946%2021.001%2021.0653%2021.53%2020.4128%2021.53H11.7162C11.0634%2021.53%2010.5344%2022.0593%2010.5344%2022.7117V24.8977C10.5344%2025.5505%2011.0637%2026.0794%2011.7162%2026.0794H20.9162C21.569%2026.0794%2022.0909%2025.5501%2022.0909%2024.8977V23.1441C22.0909%2022.4913%2022.6202%2022.0279%2023.2727%2022.0279H24.9623C25.6151%2022.0279%2026.144%2021.4986%2026.144%2020.8461V17.1617C26.144%2016.5089%2025.6147%2015.9937%2024.9623%2015.9937V15.994Z%22%20fill%3D%22%23121312%22%2F%3E%3Cpath%20d%3D%22M10.5338%2011.6515C10.5338%2010.9987%2011.0631%2010.4698%2011.7156%2010.4698H20.4068C21.0596%2010.4698%2021.5885%209.94051%2021.5885%209.28803V7.10211C21.5885%206.44931%2021.0593%205.92035%2020.4068%205.92035H11.2119C10.5591%205.92035%2010.0301%206.44963%2010.0301%207.10211V8.78627C10.0301%209.43907%209.50086%209.96803%208.84838%209.96803H7.16614C6.51334%209.96803%205.98438%2010.4973%205.98438%2011.1498V14.8381C5.98438%2015.4909%206.51558%2015.9933%207.16838%2015.9933H9.3543C10.0071%2015.9933%2010.5361%2015.464%2010.5361%2014.8115L10.5341%2011.6519L10.5338%2011.6515Z%22%20fill%3D%22%23121312%22%2F%3E%3Cpath%20d%3D%22M15.0352%2013.6964H17.1351C17.8192%2013.6964%2018.3747%2014.2519%2018.3747%2014.936V17.0359C18.3747%2017.72%2017.8192%2018.2755%2017.1351%2018.2755H15.0352C14.3511%2018.2755%2013.7955%2017.72%2013.7955%2017.0359V14.936C13.7955%2014.2519%2014.3511%2013.6964%2015.0352%2013.6964Z%22%20fill%3D%22%23121312%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_2721_64477%22%20x1%3D%22-0.47809%22%20y1%3D%2229.2685%22%20x2%3D%2237.0896%22%20y2%3D%22-2.77789%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_2721_64477%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",supportChains:[exports.ChainId.MAINNET,exports.ChainId.GOERLI,exports.ChainId.BSC,exports.ChainId.POLYGON,exports.ChainId.ARBITRUM_ONE,exports.ChainId.AURORA,exports.ChainId.AVALANCHE,exports.ChainId.OPTIMISM],link:"https://app.safe.global/welcome",disabled:()=>h(void 0,void 0,void 0,(function*(){return!(yield(yield H()).getIsSafe())})),getPackage:H,connector:(e,t)=>h(void 0,void 0,void 0,(function*(){return(yield H()).default(t)}))},JO={type:exports.WalletType.uAuth,showName:"Unstoppable",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%3Cpath%20d%3D%22M32%202.47278V13.3668L0%2026.2392L32%202.47278Z%22%20fill%3D%22%2300C9FF%22%2F%3E%3Cpath%20d%3D%22M26.001%202V20.7929C26.001%2023.4191%2024.9474%2025.9378%2023.0719%2027.7948C21.1964%2029.6519%2018.6527%2030.6951%2016.0004%2030.6951C13.3481%2030.6951%2010.8044%2029.6519%208.92887%2027.7948C7.05339%2025.9378%205.99976%2023.4191%205.99976%2020.7929V12.8741L11.9991%209.60487V20.7929C11.943%2021.2811%2011.9916%2021.7757%2012.1418%2022.244C12.2922%2022.7124%2012.5406%2023.144%2012.8711%2023.5107C13.2016%2023.8773%2013.6066%2024.1707%2014.0596%2024.3715C14.5126%2024.5724%2015.0033%2024.6763%2015.4996%2024.6763C15.9959%2024.6763%2016.4866%2024.5724%2016.9396%2024.3715C17.3925%2024.1707%2017.7976%2023.8773%2018.128%2023.5107C18.4585%2023.144%2018.7071%2022.7124%2018.8573%2022.244C19.0076%2021.7757%2019.0563%2021.2811%2019%2020.7929V5.79246L26.001%202Z%22%20fill%3D%22%230D67FE%22%2F%3E%3C%2Fsvg%3E",getPackage:q,connector:(e,t)=>h(void 0,void 0,void 0,(function*(){var n;return(yield q()).default(Object.assign(Object.assign({},e),{uAuthParams:Object.assign(Object.assign({walletConnect:()=>WO.connector?WO.connector(e,t):Promise.resolve(void 0)},e.uAuthParams),{clientID:null===(n=e.uAuthParams)||void 0===n?void 0:n.clientID})}),t)})),disconnect:()=>h(void 0,void 0,void 0,(function*(){const{disconnectWallet:e}=yield q();yield e()}))},YO={type:exports.WalletType.Blocto,showName:"Blocto",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_6352_198251%29%22%3E%3Cpath%20d%3D%22M16.9525%208.20174C13.9447%208.20174%2011.0089%209.36148%208.81418%2011.4188C6.40695%2013.6759%204.88354%2017.0092%204.0103%2020.1448C3.43835%2022.1957%203.15186%2024.3238%203.15186%2026.4541C3.15186%2027.0979%203.17829%2027.7364%203.22903%2028.3676C3.2914%2029.1351%204.03884%2029.6669%204.7831%2029.466C5.43222%2029.2916%206.11517%2029.1975%206.81926%2029.1975C8.2655%2029.1975%209.62082%2029.5908%2010.7827%2030.2779C10.8112%2030.2948%2010.8387%2030.3118%2010.8672%2030.3276C12.7554%2031.4535%2014.9829%2032.072%2017.3584%2031.9927C23.5546%2031.7876%2028.6165%2026.7459%2028.8448%2020.5507C29.0943%2013.7731%2023.6751%208.20068%2016.9535%208.20068L16.9525%208.20174ZM16.9525%2025.5386C13.949%2025.5386%2011.5143%2023.1039%2011.5143%2020.1014C11.5143%2017.099%2013.949%2014.6633%2016.9525%2014.6633C19.9559%2014.6633%2022.3907%2017.098%2022.3907%2020.1014C22.3907%2023.1049%2019.9559%2025.5386%2016.9525%2025.5386Z%22%20fill%3D%22%2314AAFF%22%2F%3E%3Cpath%20d%3D%22M12.0604%204.45499C12.0604%206.0228%2011.239%207.47749%209.89%208.27672C9.04318%208.77888%208.24923%209.37197%207.53034%2010.0475C5.93504%2011.5424%204.74464%2013.3766%203.86294%2015.195C3.6885%2015.5523%203.15039%2015.4254%203.15039%2015.0279V4.45499C3.15039%201.99491%205.14531%200%207.6054%200C10.0655%200%2012.0604%201.99491%2012.0604%204.45499Z%22%20fill%3D%22%230077FF%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6352_198251%22%3E%3Crect%20width%3D%2225.7025%22%20height%3D%2232%22%20fill%3D%22white%22%20transform%3D%22translate%283.1499%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportChains:[exports.ChainId.MAINNET,exports.ChainId.GOERLI,exports.ChainId.BSC,exports.ChainId.POLYGON,exports.ChainId.ARBITRUM_ONE,exports.ChainId.AVALANCHE,exports.ChainId.OPTIMISM,exports.ChainId.SCROLL],supportMobile:!0,link:"https://blocto.io/",getPackage:K,connector:re,mobileDeepLink:"https://blocto.app/link?url=$APP_URL",injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isBlocto},disabled:()=>!1,switchChain:e=>{var t;return M(Object.assign(Object.assign({},e),{provider:null!==(t=e.provider)&&void 0!==t?t:D.getState().provider}))},needReadProvider:!0},XO={type:exports.WalletType.Rainbow,showName:"Rainbow",logo:"data:image/svg+xml,%3Csvg%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23a%29%22%3E%3Cpath%20d%3D%22M26%200H6a6%206%200%200%200-6%206v20a6%206%200%200%200%206%206h20a6%206%200%200%200%206-6V6a6%206%200%200%200-6-6z%22%20fill%3D%22url%28%23b%29%22%2F%3E%3Cpath%20d%3D%22M5.333%2010.133h1.6c8.248%200%2014.934%206.686%2014.934%2014.934v1.6h3.2a1.6%201.6%200%200%200%201.6-1.6c0-10.899-8.835-19.733-19.734-19.733a1.6%201.6%200%200%200-1.6%201.6v3.2z%22%20fill%3D%22url%28%23c%29%22%2F%3E%3Cpath%20d%3D%22M22.4%2025.067h4.267a1.6%201.6%200%200%201-1.6%201.6H22.4v-1.6z%22%20fill%3D%22url%28%23d%29%22%2F%3E%3Cpath%20d%3D%22M6.934%205.333V9.6h-1.6V6.934a1.6%201.6%200%200%201%201.6-1.6z%22%20fill%3D%22url%28%23e%29%22%2F%3E%3Cpath%20d%3D%22M5.333%209.6h1.6c8.543%200%2015.467%206.925%2015.467%2015.467v1.6h-4.8v-1.6c0-5.891-4.776-10.667-10.667-10.667h-1.6V9.6z%22%20fill%3D%22url%28%23f%29%22%2F%3E%3Cpath%20d%3D%22M18.133%2025.067H22.4v1.6h-4.267v-1.6z%22%20fill%3D%22url%28%23g%29%22%2F%3E%3Cpath%20d%3D%22M5.333%2013.867V9.6h1.6v4.267h-1.6z%22%20fill%3D%22url%28%23h%29%22%2F%3E%3Cpath%20d%3D%22M5.333%2016.533a1.6%201.6%200%200%200%201.6%201.6%206.933%206.933%200%200%201%206.934%206.934%201.6%201.6%200%200%200%201.6%201.6h2.667v-1.6c0-6.186-5.015-11.2-11.2-11.2h-1.6v2.666z%22%20fill%3D%22url%28%23i%29%22%2F%3E%3Cpath%20d%3D%22M13.867%2025.067h4.266v1.6h-2.666a1.6%201.6%200%200%201-1.6-1.6z%22%20fill%3D%22url%28%23j%29%22%2F%3E%3Cpath%20d%3D%22M6.934%2018.133a1.6%201.6%200%200%201-1.6-1.6v-2.666h1.6v4.266z%22%20fill%3D%22url%28%23k%29%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CradialGradient%20id%3D%22f%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22rotate%28-90%2016%209.067%29%20scale%2815.4667%29%22%3E%3Cstop%20offset%3D%22.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%3CradialGradient%20id%3D%22c%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22rotate%28-90%2016%209.067%29%20scale%2819.7333%29%22%3E%3Cstop%20offset%3D%22.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%3CradialGradient%20id%3D%22i%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22rotate%28-90%2016%209.067%29%20scale%2811.2%29%22%3E%3Cstop%20offset%3D%22.595%22%20stop-color%3D%22%230AF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22j%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22matrix%284.53333%200%200%2012.0889%2013.6%2025.867%29%22%3E%3Cstop%20stop-color%3D%22%230AF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22k%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22matrix%280%20-4.53333%2085.9653%200%206.133%2018.4%29%22%3E%3Cstop%20stop-color%3D%22%230AF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%22g%22%20x1%3D%2218.133%22%20y1%3D%2225.867%22%20x2%3D%2222.4%22%20y2%3D%2225.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%22h%22%20x1%3D%226.133%22%20y1%3D%2213.867%22%20x2%3D%226.133%22%20y2%3D%229.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%3ClinearGradient%20id%3D%22e%22%20x1%3D%226.133%22%20y1%3D%225.333%22%20x2%3D%226.133%22%20y2%3D%229.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%3ClinearGradient%20id%3D%22b%22%20x1%3D%2216%22%20y1%3D%220%22%20x2%3D%2216%22%20y2%3D%2232%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%3ClinearGradient%20id%3D%22d%22%20x1%3D%2222.133%22%20y1%3D%2225.867%22%20x2%3D%2226.667%22%20y2%3D%2225.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%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h32v32H0z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://rainbow.me",getPackage:J,connector:(e,t)=>oe(e,t),needReadProvider:!0},QO={type:exports.WalletType.trust,showName:"TrustWallet",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_4548_1929%29%22%3E%3Cpath%20d%3D%22M0%208.125C0%203.63769%203.63769%200%208.125%200H23.875C28.3623%200%2032%203.63769%2032%208.125V23.875C32%2028.3623%2028.3623%2032%2023.875%2032H8.125C3.63769%2032%200%2028.3623%200%2023.875V8.125Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M16.0094%206.71875C19.2381%209.41525%2022.9407%209.24894%2023.9985%209.24894C23.7671%2024.5846%2022.004%2021.5436%2016.0094%2025.8438C10.0147%2021.5436%208.26266%2024.5846%208.03125%209.24894C9.07809%209.24894%2012.7807%209.41525%2016.0094%206.71875Z%22%20stroke%3D%22%233375BB%22%20stroke-width%3D%222.1875%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_4548_1929%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",link:"https://trustwallet.com/",supportMobile:!0,supportExtension:!0,mobileDeepLink:"https://link.trustwallet.com/open_url?url=$APP_URL",injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isTrust},disabled:()=>{var e;return!((null===(e=window.ethereum)||void 0===e?void 0:e.isTrust)||window.trustWallet)},connector:(e,t)=>_(window.trustWallet,t),switchChain:e=>M(Object.assign(Object.assign({},e),{provider:e.provider||window.trustWallet}))},eF={type:exports.WalletType.tokenPocket,showName:"TokenPocket",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_4319_127796%29%22%3E%3Cmask%20id%3D%22mask0_4319_127796%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2232%22%20height%3D%2232%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%22%23C4C4C4%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_4319_127796%29%22%3E%3Cpath%20d%3D%22M32.5475%200H-0.84375V32H32.5475V0Z%22%20fill%3D%22%232980FE%22%2F%3E%3Cpath%20d%3D%22M12.7124%2013.7077H12.7165C12.7124%2013.6831%2012.7124%2013.6544%2012.7124%2013.6299V13.7077Z%22%20fill%3D%22%2329AEFF%22%2F%3E%3Cpath%20d%3D%22M20.8626%2014.4854H16.3515V22.6273C16.3515%2023.0121%2016.6626%2023.3232%2017.0474%2023.3232H20.1667C20.5515%2023.3232%2020.8626%2023.0121%2020.8626%2022.6273V14.4854Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M14.1738%208.65625H14.0224H5.94591C5.56109%208.65625%205.25%208.96734%205.25%209.35216V12.1767C5.25%2012.5615%205.56109%2012.8726%205.94591%2012.8726H7.84119H8.59441V13.7076V22.6478C8.59441%2023.0327%208.9055%2023.3438%209.29028%2023.3438H12.254C12.6388%2023.3438%2012.9499%2023.0327%2012.9499%2022.6478V13.7076V13.6299V12.8726H13.7031H14.0101H14.1616C15.3241%2012.8726%2016.2697%2011.927%2016.2697%2010.7644C16.282%209.60184%2015.3364%208.65625%2014.1738%208.65625Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M20.8667%2014.4854V20.1671C21.0223%2020.204%2021.1819%2020.2326%2021.3457%2020.2572C21.5749%2020.2899%2021.8123%2020.3104%2022.0497%2020.3145C22.062%2020.3145%2022.0743%2020.3145%2022.0907%2020.3145V15.7953C21.4071%2015.7502%2020.8667%2015.1812%2020.8667%2014.4854Z%22%20fill%3D%22url%28%23paint0_linear_4319_127796%29%22%2F%3E%3Cpath%20d%3D%22M22.1807%208.65625C18.9632%208.65625%2016.3515%2011.2679%2016.3515%2014.4854C16.3515%2017.2526%2018.2796%2019.5695%2020.8667%2020.1672V14.4854C20.8667%2013.7608%2021.4561%2013.1714%2022.1807%2013.1714C22.9052%2013.1714%2023.4947%2013.7608%2023.4947%2014.4854C23.4947%2015.0953%2023.0813%2015.607%2022.5163%2015.7544C22.4099%2015.783%2022.2953%2015.7994%2022.1807%2015.7994V20.3146C22.2953%2020.3146%2022.4058%2020.3105%2022.5163%2020.3064C25.5783%2020.1303%2028.0098%2017.5924%2028.0098%2014.4854C28.0139%2011.2679%2025.4023%208.65625%2022.1807%208.65625Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M22.1806%2020.3147V15.7995C22.1479%2015.7995%2022.1193%2015.7995%2022.0865%2015.7954V20.3147C22.1193%2020.3147%2022.152%2020.3147%2022.1806%2020.3147Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_4319_127796%22%20x1%3D%2222.1826%22%20y1%3D%2217.4008%22%20x2%3D%2220.8673%22%20y2%3D%2217.4008%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_4319_127796%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",link:"https://www.tokenpocket.pro/",supportMobile:!0,supportExtension:!0,mobileDeepLink:`tpdapp://open?params=${encodeURI('{\n "url": "$APP_URL"\n }')}`,injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isTokenPocket},disabled:()=>{var e,t;return!((null===(e=window.tokenpocket)||void 0===e?void 0:e.ethereum)||(null===(t=window.ethereum)||void 0===t?void 0:t.isTokenPocket))},connector:(e,t)=>{var n;return _(null===(n=window.tokenpocket)||void 0===n?void 0:n.ethereum,t)},switchChain:e=>{var t;return M(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.tokenpocket)||void 0===t?void 0:t.ethereum)}))}},tF={type:exports.WalletType.Cyber,showName:"CyberWallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M16%2032c8.837%200%2016-7.163%2016-16S24.837%200%2016%200%200%207.163%200%2016s7.163%2016%2016%2016z%22%20fill%3D%22%23000%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22m19.65%2016.663%205.432%205.33a.684.684%200%200%201%20.208.482.672.672%200%200%201-.2.485l-.4.39a.706.706%200%200%201-1.004.019l-6.634-6.509a1.214%201.214%200%200%201-.364-.86%201.195%201.195%200%200%201%20.364-.861l6.634-6.509a.697.697%200%200%201%20.493-.2.708.708%200%200%201%20.492.2l.411.41a.681.681%200%200%201%20.204.483.672.672%200%200%201-.204.483l-5.433%205.332a.932.932%200%200%200%200%201.325zm-7.3-1.32-5.431-5.331a.681.681%200%200%201-.21-.485.672.672%200%200%201%20.204-.487l.397-.39a.75.75%200%200%201%20.422-.214.711.711%200%200%201%20.583.194l6.632%206.51a1.215%201.215%200%200%201%20.364.86%201.197%201.197%200%200%201-.364.86l-6.632%206.51a.7.7%200%200%201-.493.2.708.708%200%200%201-.493-.2l-.41-.404a.684.684%200%200%201-.205-.484A.673.673%200%200%201%206.92%2022l5.43-5.33a.932.932%200%200%200%200-1.326z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E",link:"https://wallet.cyber.co",disabled:()=>h(void 0,void 0,void 0,(function*(){return!(yield(yield Y()).getIsCyber())})),getPackage:Y,connector:(e,t)=>ce(e,t),supportChains:Wt,switchChain:e=>h(void 0,void 0,void 0,(function*(){const{switchChain:t}=yield Y();return t(e)})),notSupported:{sign:!0,personalSign:!0,signTypedData:!0,estimateGas:!0},isContractWallet:()=>!0,needReadProvider:!0},nF={type:exports.WalletType.uniPass,showName:"UniPass",logo:"data:image/svg+xml,%3Csvg%20width%3D%22400%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cdefs%3E%3ClinearGradient%20x1%3D%220%25%22%20y1%3D%22.013%25%22%20x2%3D%22100%25%22%20y2%3D%2299.987%25%22%20id%3D%22a%22%3E%3Cstop%20stop-color%3D%22%23398BFF%22%20offset%3D%220%25%22%2F%3E%3Cstop%20stop-color%3D%22%238864FF%22%20offset%3D%22100%25%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M0%200h400v400H0z%22%2F%3E%3Cpath%20d%3D%22M184%20386c39.102-50.29%20104.337-72.556%20166.027-56.667l2.053.534-1.413%201.6a196.08%20196.08%200%200%201-13.653%2014.16l-.48.453h-.667c-51.63-9.606-104.31%2010.354-136.613%2051.76l-.827%201.093-.773%201.014h-.64a207.856%20207.856%200%200%201-19.68-1.254l-2.107-.24%201.173-1.786c2.267-3.68%204.934-7.28%207.6-10.667zm127.913-25.44h.994l2.08.027h3.973l-3.226%202.293a200%20200%200%200%201-90.667%2035.467l-3.92.48L224%20396.16a127.413%20127.413%200%200%201%2088.907-35.6zm-45.54-67.867a9.6%209.6%200%200%201%2011.547%208.32v-.266a9.573%209.573%200%200%201-7.52%2010.506%20170.667%20170.667%200%200%200-98.933%2062.32%20176.8%20176.8%200%200%200-13.813%2020.694l-.48.853-.934-.213c-5.6-1.254-11.306-2.747-16.64-4.48l-1.573-.507.747-1.387a193.333%20193.333%200%200%201%2017.466-26.666%20189.493%20189.493%200%200%201%2098.854-66.507%20449.129%20449.129%200%200%201%2011.28-2.667zm-19.013-33.146a224.747%20224.747%200%200%201%20139.44%208.48l1.174.48-.427%201.2a202.467%20202.467%200%200%201-6.533%2015.493l-.507%201.12-1.147-.453c-84.027-33.289-179.941-7.231-235.573%2064a205.653%20205.653%200%200%200-21.12%2033.28l-.56%201.093-1.12-.507c-5.12-2.186-10.213-4.613-15.147-7.28l-1.12-.613.56-1.12A225.067%20225.067%200%200%201%20128.56%20338a220.48%20220.48%200%200%201%20118.8-78.453zM95.968%20326.485a9.68%209.68%200%200%201%207.792%202.768v.054a9.707%209.707%200%200%201%201.2%2012.186%20239.147%20239.147%200%200%200-14.053%2024.427l-.64%201.333-1.253-.826a210.562%20210.562%200%200%201-13.734-10.054l-.826-.666.48-.96a253.333%20253.333%200%200%201%2013.946-24%209.68%209.68%200%200%201%207.088-4.262zm36.14-93.312.666.24a77.893%2077.893%200%200%200%2022.133%204.8l3.947.267-3.334%202.133a266.107%20266.107%200%200%200-66.986%2061.254%20270.187%20270.187%200%200%200-26.187%2040.746l-.8%201.547-1.253-1.227c-4.134-4.08-8.267-8.453-12.134-12.96l-.586-.693.426-.773a288.747%20288.747%200%200%201%2083.547-94.934l.56-.4zm-22.614%2070.267c71.023-81.735%20186-109.557%20286.533-69.333l.987.48-.187%201.04c-.267%201.493-.533%202.96-.827%204.426a207.15%20207.15%200%200%201-2.88%2012.214l-.4%201.44-1.36-.587a231.733%20231.733%200%200%200-89.493-17.84c-9.877.003-19.745.617-29.547%201.84a233.2%20233.2%200%200%200-148.24%2079.093%209.653%209.653%200%200%201-14.133.56l-.207-.21a9.707%209.707%200%200%201-.246-13.123zm190.746-15.067a190.347%20190.347%200%200%201%2071.494%2011.094l1.493.533-.8%201.36a197.736%20197.736%200%200%201-9.413%2014.48l-.587.827-.907-.32a171.333%20171.333%200%200%200-54.213-8.747h-6.213a9.68%209.68%200%200%201-10-8.56l-.03-.33a9.627%209.627%200%200%201%209.176-10.337zm-199.706-77.76.8%201.014a80.613%2080.613%200%200%200%2012.24%2011.306l1.386%201.014-1.36%201.04v-.187a301.707%20301.707%200%200%200-76.4%2088l-1.04%201.787-1.173-1.707c-3.573-5.093-6.933-10.533-9.973-16l-.374-.667.4-.666A329.733%20329.733%200%200%201%2045.467%20266a320.4%20320.4%200%200%201%2054.107-54.64l.96-.747zm-59.865%209.083a9.68%209.68%200%200%201%207.118%202.81h-.053a9.68%209.68%200%200%201%20.32%2013.334%20306.672%20306.672%200%200%200-15.094%2018.027%20346.667%20346.667%200%200%200-15.813%2022.16l-1.36%202.08-.933-2.294a203.6%20203.6%200%200%201-6.907-19.733l-.187-.613.374-.507c3.2-4.507%206.426-8.88%209.6-12.96a382.827%20382.827%200%200%201%2016-19.067%209.68%209.68%200%200%201%206.935-3.237zM82.08%20133.28v23.147l-.533.373a362.453%20362.453%200%200%200-76.213%2073.067l-2.667%203.36-.48-3.014a198.16%20198.16%200%200%201-2.187-24v-.506l.427-.427a377.787%20377.787%200%200%201%2079.627-70.667l2.026-1.333zM263.174%20182a285.707%20285.707%200%200%201%20135.973%2016.027l.853.32V200c0%205.547-.24%2011.28-.72%2017.013l-.16%201.76-1.626-.666a262.667%20262.667%200%200%200-98.427-18.987%20269.333%20269.333%200%200%200-75.333%2010.667l-3.814%201.093%202.427-3.147a78.107%2078.107%200%200%200%2011.04-19.84l.267-.64.666-.16A289.173%20289.173%200%200%201%20263.174%20182zm-179.307-5.04.48%201.92a76.667%2076.667%200%200%200%205.92%2016.16l.4.96-.827.64a319.494%20319.494%200%200%200-19.466%2016.587%209.707%209.707%200%200%201-13.334-.24l-.228-.237a9.653%209.653%200%200%201%20.548-13.71%20343.968%20343.968%200%200%201%2024.907-20.88l1.6-1.2zm296.372-18.366a9.653%209.653%200%200%201%208.215-1.207c3.6%201.093%207.146%202.24%2010.666%203.466l.827.32v20.507l-1.76-.64a294.87%20294.87%200%200%200-15.387-5.173%209.68%209.68%200%200%201-6.8-10.134l.034-.309a9.653%209.653%200%200%201%204.205-6.83zM73.28%2094.987l.72.96a40.373%2040.373%200%200%201%207.174%2016l.186.8-.773.48a388.16%20388.16%200%200%200-78.32%2063.946L0%20179.547v-27.6l.4-.347a407.653%20407.653%200%200%201%2071.867-56l1.013-.613zm183.12%2051.12a315.6%20315.6%200%200%201%2099.147%203.066%209.627%209.627%200%200%201%207.733%2010.4v.08a9.653%209.653%200%200%201-11.386%208.587%20295.413%20295.413%200%200%200-55.627-5.333c-12.48.016-24.949.8-37.333%202.346a320.456%20320.456%200%200%200-19.12%203.014l-1.68.346v-1.733c.293-2.293.293-4.533.293-6.667V148.96l1.093-.187a239.7%20239.7%200%200%201%2016.88-2.666zm-6.746-35.92a345.52%20345.52%200%200%201%20149.44%2013.76l.906.293v20.293l-1.733-.586a325.547%20325.547%200%200%200-104.773-17.254%20332.934%20332.934%200%200%200-41.467%202.667c-3.653.453-7.493%201.013-12.08%201.76l-1.52.24v-19.573l1.12-.16a381.79%20381.79%200%200%201%2010.107-1.44zM41.04%2079.44l.683.005a40.99%2040.99%200%200%201%2014.597%202.928l2.374.96-2.16%201.36A419.493%20419.493%200%200%200%202.187%20126L0%20127.947v-7.467a40.615%2040.615%200%200%201%208.8-25.387A40.8%2040.8%200%200%201%2041.04%2079.44zm201.84-5.147a379.013%20379.013%200%200%201%20145.307%209.894c3.28.88%206.827%201.893%2010.88%203.12l.907.266v20.107l-1.707-.533a357.573%20357.573%200%200%200-107.6-16.534%20365.6%20365.6%200%200%200-45.333%202.854l-4.027.533-2.827.4V80.747c0-1.494.16-3.04.16-4.8V74.88l2.347-.32zm55.676-38.936.271.003a409.333%20409.333%200%200%201%2094.08%2013.627l.613.16.267.586a81.413%2081.413%200%200%201%205.333%2019.04l.24%202.214-1.946-.56a390.278%20390.278%200%200%200-8.987-2.534%20392.187%20392.187%200%200%200-90.08-13.12%209.653%209.653%200%200%201-9.36-10.666l.03-.27a9.653%209.653%200%200%201%209.81-8.477zm-33.222.456a9.68%209.68%200%200%201%2010.16%2010.534h.106a9.627%209.627%200%200%201-9.12%208.72c-7.466.426-14.96%201.04-22.426%201.866l-2.027.214.64-1.92a82.453%2082.453%200%200%201%208.32-17.974l.347-.533H252c4.507-.373%208.934-.693%2013.334-.907zM319.44%200a80.693%2080.693%200%200%201%2060%2026.667l2.667%203.04-4-.907a422.453%20422.453%200%200%200-93.333-10.453c-4.4%200-8.88.08-13.334.266h-4.106l3.28-2.4a80.16%2080.16%200%200%201%2044.4-16.08C316.56%200%20318%200%20319.44%200z%22%20fill%3D%22url%28%23a%29%22%20fill-rule%3D%22nonzero%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://unipass.id",supportChains:an,getPackage:X,connector:(e,t)=>le(e,t),disconnect:()=>h(void 0,void 0,void 0,(function*(){const{disconnectWallet:e}=yield X();yield e()})),notSupported:{sign:!0},contract:{signTypedData:({typedData:e})=>h(void 0,void 0,void 0,(function*(){const{signTypedData:t}=yield X();return t(e)}))},switchChain:e=>h(void 0,void 0,void 0,(function*(){const{switchChain:t}=yield X();return yield t(e),{result:!0}})),isContractWallet:()=>!0,needReadProvider:!0},rF={type:exports.WalletType.Gate,showName:"Gate 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%3Cpath%20d%3D%22M16%2024.8C13.6661%2024.8%2011.4278%2023.8729%209.77746%2022.2225C8.12714%2020.5722%207.2%2018.3339%207.2%2016C7.2%2013.6661%208.12714%2011.4278%209.77746%209.77746C11.4278%208.12714%2013.6661%207.2%2016%207.2V0C12.8355%200%209.74206%200.938382%207.11088%202.69648C4.47969%204.45459%202.42893%206.95345%201.21793%209.87707C0.00693105%2012.8007%20-0.30992%2016.0177%200.307443%2019.1214C0.924807%2022.2251%202.44865%2025.0761%204.68629%2027.3137C6.92393%2029.5513%209.77486%2031.0752%2012.8786%2031.6926C15.9823%2032.3099%2019.1993%2031.9931%2022.1229%2030.7821C25.0466%2029.5711%2027.5454%2027.5203%2029.3035%2024.8891C31.0616%2022.2579%2032%2019.1645%2032%2016H24.8C24.8%2018.3339%2023.8729%2020.5722%2022.2225%2022.2225C20.5722%2023.8729%2018.3339%2024.8%2016%2024.8Z%22%20fill%3D%22%232354E6%22%2F%3E%3Cpath%20d%3D%22M24.8%207.19995H16V15.9999H24.8V7.19995Z%22%20fill%3D%22%2317E6A1%22%2F%3E%3C%2Fsvg%3E",supportMobile:!1,link:"https://chromewebstore.google.com/detail/gate-wallet/cpmkedoipcpimgecpmgpldfpohjplkpp",disabled:()=>!window.gatewallet,connector:(e,t)=>_(window.gatewallet,t),switchChain:e=>M(Object.assign(Object.assign({},e),{provider:e.provider||window.gatewallet}))},aF={type:exports.WalletType.Rabby,showName:"Rabby Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M29.322%2017.687c1.057-2.37-4.17-8.991-9.163-11.75-3.148-2.137-6.427-1.843-7.092-.905-1.457%202.06%204.828%203.804%209.03%205.84-.903.394-1.754%201.1-2.255%202.004-1.567-1.716-5.006-3.194-9.042-2.004-2.72.803-4.98%202.694-5.853%205.551a1.715%201.715%200%200%200-2.406%201.57c0%20.95.766%201.718%201.711%201.718.176%200%20.724-.117.724-.117l8.756.063c-3.502%205.574-6.27%206.389-6.27%207.355%200%20.965%202.648.703%203.643.344%204.759-1.724%209.87-7.094%2010.748-8.64%203.684.461%206.78.516%207.469-1.03z%22%20fill%3D%22url%28%23a%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.098%2010.872c.195-.077.164-.365.11-.592-.123-.521-2.244-2.623-4.237-3.565-2.714-1.283-4.713-1.216-5.009-.625.553%201.137%203.117%202.205%205.794%203.32%201.142.476%202.305.96%203.342%201.462z%22%20fill%3D%22url%28%23b%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.652%2022.318c-.549-.21-1.169-.404-1.874-.58.752-1.349.91-3.347.2-4.61-.997-1.773-2.247-2.717-5.154-2.717-1.598%200-5.902.54-5.979%204.145-.008.379%200%20.725.027%201.044l7.86.057c-1.06%201.687-2.052%202.938-2.92%203.889%201.042.268%201.903.493%202.693.7.75.196%201.436.376%202.155.56a32.759%2032.759%200%200%200%202.992-2.488z%22%20fill%3D%22url%28%23c%29%22%2F%3E%3Cpath%20d%3D%22M4.842%2019.23c.32%202.738%201.872%203.81%205.042%204.128%203.17.318%204.987.105%207.408.326%202.022.184%203.827%201.218%204.496.861.603-.321.266-1.483-.54-2.228-1.046-.966-2.493-1.638-5.038-1.876.507-1.394.365-3.348-.423-4.41-1.14-1.538-3.242-2.233-5.903-1.93-2.78.318-5.445%201.691-5.042%205.128z%22%20fill%3D%22url%28%23d%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22a%22%20x1%3D%2210.483%22%20y1%3D%2215.588%22%20x2%3D%2229.103%22%20y2%3D%2220.851%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%22b%22%20x1%3D%2225.961%22%20y1%3D%2215.233%22%20x2%3D%2212.487%22%20y2%3D%221.771%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%22c%22%20x1%3D%2219.026%22%20y1%3D%2222.788%22%20x2%3D%226.105%22%20y2%3D%2215.384%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%22d%22%20x1%3D%2211.594%22%20y1%3D%2215.448%22%20x2%3D%2220.35%22%20y2%3D%2226.536%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238898FF%22%2F%3E%3Cstop%20offset%3D%22.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)=>_(window.rabby,t),switchChain:e=>M(Object.assign(Object.assign({},e),{provider:e.provider||window.rabby}))},sF={type:exports.WalletType.SocialLogin,showName:"Social Login",logo:"data:image/svg+xml,%3Csvg%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.833%2012.667c-.32%200-.595-.115-.824-.343a1.123%201.123%200%200%201-.342-.824v-7c0-.32.114-.596.342-.824.229-.228.503-.343.824-.343h9.334c.32%200%20.595.115.824.343.228.228.342.503.342.824v7c0%20.32-.114.595-.342.824a1.123%201.123%200%200%201-.825.343H2.833zM7.5%208.583l4.666-2.916V4.5L7.5%207.417%202.833%204.5v1.167L7.5%208.583z%22%20fill%3D%22%23fff%22%2F%3E%3Cpath%20d%3D%22M30.5%208c0-3.867-3.133-7-7-7a6.999%206.999%200%200%200-1.691%2013.793v-4.654h-1.445V8h1.445v-.921c0-2.383%201.078-3.486%203.416-3.486.442%200%201.21.087%201.52.173v1.938a9.28%209.28%200%200%200-.809-.025c-1.148%200-1.59.434-1.59%201.565V8h2.287l-.392%202.14h-1.893v4.81A7.003%207.003%200%200%200%2030.5%208z%22%20fill%3D%22%230866FF%22%2F%3E%3Cpath%20d%3D%22M26.241%2010.14%2026.633%208h-2.288v-.756c0-1.131.443-1.565%201.59-1.565.356%200%20.645.008.81.025V3.766c-.314-.086-1.078-.173-1.52-.173-2.338%200-3.416%201.103-3.416%203.486V8h-1.445v2.14h1.445v4.653a7.012%207.012%200%200%200%202.54.157v-4.81h1.892z%22%20fill%3D%22%23fff%22%2F%3E%3Cpath%20d%3D%22M13.66%2024.146c0-.455-.04-.893-.117-1.313H7.5v2.485h3.453a2.958%202.958%200%200%201-1.289%201.931v1.616h2.083c1.213-1.12%201.913-2.765%201.913-4.72z%22%20fill%3D%22%234285F4%22%2F%3E%3Cpath%20d%3D%22M7.5%2030.417c1.732%200%203.185-.572%204.246-1.552l-2.082-1.616c-.572.385-1.3.619-2.164.619-1.669%200-3.086-1.126-3.594-2.643H1.771v1.657A6.41%206.41%200%200%200%207.5%2030.417z%22%20fill%3D%22%2334A853%22%2F%3E%3Cpath%20d%3D%22M3.907%2025.22A3.845%203.845%200%200%201%203.703%2024c0-.426.076-.834.204-1.22v-1.656H1.772A6.338%206.338%200%200%200%201.083%2024c0%201.038.251%202.012.689%202.876l1.662-1.295.473-.362z%22%20fill%3D%22%23FBBC05%22%2F%3E%3Cpath%20d%3D%22M7.5%2020.138c.945%200%201.785.327%202.456.957l1.837-1.837c-1.114-1.039-2.56-1.675-4.293-1.675a6.405%206.405%200%200%200-5.729%203.541l2.135%201.657c.508-1.517%201.925-2.643%203.594-2.643z%22%20fill%3D%22%23EA4335%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M25.934%2026.025c-.428.045-.775-.122-1.041-.433-.351-.411-.436-.88-.253-1.378.167-.455.493-.755%201.002-.845.577-.102%201.176.269%201.38.851.055.155.079.317.085.437-.004.729-.5%201.296-1.173%201.368zm-3.953-.303c-.503.44-1.21.41-1.686-.059a1.382%201.382%200%200%201%20.023-1.972%201.247%201.247%200%200%201%201.936.299c.125.218.189.453.187.75-.008.355-.147.709-.46.982zm8.469-.275c-.17-1.943-.872-3.703-2.008-5.311a.466.466%200%200%200-.196-.177%2011.786%2011.786%200%200%200-2.628-.766c-.12-.02-.182.02-.23.116-.071.142-.152.28-.22.423-.05.11-.129.14-.247.124a10.768%2010.768%200%200%200-2.871-.001c-.112.015-.186-.013-.232-.117-.053-.118-.125-.227-.175-.346-.073-.173-.184-.226-.383-.187-.83.164-1.637.4-2.42.712a.74.74%200%200%200-.352.285c-1.094%201.603-1.785%203.343-1.95%205.261-.053.617-.048%201.233.002%201.85.009.115.026.225.142.305%201%20.679%202.084%201.196%203.251%201.555.11.034.182.01.248-.08a9.47%209.47%200%200%200%20.569-.874c.063-.11.039-.165-.081-.21a5.65%205.65%200%200%201-.809-.363c-.062-.035-.187-.05-.15-.143a.28.28%200%200%201%20.27-.174c.051.001.103.032.153.052%202.085.829%204.19.894%206.315.147.16-.056.314-.125.473-.183.106-.04.307.04.335.14.033.123-.091.135-.163.173-.25.132-.507.252-.776.346-.126.044-.16.105-.089.223.17.282.346.561.54.83.084.114.176.138.312.096a12.262%2012.262%200%200%200%203.191-1.516c.104-.07.16-.152.168-.272l.061-.987c-.017-.327-.024-.63-.05-.931z%22%20fill%3D%22%235A6AEF%22%2F%3E%3C%2Fsvg%3E",supportMobile:!0,getPackage:te,connector:pe,switchChain:e=>h(void 0,void 0,void 0,(function*(){return(yield te()).switchChain(e)})),disconnect:()=>h(void 0,void 0,void 0,(function*(){return(yield te()).disconnect()}))},iF={type:exports.WalletType.Alchemy,showName:"Alchemy",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%3Cpath%20d%3D%22M26.6217%2019.7984L16.4955%202.58184C16.4465%202.49682%2016.3754%202.42601%2016.2896%202.37654C16.2038%202.32706%2016.1062%202.30068%2016.0067%202.30006C15.9072%202.29944%2015.8093%202.32459%2015.7228%202.37298C15.6364%202.42137%2015.5645%202.49129%2015.5144%202.57568L12.4817%207.73449C12.3823%207.90335%2012.3301%208.09491%2012.3301%208.28992C12.3301%208.48491%2012.3823%208.67646%2012.4817%208.84535L19.0846%2020.0769C19.184%2020.2459%2019.3271%2020.3862%2019.4993%2020.4837C19.6715%2020.5813%2019.8669%2020.6325%2020.0657%2020.6323H26.1311C26.2304%2020.632%2026.3279%2020.6061%2026.4138%2020.5573C26.4997%2020.5084%2026.5711%2020.4383%2026.6207%2020.3539C26.6704%2020.2694%2026.6966%2020.1737%2026.6967%2020.0762C26.6969%2019.9788%2026.671%2019.883%2026.6217%2019.7984Z%22%20fill%3D%22url%28%23paint0_linear_8745_1983%29%22%2F%3E%3Cpath%20d%3D%22M0.0780835%2028.7964L10.2043%2011.5799C10.254%2011.4955%2010.3254%2011.4255%2010.4114%2011.3768C10.4973%2011.3281%2010.5948%2011.3025%2010.694%2011.3025C10.7933%2011.3025%2010.8908%2011.3281%2010.9768%2011.3768C11.0627%2011.4255%2011.1341%2011.4955%2011.1838%2011.5799L14.2181%2016.734C14.3174%2016.9032%2014.3697%2017.095%2014.3697%2017.2902C14.3697%2017.4855%2014.3174%2017.6773%2014.2181%2017.8464L7.61511%2029.078C7.5161%2029.247%207.37336%2029.3873%207.20136%2029.4849C7.02936%2029.5824%206.83419%2029.6336%206.63556%2029.6334H0.568641C0.468698%2029.6339%200.370413%2029.6084%200.283769%2029.5595C0.197126%2029.5106%200.125229%2029.44%200.0753857%2029.355C0.0255426%2029.2699%20-0.000469235%2029.1734%206.40786e-06%2029.0753C0.000482051%2028.9772%200.0274179%2028.881%200.0780835%2028.7964Z%22%20fill%3D%22url%28%23paint1_linear_8745_1983%29%22%2F%3E%3Cpath%20d%3D%22M11.1824%2029.6296H31.4348C31.5341%2029.6295%2031.6317%2029.6037%2031.7177%2029.5549C31.8035%2029.506%2031.875%2029.4358%2031.9245%2029.3513C31.974%2029.2668%2032%2029.1709%2032%2029.0734C32%2028.9759%2031.9737%2028.8801%2031.9239%2028.7957L28.8942%2023.6384C28.7948%2023.4694%2028.6518%2023.3291%2028.4796%2023.2315C28.3073%2023.1341%2028.1119%2023.0828%2027.9131%2023.083H14.7072C14.5084%2023.0828%2014.313%2023.1341%2014.1408%2023.2315C13.9686%2023.3291%2013.8255%2023.4694%2013.7261%2023.6384L10.6934%2028.7957C10.6436%2028.8801%2010.6173%2028.9759%2010.6172%2029.0734C10.617%2029.1709%2010.643%2029.2668%2010.6926%2029.3513C10.7422%2029.4358%2010.8135%2029.506%2010.8995%2029.5549C10.9855%2029.6037%2011.0831%2029.6295%2011.1824%2029.6296Z%22%20fill%3D%22url%28%23paint2_linear_8745_1983%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_8745_1983%22%20x1%3D%2216.0002%22%20y1%3D%224.33179%22%20x2%3D%2213.1762%22%20y2%3D%2229.6353%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_8745_1983%22%20x1%3D%2216%22%20y1%3D%224.33179%22%20x2%3D%2213.176%22%20y2%3D%2229.6353%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_8745_1983%22%20x1%3D%2216%22%20y1%3D%224.33171%22%20x2%3D%2213.176%22%20y2%3D%2229.6352%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:ne,connector:he,supportChains:TO,isContractWallet:()=>!0,contract:{signTypedData:({typedData:e})=>h(void 0,void 0,void 0,(function*(){const{signTypedData:t}=yield ne();return t(e)}))},disconnect:()=>h(void 0,void 0,void 0,(function*(){return(yield ne()).disconnect()}))},oF={type:exports.WalletType.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:[exports.ChainId.MAINNET,exports.ChainId.MANTLE,exports.ChainId.BSC,exports.ChainId.POLYGON,exports.ChainId.OPTIMISM,exports.ChainId.AVALANCHE,exports.ChainId.ARBITRUM_ONE,exports.ChainId.LINEA,exports.ChainId.MANTA],supportMobile:!0,link:"https://bybit-web3.github.io/getting-started",disabled:()=>{var e;return!(window.bybitWallet||(null===(e=window.ethereum)||void 0===e?void 0:e.isBybit))},injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isBybit},connector:(e,t)=>_(window.bybitWallet,t),switchChain:e=>M(Object.assign(Object.assign({},e),{provider:e.provider||window.bybitWallet}))};var cF=Object.freeze({__proto__:null,WalletLink:_O,ImToken:SO,Math:IO,GameStop:MO,Brave:NO,FoxWallet:BO,BSC:UO,KuCoin:RO,Coin98:jO,Frontier:LO,Ledger:GO,OpenBlock:zO,OneKey:$O,Bitkeep:HO,Nabox:qO,OKXWallet:VO,WalletConnect:WO,Portis:ZO,Gnosis:KO,UAuth:JO,Blocto:YO,Rainbow:XO,Trust:QO,TokenPocket:eF,Cyber:tF,UniPass:nF,Gate:rF,Rabby:aF,SocialLogin:sF,Alchemy:iF,Bybit:oF});const lF={type:exports.WalletType.injected,showName:"MetaMask",link:"https://metamask.io",logo:"data:image/svg+xml,%3Csvg%20height%3D%22355%22%20viewBox%3D%220%200%20397%20355%22%20width%3D%22397%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20transform%3D%22translate%28-1%20-1%29%22%3E%3Cpath%20d%3D%22m114.622644%20327.195472%2052.004717%2013.810198v-18.05949l4.245283-4.249292h29.716982v21.246459%2014.872523h-31.839624l-39.268868-16.997169z%22%20fill%3D%22%23cdbdb2%22%2F%3E%3Cpath%20d%3D%22m199.528305%20327.195472%2050.943397%2013.810198v-18.05949l4.245283-4.249292h29.716981v21.246459%2014.872523h-31.839623l-39.268868-16.997169z%22%20fill%3D%22%23cdbdb2%22%20transform%3D%22matrix%28-1%200%200%201%20483.96227%200%29%22%2F%3E%3Cpath%20d%3D%22m170.872644%20287.889523-4.245283%2035.056657%205.306604-4.249292h55.18868l6.367925%204.249292-4.245284-35.056657-8.490565-5.311615-42.452832%201.062323z%22%20fill%3D%22%23393939%22%2F%3E%3Cpath%20d%3D%22m142.216984%2050.9915022%2025.471698%2059.4900858%2011.674528%20173.158643h41.391511l12.735849-173.158643%2023.349056-59.4900858z%22%20fill%3D%22%23f89c35%22%2F%3E%3Cpath%20d%3D%22m30.7783023%20181.657226-29.71698153%2086.048161%2074.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208%208.498583z%22%20fill%3D%22%23f89d35%22%2F%3E%3Cpath%20d%3D%22m87.0283032%20191.218134%2087.0283028%202.124646-9.551886%2044.617563-41.391511-10.623229z%22%20fill%3D%22%23d87c30%22%2F%3E%3Cpath%20d%3D%22m87.0283032%20192.280457%2036.0849058%2033.994334v33.994334z%22%20fill%3D%22%23ea8d3a%22%2F%3E%3Cpath%20d%3D%22m123.113209%20227.337114%2042.452831%2010.623229%2013.79717%2045.679888-9.551886%205.311615-46.698115-27.620398z%22%20fill%3D%22%23f89d35%22%2F%3E%3Cpath%20d%3D%22m123.113209%20261.331448-8.490565%2065.864024%2056.25-39.305949z%22%20fill%3D%22%23eb8f35%22%2F%3E%3Cpath%20d%3D%22m174.056606%20193.34278%205.306604%2090.297451-15.919812-46.211049z%22%20fill%3D%22%23ea8e3a%22%2F%3E%3Cpath%20d%3D%22m74.2924539%20262.393771%2048.8207551-1.062323-8.490565%2065.864024z%22%20fill%3D%22%23d87c30%22%2F%3E%3Cpath%20d%3D%22m24.4103777%20355.878193%2090.2122663-28.682721-40.3301901-64.801701-73.23113313%205.311616z%22%20fill%3D%22%23eb8f35%22%2F%3E%3Cpath%20d%3D%22m167.688682%20110.481588-45.636793%2038.243627-35.0235858%2042.492919%2087.0283028%203.186969z%22%20fill%3D%22%23e8821e%22%2F%3E%3Cpath%20d%3D%22m114.622644%20327.195472%2056.25-39.305949-4.245283%2033.994334v19.121813l-38.207548-7.43626z%22%20fill%3D%22%23dfcec3%22%2F%3E%3Cpath%20d%3D%22m229.245286%20327.195472%2055.18868-39.305949-4.245283%2033.994334v19.121813l-38.207548-7.43626z%22%20fill%3D%22%23dfcec3%22%20transform%3D%22matrix%28-1%200%200%201%20513.679252%200%29%22%2F%3E%3Cpath%20d%3D%22m132.665096%20212.464593-11.674528%2024.433427%2041.39151-10.623229z%22%20fill%3D%22%23393939%22%20transform%3D%22matrix%28-1%200%200%201%20283.372646%200%29%22%2F%3E%3Cpath%20d%3D%22m23.349057%201.06232296%20144.339625%20109.41926504-24.410378-59.4900858z%22%20fill%3D%22%23e88f35%22%2F%3E%3Cpath%20d%3D%22m23.349057%201.06232296-19.10377392%2058.42776294%2010.61320772%2063.7393781-7.42924541%204.249292%2010.61320771%209.560906-8.49056617%207.436261%2011.67452847%2010.623229-7.4292454%206.373938%2016.9811323%2021.246459%2079.5990577-24.433428c38.915096-31.161473%2058.018869-47.096318%2057.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z%22%20fill%3D%22%238e5a30%22%2F%3E%3Cg%20transform%3D%22matrix%28-1%200%200%201%20399.056611%200%29%22%3E%3Cpath%20d%3D%22m30.7783023%20181.657226-29.71698153%2086.048161%2074.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208%208.498583z%22%20fill%3D%22%23f89d35%22%2F%3E%3Cpath%20d%3D%22m87.0283032%20191.218134%2087.0283028%202.124646-9.551886%2044.617563-41.391511-10.623229z%22%20fill%3D%22%23d87c30%22%2F%3E%3Cpath%20d%3D%22m87.0283032%20192.280457%2036.0849058%2033.994334v33.994334z%22%20fill%3D%22%23ea8d3a%22%2F%3E%3Cpath%20d%3D%22m123.113209%20227.337114%2042.452831%2010.623229%2013.79717%2045.679888-9.551886%205.311615-46.698115-27.620398z%22%20fill%3D%22%23f89d35%22%2F%3E%3Cpath%20d%3D%22m123.113209%20261.331448-8.490565%2065.864024%2055.18868-38.243626z%22%20fill%3D%22%23eb8f35%22%2F%3E%3Cpath%20d%3D%22m174.056606%20193.34278%205.306604%2090.297451-15.919812-46.211049z%22%20fill%3D%22%23ea8e3a%22%2F%3E%3Cpath%20d%3D%22m74.2924539%20262.393771%2048.8207551-1.062323-8.490565%2065.864024z%22%20fill%3D%22%23d87c30%22%2F%3E%3Cpath%20d%3D%22m24.4103777%20355.878193%2090.2122663-28.682721-40.3301901-64.801701-73.23113313%205.311616z%22%20fill%3D%22%23eb8f35%22%2F%3E%3Cpath%20d%3D%22m167.688682%20110.481588-45.636793%2038.243627-35.0235858%2042.492919%2087.0283028%203.186969z%22%20fill%3D%22%23e8821e%22%2F%3E%3Cpath%20d%3D%22m132.665096%20212.464593-11.674528%2024.433427%2041.39151-10.623229z%22%20fill%3D%22%23393939%22%20transform%3D%22matrix%28-1%200%200%201%20283.372646%200%29%22%2F%3E%3Cpath%20d%3D%22m23.349057%201.06232296%20144.339625%20109.41926504-24.410378-59.4900858z%22%20fill%3D%22%23e88f35%22%2F%3E%3Cpath%20d%3D%22m23.349057%201.06232296-19.10377392%2058.42776294%2010.61320772%2063.7393781-7.42924541%204.249292%2010.61320771%209.560906-8.49056617%207.436261%2011.67452847%2010.623229-7.4292454%206.373938%2016.9811323%2021.246459%2079.5990577-24.433428c38.915096-31.161473%2058.018869-47.096318%2057.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z%22%20fill%3D%22%238e5a30%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E",supportMobile:!0,mobileDeepLink:"https://metamask.app.link/dapp/$host",switchChain:M,disabled:()=>!1,injected:()=>window.ethereum,connector:(e,t)=>{var n;const r=D.getState().eip6963WalletList,a=null===(n=r.find((e=>e.info.rdns===Lt)))||void 0===n?void 0:n.provider,s=r.length>2;return!a||A()&&!s?de(e,t):_(a,t)}},uF=Object.assign({MetamaskWallet:lF},cF),dF=Object.values(cF),pF=Object.values(uF),hF=Object.assign(Object.assign({},zO),{disabled:()=>!1,type:exports.WalletType.openBlockIframe,connector:z}),mF=[WO.showName,lF.showName,_O.showName];function fF(e){return h(this,void 0,void 0,(function*(){const t=[],n=[],r=A();[...pF,...null!=e?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((()=>h(this,void 0,void 0,(function*(){(yield r)&&!t.includes(a)&&t.push(a)}))))}else if(e.injected){e.injected()||t.includes(a)||t.push(a)}})),yield Promise.all(n.map((e=>e()))),D.getState().setDisabledWalletKeyList(t)}))}function yF(e,t){return!e||!t||t.includes(e)}function bF({PORTIS_ID:e,chainId:t,includes:n,excludes:r,excludeNames:a,keysSort:s,mobileKeysSort:i,showAllInjected:o,afterHooks:c,extendsWalleObject:l,showNotSupport:u,eip6963WalletList:d,eip6963IgnoreIncludes:p,supportChainIds:h}={}){var m,f,y;if("undefined"==typeof window)return[];const b=A(),g=(!n||n.includes(exports.WalletType.injected))&&(!r||!r.includes(exports.WalletType.injected)),v={PORTIS_ID:e};let w,x=[],E=!1;const C=Object.assign({},uF);l&&Object.entries(l).forEach((([e,t])=>{C[e]=t}));const k=Object.values(C),T=k.filter((e=>e.type!==exports.WalletType.injected));if(g){if(b&&(dF.some((e=>!!(e.injected&&e.injected()&&yF(t,e.supportChains))&&(w=Object.assign({},e),!0))),!w&&(null==d?void 0:d.length))){const[e]=d,n=dF.find((t=>t.type===Gt[e.info.rdns])),r=zt(e);e.info.rdns!==Lt&&(n?yF(t,n.supportChains)&&(w=Object.assign(Object.assign(Object.assign({},n),r),{type:n.type,logo:n.logo})):w=r)}w||(w=lF),w.connector=null!==(f=null!==(m=w.connectorInjected)&&void 0!==m?m:w.connector)&&void 0!==f?f:(e,t)=>_(void 0,t),w.switchChain=null!==(y=w.switchChain)&&void 0!==y?y:M,x.push(w),w.injected?E=w.injected():w.disabled&&(E=!w.disabled())}const P=e=>{if(null==r?void 0:r.includes(e.type))return!1;if(null==a?void 0:a.includes(e.showName))return!1;if(e.checked&&e.type!==exports.WalletType.injected&&!e.checked(v))return!1;if(t&&e.supportChains&&!e.supportChains.includes(t))return!1;if(t&&!b&&e.supportChainsPC&&!e.supportChainsPC.includes(t))return!1;if(h&&(e.supportChains||e.supportChainsPC)){const t=h.some((t=>{var n,r;return!!(null===(n=e.supportChains)||void 0===n?void 0:n.includes(t))||!(b||!(null===(r=e.supportChainsPC)||void 0===r?void 0:r.includes(t)))}));if(!t)return!1}return!!(!n||n.includes(e.type)||p&&e.isEip6963)};if(b)E?P(WO)&&x.push(WO):k.forEach((e=>!(!P(e)||!e.supportMobile&&!u||e.showName===(null==w?void 0:w.showName))&&(x.push(e),!0)));else{let e=[];T.forEach((t=>{if(!P(t))return!1;if(!1===t.supportExtension)if(t.injected){if(!u&&!o)return!1}else if(!u)return!1;return e.push(t),!0})),x=[...x,...e]}b&&E||!(null==d?void 0:d.length)||d.forEach((e=>{const{info:t}=e,n=Gt[t.rdns],r=zt(e);let a=!1;n&&(a=x.some(((e,t)=>e.type===n&&(x.splice(t,1,Object.assign(Object.assign(Object.assign({},e),r),{type:e.type,logo:e.logo})),!0))),a||(a=dF.some((e=>e.type===n&&(P(e)&&x.push(Object.assign(Object.assign(Object.assign({},e),r),{type:e.type,logo:e.logo})),!0))))),a||x.push(r)}));const O=b&&null!=i?i:s;if(O){let e=O.map((e=>{const t=C[e];if(!t)throw new Error(`unknown key ${e}`);return t.showName}));b?E?e=[lF.showName,...e.filter((e=>e!==lF.showName))]:(e=e.filter((e=>!mF.includes(e))),e=[...mF,...e]):e.includes(lF.showName)||(e=[lF.showName,...e]),x=x.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}))}return c&&(x=c({isMobile:b,PORTIS_ID:e,chainId:t,includes:n,excludes:r,excludeNames:a,showAllInjected:o,hasInjectedWallet:E,walletList:x,showNotSupport:u})),x.forEach((e=>{e.getPackage&&e.getPackage()})),x}function gF(){return h(this,void 0,void 0,(function*(){if("undefined"!=typeof window&&window.top!==window){if(yield(yield Y()).getIsCyber())return tF;if(yield(yield H()).getIsSafe())return KO;if(yield G())return hF}}))}var vF=[{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 wF(e,t){const{account:n=e.account,calls:r,capabilities:a,chain:s=e.chain,version:i="1.0"}=t;if(!n)throw new qA({docsPath:"/experimental/eip5792/sendCalls"});const o=YT(n);if(!s)throw new $A;try{return await e.request({method:"wallet_sendCalls",params:[{calls:r.map((e=>({...e,value:e.value?vT(e.value):void 0}))),capabilities:a,chainId:vT(s.id),from:o.address,version:i}]},{retryCount:0})}catch(e){throw WA(e,{...t,account:o,chain:t.chain})}}function xF(){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:hT(e.blockNumber),gasUsed:hT(e.gasUsed),status:dO[e.status]})))??[]}}(e,t),getCapabilities:t=>async function(...e){const[t,n]=e,r=n?.account??t.account;if(!r)throw new qA;const a=YT(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=>wF(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:eP({abi:n,functionName:r,args:a}),to:t,value:s}}));return Lk(e,wF,"sendCalls")({...t,calls:n})}(e,t)})}const EF={block:gA({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=fA(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?hT(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:yA({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?hT(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:hO({format:e=>({l1GasPrice:e.l1GasPrice?hT(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?hT(e.l1GasUsed):null,l1Fee:e.l1Fee?hT(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})};const CF={contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:EF,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&&!jT(t))throw new IT({address:t});if(n&&!jT(n))throw new IT({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:a,isSystemTx:s,mint:i,to:o,value:c}=e;return GT(["0x7e",cO([t,r,o??"0x",i?yT(i):"0x",c?yT(c):"0x",a?yT(a):"0x",s?"0x1":"0x",n??"0x"])])}(e):yO(e,t)}}},kF=rO({...CF,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:{...CF.contracts,l2OutputOracle:{1:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{1:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{1:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),TF=11155111,PF=rO({...CF,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:{...CF.contracts,l2OutputOracle:{[TF]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[TF]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[TF]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:TF});var AF;function OF(){const{provider:e}=D.getState();if(!e)throw new Error("provider is undefined");return e}exports.WatchResult=void 0,(AF=exports.WatchResult||(exports.WatchResult={}))[AF.Failed=0]="Failed",AF[AF.Success=1]="Success",AF[AF.Warning=2]="Warning";const FF=e=>h(void 0,void 0,void 0,(function*(){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=OF();try{return(yield 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})),DF=e=>h(void 0,void 0,void 0,(function*(){var t,n,r,a,s;const i=OF(),o=null===(t=D.getState().connected)||void 0===t?void 0:t.wallet;if(null===(n=null==o?void 0:o.notSupported)||void 0===n?void 0:n.sendTransaction)throw new Error("Not supported sendTransaction.");if(null===(r=null==o?void 0:o.contract)||void 0===r?void 0:r.sendTransaction)return o.contract.sendTransaction(e);const c=D.getState().chainId,l=null===(a=null==o?void 0:o.getSupportEip5792ChainIds)||void 0===a?void 0:a.call(o);if(null==l?void 0:l.includes(c)){let t=kF,n="https://api.developer.coinbase.com/rpc/v1/base/pE-_rU5q_IliJGUVkVI-82ZoyiCeCSFx";84532===c&&(t=PF,n="https://api.developer.coinbase.com/rpc/v1/base-sepolia/pE-_rU5q_IliJGUVkVI-82ZoyiCeCSFx");const r=EO({chain:t,transport:nO(i.provider)}).extend(xF()),a=yield r.sendCalls({account:e.from,calls:[e],capabilities:{paymasterService:{url:n}}}),s=()=>new Promise((e=>{setTimeout((()=>h(void 0,void 0,void 0,(function*(){var t;const n=yield r.getCallsStatus({id:a});if("PENDING"===n.status){const t=yield s();e(t)}else if(null===(t=n.receipts)||void 0===t?void 0:t.length){const[t]=n.receipts,r=t.transactionHash;e(r)}else e(a)}))),700)}));return{hash:yield s()}}try{const t=yield i.getSigner().sendTransaction(e);if((null===(s=D.getState().connected)||void 0===s?void 0:s.isSafe)&&D.getState().account){const e=yield H(),n=yield e.getSafeTxHash(D.getState().chainId,D.getState().account,t.hash);return Object.assign(Object.assign({},t),{hash:n})}return t}catch(e){throw 4001===(null==e?void 0:e.code)?new Error("Transaction rejected."):e}}));function _F(e,t,n){if(!Mt(e)||e===c.AddressZero)throw Error(`Invalid 'address' parameter '${e}'.`);const r=null!=n?n:OF(),a=D.getState().account;return new o.Contract(e,t,function(e,t){return t?function(e,t){return e.getSigner(t).connectUnchecked()}(e,t):e}(r,a))}const SF=new Map;function IF(e){var t,n,r;return h(this,void 0,void 0,(function*(){const a=OF(),s=null===(t=D.getState().connected)||void 0===t?void 0:t.wallet,i=D.getState().account;if(null===(n=null==s?void 0:s.notSupported)||void 0===n?void 0:n.sign)throw new Error("Not supported sign.");return(null===(r=null==s?void 0:s.contract)||void 0===r?void 0:r.sign)?s.contract.sign(e):a.send("eth_sign",[i,e])}))}exports.ALCHEMY_EVENT_TYPES=jE,exports.ALCHEMY_MINED_TRANSACTIONS_EVENT_TYPE=RE,exports.ALCHEMY_PENDING_TRANSACTIONS_EVENT_TYPE=UE,exports.BN=gg,exports.BaseError=Ln,exports.BigNumber=Tg,exports.Core=class{constructor(e){this.isOpenBlockIframe=!1,this.isSafeIframe=!1;const t=Object.assign(Object.assign({},$t),e),{providerConfig:n,walletListConfig:r,cacheKey:a}=t;this.providerConfig=n,Ht=n,"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&&jt.test(e.uuid)&&D.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"))),fF((null==r?void 0:r.extendsWalleObject)?Object.values(null==r?void 0:r.extendsWalleObject):void 0),this.walletListConfig=r,this.connectController=new Rt({cacheKey:a,rpcUrl:n.rpcUrl})}setWalletListConfig(e){this.walletListConfig=Object.assign(Object.assign({},this.walletListConfig),e)}autoConnect(e){var t;return h(this,void 0,void 0,(function*(){try{const n=e=>this.connectToWallet(e,void 0,{isAutoConnect:!0}),r=yield gF();if(r)return n(r);if(!D.getState().connected){const r=this.connectController.getCacheType(),a=this.getWalletList(null!==(t=this.providerConfig.chainId)&&void 0!==t?t:1,e);if(r){const e=a.find((e=>e.type===r));if(e&&(e.type!==exports.WalletType.injected||window.ethereum))return n(e)}const s=A()?a.find((e=>{var t;return null===(t=e.injected)||void 0===t?void 0:t.call(e)})):void 0;if(s)return n(s);this.providerConfig.rpcUrl&&D.getState().setRpcUrlProvider(this.providerConfig.rpcUrl,this.providerConfig.chainId)}}catch(e){console.error(e)}}))}setRpcUrl(e){this.connectController.setRpcUrl(e)}getWalletList(e,t){var n;return bF(Object.assign(Object.assign({PORTIS_ID:null===(n=this.providerConfig.portisParams)||void 0===n?void 0:n.id,chainId:e},this.walletListConfig),t))}connectToWallet(e,t,n={}){return h(this,void 0,void 0,(function*(){return t&&(this.providerConfig=Object.assign(Object.assign({},this.providerConfig),t)),this.connectController.connectWallet(e,this.providerConfig,n)}))}getConnectedWallet(){return this.connectController.getConnectedWallet()}disconnectWallet(){return this.connectController.disconnectWallet()}connectWalletBefore(e){if(D.getState().disabledWalletKeyList.includes(`${e.type}-${e.showName}`)){let{link:t,supportExtension:n,supportMobile:r}=e;if(!1===n&&r&&!A())return!0;if(C()?t=e.mobileAndroidDeepLink||e.mobileDeepLink||e.link:P()&&(t=e.mobileIOSDeepLink||e.mobileDeepLink||e.link),t){if("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)}},exports.CustomNetworks={"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"}},exports.DEFAULT_ALCHEMY_API_KEY=cx,exports.DEFAULT_NETWORK=lx,exports.DefaultJsonRpcProvider=Bn,exports.EthersEvent=class extends LE{get fromAddress(){const e=this.tag.split(":");if(e[0]===UE)return e[1]&&"*"!==e[1]?HE(e[1]):void 0}get toAddress(){const e=this.tag.split(":");if(e[0]===UE)return e[2]&&"*"!==e[2]?HE(e[2]):void 0}get hashesOnly(){const e=this.tag.split(":");if(jE.includes(e[0]))return e[3]&&"*"!==e[3]?"true"===e[3]:void 0}get includeRemoved(){const e=this.tag.split(":");if(e[0]===RE)return e[2]&&"*"!==e[2]?"true"===e[2]:void 0}get addresses(){const e=this.tag.split(":");if(e[0]===RE)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}},exports.EthersNetwork=px,exports.FixedNumber=Lg,exports.HD_PATH_LIST=[{path:"m/44'/60'/x'/0/0",name:"Ledger Live"},{path:"m/44'/60'/0'/x",name:"Legacy"}],exports.HttpRequestError=ti,exports.IS_BROWSER=qx,exports.InvalidAddressError=Or,exports.Logger=yn,exports.OpenBlockIframeWallet=hF,exports.SUPPORTED_CHAIN_ID=an,exports.Utf8ErrorFuncs=xn,exports.VERSION=lE,exports.__awaiter=h,exports.__awaiter$1=rx,exports._fetchData=In,exports._toEscapedUtf8String=function(e,t){return'"'+En(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?kn(e):kn(55296+((e-=65536)>>10&1023))+kn(56320+(1023&e))})).join("")+'"'},exports._toUtf8String=Tn,exports._tslib=x,exports.allWalletList=pF,exports.allWalletObject=uF,exports.approve=(e,t,n)=>h(void 0,void 0,void 0,(function*(){const r=_F(e,vF).interface.encodeFunctionData("approve",[t,n]),a={from:D.getState().account,to:e,data:r,value:"0x0",gasLimit:void 0},s=yield FF(a);return s&&(a.gasLimit=s),yield DF(a)})),exports.browserPonyfill=UC,exports.c=RC,exports.call=So,exports.commify=function(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&$g.throwArgumentError("invalid value","value",e);let n=t[0],r="";for("-"===n.substring(0,1)&&(r="-",n=n.substring(1));"0"===n.substring(0,1);)n=n.substring(1);""===n&&(n="0");let a="";for(2===t.length&&(a="."+(t[1]||"0"));a.length>2&&"0"===a[a.length-1];)a=a.substring(0,a.length-1);const s=[];for(;n.length;){if(n.length<=3){s.unshift(n);break}{const e=n.length-3;s.unshift(n.substring(e)),n=n.substring(0,e)}}return r+s.join(",")+a},exports.commonjsGlobal=lg,exports.concat=Nr,exports.connect=function({appName:e,appLogoUrl:t,appId:n}){return h(this,void 0,void 0,(function*(){return qt&&Vt||(qt||(qt=new It({name:e,icon:t,appId:n})),void 0===Vt&&(Vt=yield Promise.race([qt.start(),new Promise((e=>setTimeout(e,300)))]))),{app:qt,cyberAccount:Vt}}))},exports.connectOpenBlockIframe=z,exports.convertTransactionType=function(e,t,n){return h(this,void 0,void 0,(function*(){const r=t;if(!n)return r;r.type=Nt;const a=yield function(e){return h(this,void 0,void 0,(function*(){if(void 0!==Ut[e])return Ut[e];const t=D.getState().provider;if(!t)return!1;const n=void 0!==(yield t.getBlock("latest")).baseFeePerGas;return Ut[e]=n,n}))}(e);if(a){const t=yield n(e);(null==t?void 0:t.maxFeePerGas)&&(null==t?void 0:t.maxPriorityFeePerGas)&&(r.maxFeePerGas=t.maxFeePerGas,r.maxPriorityFeePerGas=t.maxPriorityFeePerGas,r.type=Bt)}return r}))},exports.convertWeb3Provider=F,exports.createProvider=function(e){var t;return h(this,void 0,void 0,(function*(){const{rpcUrl:r,JsonRpcProvider:a=Bn}=e,s=null!==(t=e.chainId)&&void 0!==t?t:1,i=Cb(s),o=DO(s),c=OO[s];if(!c)throw new Error(`ChainId ${s} is not support`);const l=yield CC({apiKey:c,chain:i,signer:o});const u=new class extends a{constructor(e,t){super(e,t),this.smartAccountClient=l}getSigner(){const e=l.account.address;return new kO(u,e,0,l,o)}disconnect(){return o.disconnect()}listAccounts(){return h(this,void 0,void 0,(function*(){return[l.account.address]}))}getAddress(){const e=l.account.address;return Promise.resolve(n.getAddress(e))}}(r,s);return u}))},exports.decode=sn,exports.decodeErrorResult=Ds,exports.deepCopy=_x,exports.encode=on,exports.encodeAbiParameters=Xa,exports.eventemitter3=_C,exports.fetchJson=Mn,exports.formatEther=function(e){return qg(e,18)},exports.formatUnits=qg,exports.fromHex=Sx,exports.getAlchemyConnector=he,exports.getAlchemyEventTag=function(e){if(!GE(e))throw new Error("Event tag requires AlchemyEventType");if(e.method===exports.AlchemySubscription.PENDING_TRANSACTIONS)return function(e){const t=zE(e.fromAddress),n=zE(e.toAddress),r=$E(e.hashesOnly);return UE+":"+t+":"+n+":"+r}(e);if(e.method===exports.AlchemySubscription.MINED_TRANSACTIONS)return function(e){const t=function(e){if(void 0===e)return"*";return e.map((e=>zE(e.to)+","+zE(e.from))).join("|")}(e.addresses),n=$E(e.includeRemoved),r=$E(e.hashesOnly);return RE+":"+t+":"+n+":"+r}(e);throw new Error(`Unrecognized AlchemyFilterEvent: ${e}`)},exports.getAlchemyHttpUrl=ux,exports.getAlchemyPackage=ne,exports.getAlchemySigner=DO,exports.getAlchemyWsUrl=function(e,t){return`wss://${e}.g.alchemy.com/v2/${t}`},exports.getAugmentedNamespace=dg,exports.getBinanceConnector=ue,exports.getBinancePackage=Q,exports.getBloctoConnector=re,exports.getBloctoPackage=K,exports.getChainNameByChainId=e=>{switch(Number(e)){case 1:case 5:return"eth";case 137:case Zt:return"polygon";case 56:case 97:return"bsc";case Kt:case Jt:return"rangers";case Yt:return"scroll";case Xt:case Qt:return"arbitrum";case en:case tn:return"avalanche";case 322:case 321:return"kcc";case 65:case 66:return"okc";case nn:case rn:return"platon";default:return"polygon"}},exports.getContract=_F,exports.getCyberAccount=()=>Vt,exports.getCyberChain=function(e,t){if(!e)throw new Error("app is undefined");const{cyberWallet:n}=e;switch(t){case exports.ChainId.OPTIMISM:return n.optimism;case exports.ChainId.POLYGON:return n.polygon;case exports.ChainId.ARBITRUM_ONE:return n.arbitrum;case exports.ChainId.LINEA:return n.linea;case exports.ChainId.BASE:return n.base;case exports.ChainId.SCROLL_ALPHA_TESTNET:return n.scrollSepolia;default:throw new Error("Invalid chain")}},exports.getCyberConnector=ce,exports.getCyberPackage=Y,exports.getDefaultExportFromCjs=ug,exports.getENVByChainId=e=>{switch(Number(e)){case 1:case 137:case 56:case Kt:case Qt:case tn:case 321:case rn:case 66:return"prod";default:return"test"}},exports.getEstimateGas=FF,exports.getGasPrice=()=>h(void 0,void 0,void 0,(function*(){const e=OF();try{return yield 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})),exports.getGnosisPackage=H,exports.getIsAndroid=C,exports.getIsCyber=function(){var e,t,n,r;return h(this,void 0,void 0,(function*(){const a=Ht;if(Vt)return!0;try{return qt||(qt=new It({name:null!==(e=null==a?void 0:a.appName)&&void 0!==e?e:"DODO",icon:null!==(t=null==a?void 0:a.appLogoUrl)&&void 0!==t?t:"https://app.dodoex.io/DODO.svg",appId:null!==(r=null===(n=null==a?void 0:a.cyberParams)||void 0===n?void 0:n.appId)&&void 0!==r?r:"77cd9ea7-ae31-472e-8332-21cb26e9398e"})),Vt=yield Promise.race([qt.start(),new Promise((e=>setTimeout(e,400)))]),!!Vt}catch(e){return!1}}))},exports.getIsIOS=P,exports.getIsMobile=A,exports.getIsOpenBlockIframe=G,exports.getIsolatedEnvironmentWallet=gF,exports.getLedgerUSBPackage=$,exports.getMetamaskConnector=de,exports.getMetamaskPackage=ee,exports.getOwnerProvider=function(){if(!window.ethereum)throw new Error("Method not implemented.");return new e.Web3Provider(window.ethereum)},exports.getPortisConnector=ae,exports.getPortisPackage=V,exports.getProviderByChain=function(t,n){return h(this,void 0,void 0,(function*(){if(!t||t===D.getState().chainId&&D.getState().provider)return D.getState().provider;if(SF.has(t))return SF.get(t);const r=new e.JsonRpcProvider(n,t);return SF.set(t,r),r}))},exports.getRainbowConnectPackage=J,exports.getRainbowConnector=oe,exports.getSocialLoginConnector=pe,exports.getSocialLoginPackage=te,exports.getUAuthPackage=q,exports.getUniPassConnector=le,exports.getUniPassPackage=X,exports.getUrl=jn,exports.getWalletConnectConnector=ie,exports.getWalletConnectPackage=Z,exports.getWalletDisabledState=fF,exports.getWalletLinkConnector=se,exports.getWalletLinkPackage=W,exports.getWalletList=bF,exports.getWindow=O,exports.injectedConnect=_,exports.isAddress=Mr,exports.isAddress$1=Mt,exports.isAlchemyEvent=GE,exports.isHex=Vn,exports.isLargeIOS=T,exports.isSmallIOS=k,exports.isSupportWebHid=E,exports.keccak256=fg,exports.logWarn=function(e,...t){cE.warn(e,t)},exports.noop=function(){},exports.parseEther=function(e){return Vg(e,18)},exports.parseUnits=Vg,exports.personalSign=function(e,t){var n,r,a;return h(this,void 0,void 0,(function*(){const s=OF(),i=null===(n=D.getState().connected)||void 0===n?void 0:n.wallet;if(null===(r=null==i?void 0:i.notSupported)||void 0===r?void 0:r.personalSign)throw new Error("Not supported personalSign.");return(null===(a=null==i?void 0:i.contract)||void 0===a?void 0:a.personalSign)?i.contract.personalSign(e,t):s.getSigner().signMessage(e)}))},exports.poll=function(e,t){return t||(t={}),null==(t=a.shallowCopy(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)}))}()}))},exports.registerNetworkWithMetamask=M,exports.require$$1=bg,exports.sendTransaction=DF,exports.sha3=hg,exports.sign=IF,exports.signTransaction=function(e){return h(this,void 0,void 0,(function*(){const t=yield a.resolveProperties(e);delete t.from;const n=fg(l.serialize(t)),r=yield IF(n);return l.serialize(t,r)}))},exports.signTypedData=function({account:e,typedData:t}){var n,r,a;return h(this,void 0,void 0,(function*(){const s=OF(),i=null===(n=D.getState().connected)||void 0===n?void 0:n.wallet;if(null===(r=null==i?void 0:i.notSupported)||void 0===r?void 0:r.signTypedData)throw new Error("Not supported sign.");if(null===(a=null==i?void 0:i.contract)||void 0===a?void 0:a.signTypedData)return i.contract.signTypedData({account:e,typedData:t});try{if(s){const n=yield s.send("eth_signTypedData_v4",[e,JSON.stringify(t)]);return console.log("web3 eth_signTypedData_v4 result: ",n),n}}catch(e){if(console.error("web3 eth_signTypedData_v4 error: ",e),e.message)throw new Error(e.message)}return null}))},exports.standaloneList=dF,exports.standaloneListObject=cF,exports.stringify=_s,exports.supportChains=Wt,exports.toHex=Ix,exports.toUtf8Bytes=Cn,exports.toUtf8CodePoints=function(e,t=exports.UnicodeNormalizationForm.current){return En(Cn(e,t))},exports.toUtf8String=Pn,exports.u=SC,exports.useWalletStore=D,exports.verifyAlchemyEventName=function(e){if(!Object.values(exports.AlchemySubscription).includes(e.method))throw new Error(`Invalid method name ${e.method}. Accepted method names: ${Object.values(exports.AlchemySubscription)}`)},exports.watchTx=function(e,t,n,r,a){var s;return h(this,void 0,void 0,(function*(){const i=OF();for(;!t.killSwitch;){try{if(null===(s=D.getState().connected)||void 0===s?void 0:s.isSafe){const t=yield H(),n=yield t.getSafeTxStatus(D.getState().chainId,e,D.getState().account);if("rejected"===n)return{status:exports.WatchResult.Warning,transactionReceipt:null};let r;if(n&&(r=n.status?exports.WatchResult.Success:exports.WatchResult.Failed),void 0!==r)return{status:r,transactionReceipt:n?Object.assign(Object.assign({},n),{blockNumber:n.blockNumber||void 0,status:n.status?1:0}):null}}else{const[t,s]=yield Promise.all([a?a(e):i.getTransactionReceipt(e),i.getTransactionCount(null!=r?r:"")]);let o;if(console.log("[TX Watch] Web3",t,"/Current Nonce ",s,"/TX Nonce",n),t&&(o=t.status?exports.WatchResult.Success:exports.WatchResult.Failed),void 0===o&&n&&s>n&&(o=exports.WatchResult.Warning),void 0!==o)return{status:o,transactionReceipt:t}}}catch(e){console.error("[TX Watch] Error",e.message)}yield new Promise((e=>setTimeout(e,t.interval)))}return null}))};
|