@dodoex/wallet-web3 0.4.1-rise.1 → 0.4.1-rise.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/{alchemy-provider-5870b6fa-bb85ec6a.js → alchemy-provider-5870b6fa-e05de000.js} +1 -1
  2. package/dist/{alchemy-websocket-provider-213da986-d5400b6b.js → alchemy-websocket-provider-213da986-e04e20e5.js} +1 -1
  3. package/dist/{blocto-eff0b92d.js → blocto-97587019.js} +1 -1
  4. package/dist/{ccip-8aed4fac.js → ccip-0db5fcae.js} +1 -1
  5. package/dist/{ccip-f0761404.js → ccip-c37d418e.js} +1 -1
  6. package/dist/cjs/{alchemy-provider-5870b6fa-382979ef.cjs → alchemy-provider-5870b6fa-e24212d7.cjs} +1 -1
  7. package/dist/cjs/{alchemy-websocket-provider-213da986-4ce7835d.cjs → alchemy-websocket-provider-213da986-84543bd0.cjs} +1 -1
  8. package/dist/cjs/{blocto-14fc9f60.cjs → blocto-7c451e4d.cjs} +1 -1
  9. package/dist/cjs/{ccip-a1973409.cjs → ccip-3251edc4.cjs} +1 -1
  10. package/dist/cjs/{ccip-2b0ca597.cjs → ccip-e99c5ad4.cjs} +1 -1
  11. package/dist/cjs/{draggabilly-5c6a8eb9.cjs → draggabilly-f5a8f0d3.cjs} +1 -1
  12. package/dist/cjs/id-1447427c.cjs +1 -0
  13. package/dist/cjs/{index-34ad5f20.cjs → index-02f31a88.cjs} +1 -1
  14. package/dist/cjs/{index-5ce728f7.cjs → index-2e9d24e4.cjs} +4 -4
  15. package/dist/cjs/{index-21073eb0.cjs → index-37e9b5f9.cjs} +1 -1
  16. package/dist/cjs/{index-0eb47a78.cjs → index-79b6b22d.cjs} +1 -1
  17. package/dist/cjs/{index-418ee7e2.cjs → index-a167f18c.cjs} +1 -1
  18. package/dist/cjs/{index-67de37f3.cjs → index-a64ff146.cjs} +1 -1
  19. package/dist/cjs/{index-5d7df663.cjs → index-c46d1215.cjs} +1 -1
  20. package/dist/cjs/{index-ddd9f3b1.cjs → index-cae93f1f.cjs} +1 -1
  21. package/dist/cjs/{index-d2b3e830.cjs → index-d0e2d4e2.cjs} +3 -3
  22. package/dist/cjs/{index-6507817d.cjs → index-ed87a9e3.cjs} +2 -2
  23. package/dist/cjs/{index-ceef92b9.cjs → index-f810457d.cjs} +1 -1
  24. package/dist/cjs/index.cjs +1 -1
  25. package/dist/cjs/{index.es-26c6ee46.cjs → index.es-a1c165d6.cjs} +1 -1
  26. package/dist/cjs/{interface-301bc9d4.cjs → interface-a406ad88.cjs} +1 -1
  27. package/dist/cjs/lib-typedarrays-57096314.cjs +1 -0
  28. package/dist/cjs/{portis-6ae03796.cjs → portis-25ec3385.cjs} +1 -1
  29. package/dist/cjs/{provider-aec1ee59.cjs → provider-e1c77615.cjs} +1 -1
  30. package/dist/cjs/{rainbow-920371d7.cjs → rainbow-c04bf66f.cjs} +1 -1
  31. package/dist/cjs/{secp256k1-88c91671.cjs → secp256k1-91126b50.cjs} +1 -1
  32. package/dist/cjs/sha224-a1c60756.cjs +1 -0
  33. package/dist/cjs/{sha256-559d937c.cjs → sha256-19da1b79.cjs} +1 -1
  34. package/dist/cjs/{typed-data-2ac6e5bb.cjs → typed-data-86473c70.cjs} +1 -1
  35. package/dist/cjs/uAuth-31d0a167.cjs +1 -0
  36. package/dist/cjs/{walletConnect-1514d700.cjs → walletConnect-f85e4bb9.cjs} +1 -1
  37. package/dist/cjs/{walletLink-5879a68b.cjs → walletLink-7c24a1d7.cjs} +1 -1
  38. package/dist/{draggabilly-f3461ab1.js → draggabilly-81fdc066.js} +1 -1
  39. package/dist/id-a2df48d3.js +1 -0
  40. package/dist/{index-ad6d7603.js → index-07138828.js} +1 -1
  41. package/dist/{index-14f309d2.js → index-11df9422.js} +1 -1
  42. package/dist/{index-4b6c652e.js → index-3fc26524.js} +1 -1
  43. package/dist/{index-01b9db23.js → index-760f75a7.js} +1 -1
  44. package/dist/{index-31a37014.js → index-7b780725.js} +3 -3
  45. package/dist/{index-b6f1e8cc.js → index-83d37806.js} +2 -2
  46. package/dist/{index-c8e0cbe6.js → index-bc033af5.js} +1 -1
  47. package/dist/{index-c836d1b2.js → index-e2de6ccc.js} +4 -4
  48. package/dist/{index-e01611dd.js → index-f3e2bf95.js} +1 -1
  49. package/dist/{index-fff9fb0c.js → index-fa588d6b.js} +2 -2
  50. package/dist/{index-609bf40c.js → index-ff800c71.js} +1 -1
  51. package/dist/{index.es-9ce4fdd7.js → index.es-8feb0512.js} +1 -1
  52. package/dist/index.js +1 -1
  53. package/dist/{interface-226cc3e0.js → interface-1eb95ed0.js} +1 -1
  54. package/dist/lib-typedarrays-f580c438.js +1 -0
  55. package/dist/{portis-9112d997.js → portis-cb3a4ac8.js} +1 -1
  56. package/dist/{provider-1e6242a3.js → provider-1414b238.js} +1 -1
  57. package/dist/{rainbow-280f7951.js → rainbow-d286c290.js} +1 -1
  58. package/dist/{secp256k1-d403d4c1.js → secp256k1-501de86d.js} +1 -1
  59. package/dist/sha224-98feba8e.js +1 -0
  60. package/dist/{sha256-ecf76121.js → sha256-ab11a2f8.js} +1 -1
  61. package/dist/{typed-data-cfc1152c.js → typed-data-4720c77b.js} +1 -1
  62. package/dist/uAuth-a0882ace.js +1 -0
  63. package/dist/{walletConnect-6bf9ed97.js → walletConnect-5b288c1f.js} +1 -1
  64. package/dist/{walletLink-0444bb94.js → walletLink-541d2c47.js} +1 -1
  65. package/package.json +1 -1
  66. package/dist/cjs/id-030fb120.cjs +0 -1
  67. package/dist/cjs/lib-typedarrays-e51b5d1f.cjs +0 -1
  68. package/dist/cjs/sha224-44664857.cjs +0 -1
  69. package/dist/cjs/uAuth-63dec270.cjs +0 -1
  70. package/dist/id-155c1875.js +0 -1
  71. package/dist/lib-typedarrays-c1439d8d.js +0 -1
  72. package/dist/sha224-34dbb09c.js +0 -1
  73. package/dist/uAuth-2883581a.js +0 -1
@@ -1,5 +1,5 @@
1
- "use strict";var e=require("@ethersproject/providers"),t=require("zustand"),n=require("@ethersproject/bytes"),r=require("@ethersproject/properties"),a=require("@ethersproject/address"),i=require("@ethersproject/abstract-signer"),s=require("buffer");require("@ethersproject/abstract-provider");var o=require("@ethersproject/contracts");require("events");var 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)}function d(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var p=function(e,t){return p=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])},p(e,t)};var h=function(){return h=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},h.apply(this,arguments)};function m(e,t,n,r){return new(n||(n=Promise))((function(a,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(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(s,o)}c((r=r.apply(e,t||[])).next())}))}var f=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 y(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 b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s}function g(e){return this instanceof g?(this.v=e,this):new g(e)}var v=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var w,C,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}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return h},__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,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,n,s):a(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},__param:function(e,t){return function(n,r){t(n,r,e)}},__esDecorate:function(e,t,n,r,a,i){function s(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");i.push(s(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=s(y.get))&&(d.get=o),(o=s(y.set))&&(d.set=o),(o=s(y.init))&&a.push(o)}else(o=s(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:m,__generator:function(e,t){var n,r,a,i,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,o[0]&&(s=0)),s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){s.label=o[1];break}if(6===o[0]&&s.label<a[1]){s.label=a[1],a=o;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(o);break}a[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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:f,__exportStar:function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||f(t,e,n)},__values:y,__read:b,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(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 i=arguments[t],s=0,o=i.length;s<o;s++,a++)r[a]=i[s];return r},__spreadArray:function(e,t,n){if(n||2===arguments.length)for(var r,a=0,i=t.length;a<i;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:g,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,a=n.apply(e,t||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){a[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||o(e,t)}))})}function o(e,t){try{!function(e){e.value instanceof g?Promise.resolve(e.value.v).then(c,l):u(i[0][2],e)}(a[e](t))}catch(e){u(i[0][3],e)}}function c(e){o("next",e)}function l(e){o("throw",e)}function u(e,t){e(t),i.shift(),i.length&&o(i[0][0],i[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:g(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=y(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)&&f(t,e,n);return v(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,(w=exports.ChainId||(exports.ChainId={}))[w.MAINNET=1]="MAINNET",w[w.GOERLI=5]="GOERLI",w[w.BSC=56]="BSC",w[w.POLYGON=137]="POLYGON",w[w.ARBITRUM_ONE=42161]="ARBITRUM_ONE",w[w.AURORA=1313161554]="AURORA",w[w.OKCHAIN=66]="OKCHAIN",w[w.OPTIMISM=10]="OPTIMISM",w[w.AVALANCHE=43114]="AVALANCHE",w[w.CONFLUX=1030]="CONFLUX",w[w.BASE=8453]="BASE",w[w.LINEA=59144]="LINEA",w[w.SCROLL_ALPHA_TESTNET=534353]="SCROLL_ALPHA_TESTNET",w[w.SCROLL=534352]="SCROLL",w[w.MANTLE=5e3]="MANTLE",w[w.MANTA=169]="MANTA",w[w.BTR=200901]="BTR",w[w.OKB=196]="OKB",exports.WalletType=void 0,(C=exports.WalletType||(exports.WalletType={})).injected="injected",C.BinanceChain="custom-bsc-injected",C.WalletConnect="walletconnect",C.Portis="portis",C.Gnosis="custom-gnosis",C.WalletLink="custom-walletlink",C.LedgerUSB="custom-ledger-usb",C.Ledger="custom-ledger",C.openBlock="custom-open-block",C.openBlockIframe="custom-open-block-iframe",C.GameStop="custom-game-stop",C.Nabox="custom-nabox",C.Bitkeep="custom-bitkeep",C.OneKey="custom-onekey",C.OKX="custom-okx",C.uAuth="custom-uauth",C.kuCoinWallet="custom-kucoin-wallet",C.frontier="custom-frontier",C.Blocto="custom-blocto",C.Rainbow="custom-rainbow",C.trust="custom-trust",C.tokenPocket="custom-token-pocket",C.Cyber="custom-cyber",C.uniPass="custom-uni-pass",C.Gate="custom-gate",C.Coin98="custom-coin-98",C.FoxWallet="custom-fox-wallet",C.Brave="custom-brave",C.Math="custom-math",C.ImToken="custom-im-token",C.Rabby="custom-rabby",C.SocialLogin="custom-social-login",C.Alchemy="custom-alchemy",C.Bybit="custom-bybit",C.Zerion="custom-zerion",C.Holdstation="custom-holdstation",C.SafePal="custom-safe-pal",C.Rise="custom-rise",C.EIP6963Prefix="custom-eip-6963-";const E=()=>{var e;return"undefined"!=typeof navigator&&!!(null===(e=window.navigator)||void 0===e?void 0:e.hid)},k=()=>{var e;return"undefined"!=typeof navigator&&(null===(e=window.navigator)||void 0===e?void 0:e.userAgent)&&/(Android)/i.test(navigator.userAgent)};function T(){return"undefined"!=typeof navigator&&/iPhone|iPod|iOS/.test(navigator.userAgent)}function P(){return"undefined"!=typeof navigator&&(/iPad/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)}const A=()=>T()||P(),_=()=>k()||A(),D=()=>{if("undefined"!=typeof window)return window},O=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)=>m(void 0,void 0,void 0,(function*(){t((()=>({provider:e})));const{chainId:a}=yield e.getNetwork(),i=yield e.listAccounts(),[s]=i,{type:o}=n;let c=o===exports.WalletType.Gnosis;if(!c&&o===exports.WalletType.WalletConnect&&s){const e=yield q();c=yield e.getAccountIsSafe(a,s)}t((e=>{var t;return{accounts:i,account:s,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,accounts:void 0,account:void 0})))},accountsChanged:e=>{const[n]=e;t((()=>({accounts:e,account:n})))},chainIdChanged:e=>{t((()=>({chainId:e})))},setRpcUrlProvider:(n,r)=>m(void 0,void 0,void 0,(function*(){const a=new e.JsonRpcProvider(n,r);let i=r;if(!i){const e=yield a.getNetwork();i=e.chainId}t((()=>({provider:a,chainId:i,accounts:void 0,account:void 0,walletType:void 0,connected:void 0,connectedWalletSpecial:void 0})))})),disconnect:n=>m(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 F(e){return m(this,void 0,void 0,(function*(){const{Web3Provider:t}=yield Promise.resolve().then((function(){return u(require("@ethersproject/providers"))}));return new t(e,"any")}))}function S(e=null,t){return m(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 I(e,t){return e.request?e.request(t):e.send(t.method,t.params)}function M({provider:e,addChainParameters:t}){return m(this,void 0,void 0,(function*(){try{return yield I(e,{method:"wallet_addEthereumChain",params:[t]}),{result:!0}}catch(e){console.error(`[failed to add ${t.chainId}]: `,t,e)}return{result:!1}}))}function N({addChainDirectly:e,addChainParameters:t,provider:n}){var r;return m(this,void 0,void 0,(function*(){const a=null!==(r=null!=n?n:O.getState().provider)&&void 0!==r?r:window.ethereum;if(!a)return{result:!1};if(e)return M({provider:a,addChainParameters:t});const{chainId:i}=t;try{return yield I(a,{method:"wallet_switchEthereumChain",params:[{chainId:i}]}),{result:!0}}catch(e){const{code:n}=e;if(4902===n||-32603===n)return M({provider:a,addChainParameters:t});console.error(`[failed to switch ${i}]: `,t,e)}return{result:!1}}))}let U=!1,L=1;const B={};let R=!1;var j,G;null===(j=D())||void 0===j||j.addEventListener("message",(e=>{"openblock-content-integration"===e.data.from&&(U=!0,Object.values(B).map((e=>e())))})),null===(G=D())||void 0===G||G.addEventListener("load",(()=>{setTimeout((()=>{R=!0,Object.values(B).map((e=>e()))}),1e3)}),{once:!0});const z=()=>m(void 0,void 0,void 0,(function*(){return new Promise((e=>{U?e(!0):window.parent===window||R?e(!1):(L++,B[L]=()=>{e(U),delete B[L]})}))})),$=(e,t)=>m(void 0,void 0,void 0,(function*(){const e=(yield Promise.resolve().then((function(){return require("./provider-aec1ee59.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 H(){return Promise.resolve().then((function(){return require("./index-21073eb0.cjs")}))}function q(){return Promise.resolve().then((function(){return require("./index-0eb47a78.cjs")}))}function V(){return Promise.resolve().then((function(){return require("./uAuth-63dec270.cjs")}))}function W(){return Promise.resolve().then((function(){return require("./portis-6ae03796.cjs")}))}function Z(){return Promise.resolve().then((function(){return require("./walletLink-5879a68b.cjs")}))}function K(){return Promise.resolve().then((function(){return require("./walletConnect-1514d700.cjs")}))}function J(){return Promise.resolve().then((function(){return require("./blocto-14fc9f60.cjs")}))}function X(){return Promise.resolve().then((function(){return require("./rainbow-920371d7.cjs")}))}function Y(){return Promise.resolve().then((function(){return require("./index-5d7df663.cjs")}))}function Q(){return Promise.resolve().then((function(){return require("./index-67de37f3.cjs")}))}function ee(){return Promise.resolve().then((function(){return require("./index-ddd9f3b1.cjs")}))}function te(){return Promise.resolve().then((function(){return require("./index-34ad5f20.cjs")}))}function ne(){return Promise.resolve().then((function(){return require("./index-d2b3e830.cjs")}))}function re(){return Promise.resolve().then((function(){return require("./index-ceef92b9.cjs")}))}function ae(){return Promise.resolve().then((function(){return require("./index-6507817d.cjs")})).then((function(e){return e.index}))}function ie(e,t){return m(this,void 0,void 0,(function*(){return(yield J()).default(e,t)}))}function se(e,t){return m(this,void 0,void 0,(function*(){return(yield W()).default(e,t)}))}function oe(e,t){return m(this,void 0,void 0,(function*(){return(yield Z()).default(e,t)}))}function ce(e,t){return m(this,void 0,void 0,(function*(){return(yield K()).default(e,t)}))}function le(e,t){return m(this,void 0,void 0,(function*(){return(yield X()).default(e,t)}))}function ue(e,t){return m(this,void 0,void 0,(function*(){return(yield Y()).default(e,t)}))}function de(e,t){return m(this,void 0,void 0,(function*(){return(yield Q()).default(e,t)}))}function pe(e,t){return m(this,void 0,void 0,(function*(){return(yield ee()).default(e,t)}))}function he(e,t){return m(this,void 0,void 0,(function*(){return(yield te()).default(e,t)}))}function me(e,t){return m(this,void 0,void 0,(function*(){return(yield ne()).default(e,t)}))}function fe(e,t){return m(this,void 0,void 0,(function*(){return(yield re()).default(e,t)}))}function ye(e,t){return m(this,void 0,void 0,(function*(){return(yield ae()).default(e,t)}))}var be="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ge(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ve(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 we={},Ce={},xe=Ee;function Ee(e,t){if(!e)throw new Error(t||"Assertion failed")}Ee.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var ke={exports:{}};"function"==typeof Object.create?ke.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ke.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var Te=xe,Pe=ke.exports;function Ae(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function _e(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function De(e){return 1===e.length?"0"+e:e}function Oe(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}Ce.inherits=Pe,Ce.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a<e.length;a+=2)n.push(parseInt(e[a]+e[a+1],16))}else for(var r=0,a=0;a<e.length;a++){var i=e.charCodeAt(a);i<128?n[r++]=i:i<2048?(n[r++]=i>>6|192,n[r++]=63&i|128):Ae(e,a)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++a)),n[r++]=i>>18|240,n[r++]=i>>12&63|128,n[r++]=i>>6&63|128,n[r++]=63&i|128):(n[r++]=i>>12|224,n[r++]=i>>6&63|128,n[r++]=63&i|128)}else for(a=0;a<e.length;a++)n[a]=0|e[a];return n},Ce.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=De(e[n].toString(16));return t},Ce.htonl=_e,Ce.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var a=e[r];"little"===t&&(a=_e(a)),n+=Oe(a.toString(16))}return n},Ce.zero2=De,Ce.zero8=Oe,Ce.join32=function(e,t,n,r){var a=n-t;Te(a%4==0);for(var i=new Array(a/4),s=0,o=t;s<i.length;s++,o+=4){var c;c="big"===r?e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3]:e[o+3]<<24|e[o+2]<<16|e[o+1]<<8|e[o],i[s]=c>>>0}return i},Ce.split32=function(e,t){for(var n=new Array(4*e.length),r=0,a=0;r<e.length;r++,a+=4){var i=e[r];"big"===t?(n[a]=i>>>24,n[a+1]=i>>>16&255,n[a+2]=i>>>8&255,n[a+3]=255&i):(n[a+3]=i>>>24,n[a+2]=i>>>16&255,n[a+1]=i>>>8&255,n[a]=255&i)}return n},Ce.rotr32=function(e,t){return e>>>t|e<<32-t},Ce.rotl32=function(e,t){return e<<t|e>>>32-t},Ce.sum32=function(e,t){return e+t>>>0},Ce.sum32_3=function(e,t,n){return e+t+n>>>0},Ce.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},Ce.sum32_5=function(e,t,n,r,a){return e+t+n+r+a>>>0},Ce.sum64=function(e,t,n,r){var a=e[t],i=r+e[t+1]>>>0,s=(i<r?1:0)+n+a;e[t]=s>>>0,e[t+1]=i},Ce.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},Ce.sum64_lo=function(e,t,n,r){return t+r>>>0},Ce.sum64_4_hi=function(e,t,n,r,a,i,s,o){var c=0,l=t;return c+=(l=l+r>>>0)<t?1:0,c+=(l=l+i>>>0)<i?1:0,e+n+a+s+(c+=(l=l+o>>>0)<o?1:0)>>>0},Ce.sum64_4_lo=function(e,t,n,r,a,i,s,o){return t+r+i+o>>>0},Ce.sum64_5_hi=function(e,t,n,r,a,i,s,o,c,l){var u=0,d=t;return u+=(d=d+r>>>0)<t?1:0,u+=(d=d+i>>>0)<i?1:0,u+=(d=d+o>>>0)<o?1:0,e+n+a+s+c+(u+=(d=d+l>>>0)<l?1:0)>>>0},Ce.sum64_5_lo=function(e,t,n,r,a,i,s,o,c,l){return t+r+i+o+l>>>0},Ce.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},Ce.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},Ce.shr64_hi=function(e,t,n){return e>>>n},Ce.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0};var Fe={},Se=Ce,Ie=xe;function Me(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Fe.BlockHash=Me,Me.prototype.update=function(e,t){if(e=Se.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=Se.join32(e,0,e.length-n,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},Me.prototype.digest=function(e){return this.update(this._pad()),Ie(null===this.pending),this._digest(e)},Me.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var a=1;a<n;a++)r[a]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[a++]=0;r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=e>>>24&255,r[a++]=e>>>16&255,r[a++]=e>>>8&255,r[a++]=255&e}else for(r[a++]=255&e,r[a++]=e>>>8&255,r[a++]=e>>>16&255,r[a++]=e>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,i=8;i<this.padLength;i++)r[a++]=0;return r};var Ne={},Ue={},Le=Ce.rotr32;function Be(e,t,n){return e&t^~e&n}function Re(e,t,n){return e&t^e&n^t&n}function je(e,t,n){return e^t^n}Ue.ft_1=function(e,t,n,r){return 0===e?Be(t,n,r):1===e||3===e?je(t,n,r):2===e?Re(t,n,r):void 0},Ue.ch32=Be,Ue.maj32=Re,Ue.p32=je,Ue.s0_256=function(e){return Le(e,2)^Le(e,13)^Le(e,22)},Ue.s1_256=function(e){return Le(e,6)^Le(e,11)^Le(e,25)},Ue.g0_256=function(e){return Le(e,7)^Le(e,18)^e>>>3},Ue.g1_256=function(e){return Le(e,17)^Le(e,19)^e>>>10};var Ge=Ce,ze=Fe,$e=Ue,He=Ge.rotl32,qe=Ge.sum32,Ve=Ge.sum32_5,We=$e.ft_1,Ze=ze.BlockHash,Ke=[1518500249,1859775393,2400959708,3395469782];function Je(){if(!(this instanceof Je))return new Je;Ze.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ge.inherits(Je,Ze);var Xe=Je;Je.blockSize=512,Je.outSize=160,Je.hmacStrength=80,Je.padLength=64,Je.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=He(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var a=this.h[0],i=this.h[1],s=this.h[2],o=this.h[3],c=this.h[4];for(r=0;r<n.length;r++){var l=~~(r/20),u=Ve(He(a,5),We(l,i,s,o),c,n[r],Ke[l]);c=o,o=s,s=He(i,30),i=a,a=u}this.h[0]=qe(this.h[0],a),this.h[1]=qe(this.h[1],i),this.h[2]=qe(this.h[2],s),this.h[3]=qe(this.h[3],o),this.h[4]=qe(this.h[4],c)},Je.prototype._digest=function(e){return"hex"===e?Ge.toHex32(this.h,"big"):Ge.split32(this.h,"big")};var Ye=Ce,Qe=Fe,et=Ue,tt=xe,nt=Ye.sum32,rt=Ye.sum32_4,at=Ye.sum32_5,it=et.ch32,st=et.maj32,ot=et.s0_256,ct=et.s1_256,lt=et.g0_256,ut=et.g1_256,dt=Qe.BlockHash,pt=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function ht(){if(!(this instanceof ht))return new ht;dt.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=pt,this.W=new Array(64)}Ye.inherits(ht,dt);var mt=ht;ht.blockSize=512,ht.outSize=256,ht.hmacStrength=192,ht.padLength=64,ht.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=rt(ut(n[r-2]),n[r-7],lt(n[r-15]),n[r-16]);var a=this.h[0],i=this.h[1],s=this.h[2],o=this.h[3],c=this.h[4],l=this.h[5],u=this.h[6],d=this.h[7];for(tt(this.k.length===n.length),r=0;r<n.length;r++){var p=at(d,ct(c),it(c,l,u),this.k[r],n[r]),h=nt(ot(a),st(a,i,s));d=u,u=l,l=c,c=nt(o,p),o=s,s=i,i=a,a=nt(p,h)}this.h[0]=nt(this.h[0],a),this.h[1]=nt(this.h[1],i),this.h[2]=nt(this.h[2],s),this.h[3]=nt(this.h[3],o),this.h[4]=nt(this.h[4],c),this.h[5]=nt(this.h[5],l),this.h[6]=nt(this.h[6],u),this.h[7]=nt(this.h[7],d)},ht.prototype._digest=function(e){return"hex"===e?Ye.toHex32(this.h,"big"):Ye.split32(this.h,"big")};var ft=Ce,yt=mt;function bt(){if(!(this instanceof bt))return new bt;yt.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}ft.inherits(bt,yt);var gt=bt;bt.blockSize=512,bt.outSize=224,bt.hmacStrength=192,bt.padLength=64,bt.prototype._digest=function(e){return"hex"===e?ft.toHex32(this.h.slice(0,7),"big"):ft.split32(this.h.slice(0,7),"big")};var vt=Ce,wt=Fe,Ct=xe,xt=vt.rotr64_hi,Et=vt.rotr64_lo,kt=vt.shr64_hi,Tt=vt.shr64_lo,Pt=vt.sum64,At=vt.sum64_hi,_t=vt.sum64_lo,Dt=vt.sum64_4_hi,Ot=vt.sum64_4_lo,Ft=vt.sum64_5_hi,St=vt.sum64_5_lo,It=wt.BlockHash,Mt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Nt(){if(!(this instanceof Nt))return new Nt;It.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Mt,this.W=new Array(160)}vt.inherits(Nt,It);var Ut=Nt;function Lt(e,t,n,r,a){var i=e&n^~e&a;return i<0&&(i+=4294967296),i}function Bt(e,t,n,r,a,i){var s=t&r^~t&i;return s<0&&(s+=4294967296),s}function Rt(e,t,n,r,a){var i=e&n^e&a^n&a;return i<0&&(i+=4294967296),i}function jt(e,t,n,r,a,i){var s=t&r^t&i^r&i;return s<0&&(s+=4294967296),s}function Gt(e,t){var n=xt(e,t,28)^xt(t,e,2)^xt(t,e,7);return n<0&&(n+=4294967296),n}function zt(e,t){var n=Et(e,t,28)^Et(t,e,2)^Et(t,e,7);return n<0&&(n+=4294967296),n}function $t(e,t){var n=xt(e,t,14)^xt(e,t,18)^xt(t,e,9);return n<0&&(n+=4294967296),n}function Ht(e,t){var n=Et(e,t,14)^Et(e,t,18)^Et(t,e,9);return n<0&&(n+=4294967296),n}function qt(e,t){var n=xt(e,t,1)^xt(e,t,8)^kt(e,t,7);return n<0&&(n+=4294967296),n}function Vt(e,t){var n=Et(e,t,1)^Et(e,t,8)^Tt(e,t,7);return n<0&&(n+=4294967296),n}function Wt(e,t){var n=xt(e,t,19)^xt(t,e,29)^kt(e,t,6);return n<0&&(n+=4294967296),n}function Zt(e,t){var n=Et(e,t,19)^Et(t,e,29)^Tt(e,t,6);return n<0&&(n+=4294967296),n}Nt.blockSize=1024,Nt.outSize=512,Nt.hmacStrength=192,Nt.padLength=128,Nt.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var a=Wt(n[r-4],n[r-3]),i=Zt(n[r-4],n[r-3]),s=n[r-14],o=n[r-13],c=qt(n[r-30],n[r-29]),l=Vt(n[r-30],n[r-29]),u=n[r-32],d=n[r-31];n[r]=Dt(a,i,s,o,c,l,u,d),n[r+1]=Ot(a,i,s,o,c,l,u,d)}},Nt.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,r=this.h[0],a=this.h[1],i=this.h[2],s=this.h[3],o=this.h[4],c=this.h[5],l=this.h[6],u=this.h[7],d=this.h[8],p=this.h[9],h=this.h[10],m=this.h[11],f=this.h[12],y=this.h[13],b=this.h[14],g=this.h[15];Ct(this.k.length===n.length);for(var v=0;v<n.length;v+=2){var w=b,C=g,x=$t(d,p),E=Ht(d,p),k=Lt(d,p,h,m,f),T=Bt(d,p,h,m,f,y),P=this.k[v],A=this.k[v+1],_=n[v],D=n[v+1],O=Ft(w,C,x,E,k,T,P,A,_,D),F=St(w,C,x,E,k,T,P,A,_,D);w=Gt(r,a),C=zt(r,a),x=Rt(r,a,i,s,o),E=jt(r,a,i,s,o,c);var S=At(w,C,x,E),I=_t(w,C,x,E);b=f,g=y,f=h,y=m,h=d,m=p,d=At(l,u,O,F),p=_t(u,u,O,F),l=o,u=c,o=i,c=s,i=r,s=a,r=At(O,F,S,I),a=_t(O,F,S,I)}Pt(this.h,0,r,a),Pt(this.h,2,i,s),Pt(this.h,4,o,c),Pt(this.h,6,l,u),Pt(this.h,8,d,p),Pt(this.h,10,h,m),Pt(this.h,12,f,y),Pt(this.h,14,b,g)},Nt.prototype._digest=function(e){return"hex"===e?vt.toHex32(this.h,"big"):vt.split32(this.h,"big")};var Kt=Ce,Jt=Ut;function Xt(){if(!(this instanceof Xt))return new Xt;Jt.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Kt.inherits(Xt,Jt);var Yt=Xt;Xt.blockSize=1024,Xt.outSize=384,Xt.hmacStrength=192,Xt.padLength=128,Xt.prototype._digest=function(e){return"hex"===e?Kt.toHex32(this.h.slice(0,12),"big"):Kt.split32(this.h.slice(0,12),"big")},Ne.sha1=Xe,Ne.sha224=gt,Ne.sha256=mt,Ne.sha384=Yt,Ne.sha512=Ut;var Qt={},en=Ce,tn=Fe,nn=en.rotl32,rn=en.sum32,an=en.sum32_3,sn=en.sum32_4,on=tn.BlockHash;function cn(){if(!(this instanceof cn))return new cn;on.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function ln(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function un(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function dn(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}en.inherits(cn,on),Qt.ripemd160=cn,cn.blockSize=512,cn.outSize=160,cn.hmacStrength=192,cn.padLength=64,cn.prototype._update=function(e,t){for(var n=this.h[0],r=this.h[1],a=this.h[2],i=this.h[3],s=this.h[4],o=n,c=r,l=a,u=i,d=s,p=0;p<80;p++){var h=rn(nn(sn(n,ln(p,r,a,i),e[pn[p]+t],un(p)),mn[p]),s);n=s,s=i,i=nn(a,10),a=r,r=h,h=rn(nn(sn(o,ln(79-p,c,l,u),e[hn[p]+t],dn(p)),fn[p]),d),o=d,d=u,u=nn(l,10),l=c,c=h}h=an(this.h[1],a,u),this.h[1]=an(this.h[2],i,d),this.h[2]=an(this.h[3],s,o),this.h[3]=an(this.h[4],n,c),this.h[4]=an(this.h[0],r,l),this.h[0]=h},cn.prototype._digest=function(e){return"hex"===e?en.toHex32(this.h,"little"):en.split32(this.h,"little")};var pn=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],hn=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],mn=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],fn=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],yn=Ce,bn=xe;function gn(e,t,n){if(!(this instanceof gn))return new gn(e,t,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(yn.toArray(t,n))}var vn=gn;gn.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),bn(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},gn.prototype.update=function(e,t){return this.inner.update(e,t),this},gn.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=we;t.utils=Ce,t.common=Fe,t.sha=Ne,t.ripemd=Qt,t.hmac=vn,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}();var wn=d({__proto__:null,default:we},[we]),Cn={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 i(e,t,r,i,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new a(r,i||e,s),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 s(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,i=r.length,s=new Array(i);a<i;a++)s[a]=r[a].fn;return s},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,i,s){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,i),!0;case 6:return u.fn.call(u.context,t,r,a,i,s),!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 i(this,e,t,n,!1)},o.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},o.prototype.removeListener=function(e,t,r,a){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return s(this,i),this;var o=this._events[i];if(o.fn)o.fn!==t||a&&!o.once||r&&o.context!==r||s(this,i);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[i]=1===l.length?l[0]:l:s(this,i)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(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}(Cn);var xn=Cn.exports;const En="function"==typeof atob,kn="function"==typeof btoa,Tn="function"==typeof Buffer,Pn="function"==typeof TextDecoder?new TextDecoder:void 0,An="function"==typeof TextEncoder?new TextEncoder:void 0,_n=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Dn=(e=>{let t={};return _n.forEach(((e,n)=>t[e]=n)),t})(),On=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Fn=String.fromCharCode.bind(String),Sn="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),In=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Mn=kn?e=>btoa(e):Tn?e=>Buffer.from(e,"binary").toString("base64"):e=>{let t,n,r,a,i="";const s=e.length%3;for(let s=0;s<e.length;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|a,i+=_n[t>>18&63]+_n[t>>12&63]+_n[t>>6&63]+_n[63&t]}return s?i.slice(0,s-3)+"===".substring(s):i},Nn=Tn?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(Fn.apply(null,e.subarray(n,n+4096)));return Mn(t.join(""))},Un=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Fn(192|t>>>6)+Fn(128|63&t):Fn(224|t>>>12&15)+Fn(128|t>>>6&63)+Fn(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Fn(240|t>>>18&7)+Fn(128|t>>>12&63)+Fn(128|t>>>6&63)+Fn(128|63&t)},Ln=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Bn=Tn?e=>Buffer.from(e,"utf8").toString("base64"):An?e=>Nn(An.encode(e)):e=>Mn((e=>e.replace(Ln,Un))(e)),Rn=e=>((e,t=!1)=>t?(e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")))(Bn(e)):Bn(e))(e,!0),jn=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Gn=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Fn(55296+(t>>>10))+Fn(56320+(1023&t));case 3:return Fn((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Fn((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},zn=En?e=>atob(In(e)):Tn?e=>Buffer.from(e,"base64").toString("binary"):e=>{if(e=e.replace(/\s+/g,""),!On.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n,r,a="";for(let i=0;i<e.length;)t=Dn[e.charAt(i++)]<<18|Dn[e.charAt(i++)]<<12|(n=Dn[e.charAt(i++)])<<6|(r=Dn[e.charAt(i++)]),a+=64===n?Fn(t>>16&255):64===r?Fn(t>>16&255,t>>8&255):Fn(t>>16&255,t>>8&255,255&t);return a},$n=Tn?e=>Sn(Buffer.from(e,"base64")):e=>Sn(zn(e).split("").map((e=>e.charCodeAt(0)))),Hn=Tn?e=>Buffer.from(e,"base64").toString("utf8"):Pn?e=>Pn.decode($n(e)):e=>(e=>e.replace(jn,Gn))(zn(e));function qn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vn(e){if(Array.isArray(e))return qn(e)}function Wn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zn(e,t,n){return Zn=ir()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&er(a,n.prototype),a},Zn.apply(null,arguments)}function Kn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Jn(e,t,n){return t&&Kn(e.prototype,t),n&&Kn(e,n),e}function Xn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yn(e){return Yn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Yn(e)}function Qn(e,t){return!t||"object"!==nr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function er(e,t){return er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},er(e,t)}function tr(e){return Vn(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||rr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nr(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function rr(e,t){if(e){if("string"==typeof e)return qn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qn(e,t):void 0}}function ar(e){var t="function"==typeof Map?new Map:void 0;return ar=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Zn(e,arguments,Yn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),er(n,e)},ar(e)}function ir(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ir=function(){return!!e})()}var sr,or=Object.defineProperty,cr=function(e,t,n){return function(e,t,n){t in e?or(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!=(void 0===t?"undefined":nr(t))?t+"":t,n),n};function lr(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}Xn(sr={},"PARSE_ERROR",{code:-32700,message:"Parse error"}),Xn(sr,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),Xn(sr,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),Xn(sr,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),Xn(sr,"INTERNAL_ERROR",{code:-32603,message:"Internal error"}),Xn(sr,"SERVER_ERROR",{code:-32e3,message:"Server error"});var ur="hex",dr="utf8";function pr(e){return e.replace(/^0x/,"")}function hr(e){return fr(Buffer.from(pr(e),ur))}function mr(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.toString(ur);return t?function(e){return e.startsWith("0x")?e:"0x".concat(e)}(n):n}(yr(e),t)}function fr(e){return new Uint8Array(e)}function yr(e){return function(e){return ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)}(e)}function br(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=[];return t.forEach((function(e){return r=r.concat(Array.from(e))})),new Uint8Array(tr(r))}function gr(e){return function(e){return e.toString(dr)}(yr(e))}function vr(e){return yr(new Uint8Array(e))}var wr={16:10,24:12,32:14},Cr=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],xr=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Er=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],kr=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Tr=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Pr=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Ar=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],_r=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Dr=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Or=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Fr=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Sr=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Ir=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Mr=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Nr=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Ur(e){return parseInt("".concat(e))===e}function Lr(e){if(!Ur(e.length))return!1;for(var t=0;t<e.length;t++)if(!Ur(e[t])||e[t]<0||e[t]>255)return!1;return!0}function Br(e){return new Uint8Array(e)}function Rr(e){for(var t=[],n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);return t}function jr(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!Lr(e))throw new Error("Array contains invalid value");return new Uint8Array(e)}if(Ur(e.length)&&Lr(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function Gr(e,t,n,r,a){(null!=r||null!=a)&&(e=e.slice?e.slice(r,a):Array.prototype.slice.call(e,r,a)),t.set(e,n)}var zr=function(){function e(t){Wn(this,e),cr(this,"key"),cr(this,"_Ke"),cr(this,"_Kd"),this.key=jr(t,!0),this._prepare()}return Jn(e,[{key:"_prepare",value:function(){var e=wr[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var n,r=4*(e+1),a=this.key.length/4,i=Rr(this.key),s=0;s<a;s++)n=s>>2,this._Ke[n][s%4]=i[s],this._Kd[e-n][s%4]=i[s];for(var o,c=0,l=a;l<r;){if(o=i[a-1],i[0]^=xr[o>>16&255]<<24^xr[o>>8&255]<<16^xr[255&o]<<8^xr[o>>24&255]^Cr[c]<<24,c+=1,8!=a)for(var u=1;u<a;u++)i[u]^=i[u-1];else{for(var d=1;d<a/2;d++)i[d]^=i[d-1];o=i[a/2-1],i[a/2]^=xr[255&o]^xr[o>>8&255]<<8^xr[o>>16&255]<<16^xr[o>>24&255]<<24;for(var p=a/2+1;p<a;p++)i[p]^=i[p-1]}for(var h=0,m=void 0,f=void 0;h<a&&l<r;)m=l>>2,f=l%4,this._Ke[m][f]=i[h],this._Kd[e-m][f]=i[h++],l++}for(var y=1;y<e;y++)for(var b=0;b<4;b++)o=this._Kd[y][b],this._Kd[y][b]=Sr[o>>24&255]^Ir[o>>16&255]^Mr[o>>8&255]^Nr[255&o]}},{key:"encrypt",value:function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,n=[0,0,0,0],r=Rr(e),a=0;a<4;a++)r[a]^=this._Ke[0][a];for(var i=1;i<t;i++){for(var s=0;s<4;s++)n[s]=kr[r[s]>>24&255]^Tr[r[(s+1)%4]>>16&255]^Pr[r[(s+2)%4]>>8&255]^Ar[255&r[(s+3)%4]]^this._Ke[i][s];r=n.slice()}for(var o,c=Br(16),l=0;l<4;l++)o=this._Ke[t][l],c[4*l]=255&(xr[r[l]>>24&255]^o>>24),c[4*l+1]=255&(xr[r[(l+1)%4]>>16&255]^o>>16),c[4*l+2]=255&(xr[r[(l+2)%4]>>8&255]^o>>8),c[4*l+3]=255&(xr[255&r[(l+3)%4]]^o);return c}},{key:"decrypt",value:function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,n=[0,0,0,0],r=Rr(e),a=0;a<4;a++)r[a]^=this._Kd[0][a];for(var i=1;i<t;i++){for(var s=0;s<4;s++)n[s]=_r[r[s]>>24&255]^Dr[r[(s+3)%4]>>16&255]^Or[r[(s+2)%4]>>8&255]^Fr[255&r[(s+1)%4]]^this._Kd[i][s];r=n.slice()}for(var o,c=Br(16),l=0;l<4;l++)o=this._Kd[t][l],c[4*l]=255&(Er[r[l]>>24&255]^o>>24),c[4*l+1]=255&(Er[r[(l+3)%4]>>16&255]^o>>16),c[4*l+2]=255&(Er[r[(l+2)%4]>>8&255]^o>>8),c[4*l+3]=255&(Er[255&r[(l+1)%4]]^o);return c}}]),e}(),$r=function(){function e(t,n){if(Wn(this,e),cr(this,"_aes"),cr(this,"_lastCipherblock"),n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else n=new Uint8Array(16);this._lastCipherblock=jr(n,!0),this._aes=new zr(t)}return Jn(e,[{key:"encrypt",value:function(e){if(e=jr(e),e.length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=Br(e.length),n=Br(16),r=0;r<e.length;r+=16){Gr(e,n,0,r,r+16);for(var a=0;a<16;a++)n[a]^=this._lastCipherblock[a];this._lastCipherblock=this._aes.encrypt(n),Gr(this._lastCipherblock,t,r)}return t}},{key:"decrypt",value:function(e){if(e=jr(e),e.length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=Br(e.length),n=Br(16),r=0;r<e.length;r+=16){Gr(e,n,0,r,r+16),n=this._aes.decrypt(n);for(var a=0;a<16;a++)t[r+a]=n[a]^this._lastCipherblock[a];Gr(e,this._lastCipherblock,0,r,r+16)}return t}}]),e}(),Hr=[[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16],[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15],[14,14,14,14,14,14,14,14,14,14,14,14,14,14],[13,13,13,13,13,13,13,13,13,13,13,13,13],[12,12,12,12,12,12,12,12,12,12,12,12],[11,11,11,11,11,11,11,11,11,11,11],[10,10,10,10,10,10,10,10,10,10],[9,9,9,9,9,9,9,9,9],[8,8,8,8,8,8,8,8],[7,7,7,7,7,7,7],[6,6,6,6,6,6],[5,5,5,5,5],[4,4,4,4],[3,3,3],[2,2],[1]],qr={pad:function(e){var t=Hr[e.byteLength%16||0],n=new Uint8Array(e.byteLength+t.length);return n.set(e),n.set(t,e.byteLength),n},unpad:function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}},Vr="sha256";function Wr(e,t){return hr(we.hmac(wn[Vr],e).update(t).digest("hex"))}function Zr(e){var t=function(e){for(var t=new Uint8Array(e),n=0;n<e;++n)t[n]=Math.floor(256*Math.random());return yr(t)}(e);return fr(t)}function Kr(e){return function(e){return fr(e).buffer}(yr(Zr((e||256)/8)))}var Jr={error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).error.apply(r,["[ERROR]"].concat(tr(t)))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).warn.apply(r,["[WARN]"].concat(tr(t)))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).info.apply(r,["[INFO]"].concat(tr(t)))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).log.apply(r,["[DEBUG]"].concat(tr(t)))}},Xr=("undefined"==typeof window?"undefined":nr(window))<"u";function Yr(){for(var e=function(e){var t=a[e],r=["itemprop","property","name"].map((function(e){return t.getAttribute(e)})).filter((function(e){return!!e&&n.includes(e)}));if(r.length&&r){var i=t.getAttribute("content");if(i)return{v:i}}},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var a=document.getElementsByTagName("meta"),i=0;i<a.length;i++){var s=e(i);if("object"===nr(s))return s.v}return""}var Qr=function(e){function t(e,n){var r;return Wn(this,t),r=function(e,t,n){return t=Yn(t),Qn(e,ir()?Reflect.construct(t,n||[],Yn(e).constructor):t.apply(e,n))}(this,t,[n]),cr(r,"code"),r.code=e,Object.setPrototypeOf(r,(function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}(this,t)?this.constructor:void 0).prototype),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&er(e,t)}(t,e),Jn(t,[{key:"toString",value:function(){return"".concat(this.message," (").concat(this.code,")")}}]),t}(ar(Error)),ea=function(){return!!(nr(window.navigator)>"u"?"":navigator.userAgent).match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i)},ta=function(e,t){var n="appId=xoqXxUSMRccLCrZNRebmzj&startPagePath=L3BhZ2VzL2Rhc2hib2FyZC1uZXcvaW5kZXg=";if(t){var r=Rn("wc=".concat(encodeURIComponent(t),"&isDeepLink=true&id=").concat(+new Date));n="".concat(n,"&startPageQuery=").concat(r)}var a="//app.binance.com";return e?"bnc:".concat(a,"/mp/app?").concat(n):"https:".concat(a,"/?_dp=").concat(Rn("/mp/app?".concat(n)))},na=function(){try{var e,t;return!0===(null===(t=window)||void 0===t||null===(e=t.ethereum)||void 0===e?void 0:e.isBinance)}catch(e){return!1}};function ra(e){e=atob(e);const t=[];for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));return n.arrayify(t)}function aa(e){e=n.arrayify(e);let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}let ia=!1,sa=!1;const oa={debug:1,default:2,info:2,warning:3,error:4,off:5};let ca=oa.default,la=null;const ua=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var da;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(da||(da={})),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 pa="0123456789abcdef";class ha{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==oa[n]&&this.throwArgumentError("invalid log level name","logLevel",e),ca>oa[n]||console.log.apply(console,t)}debug(...e){this._log(ha.levels.DEBUG,e)}info(...e){this._log(ha.levels.INFO,e)}warn(...e){this._log(ha.levels.WARNING,e)}makeError(e,t,n){if(sa)return this.makeError("censored error",t,{});t||(t=ha.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+=pa[t[e]>>4],n+=pa[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 i="";switch(t){case exports.ErrorCode.NUMERIC_FAULT:{i="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":i+="-"+t;break;case"negative-power":case"negative-width":i+="-unsupported";break;case"unbound-bitwise-result":i+="-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:i=t}i&&(e+=" [ See: https://links.ethers.org/v5-errors-"+i+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const s=new Error(e);return s.reason=a,s.code=t,Object.keys(n).forEach((function(e){s[e]=n[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,ha.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){ua&&this.throwError("platform missing String.prototype.normalize",ha.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ua})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,ha.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,ha.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,ha.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,ha.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",ha.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",ha.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",ha.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return la||(la=new ha("logger/5.7.0")),la}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",ha.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),ia){if(!e)return;this.globalLogger().throwError("error censorship permanent",ha.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}sa=!!e,ia=!!t}static setLogLevel(e){const t=oa[e.toLowerCase()];null!=t?ca=t:ha.globalLogger().warn("invalid log level - "+e)}static from(e){return new ha(e)}}ha.errors=exports.ErrorCode,ha.levels=da;const ma=new ha("strings/5.7.0");var fa,ya;function ba(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,(fa=exports.UnicodeNormalizationForm||(exports.UnicodeNormalizationForm={})).current="",fa.NFC="NFC",fa.NFD="NFD",fa.NFKC="NFKC",fa.NFKD="NFKD",exports.Utf8ErrorReason=void 0,(ya=exports.Utf8ErrorReason||(exports.Utf8ErrorReason={})).UNEXPECTED_CONTINUE="unexpected continuation byte",ya.BAD_PREFIX="bad codepoint prefix",ya.OVERRUN="string overrun",ya.MISSING_CONTINUE="missing continuation byte",ya.OUT_OF_RANGE="out of UTF-8 range",ya.UTF16_SURROGATE="UTF-16 surrogate",ya.OVERLONG="overlong representation";const ga=Object.freeze({error:function(e,t,n,r,a){return ma.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:ba,replace:function(e,t,n,r,a){return e===exports.Utf8ErrorReason.OVERLONG?(r.push(a),0):(r.push(65533),ba(e,t,n))}});function va(e,t){null==t&&(t=ga.error),e=n.arrayify(e);const r=[];let a=0;for(;a<e.length;){const n=e[a++];if(n>>7==0){r.push(n);continue}let i=null,s=null;if(192==(224&n))i=1,s=127;else if(224==(240&n))i=2,s=2047;else{if(240!=(248&n)){a+=t(128==(192&n)?exports.Utf8ErrorReason.UNEXPECTED_CONTINUE:exports.Utf8ErrorReason.BAD_PREFIX,a-1,e,r);continue}i=3,s=65535}if(a-1+i>=e.length){a+=t(exports.Utf8ErrorReason.OVERRUN,a-1,e,r);continue}let o=n&(1<<8-i-1)-1;for(let n=0;n<i;n++){let n=e[a];if(128!=(192&n)){a+=t(exports.Utf8ErrorReason.MISSING_CONTINUE,a,e,r),o=null;break}o=o<<6|63&n,a++}null!==o&&(o>1114111?a+=t(exports.Utf8ErrorReason.OUT_OF_RANGE,a-1-i,e,r,o):o>=55296&&o<=57343?a+=t(exports.Utf8ErrorReason.UTF16_SURROGATE,a-1-i,e,r,o):o<=s?a+=t(exports.Utf8ErrorReason.OVERLONG,a-1-i,e,r,o):r.push(o))}return r}function wa(e,t=exports.UnicodeNormalizationForm.current){t!=exports.UnicodeNormalizationForm.current&&(ma.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const a=e.charCodeAt(t);if(t>=e.length||56320!=(64512&a))throw new Error("invalid utf-8 string");const i=65536+((1023&n)<<10)+(1023&a);r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(63&i|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return n.arrayify(r)}function Ca(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function xa(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Ea(e,t){return xa(va(e,t))}var ka=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(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(s,o)}c((r=r.apply(e,t||[])).next())}))};function Ta(e,t){return ka(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const a=yield fetch(e,r),i=yield a.arrayBuffer(),s={};return a.headers.forEach?a.headers.forEach(((e,t)=>{s[t.toLowerCase()]=e})):a.headers.keys().forEach((e=>{s[e.toLowerCase()]=a.headers.get(e)})),{headers:s,statusCode:a.status,statusMessage:a.statusText,body:n.arrayify(new Uint8Array(i))}}))}var Pa=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(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(s,o)}c((r=r.apply(e,t||[])).next())}))};const Aa=new ha("web/5.7.1");function _a(e){return new Promise((t=>{setTimeout(t,e)}))}function Da(e,t){if(null==e)return null;if("string"==typeof e)return e;if(n.isBytesLike(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Ea(e)}catch(e){}return n.hexlify(e)}return e}function Oa(e,t,n){const a="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Aa.assertArgument(a>0&&a%1==0,"invalid connection throttle limit","connection.throttleLimit",a);const i="object"==typeof e?e.throttleCallback:null,s="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Aa.assertArgument(s>0&&s%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);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||Aa.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&&Aa.throwError("basic authentication requires a secure https url",ha.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;c.authorization={key:"Authorization",value:"Basic "+aa(wa(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=r.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]?ra(m[3]):(f=m[3],wa(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){Aa.throwError("processing response error",ha.errors.SERVER_ERROR,{body:Da(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(Aa.makeError("timeout",ha.errors.TIMEOUT,{requestBody:Da(u.body,y["content-type"]),requestMethod:u.method,timeout:p,url:l})))}),p))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),g=function(){return Pa(this,void 0,void 0,(function*(){for(let e=0;e<a;e++){let t=null;try{if(t=yield Ta(l,u),e<a)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(i&&(n=yield i(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):s*parseInt(String(Math.random()*Math.pow(2,e))),yield _a(n);continue}}}catch(e){t=e.response,null==t&&(b.cancel(),Aa.throwError("missing response",ha.errors.SERVER_ERROR,{requestBody:Da(u.body,y["content-type"]),requestMethod:u.method,serverError:e,url:l}))}let r=t.body;if(d&&304===t.statusCode?r=null:!o&&(t.statusCode<200||t.statusCode>=300)&&(b.cancel(),Aa.throwError("bad response",ha.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Da(r,t.headers?t.headers["content-type"]:null),requestBody:Da(u.body,y["content-type"]),requestMethod:u.method,url:l})),n)try{const e=yield n(r,t);return b.cancel(),e}catch(n){if(n.throttleRetry&&e<a){let t=!0;if(i&&(t=yield i(e,l)),t){const t=s*parseInt(String(Math.random()*Math.pow(2,e)));yield _a(t);continue}}b.cancel(),Aa.throwError("processing response error",ha.errors.SERVER_ERROR,{body:Da(r,t.headers?t.headers["content-type"]:null),error:n,requestBody:Da(u.body,y["content-type"]),requestMethod:u.method,url:l})}return b.cancel(),r}return Aa.throwError("failed response",ha.errors.SERVER_ERROR,{requestBody:Da(u.body,y["content-type"]),requestMethod:u.method,url:l})}))}();return Promise.race([b.promise,g])}function Fa(e,t,n){let a=null;if(null!=t){a=wa(t);const n="string"==typeof e?{url:e}:r.shallowCopy(e);if(n.headers){const e=0!==Object.keys(n.headers).filter((e=>"content-type"===e.toLowerCase())).length;e||(n.headers=r.shallowCopy(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return Oa(e,a,((e,t)=>{let r=null;if(null!=e)try{r=JSON.parse(Ea(e))}catch(t){Aa.throwError("invalid JSON",ha.errors.SERVER_ERROR,{body:e,error:t})}return n&&(r=n(r,t)),r}))}function Sa(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 Ia 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 a={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:r.deepCopy(a),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=Fa(Object.assign(Object.assign({},this.connection),{url:this.rpcUrl||(null===(n=this.connection)||void 0===n?void 0:n.url)}),JSON.stringify(a),Sa).then((e=>(this.emit("debug",{action:"response",request:a,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:a,provider:this}),e}));return i&&(this._cache[e]=s,setTimeout((()=>{this._cache[e]=null}),0)),s}}function Ma(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const Na=Ma({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}),Ua=e=>e;class La 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 La?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof La&&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 Ba(this,e)}}function Ba(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?Ba(e.cause,t):t?null:e}class Ra extends La{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 ja extends La{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 Ga extends La{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 za extends La{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 $a(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function Ha(e){return $a(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function qa(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 Va extends La{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 Wa extends La{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 Za extends La{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 Ka(e,{dir:t,size:n=32}={}){return"string"==typeof e?Ja(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new Wa({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let a=0;a<n;a++){const i="right"===t;r[i?a:n-a-1]=e[i?a:e.length-a-1]}return r}(e,{dir:t,size:n})}function Ja(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new Wa({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}const Xa=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Ya(e,t={}){return"number"==typeof e||"bigint"==typeof e?ti(e,t):"string"==typeof e?ri(e,t):"boolean"==typeof e?Qa(e,t):ei(e,t)}function Qa(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(ui(n,{size:t.size}),Ka(n,{size:t.size})):n}function ei(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=Xa[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(ui(r,{size:t.size}),Ka(r,{dir:"right",size:t.size})):r}function ti(e,t={}){const{signed:n,size:r}=t,a=BigInt(e);let i;r?i=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(i=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof i&&n?-i-1n:0;if(i&&a>i||a<s){const t="bigint"==typeof e?"n":"";throw new Ra({max:i?`${i}${t}`:void 0,min:`${s}${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?Ka(o,{size:r}):o}const ni=new TextEncoder;function ri(e,t={}){return ei(ni.encode(e),t)}const ai=new TextEncoder;function ii(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=ti(e,t);return ci(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return ui(n,{size:t.size}),Ka(n,{size:t.size});return n}(e,t):$a(e)?ci(e,t):li(e,t)}const si={zero:48,nine:57,A:65,F:70,a:97,f:102};function oi(e){return e>=si.zero&&e<=si.nine?e-si.zero:e>=si.A&&e<=si.F?e-(si.A-10):e>=si.a&&e<=si.f?e-(si.a-10):void 0}function ci(e,t={}){let n=e;t.size&&(ui(n,{size:t.size}),n=Ka(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const a=r.length/2,i=new Uint8Array(a);for(let e=0,t=0;e<a;e++){const n=oi(r.charCodeAt(t++)),a=oi(r.charCodeAt(t++));if(void 0===n||void 0===a)throw new La(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);i[e]=16*n+a}return i}function li(e,t={}){const n=ai.encode(e);return"number"==typeof t.size?(ui(n,{size:t.size}),Ka(n,{dir:"right",size:t.size})):n}function ui(e,{size:t}){if(Ha(e)>t)throw new za({givenSize:Ha(e),maxSize:t})}function di(e,t){const n="string"==typeof t?{to:t}:t,r=n.to;return"number"===r?hi(e,n):"bigint"===r?pi(e,n):"string"===r?function(e,t={}){let n=ci(e);t.size&&(ui(n,{size:t.size}),n=qa(n,{dir:"right"}));return(new TextDecoder).decode(n)}(e,n):"boolean"===r?function(e,t={}){let n=e;t.size&&(ui(n,{size:t.size}),n=qa(n));if("0x00"===qa(n))return!1;if("0x01"===qa(n))return!0;throw new Ga(n)}(e,n):ci(e,n)}function pi(e,t={}){const{signed:n}=t;t.size&&ui(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 hi(e,t={}){return Number(pi(e,t))}function mi(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 fi={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function yi(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?hi(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?hi(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?fi[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 bi=mi("transaction",yi);function gi(e){const t=e.transactions?.map((e=>"string"==typeof e?e:yi(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 vi=mi("block",gi);function wi(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 Ci={"0x0":"reverted","0x1":"success"};function xi(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=>wi(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?hi(e.transactionIndex):null,status:e.status?Ci[e.status]:null,type:e.type?fi[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const Ei=mi("transactionReceipt",xi),ki={block:vi({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=yi(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?pi(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:bi({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?pi(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Ei({format:e=>({l1GasPrice:e.l1GasPrice?pi(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?pi(e.l1GasUsed):null,l1Fee:e.l1Fee?pi(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})};class Ti extends La{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 Pi 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 Ai(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function _i(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 Di(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 Oi(e,t){_i(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Fi=BigInt(2**32-1),Si=BigInt(32);function Ii(e,t=!1){return t?{h:Number(e&Fi),l:Number(e>>Si&Fi)}:{h:0|Number(e>>Si&Fi),l:0|Number(e&Fi)}}function Mi(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let a=0;a<e.length;a++){const{h:i,l:s}=Ii(e[a],t);[n[a],r[a]]=[i,s]}return[n,r]}const Ni=e=>e instanceof Uint8Array,Ui=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Li=(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 Bi(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)),!Ni(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class Ri{clone(){return this._cloneInto()}}function ji(e){const t=t=>e().update(Bi(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const[Gi,zi,$i]=[[],[],[]],Hi=BigInt(0),qi=BigInt(1),Vi=BigInt(2),Wi=BigInt(7),Zi=BigInt(256),Ki=BigInt(113);for(let e=0,t=qi,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Gi.push(2*(5*r+n)),zi.push((e+1)*(e+2)/2%64);let a=Hi;for(let e=0;e<7;e++)t=(t<<qi^(t>>Wi)*Ki)%Zi,t&Vi&&(a^=qi<<(qi<<BigInt(e))-qi);$i.push(a)}const[Ji,Xi]=Mi($i,!0),Yi=(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),Qi=(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 es extends Ri{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,Ai(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.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,i=n[a],s=n[a+1],o=Yi(i,s,1)^n[r],c=Qi(i,s,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=zi[n],i=Yi(t,a,r),s=Qi(t,a,r),o=Gi[n];t=e[o],a=e[o+1],e[o]=i,e[o+1]=s}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]^=Ji[r],e[1]^=Xi[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Di(this);const{blockLen:t,state:n}=this,r=(e=Bi(e)).length;for(let a=0;a<r;){const i=Math.min(t-this.pos,r-a);for(let t=0;t<i;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){Di(this,!1),_i(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 i=Math.min(n-this.posOut,a-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ai(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Oi(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:i}=this;return e||(e=new es(t,n,r,i,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=i,e.destroyed=this.destroyed,e}}const ts=((e,t,n)=>ji((()=>new es(t,e,n))))(1,136,32);function ns(e,t){const n=t||"hex",r=ts($a(e,{strict:!1})?ii(e):e);return"bytes"===n?r:Ya(r)}function rs(e,t){const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=ns(li(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 as=/^0x[a-fA-F0-9]{40}$/,is=new Pi(8192);function ss(e,{strict:t=!0}={}){if(is.has(e))return is.get(e);const n=!(!as.test(e)||e.toLowerCase()!==e&&t&&rs(e)!==e);return is.set(e,n),n}function os(e){return"string"==typeof e[0]?cs(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 cs(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}class ls extends Error{constructor(e,t={}){const n=t.cause instanceof ls?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof ls&&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 us(e,t){const n=e.exec(t);return n?.groups}const ds=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,ps=/^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)?$/,hs=/^\(.+?\).*?$/,ms=/^tuple(?<array>(\[(\d*)\])*)$/;function fs(e){let t=e.type;if(ms.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){t+=fs(e.components[r]),r<n-1&&(t+=", ")}const r=us(ms,e.type);return t+=`)${r?.array??""}`,fs({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function ys(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=fs(e[r]),r!==n-1&&(t+=", ")}return t}const bs=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function gs(e){return bs.test(e)}function vs(e){return us(bs,e)}const ws=new Set(["memory","indexed","storage","calldata"]),Cs=new Set(["calldata","memory","storage"]);class xs extends ls{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 Es extends ls{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 ks extends ls{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 Ts extends ls{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Ps extends ls{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 As extends ls{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 _s extends ls{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 Ds extends ls{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 Os extends ls{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Fs extends ls{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 Ss extends ls{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 Is extends ls{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 Ms=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}]]),Ns=/^(?<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$_]*))?$/,Us=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Ls=/^u?int$/;function Bs(e,t){const n=function(e,t){return t?`${t}:${e}`:e}(e,t?.type);if(Ms.has(n))return Ms.get(n);const r=hs.test(e),a=us(r?Us:Ns,e);if(!a)throw new Ts({param:e});if(a.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||ds.test(e)||ps.test(e)||Gs.test(e)}(a.name))throw new Ps({param:e,name:a.name});const i=a.name?{name:a.name}:{},s="indexed"===a.modifier?{indexed:!0}:{},o=t?.structs??{};let c,l={};if(r){c="tuple";const e=Rs(a.type),t=[],n=e.length;for(let r=0;r<n;r++)t.push(Bs(e[r],{structs:o}));l={components:t}}else if(a.type in o)c="tuple",l={components:o[a.type]};else if(Ls.test(a.type))c=`${a.type}256`;else if(c=a.type,"struct"!==t?.type&&!js(c))throw new Es({type:c});if(a.modifier){if(!t?.modifiers?.has?.(a.modifier))throw new As({param:e,type:t?.type,modifier:a.modifier});if(Cs.has(a.modifier)&&!function(e,t){return t||"bytes"===e||"string"===e||"tuple"===e}(c,!!a.array))throw new _s({param:e,type:t?.type,modifier:a.modifier})}const u={type:`${c}${a.array??""}`,...i,...s,...l};return Ms.set(n,u),u}function Rs(e,t=[],n="",r=0){const a=e.trim().length;for(let i=0;i<a;i++){const a=e[i],s=e.slice(i+1);switch(a){case",":return 0===r?Rs(s,[...t,n.trim()]):Rs(s,t,`${n}${a}`,r);case"(":return Rs(s,t,`${n}${a}`,r+1);case")":return Rs(s,t,`${n}${a}`,r-1);default:return Rs(s,t,`${n}${a}`,r)}}if(""===n)return t;if(0!==r)throw new Is({current:n,depth:r});return t.push(n.trim()),t}function js(e){return"address"===e||"bool"===e||"function"===e||"string"===e||ds.test(e)||ps.test(e)}const Gs=/^(?: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 zs=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function $s(e,t,n=new Set){const r=[],a=e.length;for(let i=0;i<a;i++){const a=e[i];if(hs.test(a.type))r.push(a);else{const e=us(zs,a.type);if(!e?.type)throw new Ds({abiParameter:a});const{array:i,type:s}=e;if(s in t){if(n.has(s))throw new Ss({type:s});r.push({...a,type:`tuple${i??""}`,components:$s(t[s]??[],t,new Set([...n,s]))})}else{if(!js(s))throw new xs({type:s});r.push(a)}}}return r}function Hs(e){const t=[];if("string"==typeof e){const n=Rs(e),r=n.length;for(let e=0;e<r;e++)t.push(Bs(n[e],{modifiers:ws}))}else{const n=function(e){const t={},n=e.length;for(let r=0;r<n;r++){const n=e[r];if(!gs(n))continue;const a=vs(n);if(!a)throw new Os({signature:n,type:"struct"});const i=a.properties.split(";"),s=[],o=i.length;for(let e=0;e<o;e++){const t=i[e].trim();if(!t)continue;const n=Bs(t,{type:"struct"});s.push(n)}if(!s.length)throw new Fs({signature:n});t[a.name]=s}const r={},a=Object.entries(t),i=a.length;for(let e=0;e<i;e++){const[n,i]=a[e];r[n]=$s(i,t)}return r}(e),r=e.length;for(let a=0;a<r;a++){const r=e[a];if(gs(r))continue;const i=Rs(r),s=i.length;for(let e=0;e<s;e++)t.push(Bs(i[e],{modifiers:ws,structs:n}))}}if(0===t.length)throw new ks({params:e});return t}function qs(e,t,n){return r=>e[t.name||n]?.(r)??t(e,r)}function Vs(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new fo(e.type);return`${e.name}(${Ws(e.inputs,{includeName:t})})`}function Ws(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${Ws(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}class Zs extends La{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 Ks extends La{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 Js extends La{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${Ws(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 Xs extends La{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class Ys extends La{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 Qs extends La{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${Ha(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class eo extends La{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 to extends La{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 no extends La{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 ro extends La{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class ao extends La{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 io extends La{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 so extends La{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 oo extends La{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Vs(e.abiItem)}\`, and`,`\`${t.type}\` in \`${Vs(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 co extends La{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 lo extends La{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: (${Ws(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 uo extends La{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${Vs(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 po extends La{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 ho extends La{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 mo extends La{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 fo extends La{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 yo extends La{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const bo=e=>ns(ii(e));const go=e=>{var t;return function(e){let t=!0,n="",r=0,a="",i=!1;for(let s=0;s<e.length;s++){const o=e[s];if(["(",")",","].includes(o)&&(t=!0),"("===o&&r++,")"===o&&r--,t)if(0!==r)" "!==o?(a+=o,n+=o):","!==e[s-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===o&&["event","function",""].includes(a))a="";else if(a+=o,")"===o){i=!0;break}}if(!i)throw new La("Unable to normalize signature.");return a}("string"==typeof e?e:"function"===(t=e).type?`function ${t.name}(${ys(t.inputs)})${t.stateMutability&&"nonpayable"!==t.stateMutability?` ${t.stateMutability}`:""}${t.outputs.length?` returns (${ys(t.outputs)})`:""}`:"event"===t.type?`event ${t.name}(${ys(t.inputs)})`:"error"===t.type?`error ${t.name}(${ys(t.inputs)})`:"constructor"===t.type?`constructor(${ys(t.inputs)})${"payable"===t.stateMutability?" payable":""}`:"fallback"===t.type?"fallback()":"receive() external payable")};function vo(e){return t=go(e),bo(t);var t}const wo=vo;function Co(e,t,n,{strict:r}={}){return $a(e,{strict:!1})?function(e,t,n,{strict:r}={}){xo(e,t);const a=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&Eo(a,t,n);return a}(e,t,n,{strict:r}):ko(e,t,n,{strict:r})}function xo(e,t){if("number"==typeof t&&t>0&&t>Ha(e)-1)throw new Va({offset:t,position:"start",size:Ha(e)})}function Eo(e,t,n){if("number"==typeof t&&"number"==typeof n&&Ha(e)!==n-t)throw new Va({offset:n,position:"end",size:Ha(e)})}function ko(e,t,n,{strict:r}={}){xo(e,t);const a=e.slice(t,n);return r&&Eo(a,t,n),a}function To(e,t){if(e.length!==t.length)throw new eo({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(Po({param:e[r],value:t[r]}));return n}({params:e,values:t}),r=Ao(n);return 0===r.length?"0x":r}function Po({param:e,value:t}){const n=_o(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 mo(e);if(!r&&e.length!==t)throw new Ys({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let a=!1;const i=[];for(let t=0;t<e.length;t++){const r=Po({param:n,value:e[t]});r.dynamic&&(a=!0),i.push(r)}if(r||a){const e=Ao(i);if(r){const t=ti(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?os([t,e]):t}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:os(i.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 i=t.components[a],s=Po({param:i,value:e[Array.isArray(e)?a:i.name]});r.push(s),s.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Ao(r):os(r.map((({encoded:e})=>e)))}}(t,{param:e});if("address"===e.type)return function(e){if(!ss(e))throw new Ti({address:e});return{dynamic:!1,encoded:Ja(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){return{dynamic:!1,encoded:Ja(Qa(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:ti(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=Ha(e);if(!n){let t=e;return r%32!=0&&(t=Ja(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:os([Ja(ti(r,{size:32})),t])}}if(r!==parseInt(n))throw new Qs({expectedSize:parseInt(n),value:e});return{dynamic:!1,encoded:Ja(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=ri(e),n=Math.ceil(Ha(t)/32),r=[];for(let e=0;e<n;e++)r.push(Ja(Co(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:os([Ja(ti(Ha(t),{size:32})),...r])}}(t);throw new po(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Ao(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:r,encoded:a}=e[n];t+=r?32:Ha(a)}const n=[],r=[];let a=0;for(let i=0;i<e.length;i++){const{dynamic:s,encoded:o}=e[i];s?(n.push(ti(t+a,{size:32})),r.push(o),a+=Ha(o)):n.push(o)}return os([...n,...r])}function _o(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Do=e=>Co(vo(e),0,4);function Oo(e){const{abi:t,args:n=[],name:r}=e,a=$a(r,{strict:!1}),i=t.filter((e=>a?"function"===e.type?Do(e)===r:"event"===e.type&&wo(e)===r:"name"in e&&e.name===r));if(0===i.length)return;if(1===i.length)return i[0];let s;for(const e of i){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&&Fo(t,r)}));if(t){if(s&&"inputs"in s&&s.inputs){const t=So(e.inputs,s.inputs,n);if(t)throw new oo({abiItem:e,type:t[0]},{abiItem:s,type:t[1]})}s=e}}return s||i[0]}function Fo(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ss(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)=>Fo(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=>Fo(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function So(e,t,n){for(const r in e){const a=e[r],i=t[r];if("tuple"===a.type&&"tuple"===i.type&&"components"in a&&"components"in i)return So(a.components,i.components,n[r]);const s=[a.type,i.type];if(!(!s.includes("address")||!s.includes("bytes20"))||(s.includes("address")&&s.includes("string")||!(!s.includes("address")||!s.includes("bytes")))&&ss(n[r],{strict:!1}))return s}}const Io="/docs/contract/encodeEventTopics";function Mo(e){const{abi:t,eventName:n,args:r}=e;let a=t[0];if(n){const e=Oo({abi:t,name:n});if(!e)throw new ao(n,{docsPath:Io});a=e}if("event"!==a.type)throw new ao(void 0,{docsPath:Io});const i=Vs(a),s=wo(i);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)=>No({param:e,value:t[n][a]}))):t[n]?No({param:e,value:t[n]}):null))??[])}return[s,...o]}function No({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return ns(ii(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new yo(e.type);return To([e],[t])}function Uo(e,{method:t}){const n={};return"fallback"===e.transport.type&&e.transport.onResponse?.((({method:e,response:r,status:a,transport:i})=>{"success"===a&&t===e&&(n[r]=i.request)})),t=>n[t]||e.request}async function Lo(e,t){const{address:n,abi:r,args:a,eventName:i,fromBlock:s,strict:o,toBlock:c}=t,l=Uo(e,{method:"eth_newFilter"}),u=i?Mo({abi:r,args:a,eventName:i}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:"bigint"==typeof s?ti(s):s,toBlock:"bigint"==typeof c?ti(c):c,topics:u}]});return{abi:r,args:a,eventName:i,id:d,request:l(d),strict:Boolean(o),type:"event"}}function Bo(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const Ro="/docs/contract/encodeFunctionData";function jo(e){const{abi:t,args:n,functionName:r}=e;let a=t[0];if(r){const e=Oo({abi:t,args:n,name:r});if(!e)throw new io(r,{docsPath:Ro});a=e}if("function"!==a.type)throw new io(void 0,{docsPath:Ro});const i=Vs(a);return cs([Do(i),("inputs"in a&&a.inputs?To(a.inputs,n??[]):void 0)??"0x"])}const Go={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."},zo={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},$o={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class Ho extends La{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class qo extends La{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 Vo extends La{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 Wo={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 Vo({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new qo({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Ho({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 Ho({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 Zo(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Wo);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Ko(e,t={}){void 0!==t.size&&ui(e,{size:t.size});return pi(ei(e,t),t)}function Jo(e,t={}){let n=e;if(void 0!==t.size&&(ui(n,{size:t.size}),n=qa(n)),n.length>1||n[0]>1)throw new ja(n);return Boolean(n[0])}function Xo(e,t={}){void 0!==t.size&&ui(e,{size:t.size});return hi(ei(e,t),t)}function Yo(e,t){const n="string"==typeof t?ci(t):t,r=Zo(n);if(0===Ha(n)&&e.length>0)throw new Xs;if(Ha(t)&&Ha(t)<32)throw new Js({data:"string"==typeof t?t:ei(t),params:e,size:Ha(t)});let a=0;const i=[];for(let t=0;t<e.length;++t){const n=e[t];r.setPosition(a);const[s,o]=Qo(r,n,{staticPosition:0});a+=o,i.push(s)}return i}function Qo(e,t,{staticPosition:n}){const r=_o(t.type);if(r){const[a,i]=r;return function(e,t,{length:n,staticPosition:r}){if(!n){const n=r+Xo(e.readBytes(tc)),a=n+ec;e.setPosition(n);const i=Xo(e.readBytes(ec)),s=nc(t);let o=0;const c=[];for(let n=0;n<i;++n){e.setPosition(a+(s?32*n:o));const[r,i]=Qo(e,t,{staticPosition:a});o+=i,c.push(r)}return e.setPosition(r+32),[c,32]}if(nc(t)){const a=r+Xo(e.readBytes(tc)),i=[];for(let r=0;r<n;++r){e.setPosition(a+32*r);const[n]=Qo(e,t,{staticPosition:a});i.push(n)}return e.setPosition(r+32),[i,32]}let a=0;const i=[];for(let s=0;s<n;++s){const[n,s]=Qo(e,t,{staticPosition:r+a});a+=s,i.push(n)}return[i,a]}(e,{...t,type:i},{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 i=0;if(nc(t)){const s=n+Xo(e.readBytes(tc));for(let n=0;n<t.components.length;++n){const o=t.components[n];e.setPosition(s+i);const[c,l]=Qo(e,o,{staticPosition:s});i+=l,a[r?n:o?.name]=c}return e.setPosition(n+32),[a,32]}for(let s=0;s<t.components.length;++s){const o=t.components[s],[c,l]=Qo(e,o,{staticPosition:n});a[r?s:o?.name]=c,i+=l}return[a,i]}(e,t,{staticPosition:n});if("address"===t.type)return function(e){const t=e.readBytes(32);return[rs(ei(ko(t,-20))),32]}(e);if("bool"===t.type)return function(e){return[Jo(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=Xo(e.readBytes(32));e.setPosition(n+t);const r=Xo(e.readBytes(32));if(0===r)return e.setPosition(n+32),["0x",32];const a=e.readBytes(r);return e.setPosition(n+32),[ei(a),32]}const i=ei(e.readBytes(parseInt(a),32));return[i,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?Ko(a,{signed:n}):Xo(a,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=Xo(e.readBytes(32)),r=t+n;e.setPosition(r);const a=Xo(e.readBytes(32));if(0===a)return e.setPosition(t+32),["",32];const i=e.readBytes(a,32),s=function(e,t={}){let n=e;return void 0!==t.size&&(ui(n,{size:t.size}),n=qa(n,{dir:"right"})),(new TextDecoder).decode(n)}(qa(i));return e.setPosition(t+32),[s,32]}(e,{staticPosition:n});throw new ho(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ec=32,tc=32;function nc(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(nc);const n=_o(e.type);return!(!n||!nc({...e,type:n[1]}))}function rc(e){const{abi:t,data:n}=e,r=Co(n,0,4);if("0x"===r)throw new Xs;const a=[...t||[],zo,$o].find((e=>"error"===e.type&&r===Do(Vs(e))));if(!a)throw new to(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?Yo(a.inputs,Co(n,4)):void 0,errorName:a.name}}const ac=(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 ic({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]?ac(t[n]):t[n]}`)).join(", ")})`}const sc={gwei:9,wei:18},oc={ether:-9,wei:9};function cc(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[a,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${a||"0"}${i?`.${i}`:""}`}function lc(e,t="wei"){return cc(e,sc[t])}function uc(e,t="wei"){return cc(e,oc[t])}class dc extends La{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 pc extends La{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function hc(e){return e.reduce(((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`),"")}function mc(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 fc extends La{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 yc extends La{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 bc extends La{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",mc(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 gc extends La{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 vc extends La{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:i,gasPrice:s,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=mc({chain:r&&`${r?.name} (id: ${r?.id})`,from:t?.address,to:u,value:void 0!==d&&`${lc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:i,gasPrice:void 0!==s&&`${uc(s)} gwei`,maxFeePerGas:void 0!==o&&`${uc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${uc(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 wc extends La{constructor({blockHash:e,blockNumber:t,blockTag:n,hash:r,index:a}){let i="Transaction";n&&void 0!==a&&(i=`Transaction at block time "${n}" at index "${a}"`),e&&void 0!==a&&(i=`Transaction at block hash "${e}" at index "${a}"`),t&&void 0!==a&&(i=`Transaction at block number "${t}" at index "${a}"`),r&&(i=`Transaction with hash "${r}"`),super(`${i} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class Cc extends La{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 xc extends La{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 Ec extends La{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:i,gasPrice:s,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d,stateOverride:p}){const h=t?Bo(t):void 0;let m=mc({from:h?.address,to:u,value:void 0!==d&&`${lc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:i,gasPrice:void 0!==s&&`${uc(s)} gwei`,maxFeePerGas:void 0!==o&&`${uc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${uc(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+=hc(n.state)),n.stateDiff&&(r+=" stateDiff:\n",r+=hc(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 kc extends La{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:a,functionName:i,sender:s}){const o=Oo({abi:t,args:n,name:i}),c=o?ic({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=mc({address:r&&r,function:o?Vs(o,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(i?.length??0).keys()].map((()=>" ")).join("")}${c}`,sender:s});super(e.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{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=i,this.sender=s}}class Tc extends La{constructor({abi:e,data:t,functionName:n,message:r}){let a,i,s,o,c;if(t&&"0x"!==t)try{i=rc({abi:e,data:t});const{abiItem:n,errorName:r,args:a}=i;if("Error"===r)o=a[0];else if("Panic"===r){const[e]=a;o=Go[e]}else{const e=n?Vs(n,{includeName:!0}):void 0,t=n&&a?ic({abiItem:n,args:a,includeFunctionName:!1,includeName:!1}):void 0;s=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(e){a=e}else r&&(o=r);a instanceof to&&(c=a.signature,s=[`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:s}),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=i,this.reason=o,this.signature=c}}class Pc extends La{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 Ac extends La{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 _c extends La{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: ${ac(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 Dc extends La{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${ac(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 Oc extends La{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${t}`,`Request body: ${ac(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}class Fc extends La{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 Dc?e.code:t??-1}}class Sc extends Fc{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 Ic extends Fc{constructor(e){super(e,{code:Ic.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(Ic,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Mc extends Fc{constructor(e){super(e,{code:Mc.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(Mc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Nc extends Fc{constructor(e){super(e,{code:Nc.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(Nc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Uc extends Fc{constructor(e){super(e,{code:Uc.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(Uc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Lc extends Fc{constructor(e){super(e,{code:Lc.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(Lc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Bc extends Fc{constructor(e){super(e,{code:Bc.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(Bc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Rc extends Fc{constructor(e){super(e,{code:Rc.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Rc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class jc extends Fc{constructor(e){super(e,{code:jc.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(jc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Gc extends Fc{constructor(e){super(e,{code:Gc.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(Gc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class zc extends Fc{constructor(e){super(e,{code:zc.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(zc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class $c extends Fc{constructor(e){super(e,{code:$c.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty($c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Hc extends Fc{constructor(e){super(e,{code:Hc.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(Hc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class qc extends Sc{constructor(e){super(e,{code:qc.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(qc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Vc extends Sc{constructor(e){super(e,{code:Vc.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(Vc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Wc extends Sc{constructor(e){super(e,{code:Wc.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(Wc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Zc extends Sc{constructor(e){super(e,{code:Zc.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(Zc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Kc extends Sc{constructor(e){super(e,{code:Kc.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(Kc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Jc extends Sc{constructor(e){super(e,{code:Jc.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(Jc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Xc extends Fc{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const Yc=3;function Qc(e,{abi:t,address:n,args:r,docsPath:a,functionName:i,sender:s}){const{code:o,data:c,message:l,shortMessage:u}=e instanceof Ac?e:e instanceof La?e.walk((e=>"data"in e))||e.walk():{},d=e instanceof Xs?new Pc({functionName:i}):[Yc,Lc.code].includes(o)&&(c||l||u)?new Tc({abi:t,data:"object"==typeof c?c.data:c,functionName:i,message:u??l}):e;return new kc(d,{abi:t,args:r,contractAddress:n,docsPath:a,functionName:i,sender:s})}class el extends La{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:i,gasPrice:s,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=mc({from:t?.address,to:u,value:void 0!==d&&`${lc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:i,gasPrice:void 0!==s&&`${uc(s)} gwei`,maxFeePerGas:void 0!==o&&`${uc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${uc(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 tl extends La{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(tl,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(tl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class nl extends La{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${uc(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(nl,"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 rl extends La{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${uc(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(rl,"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 al extends La{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(al,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class il extends La{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(il,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class sl extends La{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(sl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class ol extends La{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(ol,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class cl extends La{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(cl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class ll extends La{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(ll,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class ul extends La{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(ul,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class dl extends La{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${uc(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${uc(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(dl,"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 pl extends La{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 hl(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof La?e.walk((e=>e.code===tl.code)):e;return r instanceof La?new tl({cause:e,message:r.details}):tl.nodeMessage.test(n)?new tl({cause:e,message:e.details}):nl.nodeMessage.test(n)?new nl({cause:e,maxFeePerGas:t?.maxFeePerGas}):rl.nodeMessage.test(n)?new rl({cause:e,maxFeePerGas:t?.maxFeePerGas}):al.nodeMessage.test(n)?new al({cause:e,nonce:t?.nonce}):il.nodeMessage.test(n)?new il({cause:e,nonce:t?.nonce}):sl.nodeMessage.test(n)?new sl({cause:e,nonce:t?.nonce}):ol.nodeMessage.test(n)?new ol({cause:e}):cl.nodeMessage.test(n)?new cl({cause:e,gas:t?.gas}):ll.nodeMessage.test(n)?new ll({cause:e,gas:t?.gas}):ul.nodeMessage.test(n)?new ul({cause:e}):dl.nodeMessage.test(n)?new dl({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new pl({cause:e})}function ml(e,{format:t}){if(!t)return{};const n={};return function t(r){const a=Object.keys(r);for(const i of a)i in e&&(n[i]=e[i]),r[i]&&"object"==typeof r[i]&&!Array.isArray(r[i])&&t(r[i])}(t(e||{})),n}const fl={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function yl(e){const t={...e};return void 0!==e.blobs&&"string"!=typeof e.blobs[0]&&(t.blobs=e.blobs.map((e=>ei(e)))),void 0!==e.gas&&(t.gas=ti(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=ti(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=ti(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=ti(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=ti(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=ti(e.nonce)),void 0!==e.type&&(t.type=fl[e.type]),void 0!==e.value&&(t.value=ti(e.value)),t}const bl=mi("transactionRequest",yl);function gl(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:a,to:i}=e,s=t?Bo(t):void 0;if(s&&!ss(s.address))throw new Ti({address:s.address});if(i&&!ss(i))throw new Ti({address:i});if(void 0!==n&&(void 0!==r||void 0!==a))throw new fc;if(r&&r>2n**256n-1n)throw new nl({maxFeePerGas:r});if(a&&r&&a>r)throw new dl({maxFeePerGas:r,maxPriorityFeePerGas:a})}class vl extends La{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class wl extends La{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class Cl extends La{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${uc(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class xl extends La{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 El(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:a}={}){const i=r??"latest",s=a??!1,o=void 0!==n?ti(n):void 0;let c=null;if(c=t?await e.request({method:"eth_getBlockByHash",params:[t,s]}):await e.request({method:"eth_getBlockByNumber",params:[o||i,s]}),!c)throw new xl({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||gi)(c)}async function kl(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Tl(e,t){const{block:n,chain:r=e.chain,request:a}=t||{};if("function"==typeof r?.fees?.defaultPriorityFee){const t=n||await qs(e,El,"getBlock")({});return r.fees.defaultPriorityFee({block:t,client:e,request:a})}if(void 0!==r?.fees?.defaultPriorityFee)return r?.fees?.defaultPriorityFee;try{return pi(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):qs(e,El,"getBlock")({}),qs(e,kl,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new wl;const a=r-t.baseFeePerGas;return a<0n?0n:a}}async function Pl(e,t){const{block:n,chain:r=e.chain,request:a,type:i="eip1559"}=t||{},s=await(async()=>"function"==typeof r?.fees?.baseFeeMultiplier?r.fees.baseFeeMultiplier({block:n,client:e,request:a}):r?.fees?.baseFeeMultiplier??1.2)();if(s<1)throw new vl;const o=10**(s.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(s*o))/BigInt(o),l=n||await qs(e,El,"getBlock")({});if("function"==typeof r?.fees?.estimateFeesPerGas)return r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:a,type:i});if("eip1559"===i){if("bigint"!=typeof l.baseFeePerGas)throw new wl;const t="bigint"==typeof a?.maxPriorityFeePerGas?a.maxPriorityFeePerGas:await Tl(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 qs(e,kl,"getGasPrice")({}))}}async function Al(e,{address:t,blockTag:n="latest",blockNumber:r}){return hi(await e.request({method:"eth_getTransactionCount",params:[t,r?ti(r):n]}))}class _l extends La{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 Dl(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 bc({transaction:e})}async function Ol(e){return hi(await e.request({method:"eth_chainId"}))}async function Fl(e,t){const{account:n=e.account,chain:r,chainId:a,gas:i,nonce:s,parameters:o=["chainId","fees","gas","nonce","type"],type:c}=t,l=n?Bo(n):void 0,u=await qs(e,El,"getBlock")({blockTag:"latest"}),d={...t,...l?{from:l?.address}:{}};if(o.includes("chainId")&&(d.chainId=r?r.id:void 0!==a?a:await qs(e,Ol,"getChainId")({})),o.includes("nonce")&&void 0===s&&l&&(d.nonce=await qs(e,Al,"getTransactionCount")({address:l.address,blockTag:"pending"})),(o.includes("fees")||o.includes("type"))&&void 0===c)try{d.type=Dl(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 Pl(e,{block:u,chain:r,request:d});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas<a)throw new Cl({maxPriorityFeePerGas:a});d.maxPriorityFeePerGas=a,d.maxFeePerGas=n}else{if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)throw new wl;const{gasPrice:n}=await Pl(e,{block:u,chain:r,request:d,type:"legacy"});d.gasPrice=n}return o.includes("gas")&&void 0===i&&(d.gas=await qs(e,Sl,"estimateGas")({...d,account:l?{address:l.address,type:"json-rpc"}:void 0})),gl(d),delete d.parameters,d}async function Sl(e,t){const n=t.account??e.account,r=n?Bo(n):void 0;try{const{accessList:n,blobs:a,blockNumber:i,blockTag:s,data:o,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:m,value:f,...y}="local"===r?.type?await Fl(e,t):t,b=(i?ti(i):void 0)||s;gl(t);const g=e.chain?.formatters?.transactionRequest?.format,v=(g||yl)({...ml(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=hl(e,n);return t instanceof pl?e:t})();return new el(r,{docsPath:t,...n})}(n,{...t,account:r,chain:e.chain})}}async function Il(e,t){const{abi:n,address:r,args:a,functionName:i,...s}=t,o=jo({abi:n,args:a,functionName:i});try{return await qs(e,Sl,"estimateGas")({data:o,to:r,...s})}catch(e){const t=s.account?Bo(s.account):void 0;throw Qc(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:t?.address})}}const Ml="/docs/contract/decodeEventLog";function Nl(e){const{abi:t,data:n,strict:r,topics:a}=e,i=r??!0,[s,...o]=a;if(!s)throw new no({docsPath:Ml});const c=t.find((e=>"event"===e.type&&s===wo(Vs(e))));if(!c||!("name"in c)||"event"!==c.type)throw new ro(s,{docsPath:Ml});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 uo({abiItem:c,param:t});p[t.name||e]=Ul({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=Yo(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(i){if(e instanceof Js||e instanceof qo)throw new lo({abiItem:c,data:n,params:m,size:Ha(n)});throw e}}else if(i)throw new lo({abiItem:c,data:"0x",params:m,size:0});return{eventName:l,args:Object.values(p).length>0?p:void 0}}function Ul({param:e,value:t}){if("string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))return t;return(Yo([e],t)||[])[0]}function Ll({abi:e,eventName:t,logs:n,strict:r=!0}){return n.map((n=>{try{const a=Nl({...n,abi:e,strict:r});return t&&!t.includes(a.eventName)?null:{...a,...n}}catch(e){let t,a;if(e instanceof ro)return null;if(e instanceof lo||e instanceof uo){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 Bl(e,{address:t,blockHash:n,fromBlock:r,toBlock:a,event:i,events:s,args:o,strict:c}={}){const l=c??!1,u=s??(i?[i]:void 0);let d,p=[];u&&(p=[u.flatMap((e=>Mo({abi:[e],eventName:e.name,args:o})))],i&&(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?ti(r):r,toBlock:"bigint"==typeof a?ti(a):a}]});const h=d.map((e=>wi(e)));return u?Ll({abi:u,logs:h,strict:l}):h}async function Rl(e,t){const{abi:n,address:r,args:a,blockHash:i,eventName:s,fromBlock:o,toBlock:c,strict:l}=t,u=s?Oo({abi:n,name:s}):void 0,d=u?void 0:n.filter((e=>"event"===e.type));return qs(e,Bl,"getLogs")({address:r,args:a,blockHash:i,event:u,events:d,fromBlock:o,toBlock:c,strict:l})}const jl="/docs/contract/decodeFunctionResult";function Gl(e){const{abi:t,args:n,functionName:r,data:a}=e;let i=t[0];if(r){const e=Oo({abi:t,args:n,name:r});if(!e)throw new io(r,{docsPath:jl});i=e}if("function"!==i.type)throw new io(void 0,{docsPath:jl});if(!i.outputs)throw new so(i.name,{docsPath:jl});const s=Yo(i.outputs,a);return s&&s.length>1?s:s&&1===s.length?s[0]:void 0}const zl=[{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"}],$l=[{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"}],Hl=[...$l,{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"}]}],ql=[...$l,{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"}]}],Vl=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Wl=[{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"}]}],Zl=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],Kl="0x82ad56cb";class Jl extends La{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 Xl extends La{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 Yl extends La{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 Ql extends La{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class eu extends La{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 tu({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new Jl({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Jl({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const nu=new Map;function ru({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:a}){const i=async()=>{const t=o();s();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)}}))},s=()=>nu.delete(t),o=()=>nu.get(t)||[],c=e=>nu.set(t,[...o(),e]);return{flush:s,async schedule(e){const t={},a=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),s=n?.([...o().map((({args:e})=>e)),e]);s&&i();return o().length>0?(c({args:e,pendingPromise:t}),a):(c({args:e,pendingPromise:t}),setTimeout(i,r),a)}}}async function au(e,t){const{account:n=e.account,batch:r=Boolean(e.batch?.multicall),blockNumber:a,blockTag:i="latest",accessList:s,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?Bo(n):void 0;try{gl(t);const n=(a?ti(a):void 0)||i,w=function(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ss(n,{strict:!1}))throw new Ti({address:n});if(t[n])throw new dc({address:n});t[n]=su(r)}return t}(b),C=e.chain?.formatters?.transactionRequest?.format,x=(C||yl)({...ml(g,{format:C}),from:v?.address,accessList:s,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(Kl)&&(!!n&&!(Object.values(r).filter((e=>void 0!==e)).length>0)))}({request:x})&&!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:i="latest",data:s,multicallAddress:o,to:c}=t;let l=o;if(!l){if(!e.chain)throw new Ql;l=tu({blockNumber:a,chain:e.chain,contract:"multicall3"})}const u=a?ti(a):void 0,d=u||i,{schedule:p}=ru({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=jo({abi:zl,args:[n],functionName:"aggregate3"}),a=await e.request({method:"eth_call",params:[{data:r,to:l},d]});return Gl({abi:zl,args:[n],functionName:"aggregate3",data:a||"0x"})}}),[{returnData:h,success:m}]=await p({data:s,to:c});if(!m)throw new Ac({data:h});return"0x"===h?{data:void 0}:{data:h}}(e,{...x,blockNumber:a,blockTag:i})}catch(e){if(!(e instanceof Ql||e instanceof Jl))throw e}const E=await e.request({method:"eth_call",params:w?[x,n,w]:[x,n]});return"0x"===E?{data:void 0}:{data:E}}catch(n){const r=function(e){if(!(e instanceof La))return;const t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(n),{offchainLookup:a,offchainLookupSignature:i}=await Promise.resolve().then((function(){return require("./ccip-2b0ca597.cjs")}));if(r?.slice(0,10)===i&&f)return{data:await a(e,{data:r,to:f})};throw function(e,{docsPath:t,...n}){const r=(()=>{const t=hl(e,n);return t instanceof pl?e:t})();return new Ec(r,{docsPath:t,...n})}(n,{...t,account:v,chain:e.chain})}}function iu(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new Za({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new Za({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function su(e){const{balance:t,nonce:n,state:r,stateDiff:a,code:i}=e,s={};if(void 0!==i&&(s.code=i),void 0!==t&&(s.balance=ti(t,{size:32})),void 0!==n&&(s.nonce=ti(n,{size:8})),void 0!==r&&(s.state=iu(r)),void 0!==a){if(s.state)throw new pc;s.stateDiff=iu(a)}return s}async function ou(e,t){const{abi:n,address:r,args:a,functionName:i,...s}=t,o=jo({abi:n,args:a,functionName:i});try{const{data:t}=await qs(e,au,"call")({...s,data:o,to:r});return Gl({abi:n,args:a,functionName:i,data:t||"0x"})}catch(e){throw Qc(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/readContract",functionName:i})}}async function cu(e,t){const{abi:n,address:r,args:a,dataSuffix:i,functionName:s,...o}=t,c=o.account?Bo(o.account):e.account,l=jo({abi:n,args:a,functionName:s});try{const{data:u}=await qs(e,au,"call")({batch:!1,data:`${l}${i?i.replace("0x",""):""}`,to:r,...o,account:c}),d=Gl({abi:n,args:a,functionName:s,data:u||"0x"});return{result:d,request:{abi:n.filter((e=>"name"in e&&e.name===t.functionName)),address:r,args:a,dataSuffix:i,functionName:s,...o,account:c}}}catch(e){throw Qc(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/simulateContract",functionName:s,sender:c?.address})}}const lu=new Map,uu=new Map;let du=0;function pu(e,t,n){const r=++du,a=()=>lu.get(e)||[],i=()=>{const t=uu.get(e);1===a().length&&t&&t(),(()=>{const t=a();lu.set(e,t.filter((e=>e.id!==r)))})()},s=a();if(lu.set(e,[...s,{id:r,fns:t}]),s&&s.length>0)return i;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&&uu.set(e,c),i}async function hu(e){return new Promise((t=>setTimeout(t,e)))}function mu(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let a=!0;const i=()=>a=!1;return(async()=>{let s;t&&(s=await e({unpoll:i}));const o=await(n?.(s))??r;await hu(o);const c=async()=>{a&&(await e({unpoll:i}),await hu(r),c())};c()})(),i}const fu=new Map,yu=new Map;async function bu(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,fu),r=t(e,yu);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 i=r.promise.get();i||(i=e(),r.promise.set(i));try{const e=await i;return r.response.set({created:new Date,data:e}),e}finally{r.promise.clear()}}const gu=e=>`blockNumber.${e}`;async function vu(e,{cacheTime:t=e.cacheTime}={}){const n=await bu((()=>e.request({method:"eth_blockNumber"})),{cacheKey:gu(e.uid),cacheTime:t});return BigInt(n)}async function wu(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=>wi(e)));return"abi"in t&&t.abi?Ll({abi:t.abi,logs:a,strict:n}):a}async function Cu(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function xu(e,t){const{abi:n,address:r,args:a,batch:i=!0,eventName:s,onError:o,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}=t;return(void 0!==l?l:"webSocket"!==e.transport.type)?(()=>{const t=ac(["watchContractEvent",r,a,i,e.uid,s,u]),l=d??!1;return pu(t,{onLogs:c,onError:o},(t=>{let o,c,d=!1;const p=mu((async()=>{if(d)try{let u;if(c)u=await qs(e,wu,"getFilterChanges")({filter:c});else{const t=await qs(e,vu,"getBlockNumber")({});u=o&&o!==t?await qs(e,Rl,"getContractEvents")({abi:n,address:r,args:a,eventName:s,fromBlock:o+1n,toBlock:t,strict:l}):[],o=t}if(0===u.length)return;if(i)t.onLogs(u);else for(const e of u)t.onLogs([e])}catch(e){c&&e instanceof Bc&&(d=!1),t.onError?.(e)}else{try{c=await qs(e,Lo,"createContractEventFilter")({abi:n,address:r,args:a,eventName:s,strict:l})}catch{}d=!0}}),{emitOnBegin:!0,interval:u});return async()=>{c&&await qs(e,Cu,"uninstallFilter")({filter:c}),p()}}))})():(()=>{let t=!0,i=()=>t=!1;return(async()=>{try{const l=s?Mo({abi:n,eventName:s,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}=Nl({abi:n,data:r.data,topics:r.topics,strict:d}),a=wi(r,{args:t,eventName:e});c([a])}catch(e){let t,n;if(e instanceof lo||e instanceof uo){if(d)return;t=e.abiItem.name,n=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const a=wi(r,{args:n?[]:{},eventName:t});c([a])}},onError(e){o?.(e)}});i=u,t||i()}catch(e){o?.(e)}})(),i})()}async function Eu(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}async function ku(e,t){const{account:n=e.account,chain:r=e.chain,accessList:a,blobs:i,data:s,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:h,value:m,...f}=t;if(!n)throw new _l({docsPath:"/docs/actions/wallet/sendTransaction"});const y=Bo(n);try{let n;if(gl(t),null!==r&&(n=await qs(e,Ol,"getChainId")({}),function({chain:e,currentChainId:t}){if(!e)throw new Yl;if(t!==e.id)throw new Xl({chain:e,currentChainId:t})}({currentChainId:n,chain:r})),"local"===y.type){const t=await qs(e,Fl,"prepareTransactionRequest")({account:y,accessList:a,blobs:i,chain:r,chainId:n,data:s,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 qs(e,Eu,"sendRawTransaction")({serializedTransaction:g})}const b=e.chain?.formatters?.transactionRequest?.format,g=(b||yl)({...ml(f,{format:b}),accessList:a,blobs:i,data:s,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=hl(e,n);return t instanceof pl?e:t})();return new vc(r,{docsPath:t,...n})}(e,{...t,account:y,chain:t.chain||void 0})}}async function Tu(e,t){const{abi:n,address:r,args:a,dataSuffix:i,functionName:s,...o}=t,c=jo({abi:n,args:a,functionName:s});return qs(e,ku,"sendTransaction")({data:`${c}${i?i.replace("0x",""):""}`,to:r,...o})}function Pu({abi:e,address:t,client:n}){const r=n,[a,i]=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],s=null!=a,o=null!=i,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 s&&(l&&(c.read=new Proxy({},{get:(n,r)=>(...n)=>{const{args:i,options:s}=Au(n);return qs(a,ou,"readContract")({abi:e,address:t,functionName:r,args:i,...s})}})),u&&(c.simulate=new Proxy({},{get:(n,r)=>(...n)=>{const{args:i,options:s}=Au(n);return qs(a,cu,"simulateContract")({abi:e,address:t,functionName:r,args:i,...s})}})),d&&(c.createEventFilter=new Proxy({},{get:(n,r)=>(...n)=>{const i=e.find((e=>"event"===e.type&&e.name===r)),{args:s,options:o}=_u(n,i);return qs(a,Lo,"createContractEventFilter")({abi:e,address:t,eventName:r,args:s,...o})}}),c.getEvents=new Proxy({},{get:(n,r)=>(...n)=>{const i=e.find((e=>"event"===e.type&&e.name===r)),{args:s,options:o}=_u(n,i);return qs(a,Rl,"getContractEvents")({abi:e,address:t,eventName:r,args:s,...o})}}),c.watchEvent=new Proxy({},{get:(n,r)=>(...n)=>{const i=e.find((e=>"event"===e.type&&e.name===r)),{args:s,options:o}=_u(n,i);return qs(a,xu,"watchContractEvent")({abi:e,address:t,eventName:r,args:s,...o})}}))),o&&u&&(c.write=new Proxy({},{get:(n,r)=>(...n)=>{const{args:a,options:s}=Au(n);return qs(i,Tu,"writeContract")({abi:e,address:t,functionName:r,args:a,...s})}})),(s||o)&&u&&(c.estimateGas=new Proxy({},{get:(n,r)=>(...n)=>{const{args:s,options:o}=Au(n);return qs(a??i,Il,"estimateContractGas")({abi:e,address:t,functionName:r,args:s,...o,account:o.account??i.account})}})),c.address=t,c.abi=e,c}function Au(e){const t=e.length&&Array.isArray(e[0]);return{args:t?e[0]:[],options:(t?e[1]:e[0])??{}}}function _u(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 Du=256;let Ou,Fu=Du;function Su(e=11){if(!Ou||Fu+e>2*Du){Ou="",Fu=0;for(let e=0;e<Du;e++)Ou+=(256+256*Math.random()|0).toString(16).substring(1)}return Ou.substring(Fu,Fu+++e)}function Iu(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,key:r="base",name:a="Base Client",pollingInterval:i=4e3,type:s="base"}=e,o=e.chain,c=e.account?Bo(e.account):void 0,{config:l,request:u,value:d}=e.transport({chain:o,pollingInterval:i}),p={account:c,batch:t,cacheTime:n,chain:o,key:r,name:a,pollingInterval:i,request:u,transport:{...l,...d},type:s,uid:Su()};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 Mu(e,{delay:t=100,retryCount:n=2,shouldRetry:r=(()=>!0)}={}){return new Promise(((a,i)=>{const s=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 hu(n),s({count:o+1})})({error:e});i(e)}};s()}))}function Nu(e,t={}){return async(n,r={})=>{const{retryDelay:a=150,retryCount:i=3}={...t,...r};return Mu((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case Ic.code:throw new Ic(t);case Mc.code:throw new Mc(t);case Nc.code:throw new Nc(t);case Uc.code:throw new Uc(t);case Lc.code:throw new Lc(t);case Bc.code:throw new Bc(t);case Rc.code:throw new Rc(t);case jc.code:throw new jc(t);case Gc.code:throw new Gc(t);case zc.code:throw new zc(t);case $c.code:throw new $c(t);case Hc.code:throw new Hc(t);case qc.code:throw new qc(t);case Vc.code:throw new Vc(t);case Wc.code:throw new Wc(t);case Zc.code:throw new Zc(t);case Kc.code:throw new Kc(t);case Jc.code:throw new Jc(t);case 5e3:throw new qc(t);default:if(e instanceof La)throw e;throw new Xc(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof _c){const e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*parseInt(e)}return~~(1<<e)*a},retryCount:i,shouldRetry:({error:e})=>function(e){if("code"in e&&"number"==typeof e.code)return-1===e.code||(e.code===$c.code||e.code===Lc.code);if(e instanceof _c&&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 Uu({key:e,name:t,request:n,retryCount:r=3,retryDelay:a=150,timeout:i,type:s},o){return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:a,timeout:i,type:s},request:Nu(n,{retryCount:r,retryDelay:a}),value:o}}function Lu(e,t={}){const{key:n="custom",name:r="Custom Provider",retryDelay:a}=t;return({retryCount:i})=>Uu({key:n,name:r,request:e.request.bind(e),retryCount:t.retryCount??i,retryDelay:a,type:"custom"})}class Bu extends La{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function Ru(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const ju=Ru();function Gu(e,t={}){return{async request(n){const{body:r,fetchOptions:a={},onResponse:i=t.onResponse,timeout:s=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,i)=>{(async()=>{let s;try{const o=new AbortController;n>0&&(s=setTimeout((()=>{r?o.abort():i(t)}),n)),a(await e({signal:o?.signal}))}catch(e){"AbortError"===e.name&&i(t),i(e)}finally{clearTimeout(s)}})()}))}((async({signal:t})=>await fetch(e,{...a,body:Array.isArray(r)?ac(r.map((e=>({jsonrpc:"2.0",id:e.id??ju.take(),...e})))):ac({jsonrpc:"2.0",id:r.id??ju.take(),...r}),headers:{...o,"Content-Type":"application/json"},method:c||"POST",signal:l||(s>0?t:void 0)})),{errorInstance:new Oc({body:r,url:e}),timeout:s,signal:!0});let n;if(i&&await i(t),n=t.headers.get("Content-Type")?.startsWith("application/json")?await t.json():await t.text(),!t.ok)throw new _c({body:r,details:ac(n.error)||t.statusText,headers:t.headers,status:t.status,url:e});return n}catch(t){if(t instanceof _c)throw t;if(t instanceof Oc)throw t;throw new _c({body:r,details:t.message,url:e})}}}}function zu(e,t={}){const{batch:n,fetchOptions:r,key:a="http",name:i="HTTP JSON-RPC",onFetchResponse:s,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 Bu;const y=Gu(f,{fetchOptions:r,onResponse:s,timeout:m});return Uu({key:a,name:i,async request({method:t,params:r}){const a={method:t,params:r},{schedule:i}=ru({id:`${e}`,wait:p,shouldSplitBatch:e=>e.length>d,fn:e=>y.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:s,result:o}]=await(async e=>n?i(e):[await y.request({body:e})])(a);if(s)throw new Dc({body:a,error:s,url:f});return o},retryCount:h,retryDelay:o,timeout:m,type:"http"},{fetchOptions:r,url:f})}}function $u(e,t){if(!(e instanceof La))return!1;const n=e.walk((e=>e instanceof Tc));return n instanceof Tc&&("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===Go[50]))))))}function Hu(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 $a(t)?t:null}function qu(e){let t=new Uint8Array(32).fill(0);if(!e)return ei(t);const n=e.split(".");for(let e=n.length-1;e>=0;e-=1){const r=Hu(n[e]),a=r?ii(r):ns(li(n[e]),"bytes");t=ns(os([t,a]),"bytes")}return ei(t)}function Vu(e){return`[${e.slice(2)}]`}function Wu(e){const t=new Uint8Array(32).fill(0);return e?Hu(e)||ns(li(e)):ei(t)}function Zu(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array(li(t).byteLength+2);let r=0;const a=t.split(".");for(let e=0;e<a.length;e++){let t=li(a[e]);t.byteLength>255&&(t=li(Vu(Wu(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 Ku extends La{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 Ju extends La{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class Xu extends La{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 Yu extends La{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 Qu=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,ed=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,td=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,nd=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function rd(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function ad({uri:e,gatewayUrls:t}){const n=td.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=rd(t?.ipfs,"https://ipfs.io"),a=rd(t?.arweave,"https://arweave.net"),i=e.match(Qu),{protocol:s,subpath:o,target:c,subtarget:l=""}=i?.groups||{},u="ipns:/"===s||"ipns/"===o,d="ipfs:/"===s||"ipfs/"===o||ed.test(e);if(e.startsWith("http")&&!u&&!d){let n=e;return t?.arweave&&(n=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:n,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===s&&c)return{uri:`${a}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let p=e.replace(nd,"");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 Xu({uri:e})}function id(e){if("object"!=typeof e||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Ku({data:e});return e.image||e.image_url||e.image_data}async function sd({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=ad({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 Xu({uri:t})}async function od(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("/"),[i,s]=n.split(":"),[o,c]=r.split(":");if(!i||"eip155"!==i.toLowerCase())throw new Ju({reason:"Only EIP-155 supported"});if(!s)throw new Ju({reason:"Chain ID not found"});if(!c)throw new Ju({reason:"Contract address not found"});if(!a)throw new Ju({reason:"Token ID not found"});if(!o)throw new Ju({reason:"ERC namespace not found"});return{chainID:parseInt(s),namespace:o.toLowerCase(),contractAddress:c,tokenID:a}}(n),a=await async function(e,{nft:t}){if("erc721"===t.namespace)return ou(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 ou(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 Yu({namespace:t.namespace})}(e,{nft:r}),{uri:i,isOnChain:s,isEncoded:o}=ad({uri:a,gatewayUrls:t});if(s&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){const e=o?atob(i.replace("data:application/json;base64,","")):i;return sd({uri:id(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 sd({gatewayUrls:e,uri:id(n)})}catch{throw new Xu({uri:t})}}({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:n}):sd({uri:n,gatewayUrls:t})}async function cd(e,{blockNumber:t,blockTag:n,name:r,key:a,gatewayUrls:i,strict:s,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=tu({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const s={address:c,abi:Hl,functionName:"resolve",args:[Ya(Zu(r)),jo({abi:Vl,functionName:"text",args:[qu(r),a]})],blockNumber:t,blockTag:n},o=qs(e,ou,"readContract"),l=i?await o({...s,args:[...s.args,i]}):await o(s);if("0x"===l[0])return null;const u=Gl({abi:Vl,functionName:"text",data:l[0]});return""===u?null:u}catch(e){if(s)throw e;if($u(e,"resolve"))return null;throw e}}async function ld(e,{address:t,args:n,event:r,events:a,fromBlock:i,strict:s,toBlock:o}={}){const c=a??(r?[r]:void 0),l=Uo(e,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap((e=>Mo({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 i?ti(i):i,toBlock:"bigint"==typeof o?ti(o):o,...u.length?{topics:u}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:i,id:d,request:l(d),strict:Boolean(s),toBlock:o,type:"event"}}async function ud(e){const t=Uo(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function dd(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:a}){const i=n?ti(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:[ti(t),i||r,a]}))}const pd=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,hd=/^(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 md(e){const{domain:t={},message:n,primaryType:r}=e,a={EIP712Domain:wd({domain:t}),...e.types};!function(e){const{domain:t,message:n,primaryType:r,types:a}=e,i=(e,t)=>{for(const n of e){const{name:e,type:r}=n,s=t[e],o=r.match(hd);if(o&&("number"==typeof s||"bigint"==typeof s)){const[e,t,n]=o;ti(s,{signed:"int"===t,size:parseInt(n)/8})}if("address"===r&&"string"==typeof s&&!ss(s))throw new Ti({address:s});const c=r.match(pd);if(c){const[e,t]=c;if(t&&Ha(s)!==parseInt(t))throw new co({expectedSize:parseInt(t),givenSize:Ha(s)})}const l=a[r];l&&i(l,s)}};a.EIP712Domain&&t&&i(a.EIP712Domain,t);if("EIP712Domain"!==r){const e=a[r];i(e,n)}}({domain:t,message:n,primaryType:r,types:a});const i=["0x1901"];return t&&i.push(function({domain:e,types:t}){return fd({data:e,primaryType:"EIP712Domain",types:t})}({domain:t,types:a})),"EIP712Domain"!==r&&i.push(fd({data:n,primaryType:r,types:a})),ns(os(i))}function fd({data:e,primaryType:t,types:n}){return ns(yd({data:e,primaryType:t,types:n}))}function yd({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],a=[bd({primaryType:t,types:n})];for(const i of n[t]){const[t,s]=vd({types:n,name:i.name,type:i.type,value:e[i.name]});r.push(t),a.push(s)}return To(r,a)}function bd({primaryType:e,types:t}){const n=Ya(function({primaryType:e,types:t}){let n="";const r=gd({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 ns(n)}function gd({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])gd({primaryType:e.type,types:t},n);return n}function vd({types:e,name:t,type:n,value:r}){if(void 0!==e[n])return[{type:"bytes32"},ns(yd({data:r,primaryType:n,types:e}))];if("bytes"===n){return[{type:"bytes32"},ns(r=`0x${(r.length%2?"0":"")+r.slice(2)}`)]}if("string"===n)return[{type:"bytes32"},ns(Ya(r))];if(n.lastIndexOf("]")===n.length-1){const a=n.slice(0,n.lastIndexOf("[")),i=r.map((n=>vd({name:t,type:a,types:e,value:n})));return[{type:"bytes32"},ns(To(i.map((([e])=>e)),i.map((([,e])=>e))))]}return[{type:n},r]}function wd({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 Cd="/docs/contract/encodeDeployData";function xd(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 Zs({docsPath:Cd});if(!("inputs"in a))throw new Ks({docsPath:Cd});if(!a.inputs||0===a.inputs.length)throw new Ks({docsPath:Cd});return cs([r,To(a.inputs,n)])}const Ed="/docs/contract/encodeFunctionResult";class kd extends Ri{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=Ui(this.buffer)}update(e){Di(this);const{view:t,buffer:n,blockLen:r}=this,a=(e=Bi(e)).length;for(let i=0;i<a;){const s=Math.min(r-this.pos,a-i);if(s!==r)n.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===r&&(this.process(t,0),this.pos=0);else{const t=Ui(e);for(;r<=a-i;i+=r)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){Di(this),Oi(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:a}=this;let{pos:i}=this;t[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>r-i&&(this.process(n,0),i=0);for(let e=i;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),i=BigInt(4294967295),s=Number(n>>a&i),o=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,s,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),a),this.process(n,0);const s=Ui(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++)s.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:i,pos:s}=this;return e.length=r,e.pos=s,e.finished=a,e.destroyed=i,r%t&&e.buffer.set(n),e}}const Td=(e,t,n)=>e&t^~e&n,Pd=(e,t,n)=>e&t^e&n^t&n,Ad=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]),_d=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Dd=new Uint32Array(64);class Od extends kd{constructor(){super(64,32,8,!1),this.A=0|_d[0],this.B=0|_d[1],this.C=0|_d[2],this.D=0|_d[3],this.E=0|_d[4],this.F=0|_d[5],this.G=0|_d[6],this.H=0|_d[7]}get(){const{A:e,B:t,C:n,D:r,E:a,F:i,G:s,H:o}=this;return[e,t,n,r,a,i,s,o]}set(e,t,n,r,a,i,s,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|a,this.F=0|i,this.G=0|s,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)Dd[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Dd[e-15],n=Dd[e-2],r=Li(t,7)^Li(t,18)^t>>>3,a=Li(n,17)^Li(n,19)^n>>>10;Dd[e]=a+Dd[e-7]+r+Dd[e-16]|0}let{A:n,B:r,C:a,D:i,E:s,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(Li(s,6)^Li(s,11)^Li(s,25))+Td(s,o,c)+Ad[e]+Dd[e]|0,u=(Li(n,2)^Li(n,13)^Li(n,22))+Pd(n,r,a)|0;l=c,c=o,o=s,s=i+t|0,i=a,a=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,a=a+this.C|0,i=i+this.D|0,s=s+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,a,i,s,o,c,l)}roundClean(){Dd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Fd=ji((()=>new Od));const Sd="Ethereum Signed Message:\n";function Id(e,t){const n="string"==typeof e?li(e):e.raw instanceof Uint8Array?e.raw:ii(e.raw);return ns(os([li(`${Sd}${n.length}`),n]),t)}const Md=1;class Nd extends La{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 Ud extends La{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class Ld extends La{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 Bd extends La{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${Md}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}function Rd(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i}=e;if(t<=0)throw new eu({chainId:t});if(i&&!ss(i))throw new Ti({address:i});if(r)throw new La("`gasPrice` is not a valid EIP-1559 Transaction attribute.");if(a&&a>2n**256n-1n)throw new nl({maxFeePerGas:a});if(n&&a&&n>a)throw new dl({maxFeePerGas:a,maxPriorityFeePerGas:n})}function jd(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=>ci(e))):e.blobs,a=[];for(const e of r)a.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?a:a.map((e=>ei(e)))}function Gd(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=>ci(e))):e.blobs,a="string"==typeof e.commitments[0]?e.commitments.map((e=>ci(e))):e.commitments,i=[];for(let e=0;e<r.length;e++){const n=r[e],s=a[e];i.push(Uint8Array.from(t.computeBlobKzgProof(n,s)))}return"bytes"===n?i:i.map((e=>ei(e)))}const zd=32,$d=4096,Hd=zd*$d,qd=2*Hd-1-1*$d*2;function Vd(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?ci(e.data):e.data,r=Ha(n);if(!r)throw new Ud;if(r>qd)throw new Nd({maxSize:qd,size:r});const a=[];let i=!0,s=0;for(;i;){const e=Zo(new Uint8Array(Hd));let t=0;for(;t<$d;){const r=n.slice(s,s+(zd-1));if(e.pushByte(0),e.pushBytes(r),r.length<31){e.pushByte(128),i=!1;break}t++,s+=31}a.push(e)}return"bytes"===t?a.map((e=>e.bytes)):a.map((e=>ei(e.bytes)))}({data:t,to:r}),i=e.commitments??jd({blobs:a,kzg:n,to:r}),s=e.proofs??Gd({blobs:a,commitments:i,kzg:n,to:r}),o=[];for(let e=0;e<a.length;e++)o.push({blob:a[e],commitment:i[e],proof:s[e]});return o}function Wd(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=Fd($a(e,{strict:!1})?ii(e):e);return"bytes"===n?r:Ya(r)}(t,"bytes");return a.set([n],0),"bytes"===r?a:ei(a)}function Zd(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 gc({storageKey:a[e]});if(!ss(r,{strict:!1}))throw new Ti({address:r});t.push([r,a])}return t}function Kd(e,t){const n=Dl(e);return"eip1559"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:i,value:s,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,data:u}=e;Rd(e);const d=Zd(l),p=[Ya(n),a?Ya(a):"0x",c?Ya(c):"0x",o?Ya(o):"0x",r?Ya(r):"0x",i??"0x",s?Ya(s):"0x",u??"0x",d,...Jd(e,t)];return cs(["0x02",ap(p)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:r,data:a,nonce:i,to:s,value:o,accessList:c,gasPrice:l}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i}=e;if(t<=0)throw new eu({chainId:t});if(i&&!ss(i))throw new Ti({address:i});if(n||a)throw new La("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new nl({maxFeePerGas:r})}(e);const u=Zd(c),d=[Ya(n),i?Ya(i):"0x",l?Ya(l):"0x",r?Ya(r):"0x",s??"0x",o?Ya(o):"0x",a??"0x",u,...Jd(e,t)];return cs(["0x01",ap(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:i,value:s,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 Ud;for(const e of t){const t=Ha(e),n=hi(Co(e,0,1));if(32!==t)throw new Ld({hash:e,size:t});if(n!==Md)throw new Bd({hash:e,version:n})}}Rd(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=>ei(e))),n=e.kzg,r=jd({blobs:t,kzg:n}),a=Gd({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(Wd({commitment:e,to:r,version:n}));return a}({commitments:r}),!1!==h&&(h=Vd({blobs:t,commitments:r,proofs:a}))}const m=Zd(u),f=[Ya(n),a?Ya(a):"0x",l?Ya(l):"0x",c?Ya(c):"0x",r?Ya(r):"0x",i??"0x",s?Ya(s):"0x",d??"0x",m,o?Ya(o):"0x",p??[],...Jd(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 cs(["0x03",ap(h?[f,y,b,g]:f)])}(e,t):function(e,t){const{chainId:n=0,gas:r,data:a,nonce:i,to:s,value:o,gasPrice:c}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i,accessList:s}=e;if(i&&!ss(i))throw new Ti({address:i});if(void 0!==t&&t<=0)throw new eu({chainId:t});if(n||a)throw new La("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new nl({maxFeePerGas:r});if(s)throw new La("`accessList` is not a valid Legacy Transaction attribute.")}(e);let l=[i?Ya(i):"0x",c?Ya(c):"0x",r?Ya(r):"0x",s??"0x",o?Ya(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 yc({v:t.v});return e})();l=[...l,Ya(e),t.r,t.s]}else n>0&&(l=[...l,Ya(n),"0x","0x"]);return ap(l)}(e,t)}function Jd(e,t){const{r:n,s:r,v:a,yParity:i}=t??e;if(void 0===n)return[];if(void 0===r)return[];if(void 0===a&&void 0===i)return[];return["number"==typeof i?i?Ya(1):"0x":0n===a?"0x":1n===a?Ya(1):27n===a?"0x":Ya(1),qa(n),qa(r)]}async function Xd(e,{address:t,blockNumber:n,blockTag:r,storageKeys:a}){const i=r??"latest",s=void 0!==n?ti(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?hi(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,s||i]}))}async function Yd(e,{blockHash:t,blockNumber:n,blockTag:r,hash:a,index:i}){const s=r||"latest",o=void 0!==n?ti(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,ti(i)]}):(o||s)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||s,ti(i)]})),!c)throw new wc({blockHash:t,blockNumber:n,blockTag:s,hash:a,index:i});return(e.chain?.formatters?.transaction?.format||yi)(c)}async function Qd(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!n)throw new Cc({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||xi)(n)}const ep="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";
1
+ "use strict";var e=require("@ethersproject/providers"),t=require("zustand"),n=require("@ethersproject/bytes"),r=require("@ethersproject/properties"),a=require("@ethersproject/address"),i=require("@ethersproject/abstract-signer"),s=require("buffer");require("@ethersproject/abstract-provider");var o=require("@ethersproject/contracts");require("events");var 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)}function d(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var p=function(e,t){return p=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])},p(e,t)};var h=function(){return h=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},h.apply(this,arguments)};function m(e,t,n,r){return new(n||(n=Promise))((function(a,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(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(s,o)}c((r=r.apply(e,t||[])).next())}))}var f=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 y(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 b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s}function g(e){return this instanceof g?(this.v=e,this):new g(e)}var v=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var w,C,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}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return h},__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,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,n,s):a(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},__param:function(e,t){return function(n,r){t(n,r,e)}},__esDecorate:function(e,t,n,r,a,i){function s(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");i.push(s(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=s(y.get))&&(d.get=o),(o=s(y.set))&&(d.set=o),(o=s(y.init))&&a.push(o)}else(o=s(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:m,__generator:function(e,t){var n,r,a,i,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,o[0]&&(s=0)),s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(a=s.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){s.label=o[1];break}if(6===o[0]&&s.label<a[1]){s.label=a[1],a=o;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(o);break}a[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}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:f,__exportStar:function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||f(t,e,n)},__values:y,__read:b,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(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 i=arguments[t],s=0,o=i.length;s<o;s++,a++)r[a]=i[s];return r},__spreadArray:function(e,t,n){if(n||2===arguments.length)for(var r,a=0,i=t.length;a<i;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:g,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,a=n.apply(e,t||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){a[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||o(e,t)}))})}function o(e,t){try{!function(e){e.value instanceof g?Promise.resolve(e.value.v).then(c,l):u(i[0][2],e)}(a[e](t))}catch(e){u(i[0][3],e)}}function c(e){o("next",e)}function l(e){o("throw",e)}function u(e,t){e(t),i.shift(),i.length&&o(i[0][0],i[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:g(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=y(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)&&f(t,e,n);return v(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,(w=exports.ChainId||(exports.ChainId={}))[w.MAINNET=1]="MAINNET",w[w.GOERLI=5]="GOERLI",w[w.BSC=56]="BSC",w[w.POLYGON=137]="POLYGON",w[w.ARBITRUM_ONE=42161]="ARBITRUM_ONE",w[w.AURORA=1313161554]="AURORA",w[w.OKCHAIN=66]="OKCHAIN",w[w.OPTIMISM=10]="OPTIMISM",w[w.AVALANCHE=43114]="AVALANCHE",w[w.CONFLUX=1030]="CONFLUX",w[w.BASE=8453]="BASE",w[w.LINEA=59144]="LINEA",w[w.SCROLL_ALPHA_TESTNET=534353]="SCROLL_ALPHA_TESTNET",w[w.SCROLL=534352]="SCROLL",w[w.MANTLE=5e3]="MANTLE",w[w.MANTA=169]="MANTA",w[w.BTR=200901]="BTR",w[w.OKB=196]="OKB",exports.WalletType=void 0,(C=exports.WalletType||(exports.WalletType={})).injected="injected",C.BinanceChain="custom-bsc-injected",C.WalletConnect="walletconnect",C.Portis="portis",C.Gnosis="custom-gnosis",C.WalletLink="custom-walletlink",C.LedgerUSB="custom-ledger-usb",C.Ledger="custom-ledger",C.openBlock="custom-open-block",C.openBlockIframe="custom-open-block-iframe",C.GameStop="custom-game-stop",C.Nabox="custom-nabox",C.Bitkeep="custom-bitkeep",C.OneKey="custom-onekey",C.OKX="custom-okx",C.uAuth="custom-uauth",C.kuCoinWallet="custom-kucoin-wallet",C.frontier="custom-frontier",C.Blocto="custom-blocto",C.Rainbow="custom-rainbow",C.trust="custom-trust",C.tokenPocket="custom-token-pocket",C.Cyber="custom-cyber",C.uniPass="custom-uni-pass",C.Gate="custom-gate",C.Coin98="custom-coin-98",C.FoxWallet="custom-fox-wallet",C.Brave="custom-brave",C.Math="custom-math",C.ImToken="custom-im-token",C.Rabby="custom-rabby",C.SocialLogin="custom-social-login",C.Alchemy="custom-alchemy",C.Bybit="custom-bybit",C.Zerion="custom-zerion",C.Holdstation="custom-holdstation",C.SafePal="custom-safe-pal",C.Rise="custom-rise",C.EIP6963Prefix="custom-eip-6963-";const E=()=>{var e;return"undefined"!=typeof navigator&&!!(null===(e=window.navigator)||void 0===e?void 0:e.hid)},k=()=>{var e;return"undefined"!=typeof navigator&&(null===(e=window.navigator)||void 0===e?void 0:e.userAgent)&&/(Android)/i.test(navigator.userAgent)};function T(){return"undefined"!=typeof navigator&&/iPhone|iPod|iOS/.test(navigator.userAgent)}function P(){return"undefined"!=typeof navigator&&(/iPad/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)}const A=()=>T()||P(),_=()=>k()||A(),D=()=>{if("undefined"!=typeof window)return window},O=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)=>m(void 0,void 0,void 0,(function*(){t((()=>({provider:e})));const{chainId:a}=yield e.getNetwork(),i=yield e.listAccounts(),[s]=i,{type:o}=n;let c=o===exports.WalletType.Gnosis;if(!c&&o===exports.WalletType.WalletConnect&&s){const e=yield q();c=yield e.getAccountIsSafe(a,s)}t((e=>{var t;return{accounts:i,account:s,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,accounts:void 0,account:void 0})))},accountsChanged:e=>{const[n]=e;t((()=>({accounts:e,account:n})))},chainIdChanged:e=>{t((()=>({chainId:e})))},setRpcUrlProvider:(n,r)=>m(void 0,void 0,void 0,(function*(){const a=new e.JsonRpcProvider(n,r);let i=r;if(!i){const e=yield a.getNetwork();i=e.chainId}t((()=>({provider:a,chainId:i,accounts:void 0,account:void 0,walletType:void 0,connected:void 0,connectedWalletSpecial:void 0})))})),disconnect:n=>m(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 F(e){return m(this,void 0,void 0,(function*(){const{Web3Provider:t}=yield Promise.resolve().then((function(){return u(require("@ethersproject/providers"))}));return new t(e,"any")}))}function S(e=null,t){return m(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 I(e,t){return e.request?e.request(t):e.send(t.method,t.params)}function M({provider:e,addChainParameters:t}){return m(this,void 0,void 0,(function*(){try{return yield I(e,{method:"wallet_addEthereumChain",params:[t]}),{result:!0}}catch(e){console.error(`[failed to add ${t.chainId}]: `,t,e)}return{result:!1}}))}function N({addChainDirectly:e,addChainParameters:t,provider:n}){var r;return m(this,void 0,void 0,(function*(){const a=null!==(r=null!=n?n:O.getState().provider)&&void 0!==r?r:window.ethereum;if(!a)return{result:!1};if(e)return M({provider:a,addChainParameters:t});const{chainId:i}=t;try{return yield I(a,{method:"wallet_switchEthereumChain",params:[{chainId:i}]}),{result:!0}}catch(e){const{code:n}=e;if(4902===n||-32603===n)return M({provider:a,addChainParameters:t});console.error(`[failed to switch ${i}]: `,t,e)}return{result:!1}}))}let U=!1,L=1;const B={};let R=!1;var j,G;null===(j=D())||void 0===j||j.addEventListener("message",(e=>{"openblock-content-integration"===e.data.from&&(U=!0,Object.values(B).map((e=>e())))})),null===(G=D())||void 0===G||G.addEventListener("load",(()=>{setTimeout((()=>{R=!0,Object.values(B).map((e=>e()))}),1e3)}),{once:!0});const z=()=>m(void 0,void 0,void 0,(function*(){return new Promise((e=>{U?e(!0):window.parent===window||R?e(!1):(L++,B[L]=()=>{e(U),delete B[L]})}))})),$=(e,t)=>m(void 0,void 0,void 0,(function*(){const e=(yield Promise.resolve().then((function(){return require("./provider-e1c77615.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 H(){return Promise.resolve().then((function(){return require("./index-37e9b5f9.cjs")}))}function q(){return Promise.resolve().then((function(){return require("./index-79b6b22d.cjs")}))}function V(){return Promise.resolve().then((function(){return require("./uAuth-31d0a167.cjs")}))}function W(){return Promise.resolve().then((function(){return require("./portis-25ec3385.cjs")}))}function Z(){return Promise.resolve().then((function(){return require("./walletLink-7c24a1d7.cjs")}))}function K(){return Promise.resolve().then((function(){return require("./walletConnect-f85e4bb9.cjs")}))}function J(){return Promise.resolve().then((function(){return require("./blocto-7c451e4d.cjs")}))}function X(){return Promise.resolve().then((function(){return require("./rainbow-c04bf66f.cjs")}))}function Y(){return Promise.resolve().then((function(){return require("./index-c46d1215.cjs")}))}function Q(){return Promise.resolve().then((function(){return require("./index-a64ff146.cjs")}))}function ee(){return Promise.resolve().then((function(){return require("./index-cae93f1f.cjs")}))}function te(){return Promise.resolve().then((function(){return require("./index-02f31a88.cjs")}))}function ne(){return Promise.resolve().then((function(){return require("./index-d0e2d4e2.cjs")}))}function re(){return Promise.resolve().then((function(){return require("./index-f810457d.cjs")}))}function ae(){return Promise.resolve().then((function(){return require("./index-ed87a9e3.cjs")})).then((function(e){return e.index}))}function ie(e,t){return m(this,void 0,void 0,(function*(){return(yield J()).default(e,t)}))}function se(e,t){return m(this,void 0,void 0,(function*(){return(yield W()).default(e,t)}))}function oe(e,t){return m(this,void 0,void 0,(function*(){return(yield Z()).default(e,t)}))}function ce(e,t){return m(this,void 0,void 0,(function*(){return(yield K()).default(e,t)}))}function le(e,t){return m(this,void 0,void 0,(function*(){return(yield X()).default(e,t)}))}function ue(e,t){return m(this,void 0,void 0,(function*(){return(yield Y()).default(e,t)}))}function de(e,t){return m(this,void 0,void 0,(function*(){return(yield Q()).default(e,t)}))}function pe(e,t){return m(this,void 0,void 0,(function*(){return(yield ee()).default(e,t)}))}function he(e,t){return m(this,void 0,void 0,(function*(){return(yield te()).default(e,t)}))}function me(e,t){return m(this,void 0,void 0,(function*(){return(yield ne()).default(e,t)}))}function fe(e,t){return m(this,void 0,void 0,(function*(){return(yield re()).default(e,t)}))}function ye(e,t){return m(this,void 0,void 0,(function*(){return(yield ae()).default(e,t)}))}var be="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ge(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ve(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 we={},Ce={},xe=Ee;function Ee(e,t){if(!e)throw new Error(t||"Assertion failed")}Ee.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var ke={exports:{}};"function"==typeof Object.create?ke.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ke.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var Te=xe,Pe=ke.exports;function Ae(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function _e(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function De(e){return 1===e.length?"0"+e:e}function Oe(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}Ce.inherits=Pe,Ce.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a<e.length;a+=2)n.push(parseInt(e[a]+e[a+1],16))}else for(var r=0,a=0;a<e.length;a++){var i=e.charCodeAt(a);i<128?n[r++]=i:i<2048?(n[r++]=i>>6|192,n[r++]=63&i|128):Ae(e,a)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++a)),n[r++]=i>>18|240,n[r++]=i>>12&63|128,n[r++]=i>>6&63|128,n[r++]=63&i|128):(n[r++]=i>>12|224,n[r++]=i>>6&63|128,n[r++]=63&i|128)}else for(a=0;a<e.length;a++)n[a]=0|e[a];return n},Ce.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=De(e[n].toString(16));return t},Ce.htonl=_e,Ce.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var a=e[r];"little"===t&&(a=_e(a)),n+=Oe(a.toString(16))}return n},Ce.zero2=De,Ce.zero8=Oe,Ce.join32=function(e,t,n,r){var a=n-t;Te(a%4==0);for(var i=new Array(a/4),s=0,o=t;s<i.length;s++,o+=4){var c;c="big"===r?e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3]:e[o+3]<<24|e[o+2]<<16|e[o+1]<<8|e[o],i[s]=c>>>0}return i},Ce.split32=function(e,t){for(var n=new Array(4*e.length),r=0,a=0;r<e.length;r++,a+=4){var i=e[r];"big"===t?(n[a]=i>>>24,n[a+1]=i>>>16&255,n[a+2]=i>>>8&255,n[a+3]=255&i):(n[a+3]=i>>>24,n[a+2]=i>>>16&255,n[a+1]=i>>>8&255,n[a]=255&i)}return n},Ce.rotr32=function(e,t){return e>>>t|e<<32-t},Ce.rotl32=function(e,t){return e<<t|e>>>32-t},Ce.sum32=function(e,t){return e+t>>>0},Ce.sum32_3=function(e,t,n){return e+t+n>>>0},Ce.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},Ce.sum32_5=function(e,t,n,r,a){return e+t+n+r+a>>>0},Ce.sum64=function(e,t,n,r){var a=e[t],i=r+e[t+1]>>>0,s=(i<r?1:0)+n+a;e[t]=s>>>0,e[t+1]=i},Ce.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},Ce.sum64_lo=function(e,t,n,r){return t+r>>>0},Ce.sum64_4_hi=function(e,t,n,r,a,i,s,o){var c=0,l=t;return c+=(l=l+r>>>0)<t?1:0,c+=(l=l+i>>>0)<i?1:0,e+n+a+s+(c+=(l=l+o>>>0)<o?1:0)>>>0},Ce.sum64_4_lo=function(e,t,n,r,a,i,s,o){return t+r+i+o>>>0},Ce.sum64_5_hi=function(e,t,n,r,a,i,s,o,c,l){var u=0,d=t;return u+=(d=d+r>>>0)<t?1:0,u+=(d=d+i>>>0)<i?1:0,u+=(d=d+o>>>0)<o?1:0,e+n+a+s+c+(u+=(d=d+l>>>0)<l?1:0)>>>0},Ce.sum64_5_lo=function(e,t,n,r,a,i,s,o,c,l){return t+r+i+o+l>>>0},Ce.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},Ce.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},Ce.shr64_hi=function(e,t,n){return e>>>n},Ce.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0};var Fe={},Se=Ce,Ie=xe;function Me(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Fe.BlockHash=Me,Me.prototype.update=function(e,t){if(e=Se.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=Se.join32(e,0,e.length-n,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},Me.prototype.digest=function(e){return this.update(this._pad()),Ie(null===this.pending),this._digest(e)},Me.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var a=1;a<n;a++)r[a]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[a++]=0;r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=e>>>24&255,r[a++]=e>>>16&255,r[a++]=e>>>8&255,r[a++]=255&e}else for(r[a++]=255&e,r[a++]=e>>>8&255,r[a++]=e>>>16&255,r[a++]=e>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,i=8;i<this.padLength;i++)r[a++]=0;return r};var Ne={},Ue={},Le=Ce.rotr32;function Be(e,t,n){return e&t^~e&n}function Re(e,t,n){return e&t^e&n^t&n}function je(e,t,n){return e^t^n}Ue.ft_1=function(e,t,n,r){return 0===e?Be(t,n,r):1===e||3===e?je(t,n,r):2===e?Re(t,n,r):void 0},Ue.ch32=Be,Ue.maj32=Re,Ue.p32=je,Ue.s0_256=function(e){return Le(e,2)^Le(e,13)^Le(e,22)},Ue.s1_256=function(e){return Le(e,6)^Le(e,11)^Le(e,25)},Ue.g0_256=function(e){return Le(e,7)^Le(e,18)^e>>>3},Ue.g1_256=function(e){return Le(e,17)^Le(e,19)^e>>>10};var Ge=Ce,ze=Fe,$e=Ue,He=Ge.rotl32,qe=Ge.sum32,Ve=Ge.sum32_5,We=$e.ft_1,Ze=ze.BlockHash,Ke=[1518500249,1859775393,2400959708,3395469782];function Je(){if(!(this instanceof Je))return new Je;Ze.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ge.inherits(Je,Ze);var Xe=Je;Je.blockSize=512,Je.outSize=160,Je.hmacStrength=80,Je.padLength=64,Je.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=He(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var a=this.h[0],i=this.h[1],s=this.h[2],o=this.h[3],c=this.h[4];for(r=0;r<n.length;r++){var l=~~(r/20),u=Ve(He(a,5),We(l,i,s,o),c,n[r],Ke[l]);c=o,o=s,s=He(i,30),i=a,a=u}this.h[0]=qe(this.h[0],a),this.h[1]=qe(this.h[1],i),this.h[2]=qe(this.h[2],s),this.h[3]=qe(this.h[3],o),this.h[4]=qe(this.h[4],c)},Je.prototype._digest=function(e){return"hex"===e?Ge.toHex32(this.h,"big"):Ge.split32(this.h,"big")};var Ye=Ce,Qe=Fe,et=Ue,tt=xe,nt=Ye.sum32,rt=Ye.sum32_4,at=Ye.sum32_5,it=et.ch32,st=et.maj32,ot=et.s0_256,ct=et.s1_256,lt=et.g0_256,ut=et.g1_256,dt=Qe.BlockHash,pt=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function ht(){if(!(this instanceof ht))return new ht;dt.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=pt,this.W=new Array(64)}Ye.inherits(ht,dt);var mt=ht;ht.blockSize=512,ht.outSize=256,ht.hmacStrength=192,ht.padLength=64,ht.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=rt(ut(n[r-2]),n[r-7],lt(n[r-15]),n[r-16]);var a=this.h[0],i=this.h[1],s=this.h[2],o=this.h[3],c=this.h[4],l=this.h[5],u=this.h[6],d=this.h[7];for(tt(this.k.length===n.length),r=0;r<n.length;r++){var p=at(d,ct(c),it(c,l,u),this.k[r],n[r]),h=nt(ot(a),st(a,i,s));d=u,u=l,l=c,c=nt(o,p),o=s,s=i,i=a,a=nt(p,h)}this.h[0]=nt(this.h[0],a),this.h[1]=nt(this.h[1],i),this.h[2]=nt(this.h[2],s),this.h[3]=nt(this.h[3],o),this.h[4]=nt(this.h[4],c),this.h[5]=nt(this.h[5],l),this.h[6]=nt(this.h[6],u),this.h[7]=nt(this.h[7],d)},ht.prototype._digest=function(e){return"hex"===e?Ye.toHex32(this.h,"big"):Ye.split32(this.h,"big")};var ft=Ce,yt=mt;function bt(){if(!(this instanceof bt))return new bt;yt.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}ft.inherits(bt,yt);var gt=bt;bt.blockSize=512,bt.outSize=224,bt.hmacStrength=192,bt.padLength=64,bt.prototype._digest=function(e){return"hex"===e?ft.toHex32(this.h.slice(0,7),"big"):ft.split32(this.h.slice(0,7),"big")};var vt=Ce,wt=Fe,Ct=xe,xt=vt.rotr64_hi,Et=vt.rotr64_lo,kt=vt.shr64_hi,Tt=vt.shr64_lo,Pt=vt.sum64,At=vt.sum64_hi,_t=vt.sum64_lo,Dt=vt.sum64_4_hi,Ot=vt.sum64_4_lo,Ft=vt.sum64_5_hi,St=vt.sum64_5_lo,It=wt.BlockHash,Mt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Nt(){if(!(this instanceof Nt))return new Nt;It.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Mt,this.W=new Array(160)}vt.inherits(Nt,It);var Ut=Nt;function Lt(e,t,n,r,a){var i=e&n^~e&a;return i<0&&(i+=4294967296),i}function Bt(e,t,n,r,a,i){var s=t&r^~t&i;return s<0&&(s+=4294967296),s}function Rt(e,t,n,r,a){var i=e&n^e&a^n&a;return i<0&&(i+=4294967296),i}function jt(e,t,n,r,a,i){var s=t&r^t&i^r&i;return s<0&&(s+=4294967296),s}function Gt(e,t){var n=xt(e,t,28)^xt(t,e,2)^xt(t,e,7);return n<0&&(n+=4294967296),n}function zt(e,t){var n=Et(e,t,28)^Et(t,e,2)^Et(t,e,7);return n<0&&(n+=4294967296),n}function $t(e,t){var n=xt(e,t,14)^xt(e,t,18)^xt(t,e,9);return n<0&&(n+=4294967296),n}function Ht(e,t){var n=Et(e,t,14)^Et(e,t,18)^Et(t,e,9);return n<0&&(n+=4294967296),n}function qt(e,t){var n=xt(e,t,1)^xt(e,t,8)^kt(e,t,7);return n<0&&(n+=4294967296),n}function Vt(e,t){var n=Et(e,t,1)^Et(e,t,8)^Tt(e,t,7);return n<0&&(n+=4294967296),n}function Wt(e,t){var n=xt(e,t,19)^xt(t,e,29)^kt(e,t,6);return n<0&&(n+=4294967296),n}function Zt(e,t){var n=Et(e,t,19)^Et(t,e,29)^Tt(e,t,6);return n<0&&(n+=4294967296),n}Nt.blockSize=1024,Nt.outSize=512,Nt.hmacStrength=192,Nt.padLength=128,Nt.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var a=Wt(n[r-4],n[r-3]),i=Zt(n[r-4],n[r-3]),s=n[r-14],o=n[r-13],c=qt(n[r-30],n[r-29]),l=Vt(n[r-30],n[r-29]),u=n[r-32],d=n[r-31];n[r]=Dt(a,i,s,o,c,l,u,d),n[r+1]=Ot(a,i,s,o,c,l,u,d)}},Nt.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,r=this.h[0],a=this.h[1],i=this.h[2],s=this.h[3],o=this.h[4],c=this.h[5],l=this.h[6],u=this.h[7],d=this.h[8],p=this.h[9],h=this.h[10],m=this.h[11],f=this.h[12],y=this.h[13],b=this.h[14],g=this.h[15];Ct(this.k.length===n.length);for(var v=0;v<n.length;v+=2){var w=b,C=g,x=$t(d,p),E=Ht(d,p),k=Lt(d,p,h,m,f),T=Bt(d,p,h,m,f,y),P=this.k[v],A=this.k[v+1],_=n[v],D=n[v+1],O=Ft(w,C,x,E,k,T,P,A,_,D),F=St(w,C,x,E,k,T,P,A,_,D);w=Gt(r,a),C=zt(r,a),x=Rt(r,a,i,s,o),E=jt(r,a,i,s,o,c);var S=At(w,C,x,E),I=_t(w,C,x,E);b=f,g=y,f=h,y=m,h=d,m=p,d=At(l,u,O,F),p=_t(u,u,O,F),l=o,u=c,o=i,c=s,i=r,s=a,r=At(O,F,S,I),a=_t(O,F,S,I)}Pt(this.h,0,r,a),Pt(this.h,2,i,s),Pt(this.h,4,o,c),Pt(this.h,6,l,u),Pt(this.h,8,d,p),Pt(this.h,10,h,m),Pt(this.h,12,f,y),Pt(this.h,14,b,g)},Nt.prototype._digest=function(e){return"hex"===e?vt.toHex32(this.h,"big"):vt.split32(this.h,"big")};var Kt=Ce,Jt=Ut;function Xt(){if(!(this instanceof Xt))return new Xt;Jt.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Kt.inherits(Xt,Jt);var Yt=Xt;Xt.blockSize=1024,Xt.outSize=384,Xt.hmacStrength=192,Xt.padLength=128,Xt.prototype._digest=function(e){return"hex"===e?Kt.toHex32(this.h.slice(0,12),"big"):Kt.split32(this.h.slice(0,12),"big")},Ne.sha1=Xe,Ne.sha224=gt,Ne.sha256=mt,Ne.sha384=Yt,Ne.sha512=Ut;var Qt={},en=Ce,tn=Fe,nn=en.rotl32,rn=en.sum32,an=en.sum32_3,sn=en.sum32_4,on=tn.BlockHash;function cn(){if(!(this instanceof cn))return new cn;on.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function ln(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function un(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function dn(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}en.inherits(cn,on),Qt.ripemd160=cn,cn.blockSize=512,cn.outSize=160,cn.hmacStrength=192,cn.padLength=64,cn.prototype._update=function(e,t){for(var n=this.h[0],r=this.h[1],a=this.h[2],i=this.h[3],s=this.h[4],o=n,c=r,l=a,u=i,d=s,p=0;p<80;p++){var h=rn(nn(sn(n,ln(p,r,a,i),e[pn[p]+t],un(p)),mn[p]),s);n=s,s=i,i=nn(a,10),a=r,r=h,h=rn(nn(sn(o,ln(79-p,c,l,u),e[hn[p]+t],dn(p)),fn[p]),d),o=d,d=u,u=nn(l,10),l=c,c=h}h=an(this.h[1],a,u),this.h[1]=an(this.h[2],i,d),this.h[2]=an(this.h[3],s,o),this.h[3]=an(this.h[4],n,c),this.h[4]=an(this.h[0],r,l),this.h[0]=h},cn.prototype._digest=function(e){return"hex"===e?en.toHex32(this.h,"little"):en.split32(this.h,"little")};var pn=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],hn=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],mn=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],fn=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],yn=Ce,bn=xe;function gn(e,t,n){if(!(this instanceof gn))return new gn(e,t,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(yn.toArray(t,n))}var vn=gn;gn.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),bn(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},gn.prototype.update=function(e,t){return this.inner.update(e,t),this},gn.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=we;t.utils=Ce,t.common=Fe,t.sha=Ne,t.ripemd=Qt,t.hmac=vn,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}();var wn=d({__proto__:null,default:we},[we]),Cn={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 i(e,t,r,i,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new a(r,i||e,s),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 s(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,i=r.length,s=new Array(i);a<i;a++)s[a]=r[a].fn;return s},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,i,s){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,i),!0;case 6:return u.fn.call(u.context,t,r,a,i,s),!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 i(this,e,t,n,!1)},o.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},o.prototype.removeListener=function(e,t,r,a){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return s(this,i),this;var o=this._events[i];if(o.fn)o.fn!==t||a&&!o.once||r&&o.context!==r||s(this,i);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[i]=1===l.length?l[0]:l:s(this,i)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(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}(Cn);var xn=Cn.exports;const En="function"==typeof atob,kn="function"==typeof btoa,Tn="function"==typeof Buffer,Pn="function"==typeof TextDecoder?new TextDecoder:void 0,An="function"==typeof TextEncoder?new TextEncoder:void 0,_n=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Dn=(e=>{let t={};return _n.forEach(((e,n)=>t[e]=n)),t})(),On=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Fn=String.fromCharCode.bind(String),Sn="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),In=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Mn=kn?e=>btoa(e):Tn?e=>Buffer.from(e,"binary").toString("base64"):e=>{let t,n,r,a,i="";const s=e.length%3;for(let s=0;s<e.length;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|a,i+=_n[t>>18&63]+_n[t>>12&63]+_n[t>>6&63]+_n[63&t]}return s?i.slice(0,s-3)+"===".substring(s):i},Nn=Tn?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(Fn.apply(null,e.subarray(n,n+4096)));return Mn(t.join(""))},Un=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Fn(192|t>>>6)+Fn(128|63&t):Fn(224|t>>>12&15)+Fn(128|t>>>6&63)+Fn(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Fn(240|t>>>18&7)+Fn(128|t>>>12&63)+Fn(128|t>>>6&63)+Fn(128|63&t)},Ln=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Bn=Tn?e=>Buffer.from(e,"utf8").toString("base64"):An?e=>Nn(An.encode(e)):e=>Mn((e=>e.replace(Ln,Un))(e)),Rn=e=>((e,t=!1)=>t?(e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")))(Bn(e)):Bn(e))(e,!0),jn=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Gn=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Fn(55296+(t>>>10))+Fn(56320+(1023&t));case 3:return Fn((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Fn((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},zn=En?e=>atob(In(e)):Tn?e=>Buffer.from(e,"base64").toString("binary"):e=>{if(e=e.replace(/\s+/g,""),!On.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n,r,a="";for(let i=0;i<e.length;)t=Dn[e.charAt(i++)]<<18|Dn[e.charAt(i++)]<<12|(n=Dn[e.charAt(i++)])<<6|(r=Dn[e.charAt(i++)]),a+=64===n?Fn(t>>16&255):64===r?Fn(t>>16&255,t>>8&255):Fn(t>>16&255,t>>8&255,255&t);return a},$n=Tn?e=>Sn(Buffer.from(e,"base64")):e=>Sn(zn(e).split("").map((e=>e.charCodeAt(0)))),Hn=Tn?e=>Buffer.from(e,"base64").toString("utf8"):Pn?e=>Pn.decode($n(e)):e=>(e=>e.replace(jn,Gn))(zn(e));function qn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vn(e){if(Array.isArray(e))return qn(e)}function Wn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zn(e,t,n){return Zn=ir()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&er(a,n.prototype),a},Zn.apply(null,arguments)}function Kn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Jn(e,t,n){return t&&Kn(e.prototype,t),n&&Kn(e,n),e}function Xn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yn(e){return Yn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Yn(e)}function Qn(e,t){return!t||"object"!==nr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function er(e,t){return er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},er(e,t)}function tr(e){return Vn(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||rr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nr(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function rr(e,t){if(e){if("string"==typeof e)return qn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qn(e,t):void 0}}function ar(e){var t="function"==typeof Map?new Map:void 0;return ar=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Zn(e,arguments,Yn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),er(n,e)},ar(e)}function ir(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ir=function(){return!!e})()}var sr,or=Object.defineProperty,cr=function(e,t,n){return function(e,t,n){t in e?or(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!=(void 0===t?"undefined":nr(t))?t+"":t,n),n};function lr(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}Xn(sr={},"PARSE_ERROR",{code:-32700,message:"Parse error"}),Xn(sr,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),Xn(sr,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),Xn(sr,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),Xn(sr,"INTERNAL_ERROR",{code:-32603,message:"Internal error"}),Xn(sr,"SERVER_ERROR",{code:-32e3,message:"Server error"});var ur="hex",dr="utf8";function pr(e){return e.replace(/^0x/,"")}function hr(e){return fr(Buffer.from(pr(e),ur))}function mr(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.toString(ur);return t?function(e){return e.startsWith("0x")?e:"0x".concat(e)}(n):n}(yr(e),t)}function fr(e){return new Uint8Array(e)}function yr(e){return function(e){return ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)}(e)}function br(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=[];return t.forEach((function(e){return r=r.concat(Array.from(e))})),new Uint8Array(tr(r))}function gr(e){return function(e){return e.toString(dr)}(yr(e))}function vr(e){return yr(new Uint8Array(e))}var wr={16:10,24:12,32:14},Cr=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],xr=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Er=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],kr=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Tr=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Pr=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Ar=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],_r=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Dr=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Or=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Fr=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Sr=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Ir=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Mr=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Nr=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Ur(e){return parseInt("".concat(e))===e}function Lr(e){if(!Ur(e.length))return!1;for(var t=0;t<e.length;t++)if(!Ur(e[t])||e[t]<0||e[t]>255)return!1;return!0}function Br(e){return new Uint8Array(e)}function Rr(e){for(var t=[],n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);return t}function jr(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!Lr(e))throw new Error("Array contains invalid value");return new Uint8Array(e)}if(Ur(e.length)&&Lr(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function Gr(e,t,n,r,a){(null!=r||null!=a)&&(e=e.slice?e.slice(r,a):Array.prototype.slice.call(e,r,a)),t.set(e,n)}var zr=function(){function e(t){Wn(this,e),cr(this,"key"),cr(this,"_Ke"),cr(this,"_Kd"),this.key=jr(t,!0),this._prepare()}return Jn(e,[{key:"_prepare",value:function(){var e=wr[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var n,r=4*(e+1),a=this.key.length/4,i=Rr(this.key),s=0;s<a;s++)n=s>>2,this._Ke[n][s%4]=i[s],this._Kd[e-n][s%4]=i[s];for(var o,c=0,l=a;l<r;){if(o=i[a-1],i[0]^=xr[o>>16&255]<<24^xr[o>>8&255]<<16^xr[255&o]<<8^xr[o>>24&255]^Cr[c]<<24,c+=1,8!=a)for(var u=1;u<a;u++)i[u]^=i[u-1];else{for(var d=1;d<a/2;d++)i[d]^=i[d-1];o=i[a/2-1],i[a/2]^=xr[255&o]^xr[o>>8&255]<<8^xr[o>>16&255]<<16^xr[o>>24&255]<<24;for(var p=a/2+1;p<a;p++)i[p]^=i[p-1]}for(var h=0,m=void 0,f=void 0;h<a&&l<r;)m=l>>2,f=l%4,this._Ke[m][f]=i[h],this._Kd[e-m][f]=i[h++],l++}for(var y=1;y<e;y++)for(var b=0;b<4;b++)o=this._Kd[y][b],this._Kd[y][b]=Sr[o>>24&255]^Ir[o>>16&255]^Mr[o>>8&255]^Nr[255&o]}},{key:"encrypt",value:function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,n=[0,0,0,0],r=Rr(e),a=0;a<4;a++)r[a]^=this._Ke[0][a];for(var i=1;i<t;i++){for(var s=0;s<4;s++)n[s]=kr[r[s]>>24&255]^Tr[r[(s+1)%4]>>16&255]^Pr[r[(s+2)%4]>>8&255]^Ar[255&r[(s+3)%4]]^this._Ke[i][s];r=n.slice()}for(var o,c=Br(16),l=0;l<4;l++)o=this._Ke[t][l],c[4*l]=255&(xr[r[l]>>24&255]^o>>24),c[4*l+1]=255&(xr[r[(l+1)%4]>>16&255]^o>>16),c[4*l+2]=255&(xr[r[(l+2)%4]>>8&255]^o>>8),c[4*l+3]=255&(xr[255&r[(l+3)%4]]^o);return c}},{key:"decrypt",value:function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,n=[0,0,0,0],r=Rr(e),a=0;a<4;a++)r[a]^=this._Kd[0][a];for(var i=1;i<t;i++){for(var s=0;s<4;s++)n[s]=_r[r[s]>>24&255]^Dr[r[(s+3)%4]>>16&255]^Or[r[(s+2)%4]>>8&255]^Fr[255&r[(s+1)%4]]^this._Kd[i][s];r=n.slice()}for(var o,c=Br(16),l=0;l<4;l++)o=this._Kd[t][l],c[4*l]=255&(Er[r[l]>>24&255]^o>>24),c[4*l+1]=255&(Er[r[(l+3)%4]>>16&255]^o>>16),c[4*l+2]=255&(Er[r[(l+2)%4]>>8&255]^o>>8),c[4*l+3]=255&(Er[255&r[(l+1)%4]]^o);return c}}]),e}(),$r=function(){function e(t,n){if(Wn(this,e),cr(this,"_aes"),cr(this,"_lastCipherblock"),n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else n=new Uint8Array(16);this._lastCipherblock=jr(n,!0),this._aes=new zr(t)}return Jn(e,[{key:"encrypt",value:function(e){if(e=jr(e),e.length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=Br(e.length),n=Br(16),r=0;r<e.length;r+=16){Gr(e,n,0,r,r+16);for(var a=0;a<16;a++)n[a]^=this._lastCipherblock[a];this._lastCipherblock=this._aes.encrypt(n),Gr(this._lastCipherblock,t,r)}return t}},{key:"decrypt",value:function(e){if(e=jr(e),e.length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=Br(e.length),n=Br(16),r=0;r<e.length;r+=16){Gr(e,n,0,r,r+16),n=this._aes.decrypt(n);for(var a=0;a<16;a++)t[r+a]=n[a]^this._lastCipherblock[a];Gr(e,this._lastCipherblock,0,r,r+16)}return t}}]),e}(),Hr=[[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16],[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15],[14,14,14,14,14,14,14,14,14,14,14,14,14,14],[13,13,13,13,13,13,13,13,13,13,13,13,13],[12,12,12,12,12,12,12,12,12,12,12,12],[11,11,11,11,11,11,11,11,11,11,11],[10,10,10,10,10,10,10,10,10,10],[9,9,9,9,9,9,9,9,9],[8,8,8,8,8,8,8,8],[7,7,7,7,7,7,7],[6,6,6,6,6,6],[5,5,5,5,5],[4,4,4,4],[3,3,3],[2,2],[1]],qr={pad:function(e){var t=Hr[e.byteLength%16||0],n=new Uint8Array(e.byteLength+t.length);return n.set(e),n.set(t,e.byteLength),n},unpad:function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}},Vr="sha256";function Wr(e,t){return hr(we.hmac(wn[Vr],e).update(t).digest("hex"))}function Zr(e){var t=function(e){for(var t=new Uint8Array(e),n=0;n<e;++n)t[n]=Math.floor(256*Math.random());return yr(t)}(e);return fr(t)}function Kr(e){return function(e){return fr(e).buffer}(yr(Zr((e||256)/8)))}var Jr={error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).error.apply(r,["[ERROR]"].concat(tr(t)))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).warn.apply(r,["[WARN]"].concat(tr(t)))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).info.apply(r,["[INFO]"].concat(tr(t)))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;(r=console).log.apply(r,["[DEBUG]"].concat(tr(t)))}},Xr=("undefined"==typeof window?"undefined":nr(window))<"u";function Yr(){for(var e=function(e){var t=a[e],r=["itemprop","property","name"].map((function(e){return t.getAttribute(e)})).filter((function(e){return!!e&&n.includes(e)}));if(r.length&&r){var i=t.getAttribute("content");if(i)return{v:i}}},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var a=document.getElementsByTagName("meta"),i=0;i<a.length;i++){var s=e(i);if("object"===nr(s))return s.v}return""}var Qr=function(e){function t(e,n){var r;return Wn(this,t),r=function(e,t,n){return t=Yn(t),Qn(e,ir()?Reflect.construct(t,n||[],Yn(e).constructor):t.apply(e,n))}(this,t,[n]),cr(r,"code"),r.code=e,Object.setPrototypeOf(r,(function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}(this,t)?this.constructor:void 0).prototype),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&er(e,t)}(t,e),Jn(t,[{key:"toString",value:function(){return"".concat(this.message," (").concat(this.code,")")}}]),t}(ar(Error)),ea=function(){return!!(nr(window.navigator)>"u"?"":navigator.userAgent).match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i)},ta=function(e,t){var n="appId=xoqXxUSMRccLCrZNRebmzj&startPagePath=L3BhZ2VzL2Rhc2hib2FyZC1uZXcvaW5kZXg=";if(t){var r=Rn("wc=".concat(encodeURIComponent(t),"&isDeepLink=true&id=").concat(+new Date));n="".concat(n,"&startPageQuery=").concat(r)}var a="//app.binance.com";return e?"bnc:".concat(a,"/mp/app?").concat(n):"https:".concat(a,"/?_dp=").concat(Rn("/mp/app?".concat(n)))},na=function(){try{var e,t;return!0===(null===(t=window)||void 0===t||null===(e=t.ethereum)||void 0===e?void 0:e.isBinance)}catch(e){return!1}};function ra(e){e=atob(e);const t=[];for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));return n.arrayify(t)}function aa(e){e=n.arrayify(e);let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}let ia=!1,sa=!1;const oa={debug:1,default:2,info:2,warning:3,error:4,off:5};let ca=oa.default,la=null;const ua=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var da;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(da||(da={})),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 pa="0123456789abcdef";class ha{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==oa[n]&&this.throwArgumentError("invalid log level name","logLevel",e),ca>oa[n]||console.log.apply(console,t)}debug(...e){this._log(ha.levels.DEBUG,e)}info(...e){this._log(ha.levels.INFO,e)}warn(...e){this._log(ha.levels.WARNING,e)}makeError(e,t,n){if(sa)return this.makeError("censored error",t,{});t||(t=ha.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+=pa[t[e]>>4],n+=pa[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 i="";switch(t){case exports.ErrorCode.NUMERIC_FAULT:{i="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":i+="-"+t;break;case"negative-power":case"negative-width":i+="-unsupported";break;case"unbound-bitwise-result":i+="-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:i=t}i&&(e+=" [ See: https://links.ethers.org/v5-errors-"+i+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const s=new Error(e);return s.reason=a,s.code=t,Object.keys(n).forEach((function(e){s[e]=n[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,ha.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){ua&&this.throwError("platform missing String.prototype.normalize",ha.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ua})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,ha.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,ha.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,ha.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,ha.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",ha.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",ha.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",ha.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return la||(la=new ha("logger/5.7.0")),la}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",ha.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),ia){if(!e)return;this.globalLogger().throwError("error censorship permanent",ha.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}sa=!!e,ia=!!t}static setLogLevel(e){const t=oa[e.toLowerCase()];null!=t?ca=t:ha.globalLogger().warn("invalid log level - "+e)}static from(e){return new ha(e)}}ha.errors=exports.ErrorCode,ha.levels=da;const ma=new ha("strings/5.7.0");var fa,ya;function ba(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,(fa=exports.UnicodeNormalizationForm||(exports.UnicodeNormalizationForm={})).current="",fa.NFC="NFC",fa.NFD="NFD",fa.NFKC="NFKC",fa.NFKD="NFKD",exports.Utf8ErrorReason=void 0,(ya=exports.Utf8ErrorReason||(exports.Utf8ErrorReason={})).UNEXPECTED_CONTINUE="unexpected continuation byte",ya.BAD_PREFIX="bad codepoint prefix",ya.OVERRUN="string overrun",ya.MISSING_CONTINUE="missing continuation byte",ya.OUT_OF_RANGE="out of UTF-8 range",ya.UTF16_SURROGATE="UTF-16 surrogate",ya.OVERLONG="overlong representation";const ga=Object.freeze({error:function(e,t,n,r,a){return ma.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:ba,replace:function(e,t,n,r,a){return e===exports.Utf8ErrorReason.OVERLONG?(r.push(a),0):(r.push(65533),ba(e,t,n))}});function va(e,t){null==t&&(t=ga.error),e=n.arrayify(e);const r=[];let a=0;for(;a<e.length;){const n=e[a++];if(n>>7==0){r.push(n);continue}let i=null,s=null;if(192==(224&n))i=1,s=127;else if(224==(240&n))i=2,s=2047;else{if(240!=(248&n)){a+=t(128==(192&n)?exports.Utf8ErrorReason.UNEXPECTED_CONTINUE:exports.Utf8ErrorReason.BAD_PREFIX,a-1,e,r);continue}i=3,s=65535}if(a-1+i>=e.length){a+=t(exports.Utf8ErrorReason.OVERRUN,a-1,e,r);continue}let o=n&(1<<8-i-1)-1;for(let n=0;n<i;n++){let n=e[a];if(128!=(192&n)){a+=t(exports.Utf8ErrorReason.MISSING_CONTINUE,a,e,r),o=null;break}o=o<<6|63&n,a++}null!==o&&(o>1114111?a+=t(exports.Utf8ErrorReason.OUT_OF_RANGE,a-1-i,e,r,o):o>=55296&&o<=57343?a+=t(exports.Utf8ErrorReason.UTF16_SURROGATE,a-1-i,e,r,o):o<=s?a+=t(exports.Utf8ErrorReason.OVERLONG,a-1-i,e,r,o):r.push(o))}return r}function wa(e,t=exports.UnicodeNormalizationForm.current){t!=exports.UnicodeNormalizationForm.current&&(ma.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const a=e.charCodeAt(t);if(t>=e.length||56320!=(64512&a))throw new Error("invalid utf-8 string");const i=65536+((1023&n)<<10)+(1023&a);r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(63&i|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return n.arrayify(r)}function Ca(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function xa(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Ea(e,t){return xa(va(e,t))}var ka=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(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(s,o)}c((r=r.apply(e,t||[])).next())}))};function Ta(e,t){return ka(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const a=yield fetch(e,r),i=yield a.arrayBuffer(),s={};return a.headers.forEach?a.headers.forEach(((e,t)=>{s[t.toLowerCase()]=e})):a.headers.keys().forEach((e=>{s[e.toLowerCase()]=a.headers.get(e)})),{headers:s,statusCode:a.status,statusMessage:a.statusText,body:n.arrayify(new Uint8Array(i))}}))}var Pa=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(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(s,o)}c((r=r.apply(e,t||[])).next())}))};const Aa=new ha("web/5.7.1");function _a(e){return new Promise((t=>{setTimeout(t,e)}))}function Da(e,t){if(null==e)return null;if("string"==typeof e)return e;if(n.isBytesLike(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Ea(e)}catch(e){}return n.hexlify(e)}return e}function Oa(e,t,n){const a="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Aa.assertArgument(a>0&&a%1==0,"invalid connection throttle limit","connection.throttleLimit",a);const i="object"==typeof e?e.throttleCallback:null,s="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Aa.assertArgument(s>0&&s%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);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||Aa.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&&Aa.throwError("basic authentication requires a secure https url",ha.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;c.authorization={key:"Authorization",value:"Basic "+aa(wa(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=r.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]?ra(m[3]):(f=m[3],wa(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){Aa.throwError("processing response error",ha.errors.SERVER_ERROR,{body:Da(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(Aa.makeError("timeout",ha.errors.TIMEOUT,{requestBody:Da(u.body,y["content-type"]),requestMethod:u.method,timeout:p,url:l})))}),p))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),g=function(){return Pa(this,void 0,void 0,(function*(){for(let e=0;e<a;e++){let t=null;try{if(t=yield Ta(l,u),e<a)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(i&&(n=yield i(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):s*parseInt(String(Math.random()*Math.pow(2,e))),yield _a(n);continue}}}catch(e){t=e.response,null==t&&(b.cancel(),Aa.throwError("missing response",ha.errors.SERVER_ERROR,{requestBody:Da(u.body,y["content-type"]),requestMethod:u.method,serverError:e,url:l}))}let r=t.body;if(d&&304===t.statusCode?r=null:!o&&(t.statusCode<200||t.statusCode>=300)&&(b.cancel(),Aa.throwError("bad response",ha.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Da(r,t.headers?t.headers["content-type"]:null),requestBody:Da(u.body,y["content-type"]),requestMethod:u.method,url:l})),n)try{const e=yield n(r,t);return b.cancel(),e}catch(n){if(n.throttleRetry&&e<a){let t=!0;if(i&&(t=yield i(e,l)),t){const t=s*parseInt(String(Math.random()*Math.pow(2,e)));yield _a(t);continue}}b.cancel(),Aa.throwError("processing response error",ha.errors.SERVER_ERROR,{body:Da(r,t.headers?t.headers["content-type"]:null),error:n,requestBody:Da(u.body,y["content-type"]),requestMethod:u.method,url:l})}return b.cancel(),r}return Aa.throwError("failed response",ha.errors.SERVER_ERROR,{requestBody:Da(u.body,y["content-type"]),requestMethod:u.method,url:l})}))}();return Promise.race([b.promise,g])}function Fa(e,t,n){let a=null;if(null!=t){a=wa(t);const n="string"==typeof e?{url:e}:r.shallowCopy(e);if(n.headers){const e=0!==Object.keys(n.headers).filter((e=>"content-type"===e.toLowerCase())).length;e||(n.headers=r.shallowCopy(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return Oa(e,a,((e,t)=>{let r=null;if(null!=e)try{r=JSON.parse(Ea(e))}catch(t){Aa.throwError("invalid JSON",ha.errors.SERVER_ERROR,{body:e,error:t})}return n&&(r=n(r,t)),r}))}function Sa(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 Ia 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 a={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:r.deepCopy(a),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=Fa(Object.assign(Object.assign({},this.connection),{url:this.rpcUrl||(null===(n=this.connection)||void 0===n?void 0:n.url)}),JSON.stringify(a),Sa).then((e=>(this.emit("debug",{action:"response",request:a,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:a,provider:this}),e}));return i&&(this._cache[e]=s,setTimeout((()=>{this._cache[e]=null}),0)),s}}function Ma(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const Na=Ma({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}),Ua=e=>e;class La 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 La?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof La&&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 Ba(this,e)}}function Ba(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?Ba(e.cause,t):t?null:e}class Ra extends La{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 ja extends La{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 Ga extends La{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 za extends La{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 $a(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function Ha(e){return $a(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function qa(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 Va extends La{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 Wa extends La{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 Za extends La{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 Ka(e,{dir:t,size:n=32}={}){return"string"==typeof e?Ja(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new Wa({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let a=0;a<n;a++){const i="right"===t;r[i?a:n-a-1]=e[i?a:e.length-a-1]}return r}(e,{dir:t,size:n})}function Ja(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new Wa({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}const Xa=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Ya(e,t={}){return"number"==typeof e||"bigint"==typeof e?ti(e,t):"string"==typeof e?ri(e,t):"boolean"==typeof e?Qa(e,t):ei(e,t)}function Qa(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(ui(n,{size:t.size}),Ka(n,{size:t.size})):n}function ei(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=Xa[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(ui(r,{size:t.size}),Ka(r,{dir:"right",size:t.size})):r}function ti(e,t={}){const{signed:n,size:r}=t,a=BigInt(e);let i;r?i=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(i=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof i&&n?-i-1n:0;if(i&&a>i||a<s){const t="bigint"==typeof e?"n":"";throw new Ra({max:i?`${i}${t}`:void 0,min:`${s}${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?Ka(o,{size:r}):o}const ni=new TextEncoder;function ri(e,t={}){return ei(ni.encode(e),t)}const ai=new TextEncoder;function ii(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=ti(e,t);return ci(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return ui(n,{size:t.size}),Ka(n,{size:t.size});return n}(e,t):$a(e)?ci(e,t):li(e,t)}const si={zero:48,nine:57,A:65,F:70,a:97,f:102};function oi(e){return e>=si.zero&&e<=si.nine?e-si.zero:e>=si.A&&e<=si.F?e-(si.A-10):e>=si.a&&e<=si.f?e-(si.a-10):void 0}function ci(e,t={}){let n=e;t.size&&(ui(n,{size:t.size}),n=Ka(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const a=r.length/2,i=new Uint8Array(a);for(let e=0,t=0;e<a;e++){const n=oi(r.charCodeAt(t++)),a=oi(r.charCodeAt(t++));if(void 0===n||void 0===a)throw new La(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);i[e]=16*n+a}return i}function li(e,t={}){const n=ai.encode(e);return"number"==typeof t.size?(ui(n,{size:t.size}),Ka(n,{dir:"right",size:t.size})):n}function ui(e,{size:t}){if(Ha(e)>t)throw new za({givenSize:Ha(e),maxSize:t})}function di(e,t){const n="string"==typeof t?{to:t}:t,r=n.to;return"number"===r?hi(e,n):"bigint"===r?pi(e,n):"string"===r?function(e,t={}){let n=ci(e);t.size&&(ui(n,{size:t.size}),n=qa(n,{dir:"right"}));return(new TextDecoder).decode(n)}(e,n):"boolean"===r?function(e,t={}){let n=e;t.size&&(ui(n,{size:t.size}),n=qa(n));if("0x00"===qa(n))return!1;if("0x01"===qa(n))return!0;throw new Ga(n)}(e,n):ci(e,n)}function pi(e,t={}){const{signed:n}=t;t.size&&ui(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 hi(e,t={}){return Number(pi(e,t))}function mi(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 fi={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function yi(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?hi(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?hi(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?fi[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 bi=mi("transaction",yi);function gi(e){const t=e.transactions?.map((e=>"string"==typeof e?e:yi(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 vi=mi("block",gi);function wi(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 Ci={"0x0":"reverted","0x1":"success"};function xi(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=>wi(e))):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?hi(e.transactionIndex):null,status:e.status?Ci[e.status]:null,type:e.type?fi[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const Ei=mi("transactionReceipt",xi),ki={block:vi({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=yi(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?pi(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:bi({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?pi(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Ei({format:e=>({l1GasPrice:e.l1GasPrice?pi(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?pi(e.l1GasUsed):null,l1Fee:e.l1Fee?pi(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})};class Ti extends La{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 Pi 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 Ai(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function _i(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 Di(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 Oi(e,t){_i(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Fi=BigInt(2**32-1),Si=BigInt(32);function Ii(e,t=!1){return t?{h:Number(e&Fi),l:Number(e>>Si&Fi)}:{h:0|Number(e>>Si&Fi),l:0|Number(e&Fi)}}function Mi(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let a=0;a<e.length;a++){const{h:i,l:s}=Ii(e[a],t);[n[a],r[a]]=[i,s]}return[n,r]}const Ni=e=>e instanceof Uint8Array,Ui=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Li=(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 Bi(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)),!Ni(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class Ri{clone(){return this._cloneInto()}}function ji(e){const t=t=>e().update(Bi(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const[Gi,zi,$i]=[[],[],[]],Hi=BigInt(0),qi=BigInt(1),Vi=BigInt(2),Wi=BigInt(7),Zi=BigInt(256),Ki=BigInt(113);for(let e=0,t=qi,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Gi.push(2*(5*r+n)),zi.push((e+1)*(e+2)/2%64);let a=Hi;for(let e=0;e<7;e++)t=(t<<qi^(t>>Wi)*Ki)%Zi,t&Vi&&(a^=qi<<(qi<<BigInt(e))-qi);$i.push(a)}const[Ji,Xi]=Mi($i,!0),Yi=(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),Qi=(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 es extends Ri{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,Ai(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.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,i=n[a],s=n[a+1],o=Yi(i,s,1)^n[r],c=Qi(i,s,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=zi[n],i=Yi(t,a,r),s=Qi(t,a,r),o=Gi[n];t=e[o],a=e[o+1],e[o]=i,e[o+1]=s}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]^=Ji[r],e[1]^=Xi[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Di(this);const{blockLen:t,state:n}=this,r=(e=Bi(e)).length;for(let a=0;a<r;){const i=Math.min(t-this.pos,r-a);for(let t=0;t<i;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){Di(this,!1),_i(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 i=Math.min(n-this.posOut,a-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ai(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Oi(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:i}=this;return e||(e=new es(t,n,r,i,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=i,e.destroyed=this.destroyed,e}}const ts=((e,t,n)=>ji((()=>new es(t,e,n))))(1,136,32);function ns(e,t){const n=t||"hex",r=ts($a(e,{strict:!1})?ii(e):e);return"bytes"===n?r:Ya(r)}function rs(e,t){const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=ns(li(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 as=/^0x[a-fA-F0-9]{40}$/,is=new Pi(8192);function ss(e,{strict:t=!0}={}){if(is.has(e))return is.get(e);const n=!(!as.test(e)||e.toLowerCase()!==e&&t&&rs(e)!==e);return is.set(e,n),n}function os(e){return"string"==typeof e[0]?cs(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 cs(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}class ls extends Error{constructor(e,t={}){const n=t.cause instanceof ls?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof ls&&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 us(e,t){const n=e.exec(t);return n?.groups}const ds=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,ps=/^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)?$/,hs=/^\(.+?\).*?$/,ms=/^tuple(?<array>(\[(\d*)\])*)$/;function fs(e){let t=e.type;if(ms.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){t+=fs(e.components[r]),r<n-1&&(t+=", ")}const r=us(ms,e.type);return t+=`)${r?.array??""}`,fs({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function ys(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=fs(e[r]),r!==n-1&&(t+=", ")}return t}const bs=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function gs(e){return bs.test(e)}function vs(e){return us(bs,e)}const ws=new Set(["memory","indexed","storage","calldata"]),Cs=new Set(["calldata","memory","storage"]);class xs extends ls{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 Es extends ls{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 ks extends ls{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 Ts extends ls{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Ps extends ls{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 As extends ls{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 _s extends ls{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 Ds extends ls{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 Os extends ls{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Fs extends ls{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 Ss extends ls{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 Is extends ls{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 Ms=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}]]),Ns=/^(?<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$_]*))?$/,Us=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Ls=/^u?int$/;function Bs(e,t){const n=function(e,t){return t?`${t}:${e}`:e}(e,t?.type);if(Ms.has(n))return Ms.get(n);const r=hs.test(e),a=us(r?Us:Ns,e);if(!a)throw new Ts({param:e});if(a.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||ds.test(e)||ps.test(e)||Gs.test(e)}(a.name))throw new Ps({param:e,name:a.name});const i=a.name?{name:a.name}:{},s="indexed"===a.modifier?{indexed:!0}:{},o=t?.structs??{};let c,l={};if(r){c="tuple";const e=Rs(a.type),t=[],n=e.length;for(let r=0;r<n;r++)t.push(Bs(e[r],{structs:o}));l={components:t}}else if(a.type in o)c="tuple",l={components:o[a.type]};else if(Ls.test(a.type))c=`${a.type}256`;else if(c=a.type,"struct"!==t?.type&&!js(c))throw new Es({type:c});if(a.modifier){if(!t?.modifiers?.has?.(a.modifier))throw new As({param:e,type:t?.type,modifier:a.modifier});if(Cs.has(a.modifier)&&!function(e,t){return t||"bytes"===e||"string"===e||"tuple"===e}(c,!!a.array))throw new _s({param:e,type:t?.type,modifier:a.modifier})}const u={type:`${c}${a.array??""}`,...i,...s,...l};return Ms.set(n,u),u}function Rs(e,t=[],n="",r=0){const a=e.trim().length;for(let i=0;i<a;i++){const a=e[i],s=e.slice(i+1);switch(a){case",":return 0===r?Rs(s,[...t,n.trim()]):Rs(s,t,`${n}${a}`,r);case"(":return Rs(s,t,`${n}${a}`,r+1);case")":return Rs(s,t,`${n}${a}`,r-1);default:return Rs(s,t,`${n}${a}`,r)}}if(""===n)return t;if(0!==r)throw new Is({current:n,depth:r});return t.push(n.trim()),t}function js(e){return"address"===e||"bool"===e||"function"===e||"string"===e||ds.test(e)||ps.test(e)}const Gs=/^(?: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 zs=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function $s(e,t,n=new Set){const r=[],a=e.length;for(let i=0;i<a;i++){const a=e[i];if(hs.test(a.type))r.push(a);else{const e=us(zs,a.type);if(!e?.type)throw new Ds({abiParameter:a});const{array:i,type:s}=e;if(s in t){if(n.has(s))throw new Ss({type:s});r.push({...a,type:`tuple${i??""}`,components:$s(t[s]??[],t,new Set([...n,s]))})}else{if(!js(s))throw new xs({type:s});r.push(a)}}}return r}function Hs(e){const t=[];if("string"==typeof e){const n=Rs(e),r=n.length;for(let e=0;e<r;e++)t.push(Bs(n[e],{modifiers:ws}))}else{const n=function(e){const t={},n=e.length;for(let r=0;r<n;r++){const n=e[r];if(!gs(n))continue;const a=vs(n);if(!a)throw new Os({signature:n,type:"struct"});const i=a.properties.split(";"),s=[],o=i.length;for(let e=0;e<o;e++){const t=i[e].trim();if(!t)continue;const n=Bs(t,{type:"struct"});s.push(n)}if(!s.length)throw new Fs({signature:n});t[a.name]=s}const r={},a=Object.entries(t),i=a.length;for(let e=0;e<i;e++){const[n,i]=a[e];r[n]=$s(i,t)}return r}(e),r=e.length;for(let a=0;a<r;a++){const r=e[a];if(gs(r))continue;const i=Rs(r),s=i.length;for(let e=0;e<s;e++)t.push(Bs(i[e],{modifiers:ws,structs:n}))}}if(0===t.length)throw new ks({params:e});return t}function qs(e,t,n){return r=>e[t.name||n]?.(r)??t(e,r)}function Vs(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new fo(e.type);return`${e.name}(${Ws(e.inputs,{includeName:t})})`}function Ws(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${Ws(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}class Zs extends La{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 Ks extends La{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 Js extends La{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${Ws(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 Xs extends La{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class Ys extends La{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 Qs extends La{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${Ha(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class eo extends La{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 to extends La{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 no extends La{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 ro extends La{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join("\n"),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class ao extends La{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 io extends La{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 so extends La{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 oo extends La{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Vs(e.abiItem)}\`, and`,`\`${t.type}\` in \`${Vs(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 co extends La{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 lo extends La{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: (${Ws(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 uo extends La{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${Vs(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 po extends La{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 ho extends La{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 mo extends La{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 fo extends La{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 yo extends La{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const bo=e=>ns(ii(e));const go=e=>{var t;return function(e){let t=!0,n="",r=0,a="",i=!1;for(let s=0;s<e.length;s++){const o=e[s];if(["(",")",","].includes(o)&&(t=!0),"("===o&&r++,")"===o&&r--,t)if(0!==r)" "!==o?(a+=o,n+=o):","!==e[s-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===o&&["event","function",""].includes(a))a="";else if(a+=o,")"===o){i=!0;break}}if(!i)throw new La("Unable to normalize signature.");return a}("string"==typeof e?e:"function"===(t=e).type?`function ${t.name}(${ys(t.inputs)})${t.stateMutability&&"nonpayable"!==t.stateMutability?` ${t.stateMutability}`:""}${t.outputs.length?` returns (${ys(t.outputs)})`:""}`:"event"===t.type?`event ${t.name}(${ys(t.inputs)})`:"error"===t.type?`error ${t.name}(${ys(t.inputs)})`:"constructor"===t.type?`constructor(${ys(t.inputs)})${"payable"===t.stateMutability?" payable":""}`:"fallback"===t.type?"fallback()":"receive() external payable")};function vo(e){return t=go(e),bo(t);var t}const wo=vo;function Co(e,t,n,{strict:r}={}){return $a(e,{strict:!1})?function(e,t,n,{strict:r}={}){xo(e,t);const a=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&Eo(a,t,n);return a}(e,t,n,{strict:r}):ko(e,t,n,{strict:r})}function xo(e,t){if("number"==typeof t&&t>0&&t>Ha(e)-1)throw new Va({offset:t,position:"start",size:Ha(e)})}function Eo(e,t,n){if("number"==typeof t&&"number"==typeof n&&Ha(e)!==n-t)throw new Va({offset:n,position:"end",size:Ha(e)})}function ko(e,t,n,{strict:r}={}){xo(e,t);const a=e.slice(t,n);return r&&Eo(a,t,n),a}function To(e,t){if(e.length!==t.length)throw new eo({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(Po({param:e[r],value:t[r]}));return n}({params:e,values:t}),r=Ao(n);return 0===r.length?"0x":r}function Po({param:e,value:t}){const n=_o(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 mo(e);if(!r&&e.length!==t)throw new Ys({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let a=!1;const i=[];for(let t=0;t<e.length;t++){const r=Po({param:n,value:e[t]});r.dynamic&&(a=!0),i.push(r)}if(r||a){const e=Ao(i);if(r){const t=ti(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?os([t,e]):t}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:os(i.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 i=t.components[a],s=Po({param:i,value:e[Array.isArray(e)?a:i.name]});r.push(s),s.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Ao(r):os(r.map((({encoded:e})=>e)))}}(t,{param:e});if("address"===e.type)return function(e){if(!ss(e))throw new Ti({address:e});return{dynamic:!1,encoded:Ja(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){return{dynamic:!1,encoded:Ja(Qa(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){return function(e,{signed:t}){return{dynamic:!1,encoded:ti(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=Ha(e);if(!n){let t=e;return r%32!=0&&(t=Ja(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:os([Ja(ti(r,{size:32})),t])}}if(r!==parseInt(n))throw new Qs({expectedSize:parseInt(n),value:e});return{dynamic:!1,encoded:Ja(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=ri(e),n=Math.ceil(Ha(t)/32),r=[];for(let e=0;e<n;e++)r.push(Ja(Co(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:os([Ja(ti(Ha(t),{size:32})),...r])}}(t);throw new po(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Ao(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:r,encoded:a}=e[n];t+=r?32:Ha(a)}const n=[],r=[];let a=0;for(let i=0;i<e.length;i++){const{dynamic:s,encoded:o}=e[i];s?(n.push(ti(t+a,{size:32})),r.push(o),a+=Ha(o)):n.push(o)}return os([...n,...r])}function _o(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Do=e=>Co(vo(e),0,4);function Oo(e){const{abi:t,args:n=[],name:r}=e,a=$a(r,{strict:!1}),i=t.filter((e=>a?"function"===e.type?Do(e)===r:"event"===e.type&&wo(e)===r:"name"in e&&e.name===r));if(0===i.length)return;if(1===i.length)return i[0];let s;for(const e of i){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&&Fo(t,r)}));if(t){if(s&&"inputs"in s&&s.inputs){const t=So(e.inputs,s.inputs,n);if(t)throw new oo({abiItem:e,type:t[0]},{abiItem:s,type:t[1]})}s=e}}return s||i[0]}function Fo(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ss(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)=>Fo(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=>Fo(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function So(e,t,n){for(const r in e){const a=e[r],i=t[r];if("tuple"===a.type&&"tuple"===i.type&&"components"in a&&"components"in i)return So(a.components,i.components,n[r]);const s=[a.type,i.type];if(!(!s.includes("address")||!s.includes("bytes20"))||(s.includes("address")&&s.includes("string")||!(!s.includes("address")||!s.includes("bytes")))&&ss(n[r],{strict:!1}))return s}}const Io="/docs/contract/encodeEventTopics";function Mo(e){const{abi:t,eventName:n,args:r}=e;let a=t[0];if(n){const e=Oo({abi:t,name:n});if(!e)throw new ao(n,{docsPath:Io});a=e}if("event"!==a.type)throw new ao(void 0,{docsPath:Io});const i=Vs(a),s=wo(i);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)=>No({param:e,value:t[n][a]}))):t[n]?No({param:e,value:t[n]}):null))??[])}return[s,...o]}function No({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return ns(ii(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new yo(e.type);return To([e],[t])}function Uo(e,{method:t}){const n={};return"fallback"===e.transport.type&&e.transport.onResponse?.((({method:e,response:r,status:a,transport:i})=>{"success"===a&&t===e&&(n[r]=i.request)})),t=>n[t]||e.request}async function Lo(e,t){const{address:n,abi:r,args:a,eventName:i,fromBlock:s,strict:o,toBlock:c}=t,l=Uo(e,{method:"eth_newFilter"}),u=i?Mo({abi:r,args:a,eventName:i}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:"bigint"==typeof s?ti(s):s,toBlock:"bigint"==typeof c?ti(c):c,topics:u}]});return{abi:r,args:a,eventName:i,id:d,request:l(d),strict:Boolean(o),type:"event"}}function Bo(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const Ro="/docs/contract/encodeFunctionData";function jo(e){const{abi:t,args:n,functionName:r}=e;let a=t[0];if(r){const e=Oo({abi:t,args:n,name:r});if(!e)throw new io(r,{docsPath:Ro});a=e}if("function"!==a.type)throw new io(void 0,{docsPath:Ro});const i=Vs(a);return cs([Do(i),("inputs"in a&&a.inputs?To(a.inputs,n??[]):void 0)??"0x"])}const Go={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."},zo={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},$o={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class Ho extends La{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class qo extends La{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 Vo extends La{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 Wo={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 Vo({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new qo({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Ho({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 Ho({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 Zo(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Wo);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Ko(e,t={}){void 0!==t.size&&ui(e,{size:t.size});return pi(ei(e,t),t)}function Jo(e,t={}){let n=e;if(void 0!==t.size&&(ui(n,{size:t.size}),n=qa(n)),n.length>1||n[0]>1)throw new ja(n);return Boolean(n[0])}function Xo(e,t={}){void 0!==t.size&&ui(e,{size:t.size});return hi(ei(e,t),t)}function Yo(e,t){const n="string"==typeof t?ci(t):t,r=Zo(n);if(0===Ha(n)&&e.length>0)throw new Xs;if(Ha(t)&&Ha(t)<32)throw new Js({data:"string"==typeof t?t:ei(t),params:e,size:Ha(t)});let a=0;const i=[];for(let t=0;t<e.length;++t){const n=e[t];r.setPosition(a);const[s,o]=Qo(r,n,{staticPosition:0});a+=o,i.push(s)}return i}function Qo(e,t,{staticPosition:n}){const r=_o(t.type);if(r){const[a,i]=r;return function(e,t,{length:n,staticPosition:r}){if(!n){const n=r+Xo(e.readBytes(tc)),a=n+ec;e.setPosition(n);const i=Xo(e.readBytes(ec)),s=nc(t);let o=0;const c=[];for(let n=0;n<i;++n){e.setPosition(a+(s?32*n:o));const[r,i]=Qo(e,t,{staticPosition:a});o+=i,c.push(r)}return e.setPosition(r+32),[c,32]}if(nc(t)){const a=r+Xo(e.readBytes(tc)),i=[];for(let r=0;r<n;++r){e.setPosition(a+32*r);const[n]=Qo(e,t,{staticPosition:a});i.push(n)}return e.setPosition(r+32),[i,32]}let a=0;const i=[];for(let s=0;s<n;++s){const[n,s]=Qo(e,t,{staticPosition:r+a});a+=s,i.push(n)}return[i,a]}(e,{...t,type:i},{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 i=0;if(nc(t)){const s=n+Xo(e.readBytes(tc));for(let n=0;n<t.components.length;++n){const o=t.components[n];e.setPosition(s+i);const[c,l]=Qo(e,o,{staticPosition:s});i+=l,a[r?n:o?.name]=c}return e.setPosition(n+32),[a,32]}for(let s=0;s<t.components.length;++s){const o=t.components[s],[c,l]=Qo(e,o,{staticPosition:n});a[r?s:o?.name]=c,i+=l}return[a,i]}(e,t,{staticPosition:n});if("address"===t.type)return function(e){const t=e.readBytes(32);return[rs(ei(ko(t,-20))),32]}(e);if("bool"===t.type)return function(e){return[Jo(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=Xo(e.readBytes(32));e.setPosition(n+t);const r=Xo(e.readBytes(32));if(0===r)return e.setPosition(n+32),["0x",32];const a=e.readBytes(r);return e.setPosition(n+32),[ei(a),32]}const i=ei(e.readBytes(parseInt(a),32));return[i,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?Ko(a,{signed:n}):Xo(a,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=Xo(e.readBytes(32)),r=t+n;e.setPosition(r);const a=Xo(e.readBytes(32));if(0===a)return e.setPosition(t+32),["",32];const i=e.readBytes(a,32),s=function(e,t={}){let n=e;return void 0!==t.size&&(ui(n,{size:t.size}),n=qa(n,{dir:"right"})),(new TextDecoder).decode(n)}(qa(i));return e.setPosition(t+32),[s,32]}(e,{staticPosition:n});throw new ho(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ec=32,tc=32;function nc(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(nc);const n=_o(e.type);return!(!n||!nc({...e,type:n[1]}))}function rc(e){const{abi:t,data:n}=e,r=Co(n,0,4);if("0x"===r)throw new Xs;const a=[...t||[],zo,$o].find((e=>"error"===e.type&&r===Do(Vs(e))));if(!a)throw new to(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?Yo(a.inputs,Co(n,4)):void 0,errorName:a.name}}const ac=(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 ic({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]?ac(t[n]):t[n]}`)).join(", ")})`}const sc={gwei:9,wei:18},oc={ether:-9,wei:9};function cc(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[a,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${a||"0"}${i?`.${i}`:""}`}function lc(e,t="wei"){return cc(e,sc[t])}function uc(e,t="wei"){return cc(e,oc[t])}class dc extends La{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 pc extends La{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function hc(e){return e.reduce(((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`),"")}function mc(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 fc extends La{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 yc extends La{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 bc extends La{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",mc(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 gc extends La{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 vc extends La{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:i,gasPrice:s,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=mc({chain:r&&`${r?.name} (id: ${r?.id})`,from:t?.address,to:u,value:void 0!==d&&`${lc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:i,gasPrice:void 0!==s&&`${uc(s)} gwei`,maxFeePerGas:void 0!==o&&`${uc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${uc(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 wc extends La{constructor({blockHash:e,blockNumber:t,blockTag:n,hash:r,index:a}){let i="Transaction";n&&void 0!==a&&(i=`Transaction at block time "${n}" at index "${a}"`),e&&void 0!==a&&(i=`Transaction at block hash "${e}" at index "${a}"`),t&&void 0!==a&&(i=`Transaction at block number "${t}" at index "${a}"`),r&&(i=`Transaction with hash "${r}"`),super(`${i} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class Cc extends La{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 xc extends La{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 Ec extends La{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:i,gasPrice:s,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d,stateOverride:p}){const h=t?Bo(t):void 0;let m=mc({from:h?.address,to:u,value:void 0!==d&&`${lc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:i,gasPrice:void 0!==s&&`${uc(s)} gwei`,maxFeePerGas:void 0!==o&&`${uc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${uc(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+=hc(n.state)),n.stateDiff&&(r+=" stateDiff:\n",r+=hc(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 kc extends La{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:a,functionName:i,sender:s}){const o=Oo({abi:t,args:n,name:i}),c=o?ic({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=mc({address:r&&r,function:o?Vs(o,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(i?.length??0).keys()].map((()=>" ")).join("")}${c}`,sender:s});super(e.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{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=i,this.sender=s}}class Tc extends La{constructor({abi:e,data:t,functionName:n,message:r}){let a,i,s,o,c;if(t&&"0x"!==t)try{i=rc({abi:e,data:t});const{abiItem:n,errorName:r,args:a}=i;if("Error"===r)o=a[0];else if("Panic"===r){const[e]=a;o=Go[e]}else{const e=n?Vs(n,{includeName:!0}):void 0,t=n&&a?ic({abiItem:n,args:a,includeFunctionName:!1,includeName:!1}):void 0;s=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(e){a=e}else r&&(o=r);a instanceof to&&(c=a.signature,s=[`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:s}),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=i,this.reason=o,this.signature=c}}class Pc extends La{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 Ac extends La{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 _c extends La{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: ${ac(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 Dc extends La{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${ac(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 Oc extends La{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${t}`,`Request body: ${ac(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}class Fc extends La{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 Dc?e.code:t??-1}}class Sc extends Fc{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 Ic extends Fc{constructor(e){super(e,{code:Ic.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(Ic,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Mc extends Fc{constructor(e){super(e,{code:Mc.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(Mc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Nc extends Fc{constructor(e){super(e,{code:Nc.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(Nc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Uc extends Fc{constructor(e){super(e,{code:Uc.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(Uc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Lc extends Fc{constructor(e){super(e,{code:Lc.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(Lc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Bc extends Fc{constructor(e){super(e,{code:Bc.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(Bc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Rc extends Fc{constructor(e){super(e,{code:Rc.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Rc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class jc extends Fc{constructor(e){super(e,{code:jc.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(jc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Gc extends Fc{constructor(e){super(e,{code:Gc.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(Gc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class zc extends Fc{constructor(e){super(e,{code:zc.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(zc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class $c extends Fc{constructor(e){super(e,{code:$c.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty($c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Hc extends Fc{constructor(e){super(e,{code:Hc.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(Hc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class qc extends Sc{constructor(e){super(e,{code:qc.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(qc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Vc extends Sc{constructor(e){super(e,{code:Vc.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(Vc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Wc extends Sc{constructor(e){super(e,{code:Wc.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(Wc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Zc extends Sc{constructor(e){super(e,{code:Zc.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(Zc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Kc extends Sc{constructor(e){super(e,{code:Kc.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(Kc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Jc extends Sc{constructor(e){super(e,{code:Jc.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(Jc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Xc extends Fc{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const Yc=3;function Qc(e,{abi:t,address:n,args:r,docsPath:a,functionName:i,sender:s}){const{code:o,data:c,message:l,shortMessage:u}=e instanceof Ac?e:e instanceof La?e.walk((e=>"data"in e))||e.walk():{},d=e instanceof Xs?new Pc({functionName:i}):[Yc,Lc.code].includes(o)&&(c||l||u)?new Tc({abi:t,data:"object"==typeof c?c.data:c,functionName:i,message:u??l}):e;return new kc(d,{abi:t,args:r,contractAddress:n,docsPath:a,functionName:i,sender:s})}class el extends La{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:i,gasPrice:s,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=mc({from:t?.address,to:u,value:void 0!==d&&`${lc(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:i,gasPrice:void 0!==s&&`${uc(s)} gwei`,maxFeePerGas:void 0!==o&&`${uc(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${uc(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 tl extends La{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(tl,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(tl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class nl extends La{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${uc(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(nl,"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 rl extends La{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${uc(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(rl,"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 al extends La{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(al,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class il extends La{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(il,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class sl extends La{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(sl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class ol extends La{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(ol,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class cl extends La{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(cl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class ll extends La{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(ll,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class ul extends La{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(ul,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class dl extends La{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${uc(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${uc(n)} gwei`:""}).`].join("\n"),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(dl,"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 pl extends La{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 hl(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof La?e.walk((e=>e.code===tl.code)):e;return r instanceof La?new tl({cause:e,message:r.details}):tl.nodeMessage.test(n)?new tl({cause:e,message:e.details}):nl.nodeMessage.test(n)?new nl({cause:e,maxFeePerGas:t?.maxFeePerGas}):rl.nodeMessage.test(n)?new rl({cause:e,maxFeePerGas:t?.maxFeePerGas}):al.nodeMessage.test(n)?new al({cause:e,nonce:t?.nonce}):il.nodeMessage.test(n)?new il({cause:e,nonce:t?.nonce}):sl.nodeMessage.test(n)?new sl({cause:e,nonce:t?.nonce}):ol.nodeMessage.test(n)?new ol({cause:e}):cl.nodeMessage.test(n)?new cl({cause:e,gas:t?.gas}):ll.nodeMessage.test(n)?new ll({cause:e,gas:t?.gas}):ul.nodeMessage.test(n)?new ul({cause:e}):dl.nodeMessage.test(n)?new dl({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new pl({cause:e})}function ml(e,{format:t}){if(!t)return{};const n={};return function t(r){const a=Object.keys(r);for(const i of a)i in e&&(n[i]=e[i]),r[i]&&"object"==typeof r[i]&&!Array.isArray(r[i])&&t(r[i])}(t(e||{})),n}const fl={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function yl(e){const t={...e};return void 0!==e.blobs&&"string"!=typeof e.blobs[0]&&(t.blobs=e.blobs.map((e=>ei(e)))),void 0!==e.gas&&(t.gas=ti(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=ti(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=ti(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=ti(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=ti(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=ti(e.nonce)),void 0!==e.type&&(t.type=fl[e.type]),void 0!==e.value&&(t.value=ti(e.value)),t}const bl=mi("transactionRequest",yl);function gl(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:a,to:i}=e,s=t?Bo(t):void 0;if(s&&!ss(s.address))throw new Ti({address:s.address});if(i&&!ss(i))throw new Ti({address:i});if(void 0!==n&&(void 0!==r||void 0!==a))throw new fc;if(r&&r>2n**256n-1n)throw new nl({maxFeePerGas:r});if(a&&r&&a>r)throw new dl({maxFeePerGas:r,maxPriorityFeePerGas:a})}class vl extends La{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class wl extends La{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class Cl extends La{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${uc(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class xl extends La{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 El(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:a}={}){const i=r??"latest",s=a??!1,o=void 0!==n?ti(n):void 0;let c=null;if(c=t?await e.request({method:"eth_getBlockByHash",params:[t,s]}):await e.request({method:"eth_getBlockByNumber",params:[o||i,s]}),!c)throw new xl({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||gi)(c)}async function kl(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Tl(e,t){const{block:n,chain:r=e.chain,request:a}=t||{};if("function"==typeof r?.fees?.defaultPriorityFee){const t=n||await qs(e,El,"getBlock")({});return r.fees.defaultPriorityFee({block:t,client:e,request:a})}if(void 0!==r?.fees?.defaultPriorityFee)return r?.fees?.defaultPriorityFee;try{return pi(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):qs(e,El,"getBlock")({}),qs(e,kl,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new wl;const a=r-t.baseFeePerGas;return a<0n?0n:a}}async function Pl(e,t){const{block:n,chain:r=e.chain,request:a,type:i="eip1559"}=t||{},s=await(async()=>"function"==typeof r?.fees?.baseFeeMultiplier?r.fees.baseFeeMultiplier({block:n,client:e,request:a}):r?.fees?.baseFeeMultiplier??1.2)();if(s<1)throw new vl;const o=10**(s.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(s*o))/BigInt(o),l=n||await qs(e,El,"getBlock")({});if("function"==typeof r?.fees?.estimateFeesPerGas)return r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:a,type:i});if("eip1559"===i){if("bigint"!=typeof l.baseFeePerGas)throw new wl;const t="bigint"==typeof a?.maxPriorityFeePerGas?a.maxPriorityFeePerGas:await Tl(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 qs(e,kl,"getGasPrice")({}))}}async function Al(e,{address:t,blockTag:n="latest",blockNumber:r}){return hi(await e.request({method:"eth_getTransactionCount",params:[t,r?ti(r):n]}))}class _l extends La{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 Dl(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 bc({transaction:e})}async function Ol(e){return hi(await e.request({method:"eth_chainId"}))}async function Fl(e,t){const{account:n=e.account,chain:r,chainId:a,gas:i,nonce:s,parameters:o=["chainId","fees","gas","nonce","type"],type:c}=t,l=n?Bo(n):void 0,u=await qs(e,El,"getBlock")({blockTag:"latest"}),d={...t,...l?{from:l?.address}:{}};if(o.includes("chainId")&&(d.chainId=r?r.id:void 0!==a?a:await qs(e,Ol,"getChainId")({})),o.includes("nonce")&&void 0===s&&l&&(d.nonce=await qs(e,Al,"getTransactionCount")({address:l.address,blockTag:"pending"})),(o.includes("fees")||o.includes("type"))&&void 0===c)try{d.type=Dl(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 Pl(e,{block:u,chain:r,request:d});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas<a)throw new Cl({maxPriorityFeePerGas:a});d.maxPriorityFeePerGas=a,d.maxFeePerGas=n}else{if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)throw new wl;const{gasPrice:n}=await Pl(e,{block:u,chain:r,request:d,type:"legacy"});d.gasPrice=n}return o.includes("gas")&&void 0===i&&(d.gas=await qs(e,Sl,"estimateGas")({...d,account:l?{address:l.address,type:"json-rpc"}:void 0})),gl(d),delete d.parameters,d}async function Sl(e,t){const n=t.account??e.account,r=n?Bo(n):void 0;try{const{accessList:n,blobs:a,blockNumber:i,blockTag:s,data:o,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:m,value:f,...y}="local"===r?.type?await Fl(e,t):t,b=(i?ti(i):void 0)||s;gl(t);const g=e.chain?.formatters?.transactionRequest?.format,v=(g||yl)({...ml(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=hl(e,n);return t instanceof pl?e:t})();return new el(r,{docsPath:t,...n})}(n,{...t,account:r,chain:e.chain})}}async function Il(e,t){const{abi:n,address:r,args:a,functionName:i,...s}=t,o=jo({abi:n,args:a,functionName:i});try{return await qs(e,Sl,"estimateGas")({data:o,to:r,...s})}catch(e){const t=s.account?Bo(s.account):void 0;throw Qc(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:t?.address})}}const Ml="/docs/contract/decodeEventLog";function Nl(e){const{abi:t,data:n,strict:r,topics:a}=e,i=r??!0,[s,...o]=a;if(!s)throw new no({docsPath:Ml});const c=t.find((e=>"event"===e.type&&s===wo(Vs(e))));if(!c||!("name"in c)||"event"!==c.type)throw new ro(s,{docsPath:Ml});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 uo({abiItem:c,param:t});p[t.name||e]=Ul({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=Yo(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(i){if(e instanceof Js||e instanceof qo)throw new lo({abiItem:c,data:n,params:m,size:Ha(n)});throw e}}else if(i)throw new lo({abiItem:c,data:"0x",params:m,size:0});return{eventName:l,args:Object.values(p).length>0?p:void 0}}function Ul({param:e,value:t}){if("string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))return t;return(Yo([e],t)||[])[0]}function Ll({abi:e,eventName:t,logs:n,strict:r=!0}){return n.map((n=>{try{const a=Nl({...n,abi:e,strict:r});return t&&!t.includes(a.eventName)?null:{...a,...n}}catch(e){let t,a;if(e instanceof ro)return null;if(e instanceof lo||e instanceof uo){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 Bl(e,{address:t,blockHash:n,fromBlock:r,toBlock:a,event:i,events:s,args:o,strict:c}={}){const l=c??!1,u=s??(i?[i]:void 0);let d,p=[];u&&(p=[u.flatMap((e=>Mo({abi:[e],eventName:e.name,args:o})))],i&&(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?ti(r):r,toBlock:"bigint"==typeof a?ti(a):a}]});const h=d.map((e=>wi(e)));return u?Ll({abi:u,logs:h,strict:l}):h}async function Rl(e,t){const{abi:n,address:r,args:a,blockHash:i,eventName:s,fromBlock:o,toBlock:c,strict:l}=t,u=s?Oo({abi:n,name:s}):void 0,d=u?void 0:n.filter((e=>"event"===e.type));return qs(e,Bl,"getLogs")({address:r,args:a,blockHash:i,event:u,events:d,fromBlock:o,toBlock:c,strict:l})}const jl="/docs/contract/decodeFunctionResult";function Gl(e){const{abi:t,args:n,functionName:r,data:a}=e;let i=t[0];if(r){const e=Oo({abi:t,args:n,name:r});if(!e)throw new io(r,{docsPath:jl});i=e}if("function"!==i.type)throw new io(void 0,{docsPath:jl});if(!i.outputs)throw new so(i.name,{docsPath:jl});const s=Yo(i.outputs,a);return s&&s.length>1?s:s&&1===s.length?s[0]:void 0}const zl=[{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"}],$l=[{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"}],Hl=[...$l,{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"}]}],ql=[...$l,{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"}]}],Vl=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Wl=[{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"}]}],Zl=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],Kl="0x82ad56cb";class Jl extends La{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 Xl extends La{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 Yl extends La{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 Ql extends La{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class eu extends La{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 tu({blockNumber:e,chain:t,contract:n}){const r=t?.contracts?.[n];if(!r)throw new Jl({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Jl({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const nu=new Map;function ru({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:a}){const i=async()=>{const t=o();s();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)}}))},s=()=>nu.delete(t),o=()=>nu.get(t)||[],c=e=>nu.set(t,[...o(),e]);return{flush:s,async schedule(e){const t={},a=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),s=n?.([...o().map((({args:e})=>e)),e]);s&&i();return o().length>0?(c({args:e,pendingPromise:t}),a):(c({args:e,pendingPromise:t}),setTimeout(i,r),a)}}}async function au(e,t){const{account:n=e.account,batch:r=Boolean(e.batch?.multicall),blockNumber:a,blockTag:i="latest",accessList:s,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?Bo(n):void 0;try{gl(t);const n=(a?ti(a):void 0)||i,w=function(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ss(n,{strict:!1}))throw new Ti({address:n});if(t[n])throw new dc({address:n});t[n]=su(r)}return t}(b),C=e.chain?.formatters?.transactionRequest?.format,x=(C||yl)({...ml(g,{format:C}),from:v?.address,accessList:s,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(Kl)&&(!!n&&!(Object.values(r).filter((e=>void 0!==e)).length>0)))}({request:x})&&!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:i="latest",data:s,multicallAddress:o,to:c}=t;let l=o;if(!l){if(!e.chain)throw new Ql;l=tu({blockNumber:a,chain:e.chain,contract:"multicall3"})}const u=a?ti(a):void 0,d=u||i,{schedule:p}=ru({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=jo({abi:zl,args:[n],functionName:"aggregate3"}),a=await e.request({method:"eth_call",params:[{data:r,to:l},d]});return Gl({abi:zl,args:[n],functionName:"aggregate3",data:a||"0x"})}}),[{returnData:h,success:m}]=await p({data:s,to:c});if(!m)throw new Ac({data:h});return"0x"===h?{data:void 0}:{data:h}}(e,{...x,blockNumber:a,blockTag:i})}catch(e){if(!(e instanceof Ql||e instanceof Jl))throw e}const E=await e.request({method:"eth_call",params:w?[x,n,w]:[x,n]});return"0x"===E?{data:void 0}:{data:E}}catch(n){const r=function(e){if(!(e instanceof La))return;const t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(n),{offchainLookup:a,offchainLookupSignature:i}=await Promise.resolve().then((function(){return require("./ccip-e99c5ad4.cjs")}));if(r?.slice(0,10)===i&&f)return{data:await a(e,{data:r,to:f})};throw function(e,{docsPath:t,...n}){const r=(()=>{const t=hl(e,n);return t instanceof pl?e:t})();return new Ec(r,{docsPath:t,...n})}(n,{...t,account:v,chain:e.chain})}}function iu(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new Za({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new Za({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function su(e){const{balance:t,nonce:n,state:r,stateDiff:a,code:i}=e,s={};if(void 0!==i&&(s.code=i),void 0!==t&&(s.balance=ti(t,{size:32})),void 0!==n&&(s.nonce=ti(n,{size:8})),void 0!==r&&(s.state=iu(r)),void 0!==a){if(s.state)throw new pc;s.stateDiff=iu(a)}return s}async function ou(e,t){const{abi:n,address:r,args:a,functionName:i,...s}=t,o=jo({abi:n,args:a,functionName:i});try{const{data:t}=await qs(e,au,"call")({...s,data:o,to:r});return Gl({abi:n,args:a,functionName:i,data:t||"0x"})}catch(e){throw Qc(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/readContract",functionName:i})}}async function cu(e,t){const{abi:n,address:r,args:a,dataSuffix:i,functionName:s,...o}=t,c=o.account?Bo(o.account):e.account,l=jo({abi:n,args:a,functionName:s});try{const{data:u}=await qs(e,au,"call")({batch:!1,data:`${l}${i?i.replace("0x",""):""}`,to:r,...o,account:c}),d=Gl({abi:n,args:a,functionName:s,data:u||"0x"});return{result:d,request:{abi:n.filter((e=>"name"in e&&e.name===t.functionName)),address:r,args:a,dataSuffix:i,functionName:s,...o,account:c}}}catch(e){throw Qc(e,{abi:n,address:r,args:a,docsPath:"/docs/contract/simulateContract",functionName:s,sender:c?.address})}}const lu=new Map,uu=new Map;let du=0;function pu(e,t,n){const r=++du,a=()=>lu.get(e)||[],i=()=>{const t=uu.get(e);1===a().length&&t&&t(),(()=>{const t=a();lu.set(e,t.filter((e=>e.id!==r)))})()},s=a();if(lu.set(e,[...s,{id:r,fns:t}]),s&&s.length>0)return i;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&&uu.set(e,c),i}async function hu(e){return new Promise((t=>setTimeout(t,e)))}function mu(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let a=!0;const i=()=>a=!1;return(async()=>{let s;t&&(s=await e({unpoll:i}));const o=await(n?.(s))??r;await hu(o);const c=async()=>{a&&(await e({unpoll:i}),await hu(r),c())};c()})(),i}const fu=new Map,yu=new Map;async function bu(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,fu),r=t(e,yu);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 i=r.promise.get();i||(i=e(),r.promise.set(i));try{const e=await i;return r.response.set({created:new Date,data:e}),e}finally{r.promise.clear()}}const gu=e=>`blockNumber.${e}`;async function vu(e,{cacheTime:t=e.cacheTime}={}){const n=await bu((()=>e.request({method:"eth_blockNumber"})),{cacheKey:gu(e.uid),cacheTime:t});return BigInt(n)}async function wu(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=>wi(e)));return"abi"in t&&t.abi?Ll({abi:t.abi,logs:a,strict:n}):a}async function Cu(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function xu(e,t){const{abi:n,address:r,args:a,batch:i=!0,eventName:s,onError:o,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}=t;return(void 0!==l?l:"webSocket"!==e.transport.type)?(()=>{const t=ac(["watchContractEvent",r,a,i,e.uid,s,u]),l=d??!1;return pu(t,{onLogs:c,onError:o},(t=>{let o,c,d=!1;const p=mu((async()=>{if(d)try{let u;if(c)u=await qs(e,wu,"getFilterChanges")({filter:c});else{const t=await qs(e,vu,"getBlockNumber")({});u=o&&o!==t?await qs(e,Rl,"getContractEvents")({abi:n,address:r,args:a,eventName:s,fromBlock:o+1n,toBlock:t,strict:l}):[],o=t}if(0===u.length)return;if(i)t.onLogs(u);else for(const e of u)t.onLogs([e])}catch(e){c&&e instanceof Bc&&(d=!1),t.onError?.(e)}else{try{c=await qs(e,Lo,"createContractEventFilter")({abi:n,address:r,args:a,eventName:s,strict:l})}catch{}d=!0}}),{emitOnBegin:!0,interval:u});return async()=>{c&&await qs(e,Cu,"uninstallFilter")({filter:c}),p()}}))})():(()=>{let t=!0,i=()=>t=!1;return(async()=>{try{const l=s?Mo({abi:n,eventName:s,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}=Nl({abi:n,data:r.data,topics:r.topics,strict:d}),a=wi(r,{args:t,eventName:e});c([a])}catch(e){let t,n;if(e instanceof lo||e instanceof uo){if(d)return;t=e.abiItem.name,n=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const a=wi(r,{args:n?[]:{},eventName:t});c([a])}},onError(e){o?.(e)}});i=u,t||i()}catch(e){o?.(e)}})(),i})()}async function Eu(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}async function ku(e,t){const{account:n=e.account,chain:r=e.chain,accessList:a,blobs:i,data:s,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:h,value:m,...f}=t;if(!n)throw new _l({docsPath:"/docs/actions/wallet/sendTransaction"});const y=Bo(n);try{let n;if(gl(t),null!==r&&(n=await qs(e,Ol,"getChainId")({}),function({chain:e,currentChainId:t}){if(!e)throw new Yl;if(t!==e.id)throw new Xl({chain:e,currentChainId:t})}({currentChainId:n,chain:r})),"local"===y.type){const t=await qs(e,Fl,"prepareTransactionRequest")({account:y,accessList:a,blobs:i,chain:r,chainId:n,data:s,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 qs(e,Eu,"sendRawTransaction")({serializedTransaction:g})}const b=e.chain?.formatters?.transactionRequest?.format,g=(b||yl)({...ml(f,{format:b}),accessList:a,blobs:i,data:s,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=hl(e,n);return t instanceof pl?e:t})();return new vc(r,{docsPath:t,...n})}(e,{...t,account:y,chain:t.chain||void 0})}}async function Tu(e,t){const{abi:n,address:r,args:a,dataSuffix:i,functionName:s,...o}=t,c=jo({abi:n,args:a,functionName:s});return qs(e,ku,"sendTransaction")({data:`${c}${i?i.replace("0x",""):""}`,to:r,...o})}function Pu({abi:e,address:t,client:n}){const r=n,[a,i]=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],s=null!=a,o=null!=i,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 s&&(l&&(c.read=new Proxy({},{get:(n,r)=>(...n)=>{const{args:i,options:s}=Au(n);return qs(a,ou,"readContract")({abi:e,address:t,functionName:r,args:i,...s})}})),u&&(c.simulate=new Proxy({},{get:(n,r)=>(...n)=>{const{args:i,options:s}=Au(n);return qs(a,cu,"simulateContract")({abi:e,address:t,functionName:r,args:i,...s})}})),d&&(c.createEventFilter=new Proxy({},{get:(n,r)=>(...n)=>{const i=e.find((e=>"event"===e.type&&e.name===r)),{args:s,options:o}=_u(n,i);return qs(a,Lo,"createContractEventFilter")({abi:e,address:t,eventName:r,args:s,...o})}}),c.getEvents=new Proxy({},{get:(n,r)=>(...n)=>{const i=e.find((e=>"event"===e.type&&e.name===r)),{args:s,options:o}=_u(n,i);return qs(a,Rl,"getContractEvents")({abi:e,address:t,eventName:r,args:s,...o})}}),c.watchEvent=new Proxy({},{get:(n,r)=>(...n)=>{const i=e.find((e=>"event"===e.type&&e.name===r)),{args:s,options:o}=_u(n,i);return qs(a,xu,"watchContractEvent")({abi:e,address:t,eventName:r,args:s,...o})}}))),o&&u&&(c.write=new Proxy({},{get:(n,r)=>(...n)=>{const{args:a,options:s}=Au(n);return qs(i,Tu,"writeContract")({abi:e,address:t,functionName:r,args:a,...s})}})),(s||o)&&u&&(c.estimateGas=new Proxy({},{get:(n,r)=>(...n)=>{const{args:s,options:o}=Au(n);return qs(a??i,Il,"estimateContractGas")({abi:e,address:t,functionName:r,args:s,...o,account:o.account??i.account})}})),c.address=t,c.abi=e,c}function Au(e){const t=e.length&&Array.isArray(e[0]);return{args:t?e[0]:[],options:(t?e[1]:e[0])??{}}}function _u(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 Du=256;let Ou,Fu=Du;function Su(e=11){if(!Ou||Fu+e>2*Du){Ou="",Fu=0;for(let e=0;e<Du;e++)Ou+=(256+256*Math.random()|0).toString(16).substring(1)}return Ou.substring(Fu,Fu+++e)}function Iu(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,key:r="base",name:a="Base Client",pollingInterval:i=4e3,type:s="base"}=e,o=e.chain,c=e.account?Bo(e.account):void 0,{config:l,request:u,value:d}=e.transport({chain:o,pollingInterval:i}),p={account:c,batch:t,cacheTime:n,chain:o,key:r,name:a,pollingInterval:i,request:u,transport:{...l,...d},type:s,uid:Su()};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 Mu(e,{delay:t=100,retryCount:n=2,shouldRetry:r=(()=>!0)}={}){return new Promise(((a,i)=>{const s=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 hu(n),s({count:o+1})})({error:e});i(e)}};s()}))}function Nu(e,t={}){return async(n,r={})=>{const{retryDelay:a=150,retryCount:i=3}={...t,...r};return Mu((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case Ic.code:throw new Ic(t);case Mc.code:throw new Mc(t);case Nc.code:throw new Nc(t);case Uc.code:throw new Uc(t);case Lc.code:throw new Lc(t);case Bc.code:throw new Bc(t);case Rc.code:throw new Rc(t);case jc.code:throw new jc(t);case Gc.code:throw new Gc(t);case zc.code:throw new zc(t);case $c.code:throw new $c(t);case Hc.code:throw new Hc(t);case qc.code:throw new qc(t);case Vc.code:throw new Vc(t);case Wc.code:throw new Wc(t);case Zc.code:throw new Zc(t);case Kc.code:throw new Kc(t);case Jc.code:throw new Jc(t);case 5e3:throw new qc(t);default:if(e instanceof La)throw e;throw new Xc(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof _c){const e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*parseInt(e)}return~~(1<<e)*a},retryCount:i,shouldRetry:({error:e})=>function(e){if("code"in e&&"number"==typeof e.code)return-1===e.code||(e.code===$c.code||e.code===Lc.code);if(e instanceof _c&&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 Uu({key:e,name:t,request:n,retryCount:r=3,retryDelay:a=150,timeout:i,type:s},o){return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:a,timeout:i,type:s},request:Nu(n,{retryCount:r,retryDelay:a}),value:o}}function Lu(e,t={}){const{key:n="custom",name:r="Custom Provider",retryDelay:a}=t;return({retryCount:i})=>Uu({key:n,name:r,request:e.request.bind(e),retryCount:t.retryCount??i,retryDelay:a,type:"custom"})}class Bu extends La{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function Ru(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const ju=Ru();function Gu(e,t={}){return{async request(n){const{body:r,fetchOptions:a={},onResponse:i=t.onResponse,timeout:s=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,i)=>{(async()=>{let s;try{const o=new AbortController;n>0&&(s=setTimeout((()=>{r?o.abort():i(t)}),n)),a(await e({signal:o?.signal}))}catch(e){"AbortError"===e.name&&i(t),i(e)}finally{clearTimeout(s)}})()}))}((async({signal:t})=>await fetch(e,{...a,body:Array.isArray(r)?ac(r.map((e=>({jsonrpc:"2.0",id:e.id??ju.take(),...e})))):ac({jsonrpc:"2.0",id:r.id??ju.take(),...r}),headers:{...o,"Content-Type":"application/json"},method:c||"POST",signal:l||(s>0?t:void 0)})),{errorInstance:new Oc({body:r,url:e}),timeout:s,signal:!0});let n;if(i&&await i(t),n=t.headers.get("Content-Type")?.startsWith("application/json")?await t.json():await t.text(),!t.ok)throw new _c({body:r,details:ac(n.error)||t.statusText,headers:t.headers,status:t.status,url:e});return n}catch(t){if(t instanceof _c)throw t;if(t instanceof Oc)throw t;throw new _c({body:r,details:t.message,url:e})}}}}function zu(e,t={}){const{batch:n,fetchOptions:r,key:a="http",name:i="HTTP JSON-RPC",onFetchResponse:s,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 Bu;const y=Gu(f,{fetchOptions:r,onResponse:s,timeout:m});return Uu({key:a,name:i,async request({method:t,params:r}){const a={method:t,params:r},{schedule:i}=ru({id:`${e}`,wait:p,shouldSplitBatch:e=>e.length>d,fn:e=>y.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:s,result:o}]=await(async e=>n?i(e):[await y.request({body:e})])(a);if(s)throw new Dc({body:a,error:s,url:f});return o},retryCount:h,retryDelay:o,timeout:m,type:"http"},{fetchOptions:r,url:f})}}function $u(e,t){if(!(e instanceof La))return!1;const n=e.walk((e=>e instanceof Tc));return n instanceof Tc&&("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===Go[50]))))))}function Hu(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 $a(t)?t:null}function qu(e){let t=new Uint8Array(32).fill(0);if(!e)return ei(t);const n=e.split(".");for(let e=n.length-1;e>=0;e-=1){const r=Hu(n[e]),a=r?ii(r):ns(li(n[e]),"bytes");t=ns(os([t,a]),"bytes")}return ei(t)}function Vu(e){return`[${e.slice(2)}]`}function Wu(e){const t=new Uint8Array(32).fill(0);return e?Hu(e)||ns(li(e)):ei(t)}function Zu(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array(li(t).byteLength+2);let r=0;const a=t.split(".");for(let e=0;e<a.length;e++){let t=li(a[e]);t.byteLength>255&&(t=li(Vu(Wu(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 Ku extends La{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 Ju extends La{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class Xu extends La{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 Yu extends La{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 Qu=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,ed=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,td=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,nd=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function rd(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function ad({uri:e,gatewayUrls:t}){const n=td.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=rd(t?.ipfs,"https://ipfs.io"),a=rd(t?.arweave,"https://arweave.net"),i=e.match(Qu),{protocol:s,subpath:o,target:c,subtarget:l=""}=i?.groups||{},u="ipns:/"===s||"ipns/"===o,d="ipfs:/"===s||"ipfs/"===o||ed.test(e);if(e.startsWith("http")&&!u&&!d){let n=e;return t?.arweave&&(n=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:n,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if("ar:/"===s&&c)return{uri:`${a}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let p=e.replace(nd,"");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 Xu({uri:e})}function id(e){if("object"!=typeof e||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Ku({data:e});return e.image||e.image_url||e.image_data}async function sd({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=ad({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 Xu({uri:t})}async function od(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("/"),[i,s]=n.split(":"),[o,c]=r.split(":");if(!i||"eip155"!==i.toLowerCase())throw new Ju({reason:"Only EIP-155 supported"});if(!s)throw new Ju({reason:"Chain ID not found"});if(!c)throw new Ju({reason:"Contract address not found"});if(!a)throw new Ju({reason:"Token ID not found"});if(!o)throw new Ju({reason:"ERC namespace not found"});return{chainID:parseInt(s),namespace:o.toLowerCase(),contractAddress:c,tokenID:a}}(n),a=await async function(e,{nft:t}){if("erc721"===t.namespace)return ou(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 ou(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 Yu({namespace:t.namespace})}(e,{nft:r}),{uri:i,isOnChain:s,isEncoded:o}=ad({uri:a,gatewayUrls:t});if(s&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){const e=o?atob(i.replace("data:application/json;base64,","")):i;return sd({uri:id(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 sd({gatewayUrls:e,uri:id(n)})}catch{throw new Xu({uri:t})}}({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,c)})}(e,{gatewayUrls:t,record:n}):sd({uri:n,gatewayUrls:t})}async function cd(e,{blockNumber:t,blockTag:n,name:r,key:a,gatewayUrls:i,strict:s,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=tu({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const s={address:c,abi:Hl,functionName:"resolve",args:[Ya(Zu(r)),jo({abi:Vl,functionName:"text",args:[qu(r),a]})],blockNumber:t,blockTag:n},o=qs(e,ou,"readContract"),l=i?await o({...s,args:[...s.args,i]}):await o(s);if("0x"===l[0])return null;const u=Gl({abi:Vl,functionName:"text",data:l[0]});return""===u?null:u}catch(e){if(s)throw e;if($u(e,"resolve"))return null;throw e}}async function ld(e,{address:t,args:n,event:r,events:a,fromBlock:i,strict:s,toBlock:o}={}){const c=a??(r?[r]:void 0),l=Uo(e,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap((e=>Mo({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 i?ti(i):i,toBlock:"bigint"==typeof o?ti(o):o,...u.length?{topics:u}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:i,id:d,request:l(d),strict:Boolean(s),toBlock:o,type:"event"}}async function ud(e){const t=Uo(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function dd(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:a}){const i=n?ti(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:[ti(t),i||r,a]}))}const pd=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,hd=/^(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 md(e){const{domain:t={},message:n,primaryType:r}=e,a={EIP712Domain:wd({domain:t}),...e.types};!function(e){const{domain:t,message:n,primaryType:r,types:a}=e,i=(e,t)=>{for(const n of e){const{name:e,type:r}=n,s=t[e],o=r.match(hd);if(o&&("number"==typeof s||"bigint"==typeof s)){const[e,t,n]=o;ti(s,{signed:"int"===t,size:parseInt(n)/8})}if("address"===r&&"string"==typeof s&&!ss(s))throw new Ti({address:s});const c=r.match(pd);if(c){const[e,t]=c;if(t&&Ha(s)!==parseInt(t))throw new co({expectedSize:parseInt(t),givenSize:Ha(s)})}const l=a[r];l&&i(l,s)}};a.EIP712Domain&&t&&i(a.EIP712Domain,t);if("EIP712Domain"!==r){const e=a[r];i(e,n)}}({domain:t,message:n,primaryType:r,types:a});const i=["0x1901"];return t&&i.push(function({domain:e,types:t}){return fd({data:e,primaryType:"EIP712Domain",types:t})}({domain:t,types:a})),"EIP712Domain"!==r&&i.push(fd({data:n,primaryType:r,types:a})),ns(os(i))}function fd({data:e,primaryType:t,types:n}){return ns(yd({data:e,primaryType:t,types:n}))}function yd({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],a=[bd({primaryType:t,types:n})];for(const i of n[t]){const[t,s]=vd({types:n,name:i.name,type:i.type,value:e[i.name]});r.push(t),a.push(s)}return To(r,a)}function bd({primaryType:e,types:t}){const n=Ya(function({primaryType:e,types:t}){let n="";const r=gd({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 ns(n)}function gd({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])gd({primaryType:e.type,types:t},n);return n}function vd({types:e,name:t,type:n,value:r}){if(void 0!==e[n])return[{type:"bytes32"},ns(yd({data:r,primaryType:n,types:e}))];if("bytes"===n){return[{type:"bytes32"},ns(r=`0x${(r.length%2?"0":"")+r.slice(2)}`)]}if("string"===n)return[{type:"bytes32"},ns(Ya(r))];if(n.lastIndexOf("]")===n.length-1){const a=n.slice(0,n.lastIndexOf("[")),i=r.map((n=>vd({name:t,type:a,types:e,value:n})));return[{type:"bytes32"},ns(To(i.map((([e])=>e)),i.map((([,e])=>e))))]}return[{type:n},r]}function wd({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 Cd="/docs/contract/encodeDeployData";function xd(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 Zs({docsPath:Cd});if(!("inputs"in a))throw new Ks({docsPath:Cd});if(!a.inputs||0===a.inputs.length)throw new Ks({docsPath:Cd});return cs([r,To(a.inputs,n)])}const Ed="/docs/contract/encodeFunctionResult";class kd extends Ri{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=Ui(this.buffer)}update(e){Di(this);const{view:t,buffer:n,blockLen:r}=this,a=(e=Bi(e)).length;for(let i=0;i<a;){const s=Math.min(r-this.pos,a-i);if(s!==r)n.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===r&&(this.process(t,0),this.pos=0);else{const t=Ui(e);for(;r<=a-i;i+=r)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){Di(this),Oi(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:a}=this;let{pos:i}=this;t[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>r-i&&(this.process(n,0),i=0);for(let e=i;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),i=BigInt(4294967295),s=Number(n>>a&i),o=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,s,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),a),this.process(n,0);const s=Ui(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++)s.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:i,pos:s}=this;return e.length=r,e.pos=s,e.finished=a,e.destroyed=i,r%t&&e.buffer.set(n),e}}const Td=(e,t,n)=>e&t^~e&n,Pd=(e,t,n)=>e&t^e&n^t&n,Ad=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]),_d=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Dd=new Uint32Array(64);class Od extends kd{constructor(){super(64,32,8,!1),this.A=0|_d[0],this.B=0|_d[1],this.C=0|_d[2],this.D=0|_d[3],this.E=0|_d[4],this.F=0|_d[5],this.G=0|_d[6],this.H=0|_d[7]}get(){const{A:e,B:t,C:n,D:r,E:a,F:i,G:s,H:o}=this;return[e,t,n,r,a,i,s,o]}set(e,t,n,r,a,i,s,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|a,this.F=0|i,this.G=0|s,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)Dd[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Dd[e-15],n=Dd[e-2],r=Li(t,7)^Li(t,18)^t>>>3,a=Li(n,17)^Li(n,19)^n>>>10;Dd[e]=a+Dd[e-7]+r+Dd[e-16]|0}let{A:n,B:r,C:a,D:i,E:s,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(Li(s,6)^Li(s,11)^Li(s,25))+Td(s,o,c)+Ad[e]+Dd[e]|0,u=(Li(n,2)^Li(n,13)^Li(n,22))+Pd(n,r,a)|0;l=c,c=o,o=s,s=i+t|0,i=a,a=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,a=a+this.C|0,i=i+this.D|0,s=s+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,a,i,s,o,c,l)}roundClean(){Dd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Fd=ji((()=>new Od));const Sd="Ethereum Signed Message:\n";function Id(e,t){const n="string"==typeof e?li(e):e.raw instanceof Uint8Array?e.raw:ii(e.raw);return ns(os([li(`${Sd}${n.length}`),n]),t)}const Md=1;class Nd extends La{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 Ud extends La{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class Ld extends La{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 Bd extends La{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${Md}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}function Rd(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i}=e;if(t<=0)throw new eu({chainId:t});if(i&&!ss(i))throw new Ti({address:i});if(r)throw new La("`gasPrice` is not a valid EIP-1559 Transaction attribute.");if(a&&a>2n**256n-1n)throw new nl({maxFeePerGas:a});if(n&&a&&n>a)throw new dl({maxFeePerGas:a,maxPriorityFeePerGas:n})}function jd(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=>ci(e))):e.blobs,a=[];for(const e of r)a.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?a:a.map((e=>ei(e)))}function Gd(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=>ci(e))):e.blobs,a="string"==typeof e.commitments[0]?e.commitments.map((e=>ci(e))):e.commitments,i=[];for(let e=0;e<r.length;e++){const n=r[e],s=a[e];i.push(Uint8Array.from(t.computeBlobKzgProof(n,s)))}return"bytes"===n?i:i.map((e=>ei(e)))}const zd=32,$d=4096,Hd=zd*$d,qd=2*Hd-1-1*$d*2;function Vd(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?ci(e.data):e.data,r=Ha(n);if(!r)throw new Ud;if(r>qd)throw new Nd({maxSize:qd,size:r});const a=[];let i=!0,s=0;for(;i;){const e=Zo(new Uint8Array(Hd));let t=0;for(;t<$d;){const r=n.slice(s,s+(zd-1));if(e.pushByte(0),e.pushBytes(r),r.length<31){e.pushByte(128),i=!1;break}t++,s+=31}a.push(e)}return"bytes"===t?a.map((e=>e.bytes)):a.map((e=>ei(e.bytes)))}({data:t,to:r}),i=e.commitments??jd({blobs:a,kzg:n,to:r}),s=e.proofs??Gd({blobs:a,commitments:i,kzg:n,to:r}),o=[];for(let e=0;e<a.length;e++)o.push({blob:a[e],commitment:i[e],proof:s[e]});return o}function Wd(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=Fd($a(e,{strict:!1})?ii(e):e);return"bytes"===n?r:Ya(r)}(t,"bytes");return a.set([n],0),"bytes"===r?a:ei(a)}function Zd(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 gc({storageKey:a[e]});if(!ss(r,{strict:!1}))throw new Ti({address:r});t.push([r,a])}return t}function Kd(e,t){const n=Dl(e);return"eip1559"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:i,value:s,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,data:u}=e;Rd(e);const d=Zd(l),p=[Ya(n),a?Ya(a):"0x",c?Ya(c):"0x",o?Ya(o):"0x",r?Ya(r):"0x",i??"0x",s?Ya(s):"0x",u??"0x",d,...Jd(e,t)];return cs(["0x02",ap(p)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:r,data:a,nonce:i,to:s,value:o,accessList:c,gasPrice:l}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i}=e;if(t<=0)throw new eu({chainId:t});if(i&&!ss(i))throw new Ti({address:i});if(n||a)throw new La("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new nl({maxFeePerGas:r})}(e);const u=Zd(c),d=[Ya(n),i?Ya(i):"0x",l?Ya(l):"0x",r?Ya(r):"0x",s??"0x",o?Ya(o):"0x",a??"0x",u,...Jd(e,t)];return cs(["0x01",ap(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:i,value:s,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 Ud;for(const e of t){const t=Ha(e),n=hi(Co(e,0,1));if(32!==t)throw new Ld({hash:e,size:t});if(n!==Md)throw new Bd({hash:e,version:n})}}Rd(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=>ei(e))),n=e.kzg,r=jd({blobs:t,kzg:n}),a=Gd({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(Wd({commitment:e,to:r,version:n}));return a}({commitments:r}),!1!==h&&(h=Vd({blobs:t,commitments:r,proofs:a}))}const m=Zd(u),f=[Ya(n),a?Ya(a):"0x",l?Ya(l):"0x",c?Ya(c):"0x",r?Ya(r):"0x",i??"0x",s?Ya(s):"0x",d??"0x",m,o?Ya(o):"0x",p??[],...Jd(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 cs(["0x03",ap(h?[f,y,b,g]:f)])}(e,t):function(e,t){const{chainId:n=0,gas:r,data:a,nonce:i,to:s,value:o,gasPrice:c}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i,accessList:s}=e;if(i&&!ss(i))throw new Ti({address:i});if(void 0!==t&&t<=0)throw new eu({chainId:t});if(n||a)throw new La("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new nl({maxFeePerGas:r});if(s)throw new La("`accessList` is not a valid Legacy Transaction attribute.")}(e);let l=[i?Ya(i):"0x",c?Ya(c):"0x",r?Ya(r):"0x",s??"0x",o?Ya(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 yc({v:t.v});return e})();l=[...l,Ya(e),t.r,t.s]}else n>0&&(l=[...l,Ya(n),"0x","0x"]);return ap(l)}(e,t)}function Jd(e,t){const{r:n,s:r,v:a,yParity:i}=t??e;if(void 0===n)return[];if(void 0===r)return[];if(void 0===a&&void 0===i)return[];return["number"==typeof i?i?Ya(1):"0x":0n===a?"0x":1n===a?Ya(1):27n===a?"0x":Ya(1),qa(n),qa(r)]}async function Xd(e,{address:t,blockNumber:n,blockTag:r,storageKeys:a}){const i=r??"latest",s=void 0!==n?ti(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?hi(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,s||i]}))}async function Yd(e,{blockHash:t,blockNumber:n,blockTag:r,hash:a,index:i}){const s=r||"latest",o=void 0!==n?ti(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,ti(i)]}):(o||s)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||s,ti(i)]})),!c)throw new wc({blockHash:t,blockNumber:n,blockTag:s,hash:a,index:i});return(e.chain?.formatters?.transaction?.format||yi)(c)}async function Qd(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!n)throw new Cc({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||xi)(n)}const ep="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";
3
3
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */async function tp(e,{address:t,hash:n,signature:r,...a}){const i=$a(r)?r:Ya(r);try{const{data:r}=await qs(e,au,"call")({data:xd({abi:Zl,args:[t,n,i],bytecode:ep}),...a});return o="0x1",function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}($a(s=r??"0x0")?ii(s):s,$a(o)?ii(o):o)}catch(e){if(e instanceof Ec)return!1;throw e}var s,o}function np(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:a,poll:i,pollingInterval:s=e.pollingInterval}){let o;return(void 0!==i?i:"webSocket"!==e.transport.type)?pu(ac(["watchBlockNumber",e.uid,t,n,s]),{onBlockNumber:r,onError:a},(r=>mu((async()=>{try{const t=await qs(e,vu,"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:s}))):pu(ac(["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=pi(e.result?.number);t.onBlockNumber(r,o),o=r},onError(e){t.onError?.(e)}});r=a,n||r()}catch(e){a?.(e)}})(),r}))}function rp(e){return{call:t=>au(e,t),createBlockFilter:()=>async function(e){const t=Uo(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>Lo(e,t),createEventFilter:t=>ld(e,t),createPendingTransactionFilter:()=>ud(e),estimateContractGas:t=>Il(e,t),estimateGas:t=>Sl(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const a=n?ti(n):void 0,i=await e.request({method:"eth_getBalance",params:[t,a||r]});return BigInt(i)}(e,t),getBlock:t=>El(e,t),getBlockNumber:t=>vu(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const a=void 0!==n?ti(n):void 0;let i;return i=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[a||r]}),hi(i)}(e,t),getBytecode:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest"}){const a=void 0!==n?ti(n):void 0,i=await e.request({method:"eth_getCode",params:[t,a||r]});if("0x"!==i)return i}(e,t),getChainId:()=>Ol(e),getContractEvents:t=>Rl(e,t),getEnsAddress:t=>async function(e,{blockNumber:t,blockTag:n,coinType:r,name:a,gatewayUrls:i,strict:s,universalResolverAddress:o}){let c=o;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=tu({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const s=jo({abi:Wl,functionName:"addr",...null!=r?{args:[qu(a),BigInt(r)]}:{args:[qu(a)]}}),o={address:c,abi:Hl,functionName:"resolve",args:[Ya(Zu(a)),s],blockNumber:t,blockTag:n},l=qs(e,ou,"readContract"),u=i?await l({...o,args:[...o.args,i]}):await l(o);if("0x"===u[0])return null;const d=Gl({abi:Wl,args:null!=r?[qu(a),BigInt(r)]:void 0,functionName:"addr",data:u[0]});return"0x"===d||"0x00"===qa(d)?null:d}catch(e){if(s)throw e;if($u(e,"resolve"))return null;throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:a,gatewayUrls:i,strict:s,universalResolverAddress:o}){const c=await qs(e,cd,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:a,universalResolverAddress:o,gatewayUrls:i,strict:s});if(!c)return null;try{return await od(e,{record:c,gatewayUrls:r})}catch{return null}}(e,t),getEnsName:t=>async function(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:a,strict:i,universalResolverAddress:s}){let o=s;if(!o){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=tu({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const i={address:o,abi:ql,functionName:"reverse",args:[Ya(Zu(c))],blockNumber:n,blockTag:r},s=qs(e,ou,"readContract"),[l,u]=a?await s({...i,args:[...i.args,a]}):await s(i);return t.toLowerCase()!==u.toLowerCase()?null:l}catch(e){if(i)throw e;if($u(e,"reverse"))return null;throw e}}(e,t),getEnsResolver:t=>async function(e,{blockNumber:t,blockTag:n,name:r,universalResolverAddress:a}){let i=a;if(!i){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=tu({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[s]=await qs(e,ou,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Ya(Zu(r))],blockNumber:t,blockTag:n});return s}(e,t),getEnsText:t=>cd(e,t),getFeeHistory:t=>dd(e,t),estimateFeesPerGas:t=>async function(e,t){return Pl(e,t)}(e,t),getFilterChanges:e=>wu(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=>wi(e)));return t.abi?Ll({abi:t.abi,logs:r,strict:n}):r}(0,e),getGasPrice:()=>kl(e),getLogs:t=>Bl(e,t),getProof:t=>Xd(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return Tl(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:a}){const i=void 0!==n?ti(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,a,i||r]})}(e,t),getTransaction:t=>Yd(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,a]=await Promise.all([qs(e,vu,"getBlockNumber")({}),t?qs(e,Yd,"getBlockNumber")({hash:t}):void 0]),i=n?.blockNumber||a?.blockNumber;return i?r-i+1n:0n}(e,t),getTransactionCount:t=>Al(e,t),getTransactionReceipt:t=>Qd(e,t),multicall:t=>async function(e,t){const{allowFailure:n=!0,batchSize:r,blockNumber:a,blockTag:i,multicallAddress:s,stateOverride:o}=t,c=t.contracts,l=r??("object"==typeof e.batch?.multicall&&e.batch.multicall.batchSize||1024);let u=s;if(!u){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");u=tu({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:i}=c[e];try{const e=jo({abi:t,args:a,functionName:i});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 s=Qc(e,{abi:t,address:r,args:a,docsPath:"/docs/contract/multicall",functionName:i});if(!n)throw s;d[p]=[...d[p],{allowFailure:!0,callData:"0x",target:r}]}}const m=await Promise.allSettled(d.map((t=>qs(e,ou,"readContract")({abi:zl,address:u,args:[t],blockNumber:a,blockTag:i,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:i}=r[t],{callData:s}=d[e][t],{abi:o,address:l,functionName:u,args:p}=c[f.length];try{if("0x"===s)throw new Xs;if(!i)throw new Ac({data:a});const e=Gl({abi:o,args:p,data:a,functionName:u});f.push(n?{result:e,status:"success"}:e)}catch(e){const t=Qc(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 La("multicall results mismatch");return f}(e,t),prepareTransactionRequest:t=>Fl(e,t),readContract:t=>ou(e,t),sendRawTransaction:t=>Eu(e,t),simulateContract:t=>cu(e,t),verifyMessage:t=>async function(e,{address:t,message:n,signature:r,...a}){return tp(e,{address:t,hash:Id(n),signature:r,...a})}(e,t),verifyTypedData:t=>async function(e,t){const{address:n,signature:r,message:a,primaryType:i,types:s,domain:o,...c}=t;return tp(e,{address:n,hash:md({message:a,primaryType:i,types:s,domain:o}),signature:r,...c})}(e,t),uninstallFilter:e=>Cu(0,e),waitForTransactionReceipt:t=>async function(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:a=e.pollingInterval,retryCount:i=6,retryDelay:s=(({count:e})=>200*~~(1<<e)),timeout:o}){const c=ac(["waitForTransactionReceipt",e.uid,n]);let l,u,d,p=!1;return new Promise(((h,m)=>{o&&setTimeout((()=>m(new xc({hash:n}))),o);const f=pu(c,{onReplaced:r,resolve:h,reject:m},(r=>{const o=qs(e,np,"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 Mu((async()=>{l=await qs(e,Yd,"getTransaction")({hash:n}),l.blockNumber&&(c=l.blockNumber)}),{delay:s,retryCount:i}),p=!1),d=await qs(e,Qd,"getTransactionReceipt")({hash:n}),t>1&&(!d.blockNumber||c-d.blockNumber+1n<t))return;h((()=>r.resolve(d)))}catch(n){if(n instanceof wc||n instanceof Cc){if(!l)return void(p=!1);try{u=l,p=!0;const n=await Mu((()=>qs(e,El,"getBlock")({blockNumber:c,includeTransactions:!0})),{delay:s,retryCount:i,shouldRetry:({error:e})=>e instanceof xl});p=!1;const a=n.transactions.find((({from:e,nonce:t})=>e===u.from&&t===u.nonce));if(!a)return;if(d=await qs(e,Qd,"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:i,includeTransactions:s,poll:o,pollingInterval:c=e.pollingInterval}){const l=void 0!==o?o:"webSocket"!==e.transport.type,u=s??!1;let d;return l?pu(ac(["watchBlocks",e.uid,n,r,u,c]),{onBlock:a,onError:i},(a=>mu((async()=>{try{const r=await qs(e,El,"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 qs(e,El,"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||gi)(n.result);a(r,d),d=r},onError(e){i?.(e)}});n=r,t||n()}catch(e){i?.(e)}})(),n})()}(e,t),watchBlockNumber:t=>np(e,t),watchContractEvent:t=>xu(e,t),watchEvent:t=>function(e,{address:t,args:n,batch:r=!0,event:a,events:i,onError:s,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?pu(ac(["watchEvent",t,n,r,e.uid,a,l]),{onLogs:o,onError:s},(s=>{let o,c,u=!1;const d=mu((async()=>{if(u)try{let l;if(c)l=await qs(e,wu,"getFilterChanges")({filter:c});else{const r=await qs(e,vu,"getBlockNumber")({});l=o&&o!==r?await qs(e,Bl,"getLogs")({address:t,args:n,event:a,events:i,fromBlock:o+1n,toBlock:r}):[],o=r}if(0===l.length)return;if(r)s.onLogs(l);else for(const e of l)s.onLogs([e])}catch(e){c&&e instanceof Bc&&(u=!1),s.onError?.(e)}else{try{c=await qs(e,ld,"createEventFilter")({address:t,args:n,event:a,events:i,strict:p})}catch{}u=!0}}),{emitOnBegin:!0,interval:l});return async()=>{c&&await qs(e,Cu,"uninstallFilter")({filter:c}),d()}})):(()=>{let r=!0,c=()=>r=!1;return(async()=>{try{const l=i??(a?[a]:void 0);let d=[];l&&(d=[l.flatMap((e=>Mo({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}=Nl({abi:l??[],data:t.data,topics:t.topics,strict:p}),r=wi(t,{args:n,eventName:e});o([r])}catch(e){let n,r;if(e instanceof lo||e instanceof uo){if(u)return;n=e.abiItem.name,r=e.abiItem.inputs?.some((e=>!("name"in e&&e.name)))}const a=wi(t,{args:r?[]:{},eventName:n});o([a])}},onError(e){s?.(e)}});c=h,r||c()}catch(e){s?.(e)}})(),c})()}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:n,onTransactions:r,poll:a,pollingInterval:i=e.pollingInterval}){return(void 0!==a?a:"webSocket"!==e.transport.type)?pu(ac(["watchPendingTransactions",e.uid,t,i]),{onTransactions:r,onError:n},(n=>{let r;const a=mu((async()=>{try{if(!r)try{return void(r=await qs(e,ud,"createPendingTransactionFilter")({}))}catch(e){throw a(),e}const i=await qs(e,wu,"getFilterChanges")({filter:r});if(0===i.length)return;if(t)n.onTransactions(i);else for(const e of i)n.onTransactions([e])}catch(e){n.onError?.(e)}}),{emitOnBegin:!0,interval:i});return async()=>{r&&await qs(e,Cu,"uninstallFilter")({filter:r}),a()}})):(()=>{let t=!0,a=()=>t=!1;return(async()=>{try{const{unsubscribe:i}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const n=e.result;r([n])},onError(e){n?.(e)}});a=i,t||a()}catch(e){n?.(e)}})(),a})()}(e,t)}}function ap(e,t="hex"){const n=ip(e),r=Zo(new Uint8Array(n.length));return n.encode(r),"hex"===t?ei(r.bytes):r.bytes}function ip(e){return Array.isArray(e)?function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=sp(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=>ip(e)))):function(e){const t="string"==typeof e?ci(e):e,n=sp(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 sp(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 La("Length is too large.")}BigInt(0),BigInt(1),BigInt(2);const op={contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:ki,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&&!ss(t))throw new Ti({address:t});if(n&&!ss(n))throw new Ti({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:a,isSystemTx:i,mint:s,to:o,value:c}=e;return cs(["0x7e",ap([t,r,o??"0x",s?Ya(s):"0x",c?Ya(c):"0x",a?Ya(a):"0x",i?"0x1":"0x",n??"0x"])])}(e):Kd(e,t)}}},cp=Ma({...op,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:{...op.contracts,l2OutputOracle:{1:{address:"0xB09DC08428C8b4EFB4ff9C0827386CDF34277996"}},portal:{1:{address:"0x639F2AECE398Aa76b07e59eF6abe2cFe32bacb68",blockCreated:19070571}},l1StandardBridge:{1:{address:"0xd5e3eDf5b68135D559D572E26bF863FBC1950033",blockCreated:19070571}}},sourceId:1}),lp=11155111,up=Ma({...op,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:{...op.contracts,l2OutputOracle:{[lp]:{address:"0x942fD5017c0F60575930D8574Eaca13BEcD6e1bB"}},portal:{[lp]:{address:"0xfa1d9E26A6aCD7b22115D27572c1221B9803c960",blockCreated:4972908}},l1StandardBridge:{[lp]:{address:"0xF6Bc0146d3c74D48306e79Ae134A260E418C9335",blockCreated:4972908}}},sourceId:lp}),dp=Ma({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"]}}}),pp=Ma({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}),hp=Ma({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}}}),mp=Ma({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}),fp=Ma({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}}}),yp=Ma({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}),bp=Ma({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}),gp=Ma({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}),vp=Ma({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}),wp=Ma({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}),Cp=Ma({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}}}),xp=Ma({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}),Ep=Ma({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}),kp=Ma({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}}}),Tp=Ma({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}),Pp=Ma({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"}}}),Ap=Ma({...op,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:{...op.contracts,l2OutputOracle:{1:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{1:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{1:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),_p=Ma({...op,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:{...op.contracts,l2OutputOracle:{5:{address:"0x2A35891ff30313CcFa6CE88dcf3858bb075A2298"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1376988},portal:{5:{address:"0xe93c8cD0D409341205A592f8c4Ac1A5fe5585cfA"}},l1StandardBridge:{5:{address:"0xfA6D8Ee5BE770F84FC001D098C4bD604Fe01284a"}}},testnet:!0,sourceId:5}),Dp=11155111,Op=Ma({...op,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:{...op.contracts,l2OutputOracle:{[Dp]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[Dp]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[Dp]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:Dp}),Fp=Ma({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}}}),Sp=Ma({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}),Ip=Ma({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"}}}),Mp=Ma({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}),Np=Ma({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}),Up=Ma({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"}}}),Lp=Ma({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}),Bp=Ma({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}),Rp=Ma({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}),jp=Ma({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}}}),Gp=Ma({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"}}}),zp=Ma({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}),$p=Ma({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}}}),Hp=Ma({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}),qp=Ma({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}),Vp=Ma({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"}}}),Wp=Ma({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"}}}),Zp=Ma({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 Kp(e){return 0===e||0n===e||null==e||"0"===e||""===e||"string"==typeof e&&("0x"===qa(e).toLowerCase()||"0x00"===qa(e).toLowerCase())}function Jp(e){return!Kp(e)}function Xp(e){return void 0!==e.maxFeePerGas&&void 0!==e.maxPriorityFeePerGas}function Yp(e){return"cip42"===e.type||Xp(e)&&(Jp(e.feeCurrency)||Jp(e.gatewayFeeRecipient)||Jp(e.gatewayFee))}function Qp(e){return"cip64"===e.type||Xp(e)&&Jp(e.feeCurrency)&&Kp(e.gatewayFee)&&Kp(e.gatewayFeeRecipient)}const eh={block:vi({exclude:["difficulty","gasLimit","mixHash","nonce","uncles"],format(e){const t=e.transactions?.map((e=>"string"==typeof e?e:{...yi(e),feeCurrency:e.feeCurrency,..."0x7b"!==e.type?{gatewayFee:e.gatewayFee?pi(e.gatewayFee):null,gatewayFeeRecipient:e.gatewayFeeRecipient||null}:{}}));return{randomness:e.randomness,transactions:t}}}),transaction:bi({format(e){const t={feeCurrency:e.feeCurrency};return"0x7b"===e.type?t.type="cip64":("0x7c"===e.type&&(t.type="cip42"),t.gatewayFee=e.gatewayFee?pi(e.gatewayFee):null,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}}),transactionRequest:bl({format(e){const t={feeCurrency:e.feeCurrency};return Qp(e)?t.type="0x7b":(Yp(e)&&(t.type="0x7c"),t.gatewayFee=void 0!==e.gatewayFee?ti(e.gatewayFee):void 0,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}})};const th={transaction:function(e,t){return Qp(e)?function(e,t){!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i,feeCurrency:s}=e;if(t<=0)throw new eu({chainId:t});if(i&&!ss(i))throw new Ti({address:i});if(r)throw new La("`gasPrice` is not a valid CIP-64 Transaction attribute.");if(Jp(a)&&a>nh)throw new nl({maxFeePerGas:a});if(Jp(n)&&Jp(a)&&n>a)throw new dl({maxFeePerGas:a,maxPriorityFeePerGas:n});if(Jp(s)&&!ss(s))throw new La("`feeCurrency` MUST be a token address for CIP-64 transactions.");if(Kp(s))throw new La("`feeCurrency` must be provided for CIP-64 transactions.")}(e);const{chainId:n,gas:r,nonce:a,to:i,value:s,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,feeCurrency:u,data:d}=e,p=[Ya(n),a?Ya(a):"0x",c?Ya(c):"0x",o?Ya(o):"0x",r?Ya(r):"0x",i??"0x",s?Ya(s):"0x",d??"0x",Zd(l),u,...Jd(e,t)];return cs(["0x7b",ap(p)])}(e,t):Yp(e)?function(e,t){!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i,feeCurrency:s,gatewayFee:o,gatewayFeeRecipient:c}=e;if(t<=0)throw new eu({chainId:t});if(i&&!ss(i))throw new Ti({address:i});if(r)throw new La("`gasPrice` is not a valid CIP-42 Transaction attribute.");if(Jp(a)&&a>nh)throw new nl({maxFeePerGas:a});if(Jp(n)&&Jp(a)&&n>a)throw new dl({maxFeePerGas:a,maxPriorityFeePerGas:n});if(Jp(o)&&Kp(c)||Jp(c)&&Kp(o))throw new La("`gatewayFee` and `gatewayFeeRecipient` must be provided together.");if(Jp(s)&&!ss(s))throw new La("`feeCurrency` MUST be a token address for CIP-42 transactions.");if(Jp(c)&&!ss(c))throw new Ti(c);if(Kp(s)&&Kp(c))throw new La("Either `feeCurrency` or `gatewayFeeRecipient` must be provided for CIP-42 transactions.")}(e);const{chainId:n,gas:r,nonce:a,to:i,value:s,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,feeCurrency:u,gatewayFeeRecipient:d,gatewayFee:p,data:h}=e,m=[Ya(n),a?Ya(a):"0x",c?Ya(c):"0x",o?Ya(o):"0x",r?Ya(r):"0x",u??"0x",d??"0x",p?Ya(p):"0x",i??"0x",s?Ya(s):"0x",h??"0x",Zd(l),...Jd(e,t)];return cs(["0x7c",ap(m)])}(e,t):Kd(e,t)}};const nh=2n**256n-1n;const rh={formatters:eh,serializers:th},ah=Ma({...rh,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}),ih=Ma({...rh,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}),sh=Ma({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"}}}),oh=Ma({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"}}}),ch=Ma({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}}}),lh=Ma({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}}}),uh=Ma({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}),dh=Ma({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}}}),ph=Ma({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}),hh=Ma({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}}}),mh=Ma({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}}}),fh=Ma({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}),yh=Ma({id:53935,name:"DFK Chain",nativeCurrency:{decimals:18,name:"Jewel",symbol:"JEWEL"},rpcUrls:{default:{http:["https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"]}},blockExplorers:{default:{name:"DFKSubnetScan",url:"https://subnets.avax.network/defi-kingdoms"}}}),bh=Ma({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"}}}),gh=Ma({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}}}),vh=Ma({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"}}}),wh=Ma({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}}}),Ch=Ma({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}),xh=Ma({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}),Eh=Ma({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"}}}),kh=Ma({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/"}}}),Th=Ma({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"}}}),Ph=Ma({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}),Ah=Ma({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}}}),_h=Ma({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}),Dh=Ma({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}}}),Oh=Ma({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"}}}),Fh=Ma({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}}}),Sh=Ma({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"}}}),Ih=Ma({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"}}}),Mh=Ma({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"}}}),Nh=Ma({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}),Uh=Ma({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"]}}}),Lh=Ma({...op,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:{...op.contracts,l2OutputOracle:{1:{address:"0x66CC916Ed5C6C2FA97014f7D1cD141528Ae171e4"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{1:{address:"0x36cb65c1967A0Fb0EEE11569C51C2f2aA1Ca6f6D",blockCreated:19135323}},l1StandardBridge:{1:{address:"0x34C0bD5877A5Ee7099D0f5688D65F4bB9158BDE2",blockCreated:19135323}}},sourceId:1}),Bh=17e3,Rh=Ma({...op,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:{...op.contracts,l2OutputOracle:{[Bh]:{address:"0x715EA64DA13F4d0831ece4Ad3E8c1aa013167F32"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[Bh]:{address:"0xB9c64BfA498d5b9a8398Ed6f46eb76d90dE5505d",blockCreated:318416}},l1StandardBridge:{[Bh]:{address:"0x0BaafC217162f64930909aD9f2B27125121d6332",blockCreated:318416}}},sourceId:Bh}),jh=Ma({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}}}),Gh=Ma({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"}}}),zh=Ma({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}}}),$h=Ma({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}),Hh=Ma({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}),qh=Ma({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}),Vh=Ma({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}),Wh=Ma({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}),Zh=Ma({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}}}),Kh=Ma({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}),Jh=Ma({id:31337,name:"Hardhat",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}}),Xh=Ma({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}}}),Yh=Ma({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"}}}),Qh=Ma({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"}}}),em=Ma({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}),tm=Ma({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}),nm=Ma({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}),rm=Ma({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}),am=Ma({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}),im=Ma({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}),sm=Ma({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}),om=Ma({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}),cm=Ma({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}}}),lm=Ma({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}),um=Ma({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}),dm=Ma({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}),pm=Ma({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}),hm=Ma({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}),mm=Ma({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}),fm=Ma({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}),ym=11155111,bm=Ma({...op,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:{...op.contracts,l2OutputOracle:{[ym]:{address:"0xA0E35F56C318DE1bD5D9ca6A94Fe7e37C5663348"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11"},portal:{[ym]:{address:"0xe3d90F21490686Ec7eF37BE788E02dfC12787264"}},l1StandardBridge:{[ym]:{address:"0x1Fb30e446eA791cd1f011675E5F3f5311b70faF5"}}},testnet:!0,sourceId:ym}),gm=Ma({id:1337,name:"Localhost",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"]}}}),vm=Ma({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"}}}),wm=Ma({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}}}),Cm=Ma({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}),xm=Ma({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}}}),Em=Ma({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}),km=Ma({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}}}),Tm=Ma({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}),Pm=Ma({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"}}}),Am=Ma({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}}}),_m=Ma({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}),Dm=Ma({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"}}}),Om=Ma({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"}}}),Fm=Ma({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}}}),Sm=Ma({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}}}),Im=Ma({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}}}),Mm=Ma({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}),Nm=Ma({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}),Um=Ma({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}}}),Lm=Ma({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}),Bm=Ma({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}),Rm=Ma({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}),jm=Ma({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"]}}}),Gm=Ma({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}),zm=Ma({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}),$m=Ma({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}),Hm=Ma({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}}}),qm=Ma({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}}}),Vm=Ma({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"}}}),Wm=Ma({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}),Zm=Ma({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}}}),Km=Ma({...op,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:{...op.contracts,l2OutputOracle:{1:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{1:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{1:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:1}),Jm=Ma({...op,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:{...op.contracts,l2OutputOracle:{5:{address:"0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461},portal:{5:{address:"0x5b47E1A08Ea6d985D6649300584e6722Ec4B1383"}},l1StandardBridge:{5:{address:"0x636Af16bf2f682dD3109e60102b8E1A089FedAa8"}}},testnet:!0,sourceId:5}),Xm=11155111,Ym=Ma({...op,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:{...op.contracts,l2OutputOracle:{[Xm]:{address:"0x90E9c4f8a994a250F6aEfd61CAFb4F2e895D458F"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1620204},portal:{[Xm]:{address:"0x16Fc5058F25648194471939df75CF27A2fdC48BC"}},l1StandardBridge:{[Xm]:{address:"0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1"}}},testnet:!0,sourceId:Xm}),Qm=Ma({id:204,name:"opBNB",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{default:{http:["https://opbnb-mainnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opbnbscan",url:"https://mainnet.opbnbscan.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:512881}}}),ef=Ma({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}),tf=Ma({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"}}}),nf=Ma({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}}}),rf=Ma({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}),af=Ma({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:ki,sourceId:1}),sf=11155111,of=Ma({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:{[sf]:{address:"0xD5bAc3152ffC25318F848B3DD5dA6C85171BaEEe"}},portal:{[sf]:{address:"0xF04BdD5353Bb0EFF6CA60CfcC78594278eBfE179"}},l1StandardBridge:{[sf]:{address:"0xFaE6abCAF30D23e233AC7faF747F2fC3a5a6Bfa3"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:3754925}},formatters:ki,sourceId:sf,testnet:!0}),cf=Ma({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}}}),lf=Ma({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}}}),uf=Ma({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}),df=Ma({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}}}),pf=Ma({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}),hf=Ma({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}),mf=Ma({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}}}),ff=Ma({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}}}),yf=Ma({id:369,name:"PulseChain",nativeCurrency:{name:"Pulse",symbol:"PLS",decimals:18},testnet:!1,rpcUrls:{default:{http:["https://rpc.pulsechain.com"],webSocket:["wss://ws.pulsechain.com"]}},blockExplorers:{default:{name:"PulseScan",url:"https://scan.pulsechain.com",apiUrl:"https://api.scan.pulsechain.com/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),bf=Ma({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}}}),gf=Ma({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"}}}),vf=Ma({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}),wf=Ma({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}}}),Cf=Ma({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}}}),xf=Ma({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}}}),Ef=Ma({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}}}),kf=Ma({...op,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:{...op.contracts,l2OutputOracle:{1:{address:"0xE6f24d2C32B3109B18ed33cF08eFb490b1e09C10"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14193},portal:{1:{address:"0x6A12432491bbbE8d3babf75F759766774C778Db4",blockCreated:19387057}},l1StandardBridge:{1:{address:"0x4cbab69108Aa72151EDa5A3c164eA86845f18438"}}},sourceId:1}),Tf=11155111,Pf=Ma({...op,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:{...op.contracts,l2OutputOracle:{[Tf]:{address:"0xDb5c46C3Eaa6Ed6aE8b2379785DF7dd029C0dC81"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:55697},portal:{[Tf]:{address:"0xcBD77E8E1E7F06B25baDe67142cdE82652Da7b57",blockCreated:5345035}},l1StandardBridge:{[Tf]:{address:"0xdDD29bb63B0839FB1cE0eE439Ff027738595D07B"}}},testnet:!0,sourceId:Tf}),Af=Ma({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}),_f=Ma({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}}}),Df=Ma({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}),Of=Ma({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}),Ff=Ma({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}),Sf=Ma({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}),If=Ma({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}),Mf=Ma({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"}}}),Nf=Ma({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}),Uf=Ma({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:{}}),Lf=Ma({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}}}),Bf=Ma({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}),Rf=Ma({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:{}}),jf=Ma({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:{}}),Gf=Ma({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}}}),zf=Ma({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}),$f=Ma({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:{}}),Hf=Ma({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:{}}),qf=Ma({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}}}),Vf=Ma({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}),Wf=Ma({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:{}}),Zf=Ma({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}}}),Kf=Ma({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}),Jf=Ma({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"}}}),Xf=Ma({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}),Yf=Ma({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}),Qf=Ma({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}),ey=Ma({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}}}),ty=Ma({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}}}),ny=Ma({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}}}),ry=Ma({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"}}}),ay=Ma({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}),iy=Ma({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"}}}),sy=Ma({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"}}}),oy=Ma({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}),cy=Ma({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}}}),ly=Ma({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}),uy=Ma({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}),dy=Ma({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}),py=Ma({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"}}}),hy=Ma({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}}}),my=Ma({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}),fy=Ma({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"}}}),yy=Ma({id:1112,name:"WEMIX Testnet",network:"wemix-testnet",nativeCurrency:{name:"WEMIX",symbol:"tWEMIX",decimals:18},rpcUrls:{default:{http:["https://api.test.wemix.com"]},public:{http:["https://api.test.wemix.com"]}},blockExplorers:{default:{name:"wemixExplorer",url:"https://testnet.wemixscan.com",apiUrl:"https://testnet.wemixscan.com/api"}},testnet:!0}),by=Ma({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}),gy=Ma({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}}}),vy=Ma({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}}}),wy=Ma({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}),Cy=Ma({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}),xy=Ma({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}),Ey={block:vi({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=Ey.transaction?.format(e);return"0x71"===t.typeHex?t.type="eip712":"0xff"===t.typeHex&&(t.type="priority"),t}));return{l1BatchNumber:e.l1BatchNumber?pi(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?pi(e.l1BatchTimestamp):null,transactions:t}}}),transaction:bi({format(e){const t={};return"0x71"===e.type?t.type="eip712":"0xff"===e.type&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?pi(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?pi(e.l1BatchTxIndex):null}}}),transactionReceipt:Ei({format:e=>({l1BatchNumber:e.l1BatchNumber?pi(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?pi(e.l1BatchTxIndex):null,logs:e.logs.map((e=>({...wi(e),l1BatchNumber:e.l1BatchNumber?pi(e.l1BatchNumber):null,transactionLogIndex:hi(e.transactionLogIndex),logType:e.logType}))),l2ToL1Logs:e.l2ToL1Logs.map((e=>({blockNumber:pi(e.blockHash),blockHash:e.blockHash,l1BatchNumber:pi(e.l1BatchNumber),transactionIndex:pi(e.transactionIndex),shardId:pi(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:pi(e.logIndex)})))})}),transactionRequest:bl({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format:e=>e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:Ya(e.gasPerPubdata)}:{},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(ci(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps}:{},...e.customSignature?{customSignature:Array.from(ci(e.customSignature))}:{}},type:"0x71"}:{}})};class ky extends La{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 Ty(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 Py(e){const{chainId:t,to:n,from:r,paymaster:a,paymasterInput:i}=e;if(!Ty(e))throw new ky;if(!t||t<=0)throw new eu({chainId:t});if(n&&!ss(n))throw new Ti({address:n});if(r&&!ss(r))throw new Ti({address:r});if(a&&!ss(a))throw new Ti({address:a});if(a&&!i)throw new La("`paymasterInput` must be provided when `paymaster` is defined");if(!a&&i)throw new La("`paymaster` must be provided when `paymasterInput` is defined")}const Ay={formatters:Ey,serializers:{transaction:function(e,t){return Ty(e)?function(e){const{chainId:t,gas:n,nonce:r,to:a,from:i,value:s,maxFeePerGas:o,maxPriorityFeePerGas:c,customSignature:l,factoryDeps:u,paymaster:d,paymasterInput:p,gasPerPubdata:h,data:m}=e;Py(e);return cs(["0x71",ap([r?Ya(r):"0x",c?Ya(c):"0x",o?Ya(o):"0x",n?Ya(n):"0x",a??"0x",s?Ya(s):"0x",m??"0x0",Ya(t),Ya(""),Ya(""),Ya(t),i??"0x",h?Ya(h):"0x",u??[],l??"0x",d&&p?[d,p]:[]])])}(e):Kd(e,t)}},custom:{getEip712Domain:e=>{Py(e);const t=function(e){const{gas:t,nonce:n,to:r,from:a,value:i,maxFeePerGas:s,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:s??0n,maxPriorityFeePerGas:o??0n,paymaster:l?BigInt(l):0n,nonce:n?BigInt(n):0n,value:i??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}}}},_y=Ma({...Ay,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"}}}),Dy=Ma({...Ay,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}),Oy=Ma({...Ay,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}),Fy=Ma({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}),Sy=Ma({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}),Iy=Ma({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}),My=Ma({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}),Ny=Ma({...op,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:{...op.contracts,l2OutputOracle:{1:{address:"0x9E6204F750cD866b299594e2aC9eA824E2e5f95c"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:5882},portal:{1:{address:"0x1a0ad011913A150f69f6A19DF447A0CfD9551054"}},l1StandardBridge:{1:{address:"0x3e2Ea9B92B7E48A52296fD261dc26fd995284631"}}},sourceId:1}),Uy=11155111,Ly=Ma({...op,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:{...op.contracts,l2OutputOracle:{[Uy]:{address:"0x2615B481Bd3E5A1C0C7Ca3Da1bdc663E8615Ade9"}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:83160},portal:{[Uy]:{address:"0xeffE2C6cA9Ab797D418f0D91eA60807713f3536f"}},l1StandardBridge:{[Uy]:{address:"0x5376f1D543dcbB5BD416c56C189e4cB7399fCcCB"}}},sourceId:Uy,testnet:!0}),By=Ma({...op,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:{...op.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:189123},portal:{5:{address:"0xDb9F51790365e7dc196e7D072728df39Be958ACe"}}},sourceId:5,testnet:!0});var Ry=Object.freeze({__proto__:null,acala:Na,ancient8:cp,ancient8Sepolia:up,anvil:dp,apexTestnet:pp,arbitrum:hp,arbitrumGoerli:mp,arbitrumNova:fp,astar:yp,astarZkEVM:bp,astarZkyoto:gp,arbitrumSepolia:vp,astarZkatana:wp,aurora:Cp,auroraTestnet:xp,auroria:Ep,avalanche:kp,avalancheFuji:Tp,bahamut:Pp,base:Ap,baseGoerli:_p,baseSepolia:Op,beam:Fp,beamTestnet:Sp,bearNetworkChainMainnet:Ip,bearNetworkChainTestnet:Mp,berachainTestnet:Np,bitTorrent:Up,bitTorrentTestnet:Lp,blast:Bp,blastSepolia:Rp,boba:jp,bronos:Gp,bronosTestnet:zp,bsc:$p,bscTestnet:Hp,bscGreenfield:qp,bxn:Vp,bxnTestnet:Wp,canto:Zp,celo:ah,celoAlfajores:ih,chiliz:sh,classic:oh,confluxESpace:ch,confluxESpaceTestnet:lh,coreDao:uh,cronos:dh,cronosTestnet:ph,crossbell:hh,defichainEvm:mh,defichainEvmTestnet:fh,dfk:yh,dogechain:bh,edgeware:gh,edgewareTestnet:vh,eos:wh,eosTestnet:Ch,etherlinkTestnet:xh,evmos:Eh,evmosTestnet:kh,ekta:Th,ektaTestnet:Ph,fantom:Ah,fantomSonicTestnet:_h,fantomTestnet:Dh,fibo:Oh,filecoin:Fh,filecoinCalibration:Sh,filecoinHyperspace:Ih,flare:Mh,flareTestnet:Nh,foundry:Uh,fraxtal:Lh,fraxtalTestnet:Rh,fuse:jh,fuseSparknet:Gh,iotex:zh,iotexTestnet:$h,jbc:Hh,karura:qh,gobi:Vh,goerli:Wh,gnosis:Zh,gnosisChiado:Kh,hardhat:Jh,harmonyOne:Xh,haqqMainnet:Yh,haqqTestedge2:Qh,hedera:em,hederaTestnet:tm,hederaPreviewnet:nm,holesky:rm,kakarotSepolia:am,kava:im,kavaTestnet:sm,kcc:om,klaytn:cm,klaytnBaobab:lm,kroma:um,kromaSepolia:dm,lightlinkPegasus:pm,lightlinkPhoenix:hm,linea:mm,lineaTestnet:fm,liskSepolia:bm,localhost:gm,lukso:vm,mainnet:wm,mandala:Cm,manta:xm,mantaTestnet:Em,mantle:km,mantleTestnet:Tm,merlin:Pm,metachain:Am,metachainIstanbul:_m,meter:Dm,meterTestnet:Om,metis:Fm,metisGoerli:Sm,mev:Im,mevTestnet:Mm,mintSepoliaTestnet:Nm,mode:Um,modeTestnet:Lm,moonbaseAlpha:Bm,moonbeam:Rm,moonbeamDev:jm,moonriver:Gm,neonDevnet:zm,neonMainnet:$m,nexi:Hm,nexilix:qm,oasys:Vm,oasisTestnet:Wm,okc:Zm,optimism:Km,optimismGoerli:Jm,optimismSepolia:Ym,opBNB:Qm,opBNBTestnet:ef,oortMainnetDev:tf,palm:nf,palmTestnet:rf,pgn:af,pgnTestnet:of,phoenix:cf,plinga:lf,plumeTestnet:uf,polygon:df,polygonAmoy:pf,polygonMumbai:hf,polygonZkEvmTestnet:mf,polygonZkEvm:ff,pulsechain:yf,pulsechainV4:bf,qMainnet:gf,qTestnet:vf,rollux:wf,rolluxTestnet:Cf,ronin:xf,rootstock:Ef,rss3:kf,rss3Sepolia:Pf,saigon:Af,sapphire:_f,sapphireTestnet:Df,scroll:Of,scrollSepolia:Ff,scrollTestnet:Sf,sepolia:If,shimmer:Mf,shimmerTestnet:Nf,skaleBlockBrawlers:Uf,skaleCalypso:Lf,skaleCalypsoTestnet:Bf,skaleCryptoBlades:Rf,skaleCryptoColosseum:jf,skaleEuropa:Gf,skaleEuropaTestnet:zf,skaleExorde:$f,skaleHumanProtocol:Hf,skaleNebula:qf,skaleNebulaTestnet:Vf,skaleRazor:Wf,skaleTitan:Zf,skaleTitanTestnet:Kf,songbird:Jf,songbirdTestnet:Xf,spicy:Yf,shardeumSphinx:Qf,shibarium:ey,syscoin:ty,syscoinTestnet:ny,taraxa:ry,taikoJolnir:ay,taikoKatla:iy,taikoTestnetSepolia:sy,taraxaTestnet:oy,telos:cy,telosTestnet:ly,tenet:uy,thunderTestnet:dy,vechain:py,wanchain:hy,wanchainTestnet:my,wemix:fy,wemixTestnet:yy,x1Testnet:by,xdc:gy,xdcTestnet:vy,zhejiang:wy,zkFair:Cy,zkFairTestnet:xy,zkSync:_y,zkSyncTestnet:Dy,zkSyncSepoliaTestnet:Oy,zetachain:Fy,zetachainAthensTestnet:Sy,zilliqa:Iy,zilliqaTestnet:My,zora:Ny,zoraSepolia:Ly,zoraTestnet:By});const jy="3.18.2";class Gy extends La{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:jy});const n=t.cause instanceof Gy&&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 zy extends Gy{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 $y extends Gy{constructor(e){super(`Invalid RPC URL ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRpcUrlError"})}}class Hy extends Gy{constructor(){super("No chain supplied to the client"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}const qy=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 Vy(e){if(!e.chain)throw new Hy;const{key:t="bundler-public",name:n="Public Bundler Client",type:r="bundlerClient"}=e,{transport:a,...i}=e,s=a({chain:e.chain,pollingInterval:i.pollingInterval}),o={...e,key:t,name:n,type:r};return(()=>{if("http"===s.config.type){const{url:e,fetchOptions:t}=s.value,n=t??{};return e.toLowerCase().indexOf("alchemy")>-1&&(n.headers={...n.headers,"Alchemy-AA-Sdk-Version":jy}),Iu({...o,transport:zu(e,{...s.config,fetchOptions:n})})}return Iu(o)})().extend(rp).extend(qy)}class Wy extends Gy{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 Zy extends Gy{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 Ky=e=>{const t=ns(e.initCode),n=ns(e.callData),r=ns(e.paymasterAndData);return To([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"bytes32"}],[e.sender,pi(e.nonce),t,n,pi(e.callGasLimit),pi(e.verificationGasLimit),pi(e.preVerificationGas),pi(e.maxFeePerGas),pi(e.maxPriorityFeePerGas),r])};const Jy=e=>{const t=e.factory&&e.factoryData?os([e.factory,e.factoryData]):"0x",n=Xy((({verificationGasLimit:e,callGasLimit:t})=>({verificationGasLimit:e,callGasLimit:t}))(e)),r=Xy((({maxPriorityFeePerGas:e,maxFeePerGas:t})=>({maxPriorityFeePerGas:e,maxFeePerGas:t}))(e)),a=e.paymaster&&ss(e.paymaster)?function({paymaster:e,paymasterVerificationGasLimit:t,paymasterPostOpGasLimit:n,paymasterData:r}){if(!(e&&t&&n&&r))return"0x";return os([e,Ka(t,{size:16}),Ka(n,{size:16}),r])}((({paymaster:e,paymasterVerificationGasLimit:t,paymasterPostOpGasLimit:n,paymasterData:r})=>({paymaster:e,paymasterVerificationGasLimit:t,paymasterPostOpGasLimit:n,paymasterData:r}))(e)):"0x";return To([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"}],[e.sender,pi(e.nonce),ns(t),ns(e.callData),n,pi(e.preVerificationGas),r,ns(a)])};function Xy(e){return os(Object.values(e).map((e=>Ka(e,{size:16}))))}const Yy="0.6.0",Qy={"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=To([{type:"bytes32"},{type:"address"},{type:"uint256"}],[ns(Ky(e)),t,BigInt(n)]);return ns(r)},packUserOperation:Ky},"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=To([{type:"bytes32"},{type:"address"},{type:"uint256"}],[ns(Jy(e)),t,BigInt(n)]);return ns(r)},packUserOperation:Jy}};function eb(e,t){const{version:n=Yy,addressOverride:r}=t??{version:Yy},a=Qy[n??Yy],i=r??a.address[e.id]??a.address.default;if(!i)throw new Wy(e,n);if("0.6.0"===a.version)return{version:a.version,address:i,chain:e,abi:a.abi,getUserOperationHash:t=>a.getUserOperationHash(t,i,e.id),packUserOperation:a.packUserOperation};if("0.7.0"===a.version)return{version:a.version,address:i,chain:e,abi:a.abi,getUserOperationHash:t=>a.getUserOperationHash(t,i,e.id),packUserOperation:a.packUserOperation};throw new Wy(e,n)}class tb extends Gy{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 nb extends Gy{constructor(){super("getCounterFactualAddress failed"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"GetCounterFactualAddressError"})}}class rb extends Gy{constructor(e){super(`Upgrades are not supported by ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UpgradesNotSupported"})}}class ab extends Gy{constructor(){super("SignTransaction is not supported by smart contracts"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignTransactionNotSupported"})}}class ib extends Gy{constructor(e,t){super(`Failed to get storage slot ${e} (${t})`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FailedToGetStorageSlotError"})}}class sb extends Gy{constructor(e){super(`Batch execution is not supported by ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BatchExecutionNotSupportedError"})}}var ob;!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"}(ob||(ob={}));class cb{static setLogLevel(e){this.logLevel=e}static setLogFilter(e){this.logFilter=e}static error(e,...t){this.shouldLog(e,ob.ERROR)&&console.error(e,...t)}static warn(e,...t){this.shouldLog(e,ob.WARN)&&console.warn(e,...t)}static debug(e,...t){this.shouldLog(e,ob.DEBUG)&&console.debug(e,...t)}static info(e,...t){this.shouldLog(e,ob.INFO)&&console.info(e,...t)}static verbose(e,...t){this.shouldLog(e,ob.VERBOSE)&&console.log(e,...t)}static shouldLog(e,t){return!(this.logLevel<t)&&!(this.logFilter&&!e.includes(this.logFilter))}}Object.defineProperty(cb,"logLevel",{enumerable:!0,configurable:!0,writable:!0,value:ob.INFO});const lb=({factoryAddress:e,factoryCalldata:t,signature:n})=>os([To(Hs("address, bytes, bytes"),[e,t,n]),"0x6492649264926492649264926492649264926492649264926492649264926492"]);var ub,db;!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}(ub||(ub={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(db||(db={}));const pb=ub.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hb=e=>{switch(typeof e){case"undefined":return pb.undefined;case"string":return pb.string;case"number":return isNaN(e)?pb.nan:pb.number;case"boolean":return pb.boolean;case"function":return pb.function;case"bigint":return pb.bigint;case"symbol":return pb.symbol;case"object":return Array.isArray(e)?pb.array:null===e?pb.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?pb.promise:"undefined"!=typeof Map&&e instanceof Map?pb.map:"undefined"!=typeof Set&&e instanceof Set?pb.set:"undefined"!=typeof Date&&e instanceof Date?pb.date:pb.object;default:return pb.unknown}},mb=ub.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 fb 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,ub.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()}}fb.create=e=>new fb(e);const yb=(e,t)=>{let n;switch(e.code){case mb.invalid_type:n=e.received===pb.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case mb.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ub.jsonStringifyReplacer)}`;break;case mb.unrecognized_keys:n=`Unrecognized key(s) in object: ${ub.joinValues(e.keys,", ")}`;break;case mb.invalid_union:n="Invalid input";break;case mb.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ub.joinValues(e.options)}`;break;case mb.invalid_enum_value:n=`Invalid enum value. Expected ${ub.joinValues(e.options)}, received '${e.received}'`;break;case mb.invalid_arguments:n="Invalid function arguments";break;case mb.invalid_return_type:n="Invalid function return type";break;case mb.invalid_date:n="Invalid date";break;case mb.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}"`:ub.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case mb.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 mb.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 mb.custom:n="Invalid input";break;case mb.invalid_intersection_types:n="Intersection results could not be merged";break;case mb.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case mb.not_finite:n="Number must be finite";break;default:n=t.defaultError,ub.assertNever(e)}return{message:n}};let bb=yb;function gb(){return bb}const vb=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],s={...a,path:i};let o="";const c=r.filter((e=>!!e)).slice().reverse();for(const e of c)o=e(s,{data:t,defaultError:o}).message;return{...a,path:i,message:a.message||o}};function wb(e,t){const n=vb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,gb(),yb].filter((e=>!!e))});e.common.issues.push(n)}class Cb{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 xb;"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 Cb.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 xb;if("aborted"===a.status)return xb;"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 xb=Object.freeze({status:"aborted"}),Eb=e=>({status:"dirty",value:e}),kb=e=>({status:"valid",value:e}),Tb=e=>"aborted"===e.status,Pb=e=>"dirty"===e.status,Ab=e=>"valid"===e.status,_b=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Db;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Db||(Db={}));class Ob{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 Fb=(e,t)=>{if(Ab(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 fb(e.common.issues);return this._error=t,this._error}}};function Sb(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 Ib{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 hb(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:hb(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Cb,ctx:{common:e.parent.common,data:e.data,parsedType:hb(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(_b(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:hb(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Fb(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:hb(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(_b(r)?r:Promise.resolve(r));return Fb(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),i=()=>r.addIssue({code:mb.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(i(),!1))):!!a||(i(),!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 Cg({schema:this,typeName:Ig.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return xg.create(this,this._def)}nullable(){return Eg.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ng.create(this,this._def)}promise(){return wg.create(this,this._def)}or(e){return ig.create([this,e],this._def)}and(e){return lg.create(this,e,this._def)}transform(e){return new Cg({...Sb(this._def),schema:this,typeName:Ig.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new kg({...Sb(this._def),innerType:this,defaultValue:t,typeName:Ig.ZodDefault})}brand(){return new _g({typeName:Ig.ZodBranded,type:this,...Sb(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Tg({...Sb(this._def),innerType:this,catchValue:t,typeName:Ig.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Dg.create(this,e)}readonly(){return Og.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Mb=/^c[^\s-]{8,}$/i,Nb=/^[a-z][a-z0-9]*$/,Ub=/^[0-9A-HJKMNP-TV-Z]{26}$/,Lb=/^[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,Bb=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Rb;const jb=/^(((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}))$/,Gb=/^(([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 zb(e,t){return!("v4"!==t&&t||!jb.test(e))||!("v6"!==t&&t||!Gb.test(e))}class $b extends Ib{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==pb.string){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.string,received:t.parsedType}),xb}const t=new Cb;let n;for(const a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),wb(n,{code:mb.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),wb(n,{code:mb.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,i=e.data.length<a.value;(r||i)&&(n=this._getOrReturnCtx(e,n),r?wb(n,{code:mb.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&wb(n,{code:mb.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)Bb.test(e.data)||(n=this._getOrReturnCtx(e,n),wb(n,{validation:"email",code:mb.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)Rb||(Rb=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Rb.test(e.data)||(n=this._getOrReturnCtx(e,n),wb(n,{validation:"emoji",code:mb.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)Lb.test(e.data)||(n=this._getOrReturnCtx(e,n),wb(n,{validation:"uuid",code:mb.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)Mb.test(e.data)||(n=this._getOrReturnCtx(e,n),wb(n,{validation:"cuid",code:mb.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)Nb.test(e.data)||(n=this._getOrReturnCtx(e,n),wb(n,{validation:"cuid2",code:mb.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)Ub.test(e.data)||(n=this._getOrReturnCtx(e,n),wb(n,{validation:"ulid",code:mb.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),wb(n,{validation:"url",code:mb.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),wb(n,{validation:"regex",code:mb.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),wb(n,{code:mb.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),wb(n,{code:mb.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),wb(n,{code:mb.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),wb(n,{code:mb.invalid_string,validation:"datetime",message:a.message}),t.dirty())}else"ip"===a.kind?zb(e.data,a.version)||(n=this._getOrReturnCtx(e,n),wb(n,{validation:"ip",code:mb.invalid_string,message:a.message}),t.dirty()):ub.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:mb.invalid_string,...Db.errToObj(n)})}_addCheck(e){return new $b({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Db.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Db.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Db.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Db.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Db.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Db.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Db.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Db.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,...Db.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Db.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...Db.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Db.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Db.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Db.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Db.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Db.errToObj(t)})}nonempty(e){return this.min(1,Db.errToObj(e))}trim(){return new $b({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new $b({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new $b({...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 Hb(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)}$b.create=e=>{var t;return new $b({checks:[],typeName:Ig.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Sb(e)})};class qb extends Ib{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)!==pb.number){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.number,received:t.parsedType}),xb}let t;const n=new Cb;for(const r of this._def.checks)if("int"===r.kind)ub.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),wb(t,{code:mb.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),wb(t,{code:mb.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),wb(t,{code:mb.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Hb(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),wb(t,{code:mb.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),wb(t,{code:mb.not_finite,message:r.message}),n.dirty()):ub.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Db.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Db.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Db.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Db.toString(t))}setLimit(e,t,n,r){return new qb({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Db.toString(r)}]})}_addCheck(e){return new qb({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Db.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Db.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Db.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Db.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Db.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Db.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Db.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Db.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Db.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&&ub.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)}}qb.create=e=>new qb({checks:[],typeName:Ig.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Sb(e)});class Vb extends Ib{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)!==pb.bigint){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.bigint,received:t.parsedType}),xb}let t;const n=new Cb;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),wb(t,{code:mb.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),wb(t,{code:mb.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),wb(t,{code:mb.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):ub.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Db.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Db.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Db.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Db.toString(t))}setLimit(e,t,n,r){return new Vb({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Db.toString(r)}]})}_addCheck(e){return new Vb({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Db.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Db.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Db.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Db.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Db.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}}Vb.create=e=>{var t;return new Vb({checks:[],typeName:Ig.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Sb(e)})};class Wb extends Ib{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==pb.boolean){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.boolean,received:t.parsedType}),xb}return kb(e.data)}}Wb.create=e=>new Wb({typeName:Ig.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Sb(e)});class Zb extends Ib{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==pb.date){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.date,received:t.parsedType}),xb}if(isNaN(e.data.getTime())){return wb(this._getOrReturnCtx(e),{code:mb.invalid_date}),xb}const t=new Cb;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),wb(n,{code:mb.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),wb(n,{code:mb.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):ub.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Zb({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Db.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Db.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}}Zb.create=e=>new Zb({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ig.ZodDate,...Sb(e)});class Kb extends Ib{_parse(e){if(this._getType(e)!==pb.symbol){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.symbol,received:t.parsedType}),xb}return kb(e.data)}}Kb.create=e=>new Kb({typeName:Ig.ZodSymbol,...Sb(e)});class Jb extends Ib{_parse(e){if(this._getType(e)!==pb.undefined){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.undefined,received:t.parsedType}),xb}return kb(e.data)}}Jb.create=e=>new Jb({typeName:Ig.ZodUndefined,...Sb(e)});class Xb extends Ib{_parse(e){if(this._getType(e)!==pb.null){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.null,received:t.parsedType}),xb}return kb(e.data)}}Xb.create=e=>new Xb({typeName:Ig.ZodNull,...Sb(e)});class Yb extends Ib{constructor(){super(...arguments),this._any=!0}_parse(e){return kb(e.data)}}Yb.create=e=>new Yb({typeName:Ig.ZodAny,...Sb(e)});class Qb extends Ib{constructor(){super(...arguments),this._unknown=!0}_parse(e){return kb(e.data)}}Qb.create=e=>new Qb({typeName:Ig.ZodUnknown,...Sb(e)});class eg extends Ib{_parse(e){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.never,received:t.parsedType}),xb}}eg.create=e=>new eg({typeName:Ig.ZodNever,...Sb(e)});class tg extends Ib{_parse(e){if(this._getType(e)!==pb.undefined){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.void,received:t.parsedType}),xb}return kb(e.data)}}tg.create=e=>new tg({typeName:Ig.ZodVoid,...Sb(e)});class ng extends Ib{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==pb.array)return wb(t,{code:mb.invalid_type,expected:pb.array,received:t.parsedType}),xb;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(wb(t,{code:e?mb.too_big:mb.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&&(wb(t,{code:mb.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&&(wb(t,{code:mb.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 Ob(t,e,t.path,n))))).then((e=>Cb.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>r.type._parseSync(new Ob(t,e,t.path,n))));return Cb.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new ng({...this._def,minLength:{value:e,message:Db.toString(t)}})}max(e,t){return new ng({...this._def,maxLength:{value:e,message:Db.toString(t)}})}length(e,t){return new ng({...this._def,exactLength:{value:e,message:Db.toString(t)}})}nonempty(e){return this.min(1,e)}}function rg(e){if(e instanceof ag){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=xg.create(rg(r))}return new ag({...e._def,shape:()=>t})}return e instanceof ng?new ng({...e._def,type:rg(e.element)}):e instanceof xg?xg.create(rg(e.unwrap())):e instanceof Eg?Eg.create(rg(e.unwrap())):e instanceof ug?ug.create(e.items.map((e=>rg(e)))):e}ng.create=(e,t)=>new ng({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ig.ZodArray,...Sb(t)});class ag extends Ib{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=ub.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==pb.object){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.object,received:t.parsedType}),xb}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof eg&&"strip"===this._def.unknownKeys))for(const e in n.data)a.includes(e)||i.push(e);const s=[];for(const e of a){const t=r[e],a=n.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new Ob(n,a,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof eg){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)s.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&(wb(n,{code:mb.unrecognized_keys,keys:i}),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 i){const r=n.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new Ob(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of s){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>Cb.mergeObjectSync(t,e))):Cb.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return Db.errToObj,new ag({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,a,i,s;const o=null!==(i=null===(a=(r=this._def).errorMap)||void 0===a?void 0:a.call(r,t,n).message)&&void 0!==i?i:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(s=Db.errToObj(e).message)&&void 0!==s?s:o}:{message:o}}}:{}})}strip(){return new ag({...this._def,unknownKeys:"strip"})}passthrough(){return new ag({...this._def,unknownKeys:"passthrough"})}extend(e){return new ag({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ag({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ig.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ag({...this._def,catchall:e})}pick(e){const t={};return ub.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new ag({...this._def,shape:()=>t})}omit(e){const t={};return ub.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new ag({...this._def,shape:()=>t})}deepPartial(){return rg(this)}partial(e){const t={};return ub.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new ag({...this._def,shape:()=>t})}required(e){const t={};return ub.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof xg;)e=e._def.innerType;t[n]=e}})),new ag({...this._def,shape:()=>t})}keyof(){return bg(ub.objectKeys(this.shape))}}ag.create=(e,t)=>new ag({shape:()=>e,unknownKeys:"strip",catchall:eg.create(),typeName:Ig.ZodObject,...Sb(t)}),ag.strictCreate=(e,t)=>new ag({shape:()=>e,unknownKeys:"strict",catchall:eg.create(),typeName:Ig.ZodObject,...Sb(t)}),ag.lazycreate=(e,t)=>new ag({shape:e,unknownKeys:"strip",catchall:eg.create(),typeName:Ig.ZodObject,...Sb(t)});class ig extends Ib{_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 fb(e.ctx.common.issues)));return wb(t,{code:mb.invalid_union,unionErrors:n}),xb}));{let e;const r=[];for(const a of n){const n={...t,common:{...t.common,issues:[]},parent:null},i=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,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 fb(e)));return wb(t,{code:mb.invalid_union,unionErrors:a}),xb}}get options(){return this._def.options}}ig.create=(e,t)=>new ig({options:e,typeName:Ig.ZodUnion,...Sb(t)});const sg=e=>e instanceof fg?sg(e.schema):e instanceof Cg?sg(e.innerType()):e instanceof yg?[e.value]:e instanceof gg?e.options:e instanceof vg?Object.keys(e.enum):e instanceof kg?sg(e._def.innerType):e instanceof Jb?[void 0]:e instanceof Xb?[null]:null;class og extends Ib{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==pb.object)return wb(t,{code:mb.invalid_type,expected:pb.object,received:t.parsedType}),xb;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}):(wb(t,{code:mb.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),xb)}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=sg(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 og({typeName:Ig.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Sb(n)})}}function cg(e,t){const n=hb(e),r=hb(t);if(e===t)return{valid:!0,data:e};if(n===pb.object&&r===pb.object){const n=ub.objectKeys(t),r=ub.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const n of r){const r=cg(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}if(n===pb.array&&r===pb.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const a=cg(e[r],t[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return n===pb.date&&r===pb.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class lg extends Ib{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Tb(e)||Tb(r))return xb;const a=cg(e.value,r.value);return a.valid?((Pb(e)||Pb(r))&&t.dirty(),{status:t.value,value:a.data}):(wb(n,{code:mb.invalid_intersection_types}),xb)};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}))}}lg.create=(e,t,n)=>new lg({left:e,right:t,typeName:Ig.ZodIntersection,...Sb(n)});class ug extends Ib{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==pb.array)return wb(n,{code:mb.invalid_type,expected:pb.array,received:n.parsedType}),xb;if(n.data.length<this._def.items.length)return wb(n,{code:mb.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xb;!this._def.rest&&n.data.length>this._def.items.length&&(wb(n,{code:mb.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 Ob(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Cb.mergeArray(t,e))):Cb.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new ug({...this._def,rest:e})}}ug.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ug({items:e,typeName:Ig.ZodTuple,rest:null,...Sb(t)})};class dg extends Ib{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!==pb.object)return wb(n,{code:mb.invalid_type,expected:pb.object,received:n.parsedType}),xb;const r=[],a=this._def.keyType,i=this._def.valueType;for(const e in n.data)r.push({key:a._parse(new Ob(n,e,n.path,e)),value:i._parse(new Ob(n,n.data[e],n.path,e))});return n.common.async?Cb.mergeObjectAsync(t,r):Cb.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new dg(t instanceof Ib?{keyType:e,valueType:t,typeName:Ig.ZodRecord,...Sb(n)}:{keyType:$b.create(),valueType:e,typeName:Ig.ZodRecord,...Sb(t)})}}class pg extends Ib{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!==pb.map)return wb(n,{code:mb.invalid_type,expected:pb.map,received:n.parsedType}),xb;const r=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map((([e,t],i)=>({key:r._parse(new Ob(n,e,n.path,[i,"key"])),value:a._parse(new Ob(n,t,n.path,[i,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of i){const r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return xb;"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 i){const r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return xb;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}pg.create=(e,t,n)=>new pg({valueType:t,keyType:e,typeName:Ig.ZodMap,...Sb(n)});class hg extends Ib{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==pb.set)return wb(n,{code:mb.invalid_type,expected:pb.set,received:n.parsedType}),xb;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(wb(n,{code:mb.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&&(wb(n,{code:mb.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const a=this._def.valueType;function i(e){const n=new Set;for(const r of e){if("aborted"===r.status)return xb;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const s=[...n.data.values()].map(((e,t)=>a._parse(new Ob(n,e,n.path,t))));return n.common.async?Promise.all(s).then((e=>i(e))):i(s)}min(e,t){return new hg({...this._def,minSize:{value:e,message:Db.toString(t)}})}max(e,t){return new hg({...this._def,maxSize:{value:e,message:Db.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}hg.create=(e,t)=>new hg({valueType:e,minSize:null,maxSize:null,typeName:Ig.ZodSet,...Sb(t)});class mg extends Ib{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==pb.function)return wb(t,{code:mb.invalid_type,expected:pb.function,received:t.parsedType}),xb;function n(e,n){return vb({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,gb(),yb].filter((e=>!!e)),issueData:{code:mb.invalid_arguments,argumentsError:n}})}function r(e,n){return vb({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,gb(),yb].filter((e=>!!e)),issueData:{code:mb.invalid_return_type,returnTypeError:n}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof wg){const e=this;return kb((async function(...t){const s=new fb([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw s.addIssue(n(t,e)),s})),c=await Reflect.apply(i,this,o),l=await e._def.returns._def.type.parseAsync(c,a).catch((e=>{throw s.addIssue(r(c,e)),s}));return l}))}{const e=this;return kb((function(...t){const s=e._def.args.safeParse(t,a);if(!s.success)throw new fb([n(t,s.error)]);const o=Reflect.apply(i,this,s.data),c=e._def.returns.safeParse(o,a);if(!c.success)throw new fb([r(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mg({...this._def,args:ug.create(e).rest(Qb.create())})}returns(e){return new mg({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new mg({args:e||ug.create([]).rest(Qb.create()),returns:t||Qb.create(),typeName:Ig.ZodFunction,...Sb(n)})}}class fg extends Ib{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})}}fg.create=(e,t)=>new fg({getter:e,typeName:Ig.ZodLazy,...Sb(t)});class yg extends Ib{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return wb(t,{received:t.data,code:mb.invalid_literal,expected:this._def.value}),xb}return{status:"valid",value:e.data}}get value(){return this._def.value}}function bg(e,t){return new gg({values:e,typeName:Ig.ZodEnum,...Sb(t)})}yg.create=(e,t)=>new yg({value:e,typeName:Ig.ZodLiteral,...Sb(t)});class gg extends Ib{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return wb(t,{expected:ub.joinValues(n),received:t.parsedType,code:mb.invalid_type}),xb}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return wb(t,{received:t.data,code:mb.invalid_enum_value,options:n}),xb}return kb(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 gg.create(e)}exclude(e){return gg.create(this.options.filter((t=>!e.includes(t))))}}gg.create=bg;class vg extends Ib{_parse(e){const t=ub.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==pb.string&&n.parsedType!==pb.number){const e=ub.objectValues(t);return wb(n,{expected:ub.joinValues(e),received:n.parsedType,code:mb.invalid_type}),xb}if(-1===t.indexOf(e.data)){const e=ub.objectValues(t);return wb(n,{received:n.data,code:mb.invalid_enum_value,options:e}),xb}return kb(e.data)}get enum(){return this._def.values}}vg.create=(e,t)=>new vg({values:e,typeName:Ig.ZodNativeEnum,...Sb(t)});class wg extends Ib{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==pb.promise&&!1===t.common.async)return wb(t,{code:mb.invalid_type,expected:pb.promise,received:t.parsedType}),xb;const n=t.parsedType===pb.promise?t.data:Promise.resolve(t.data);return kb(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}wg.create=(e,t)=>new wg({type:e,typeName:Ig.ZodPromise,...Sb(t)});class Cg extends Ib{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ig.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=>{wb(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?xb:("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?xb:("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(!Ab(e))return e;const i=r.transform(e.value,a);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>Ab(e)?Promise.resolve(r.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}ub.assertNever(r)}}Cg.create=(e,t,n)=>new Cg({schema:e,typeName:Ig.ZodEffects,effect:t,...Sb(n)}),Cg.createWithPreprocess=(e,t,n)=>new Cg({schema:t,effect:{type:"preprocess",transform:e},typeName:Ig.ZodEffects,...Sb(n)});class xg extends Ib{_parse(e){return this._getType(e)===pb.undefined?kb(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}xg.create=(e,t)=>new xg({innerType:e,typeName:Ig.ZodOptional,...Sb(t)});class Eg extends Ib{_parse(e){return this._getType(e)===pb.null?kb(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Eg.create=(e,t)=>new Eg({innerType:e,typeName:Ig.ZodNullable,...Sb(t)});class kg extends Ib{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===pb.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}kg.create=(e,t)=>new kg({innerType:e,typeName:Ig.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Sb(t)});class Tg extends Ib{_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 _b(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new fb(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new fb(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Tg.create=(e,t)=>new Tg({innerType:e,typeName:Ig.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Sb(t)});class Pg extends Ib{_parse(e){if(this._getType(e)!==pb.nan){const t=this._getOrReturnCtx(e);return wb(t,{code:mb.invalid_type,expected:pb.nan,received:t.parsedType}),xb}return{status:"valid",value:e.data}}}Pg.create=e=>new Pg({typeName:Ig.ZodNaN,...Sb(e)});const Ag=Symbol("zod_brand");class _g extends Ib{_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 Dg extends Ib{_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?xb:"dirty"===e.status?(t.dirty(),Eb(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?xb:"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 Dg({in:e,out:t,typeName:Ig.ZodPipeline})}}class Og extends Ib{_parse(e){const t=this._def.innerType._parse(e);return Ab(t)&&(t.value=Object.freeze(t.value)),t}}Og.create=(e,t)=>new Og({innerType:e,typeName:Ig.ZodReadonly,...Sb(t)});const Fg=(e,t={},n)=>e?Yb.create().superRefine(((r,a)=>{var i,s;if(!e(r)){const e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,o=null===(s=null!==(i=e.fatal)&&void 0!==i?i:n)||void 0===s||s,c="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...c,fatal:o})}})):Yb.create(),Sg={object:ag.lazycreate};var Ig;!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"}(Ig||(Ig={}));const Mg=$b.create,Ng=qb.create,Ug=Pg.create,Lg=Vb.create,Bg=Wb.create,Rg=Zb.create,jg=Kb.create,Gg=Jb.create,zg=Xb.create,$g=Yb.create,Hg=Qb.create,qg=eg.create,Vg=tg.create,Wg=ng.create,Zg=ag.create,Kg=ag.strictCreate,Jg=ig.create,Xg=og.create,Yg=lg.create,Qg=ug.create,ev=dg.create,tv=pg.create,nv=hg.create,rv=mg.create,av=fg.create,iv=yg.create,sv=gg.create,ov=vg.create,cv=wg.create,lv=Cg.create,uv=xg.create,dv=Eg.create,pv=Cg.createWithPreprocess,hv=Dg.create,mv={string:e=>$b.create({...e,coerce:!0}),number:e=>qb.create({...e,coerce:!0}),boolean:e=>Wb.create({...e,coerce:!0}),bigint:e=>Vb.create({...e,coerce:!0}),date:e=>Zb.create({...e,coerce:!0})},fv=xb;var yv=Object.freeze({__proto__:null,defaultErrorMap:yb,setErrorMap:function(e){bb=e},getErrorMap:gb,makeIssue:vb,EMPTY_PATH:[],addIssueToContext:wb,ParseStatus:Cb,INVALID:xb,DIRTY:Eb,OK:kb,isAborted:Tb,isDirty:Pb,isValid:Ab,isAsync:_b,get util(){return ub},get objectUtil(){return db},ZodParsedType:pb,getParsedType:hb,ZodType:Ib,ZodString:$b,ZodNumber:qb,ZodBigInt:Vb,ZodBoolean:Wb,ZodDate:Zb,ZodSymbol:Kb,ZodUndefined:Jb,ZodNull:Xb,ZodAny:Yb,ZodUnknown:Qb,ZodNever:eg,ZodVoid:tg,ZodArray:ng,ZodObject:ag,ZodUnion:ig,ZodDiscriminatedUnion:og,ZodIntersection:lg,ZodTuple:ug,ZodRecord:dg,ZodMap:pg,ZodSet:hg,ZodFunction:mg,ZodLazy:fg,ZodLiteral:yg,ZodEnum:gg,ZodNativeEnum:vg,ZodPromise:wg,ZodEffects:Cg,ZodTransformer:Cg,ZodOptional:xg,ZodNullable:Eg,ZodDefault:kg,ZodCatch:Tg,ZodNaN:Pg,BRAND:Ag,ZodBranded:_g,ZodPipeline:Dg,ZodReadonly:Og,custom:Fg,Schema:Ib,ZodSchema:Ib,late:Sg,get ZodFirstPartyTypeKind(){return Ig},coerce:mv,any:$g,array:Wg,bigint:Lg,boolean:Bg,date:Rg,discriminatedUnion:Xg,effect:lv,enum:sv,function:rv,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Fg((t=>t instanceof e),t),intersection:Yg,lazy:av,literal:iv,map:tv,nan:Ug,nativeEnum:ov,never:qg,null:zg,nullable:dv,number:Ng,object:Zg,oboolean:()=>Bg().optional(),onumber:()=>Ng().optional(),optional:uv,ostring:()=>Mg().optional(),pipeline:hv,preprocess:pv,promise:cv,record:ev,set:nv,strictObject:Kg,string:Mg,symbol:jg,transformer:lv,tuple:Qg,undefined:Gg,union:Jg,unknown:Hg,void:Vg,NEVER:fv,ZodIssueCode:mb,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:fb});const bv={...hp,rpcUrls:{...hp.rpcUrls,alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"]}}},gv={...mp,rpcUrls:{...mp.rpcUrls,alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"]}}},vv={...vp,rpcUrls:{...vp.rpcUrls,alchemy:{http:["https://arb-sepolia.g.alchemy.com/v2"]}}},wv={...Wh,rpcUrls:{...Wh.rpcUrls,alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"]}}},Cv={...wm,rpcUrls:{...wm.rpcUrls,alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"]}}},xv={...Km,rpcUrls:{...Km.rpcUrls,alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"]}}},Ev={...Jm,rpcUrls:{...Jm.rpcUrls,alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"]}}},kv={...Ym,rpcUrls:{...Ym.rpcUrls,alchemy:{http:["https://opt-sepolia.g.alchemy.com/v2"]}}},Tv={...If,rpcUrls:{...If.rpcUrls,alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"]}}},Pv={...Ap,rpcUrls:{...Ap.rpcUrls,alchemy:{http:["https://base-mainnet.g.alchemy.com/v2"]}}},Av={..._p,rpcUrls:{..._p.rpcUrls,alchemy:{http:["https://base-goerli.g.alchemy.com/v2"]}}},_v={...Op,rpcUrls:{...Op.rpcUrls,alchemy:{http:["https://base-sepolia.g.alchemy.com/v2"]}}},Dv={...hf,rpcUrls:{...hf.rpcUrls,alchemy:{http:["https://polygon-mumbai.g.alchemy.com/v2"]}}},Ov={...pf,rpcUrls:{...pf.rpcUrls,alchemy:{http:["https://polygon-amoy.g.alchemy.com/v2"]}}},Fv={...df,rpcUrls:{...df.rpcUrls,alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"]}}},Sv={...Lh,rpcUrls:{...Lh.rpcUrls}},Iv=Ma({id:2523,name:"Fraxtal Sepolia",nativeCurrency:{name:"Frax Ether",symbol:"frxETH",decimals:18},rpcUrls:{default:{http:["https://rpc.testnet-sepolia.frax.com"]}}}),Mv={...Ny,rpcUrls:{...Ny.rpcUrls}},Nv={...Ly,rpcUrls:{...Ly.rpcUrls}};var Uv=Object.freeze({__proto__:null,arbitrum:bv,arbitrumGoerli:gv,arbitrumSepolia:vv,goerli:wv,mainnet:Cv,optimism:xv,optimismGoerli:Ev,optimismSepolia:kv,sepolia:Tv,base:Pv,baseGoerli:Av,baseSepolia:_v,polygonMumbai:Dv,polygonAmoy:Ov,polygon:Fv,fraxtal:Sv,fraxtalSepolia:Iv,zora:Mv,zoraSepolia:Nv});const Lv=yv.custom((e=>null!=e&&"object"==typeof e&&"id"in e&&"number"==typeof e.id)),Bv=yv.custom((e=>$a(e,{strict:!0}))),Rv=yv.union([Bv,yv.number(),yv.bigint()]),jv=yv.object({min:Rv.optional(),max:Rv.optional()}).strict(),Gv=yv.object({multiplier:yv.number().refine((e=>(e.toString().split(".")[1]?.length??0)<=4),{message:"Max precision is 4 decimal places"})}).strict();function zv(e){return null!=e&&Rv.safeParse(e).success}function $v(e){return null!=e&&Gv.safeParse(e).success}const Hv=(...e)=>{if(!e.length)throw new Error("bigIntMax requires at least one argument");return e.reduce(((e,t)=>e>t?e:t))},qv=(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 Vv;!function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_UP=1]="ROUND_UP"}(Vv||(Vv={}));const Wv=(e,t,n=Vv.ROUND_UP)=>{if(!$v({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===Vv.ROUND_UP?BigInt(e)*BigInt(t*10**r)+BigInt(10**r-1):BigInt(e)*BigInt(t*10**r))/BigInt(10**r)},Zv=(e,t={})=>{const{offset:n,count:r}=t,a=2+(n?2*n:0),i=r?a+2*r:void 0;return`0x${e.slice(a,i)}`},Kv=new Map([[bv.id,10000000n],[gv.id,10000000n],[vv.id,10000000n]]),Jv=e=>({maxPriorityFeePerGas:{min:Kv.get(e.id)??100000000n,multiplier:1.33}});function Xv(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 ow(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 ow(null==e.factory,null==e.factoryData)}(e)}function Yv(e,t,n){return null!=e&&null!=t?function(e,t){return null==t?e:zv(t)?t:null!=e?Wv(e,t.multiplier):e}(e,t):function(e,t){return null==t?e:null!=e?qv(t.multiplier?Wv(e,t.multiplier):e,t.min,t.max):t.min??0n}(e,n)}const Qv=e=>!!e&&("paymasterAndData"in e||"paymasterData"in e),ew=e=>void 0!==e&&("paymasterAndData"in e&&"0x"===e.paymasterAndData||"paymasterData"in e&&"0x"===e.paymasterData),tw=({paymaster:e="0x",paymasterData:t="0x"})=>os([e,t]),nw=new Map(Object.values(Uv).map((e=>[e.id,e]))),rw=e=>{for(const t of Object.values(Ry))if(t.id===e)return nw.get(t.id)??t;throw new Error("could not find chain")};async function aw(e){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return sw((await Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{}))}function iw(e){if("function"!=typeof e)return null==e||"string"==typeof e||"boolean"==typeof e?e:"bigint"==typeof e?Ya(e):null!=e._isBigNumber||"object"!=typeof e?Ya(e).replace(/^0x0/,"0x"):Array.isArray(e)?e.map((e=>iw(e))):Object.keys(e).reduce(((t,n)=>({...t,[n]:iw(e[n])})),{})}function sw(e){for(const t in e)null==e[t]&&delete e[t];return e}const ow=(...e)=>{if(0===e.length)throw new Error("no values passed in");return e.every((t=>t===e[0]))},cw=(e,t)=>e.then((e=>e?t():void 0)),lw=yv.union([yv.object({rpcUrl:yv.never().optional(),apiKey:yv.string(),jwt:yv.never().optional()}),yv.object({rpcUrl:yv.never().optional(),apiKey:yv.never().optional(),jwt:yv.string()}),yv.object({rpcUrl:yv.string(),apiKey:yv.never().optional(),jwt:yv.never().optional()}),yv.object({rpcUrl:yv.string(),apiKey:yv.never().optional(),jwt:yv.string()})]),uw=jv.merge(Gv).partial(),dw=yv.object({maxFeePerGas:uw,maxPriorityFeePerGas:uw,callGasLimit:uw,verificationGasLimit:uw,preVerificationGas:uw}).partial().strict().extend({paymasterVerificationGasLimit:uw,paymasterPostOpGasLimit:uw}).partial().strict(),pw=yv.object({txMaxRetries:yv.number().min(0).optional().default(5),txRetryIntervalMs:yv.number().min(0).optional().default(2e3),txRetryMultiplier:yv.number().min(0).optional().default(1.5),feeOptions:dw.optional()}).strict();var hw;function mw(e){if("string"==typeof e){if(!ss(e,{strict:!1}))throw new Ti({address:e});return{address:e,type:"json-rpc"}}if(!ss(e.address,{strict:!1}))throw new Ti({address:e.address});return{address:e.address,signMessage:e.signMessage,signTransaction:e.signTransaction,signTypedData:e.signTypedData,source:"custom",type:"local"}}yv.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"}(hw||(hw={}));const fw=e=>"getSigner"in e,yw=e=>[`0x${e.substring(2,42)}`,`0x${e.substring(42)}`],bw=async({client:e,entryPoint:t,accountAddress:n,getAccountInitCode:r})=>{if(n)return n;const a=Pu({address:t.address,abi:t.abi,client:e}),i=await r();cb.verbose("[BaseSmartContractAccount](getAddress) initCode: ",i);try{await a.simulate.getSenderAddress([i])}catch(e){if(cb.verbose("[BaseSmartContractAccount](getAddress) getSenderAddress err: ",e),"SenderAddressResult"===e.cause?.data?.errorName)return cb.verbose("[BaseSmartContractAccount](getAddress) entryPoint.getSenderAddress result:",e.cause.data.args[0]),e.cause.data.args[0];if("Invalid URL"===e.details)throw new $y}throw new nb};class gw extends Gy{constructor(){super("Transaction is missing `to` address set on request"),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionMissingToParamError"})}}class vw extends Gy{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 ww(e,t,n,r){const{account:a=e.account,...i}=t;if(!a||"string"==typeof a)throw new tb;if(!i.to)throw new gw;if(!Mw(e))throw new zy("BaseSmartAccountClient","buildUserOperationFromTx",e);const s={...n,maxFeePerGas:i.maxFeePerGas?i.maxFeePerGas:void 0,maxPriorityFeePerGas:i.maxPriorityFeePerGas?i.maxPriorityFeePerGas:void 0};return Nw(e,{uo:{target:i.to,data:i.data??"0x",value:i.value?i.value:0n},account:a,context:r,overrides:s})}async function Cw(e,t){const{account:n=e.account,requests:r,overrides:a,context:i}=t;if(!n)throw new tb;if(!Mw(e))throw new zy("BaseSmartAccountClient","buildUserOperationFromTxs",e);const s=r.map((e=>{if(!e.to)throw new gw;return{target:e.to,data:e.data??"0x",value:e.value?di(e.value,"bigint"):0n}})),o=()=>r.filter((e=>null!=e.maxFeePerGas)).map((e=>di(e.maxFeePerGas,"bigint"))),c=()=>r.filter((e=>null!=e.maxPriorityFeePerGas)).map((e=>di(e.maxPriorityFeePerGas,"bigint"))),l={maxFeePerGas:null!=a?.maxFeePerGas?a?.maxFeePerGas:o().length>0?Hv(...o()):void 0,maxPriorityFeePerGas:null!=a?.maxPriorityFeePerGas?a?.maxPriorityFeePerGas:c().length>0?Hv(...c()):void 0};return{uoStruct:await Nw(e,{uo:s,account:n,context:i,overrides:l}),batch:s,overrides:l}}const xw=async e=>e,Ew=(...e)=>async(t,n)=>{let r=t;for(const t of e)r=await t(r,n);return r};async function kw(e,t){const{uo:n,overrides:r,account:a=e.account,context:i}=t;if(!a)throw new tb;const{dummyPaymasterAndData:s,paymasterAndData:o}=Qv(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:xw}:{dummyPaymasterAndData:e.middleware.dummyPaymasterAndData,paymasterAndData:e.middleware.paymasterAndData};return aw(await Ew(s,e.middleware.feeEstimator,e.middleware.gasEstimator,e.middleware.customMiddleware,o,e.middleware.userOperationSimulator)(n,{overrides:r,feeOptions:e.feeOptions,account:a,client:e,context:i}))}async function Tw(e,t){const{account:n=e.account,context:r}=t;if(!n)throw new tb;if(!Mw(e))throw new zy("BaseSmartAccountClient","signUserOperation",e);if(!e.chain)throw new Hy;return await e.middleware.signUserOperation(t.uoStruct,{...t,account:n,client:e,context:r}).then(aw).then(iw)}async function Pw(e,t){const{account:n=e.account,uoStruct:r,context:a,overrides:i}=t;if(!n)throw new tb;if(!e.chain)throw new Hy;const s=n.getEntryPoint(),o=await Tw(e,{uoStruct:r,account:n,context:a,overrides:i});return{hash:await e.sendRawUserOperation(o,s.address),request:o}}class Aw extends Gy{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 _w extends Gy{constructor(e,t){super(`Failed to find User Operation: ${t.message}`),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:e})}}const Dw=async(e,t)=>{if(!Mw(e))throw new zy("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 i=await e.getUserOperationReceipt(n).catch((e=>{cb.error(`[SmartAccountProvider] waitForUserOperationTransaction error fetching receipt for ${n}: ${e}`)}));if(i)return Yd(e,{hash:i.receipt.transactionHash}).then((e=>e.hash))}throw new vw(n)};async function Ow(e,t){const{account:n=e.account,context:r,overrides:a}=t;if(!n)throw new tb;if(!Mw(e))throw new zy("BaseSmartAccountClient","sendUserOperation",e);return Pw(e,{account:n,uoStruct:await Nw(e,{uo:t.uo,account:n,context:r,overrides:a}),context:r,overrides:a})}const Fw=e=>({buildUserOperation:t=>Nw(e,t),buildUserOperationFromTx:(t,n,r)=>ww(e,t,n,r),buildUserOperationFromTxs:t=>Cw(e,t),checkGasSponsorshipEligibility:t=>function(e,t){const{account:n=e.account,overrides:r,context:a}=t;if(!n)throw new tb;if(!Mw(e))throw new zy("BaseSmartAccountClient","checkGasSponsorshipEligibility",e);return Nw(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=>Tw(e,t),dropAndReplaceUserOperation:t=>async function(e,t){const{account:n=e.account,uoToDrop:r,overrides:a,context:i}=t;if(!n)throw new tb;if(!Mw(e))throw new zy("BaseSmartAccountClient","dropAndReplaceUserOperation",e);const s="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 kw(e,{uo:s,overrides:a,account:n}),l={...a,maxFeePerGas:Hv(BigInt(o??0n),Wv(r.maxFeePerGas,1.1)),maxPriorityFeePerGas:Hv(BigInt(c??0n),Wv(r.maxPriorityFeePerGas,1.1))};return Pw(e,{uoStruct:await kw(e,{uo:s,overrides:l,account:n}),account:n,context:i,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 tb;if(!t.to)throw new gw;if(!Mw(e))throw new zy("BaseSmartAccountClient","sendTransaction",e);const i=await ww(e,t,n,r),{hash:s,request:o}=await Pw(e,{account:a,uoStruct:i,context:r,overrides:n});return Dw(e,{hash:s}).catch((e=>{throw new _w(o,e)}))}(e,t,n,r),sendTransactions:t=>async function(e,t){const{requests:n,overrides:r,account:a=e.account,context:i}=t;if(!a)throw new tb;if(!Mw(e))throw new zy("BaseSmartAccountClient","sendTransactions",e);const{uoStruct:s}=await Cw(e,{requests:n,overrides:r,account:a,context:i}),{hash:o,request:c}=await Pw(e,{account:a,uoStruct:s,context:i,overrides:r});return Dw(e,{hash:o}).catch((e=>{throw new _w(c,e)}))}(e,t),sendUserOperation:t=>Ow(e,t),waitForUserOperationTransaction:t=>Dw.bind(e)(e,t),upgradeAccount:t=>(async(e,t)=>{const{account:n=e.account,upgradeTo:r,overrides:a,waitForTx:i,context:s}=t;if(!n)throw new tb;if(!Mw(e))throw new zy("BaseSmartAccountClient","upgradeAccount",e);const{implAddress:o,initializationData:c}=r,l=await n.encodeUpgradeToAndCall({upgradeToAddress:o,upgradeToInitData:c}),u=await Ow(e,{uo:{target:n.address,data:l},account:n,overrides:a,context:s});let d=u.hash;return i&&(d=await Dw(e,u)),d})(e,t),getAddress:t=>((e,t)=>{const{account:n}=t??{account:e.account};if(!n)throw new tb;return n.address})(e,t),signMessage:t=>(async(e,{account:t=e.account,message:n})=>{if(!t)throw new tb;return t.signMessage({message:n})})(e,t),signTypedData:t=>(async(e,{account:t=e.account,typedData:n})=>{if(!t)throw new tb;return t.signTypedData(n)})(e,t),signMessageWith6492:t=>(async(e,{account:t=e.account,message:n})=>{if(!t)throw new tb;return t.signMessageWith6492({message:n})})(e,t),signTypedDataWith6492:t=>(async(e,{account:t=e.account,typedData:n})=>{if(!t)throw new tb;return t.signTypedDataWith6492(n)})(e,t)}),Sw=Object.keys(Fw(void 0)).reduce(((e,t)=>(e.add(t),e)),new Set);function Iw(e){for(const t of Sw)if(!(t in e))return!1;return e&&"middleware"in e}function Mw(e){return e&&"middleware"in e}async function Nw(e,t){const{account:n=e.account,overrides:r,context:a}=t;if(!n)throw new tb;if(!Mw(e))throw new zy("BaseSmartAccountClient","buildUserOperation",e);return async function(e,t){const{account:n=e.account,uo:r,overrides:a}=t;if(!n)throw new tb;if(!e.chain)throw new Hy;const i=n.getEntryPoint(),s=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"===i.version?{initCode:n.getInitCode(),sender:n.address,nonce:c,callData:s,signature:o}:{factory:cw(n.isAccountDeployed().then((e=>!e)),n.getFactoryAddress),factoryData:cw(n.isAccountDeployed().then((e=>!e)),n.getFactoryData),sender:n.address,nonce:c,callData:s,signature:o}}(e,t).then((t=>kw(e,{uo:t,overrides:r,account:n,context:a})))}const Uw=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 i=await e.estimateMaxPriorityFeePerGas();i=Yv(i,n?.maxPriorityFeePerGas,r?.maxPriorityFeePerGas);let s=a.maxFeePerGas-a.maxPriorityFeePerGas+BigInt(i);return s=Yv(s,n?.maxFeePerGas,r?.maxFeePerGas),t.maxFeePerGas=s,t.maxPriorityFeePerGas=i,t},Lw=e=>async(t,{account:n,overrides:r,feeOptions:a})=>{const i=iw(await aw(t)),s=await e.estimateUserOperationGas(i,n.getEntryPoint().address,r?.stateOverride),o=Yv(s.callGasLimit,r?.callGasLimit,a?.callGasLimit),c=Yv(s.verificationGasLimit,r?.verificationGasLimit,a?.verificationGasLimit),l=Yv(s.preVerificationGas,r?.preVerificationGas,a?.preVerificationGas);t.callGasLimit=o,t.verificationGasLimit=c,t.preVerificationGas=l;if("0.7.0"===n.getEntryPoint().version){const e=Yv(s.paymasterVerificationGasLimit,r?.paymasterVerificationGasLimit,a?.paymasterVerificationGasLimit);t.paymasterVerificationGasLimit=e}return t},Bw=async(e,{account:t})=>("0.6.0"===t.getEntryPoint().version&&(e.paymasterAndData="0x"),e),Rw=async(e,{client:t,account:n=t.account})=>{if(!n)throw new tb;if(!t?.chain)throw new Hy;const r=await aw(e),a=iw(r);if(!Xv(a))throw new Aw(r);return{...r,signature:await n.signUserOperationHash(n.getEntryPoint().getUserOperationHash(a))}},jw=e=>t=>({middleware:{customMiddleware:e.customMiddleware??xw,dummyPaymasterAndData:e.paymasterAndData?.dummyPaymasterAndData?async(t,{account:n})=>{const r=e.paymasterAndData.dummyPaymasterAndData();var a;return{...t,..."0.7.0"===n.getEntryPoint().version?$a(r)?{paymaster:(a=r).substring(0,42),paymasterData:`0x${a.substring(42)}`}:r:{paymasterAndData:$a(r)?r:tw(r)}}}:Bw,feeEstimator:e.feeEstimator??Uw(t),gasEstimator:e.gasEstimator??Lw(t),paymasterAndData:e.paymasterAndData?.paymasterAndData??Bw,userOperationSimulator:e.userOperationSimulator??xw,signUserOperation:e.signUserOperation??Rw}});function Gw(e){return function(e){const{key:t="account",name:n="account provider",transport:r,type:a="SmartAccountClient",...i}=e,s=Vy({...i,key:t,name:n,type:"SmartAccountClient",transport:e=>{const t=r(e);return Lu({async request({method:n,params:r}){switch(n){case"eth_sendTransaction":if(!s.account)throw new tb;if(!s.chain)throw new Hy;const[a]=r;return s.sendTransaction({...a,account:s.account,chain:s.chain});case"eth_sign":if(!s.account)throw new tb;const[i,o]=r;if(i!==s.account.address)throw new Error("cannot sign for address that is not the current account");return s.signMessage(o);case"personal_sign":{if(!s.account)throw new tb;const[e,t]=r;if(t!==s.account.address)throw new Error("cannot sign for address that is not the current account");return s.signMessage(e)}case"eth_signTypedData_v4":{if(!s.account)throw new tb;const[e,t]=r;if(e!==s.account.address)throw new Error("cannot sign for address that is not the current account");return s.signTypedData(t)}case"eth_chainId":if(!e.chain)throw new Hy;return e.chain.id;default:return t.request({method:n,params:r})}}})(e)}}).extend((()=>({...pw.parse(e.opts??{})}))).extend(jw(e)).extend(Fw);return{...s,type:a}}({...e,chain:e.client.chain,transport:Lu(e.client)})}const zw=async(e,{account:t=e.account,overrides:n,...r})=>{if(!t)throw new tb;if(!(e=>Iw(e))(e))throw new zy("AlchemySmartAccountClient","SimulateUserOperationAssetChanges",e);const a=iw(await e.buildUserOperation({...r,account:t,overrides:n}));return e.request({method:"alchemy_simulateUserOperationAssetChanges",params:[a,t.getEntryPoint().address]})};var $w,Hw={exports:{}};
4
4
  /**
5
5
  * [js-sha3]{@link https://github.com/emn178/js-sha3}
@@ -23,6 +23,6 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
23
23
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
24
24
  PERFORMANCE OF THIS SOFTWARE.
25
25
  ***************************************************************************** */
26
- function ME(e,t,n,r){return new(n||(n=Promise))((function(a,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(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(s,o)}c((r=r.apply(e,t||[])).next())}))}function NE(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 UE(e){return this instanceof UE?(this.v=e,this):new UE(e)}function LE(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,a=n.apply(e,t||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){a[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||o(e,t)}))})}function o(e,t){try{!function(e){e.value instanceof UE?Promise.resolve(e.value.v).then(c,l):u(i[0][2],e)}(a[e](t))}catch(e){u(i[0][3],e)}}function c(e){o("next",e)}function l(e){o("throw",e)}function u(e,t){e(t),i.shift(),i.length&&o(i[0][0],i[0][1])}}function BE(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=NE(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,(lE=exports.Network||(exports.Network={})).ETH_MAINNET="eth-mainnet",lE.ETH_GOERLI="eth-goerli",lE.ETH_SEPOLIA="eth-sepolia",lE.OPT_MAINNET="opt-mainnet",lE.OPT_GOERLI="opt-goerli",lE.OPT_SEPOLIA="opt-sepolia",lE.ARB_MAINNET="arb-mainnet",lE.ARB_GOERLI="arb-goerli",lE.ARB_SEPOLIA="arb-sepolia",lE.MATIC_MAINNET="polygon-mainnet",lE.MATIC_MUMBAI="polygon-mumbai",lE.MATIC_AMOY="polygon-amoy",lE.ASTAR_MAINNET="astar-mainnet",lE.POLYGONZKEVM_MAINNET="polygonzkevm-mainnet",lE.POLYGONZKEVM_TESTNET="polygonzkevm-testnet",lE.BASE_MAINNET="base-mainnet",lE.BASE_GOERLI="base-goerli",lE.BASE_SEPOLIA="base-sepolia",function(e){e.DEFAULT_TOKENS="DEFAULT_TOKENS",e.ERC20="erc20"}(uE||(uE={})),function(e){e.EXTERNAL="external",e.INTERNAL="internal",e.ERC20="erc20",e.ERC721="erc721",e.ERC1155="erc1155",e.SPECIALNFT="specialnft"}(dE||(dE={})),function(e){e.TO="TO",e.FROM="FROM"}(pE||(pE={})),function(e){e.ASCENDING="asc",e.DESCENDING="desc"}(hE||(hE={})),function(e){e.VERIFIED="verified",e.APPROVED="approved",e.REQUESTED="requested",e.NOT_REQUESTED="not_requested"}(mE||(mE={})),exports.AlchemySubscription=void 0,(fE=exports.AlchemySubscription||(exports.AlchemySubscription={})).PENDING_TRANSACTIONS="alchemy_pendingTransactions",fE.MINED_TRANSACTIONS="alchemy_minedTransactions",function(e){e.NATIVE="NATIVE",e.ERC20="ERC20",e.ERC721="ERC721",e.ERC1155="ERC1155",e.SPECIAL_NFT="SPECIAL_NFT"}(yE||(yE={})),function(e){e.APPROVE="APPROVE",e.TRANSFER="TRANSFER"}(bE||(bE={})),function(e){e.ETHERSCAN="ETHERSCAN"}(gE||(gE={})),function(e){e.CREATE="CREATE",e.CALL="CALL",e.STATICCALL="STATICCALL",e.DELEGATECALL="DELEGATECALL"}(vE||(vE={})),function(e){e.UNSPECIFIED="TRANSACTION_JOB_STATUS_UNSPECIFIED",e.IN_PROGRESS="IN_PROGRESS",e.COMPLETE="COMPLETE",e.ABANDONED="ABANDONED"}(wE||(wE={})),function(e){e.V1="V1",e.V2="V2"}(CE||(CE={})),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"}(xE||(xE={})),function(e){e.PENDING="pending",e.LATEST="latest",e.SAFE="safe",e.FINALIZED="finalized",e.EARLIEST="earliest"}(EE||(EE={})),function(e){e.CALL_TRACER="callTracer",e.PRESTATE_TRACER="prestateTracer"}(kE||(kE={})),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"}(TE||(TE={})),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"}(PE||(PE={})),function(e){e.SPAM="SPAM",e.AIRDROPS="AIRDROPS"}(AE||(AE={})),function(e){e.TRANSFERTIME="TRANSFERTIME"}(_E||(_E={})),function(e){e.SEAPORT="seaport",e.LOOKSRARE="looksrare",e.X2Y2="x2y2",e.WYVERN="wyvern",e.CRYPTOPUNKS="cryptopunks",e.BLUR="blur",e.UNKNOWN="unknown"}(DE||(DE={})),function(e){e.BUYER="buyer",e.SELLER="seller"}(OE||(OE={})),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"}(FE||(FE={})),function(e){e.OPENSEA="OpenSea"}(SE||(SE={}));const RE="demo",jE=exports.Network.ETH_MAINNET;function GE(e,t){return`https://${e}.g.alchemy.com/v2/${t}`}var zE;!function(e){e[e.BASE=0]="BASE",e[e.NFT=1]="NFT",e[e.WEBHOOK=2]="WEBHOOK"}(zE||(zE={}));const $E={[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 HE{constructor(e){this.apiKey=(null==e?void 0:e.apiKey)||RE,this.network=(null==e?void 0:e.network)||jE,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===zE.NFT?(t=this.network,n=this.apiKey,`https://${t}.g.alchemy.com/nft/v3/${n}`):e===zE.WEBHOOK?"https://dashboard.alchemy.com/api":GE(this.network,this.apiKey);var t,n}getProvider(){return this._baseAlchemyProvider||(this._baseAlchemyProvider=(()=>ME(this,void 0,void 0,(function*(){const{AlchemyProvider:e}=yield Promise.resolve().then((function(){return require("./alchemy-provider-5870b6fa-382979ef.cjs")})).then((function(e){return e.alchemyProvider5870b6fa}));return new e(this)})))()),this._baseAlchemyProvider}getWebSocketProvider(){return this._baseAlchemyWssProvider||(this._baseAlchemyWssProvider=(()=>ME(this,void 0,void 0,(function*(){const{AlchemyWebSocketProvider:e}=yield Promise.resolve().then((function(){return require("./alchemy-websocket-provider-213da986-4ce7835d.cjs")}));return new e(this)})))()),this._baseAlchemyWssProvider}}let qE=!1,VE=!1;const WE={debug:1,default:2,info:2,warning:3,error:4,off:5};let ZE=WE.default,KE=null;const JE=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 XE,YE;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(XE||(XE={})),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"}(YE||(YE={}));const QE="0123456789abcdef";class ek{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==WE[n]&&this.throwArgumentError("invalid log level name","logLevel",e),ZE>WE[n]||console.log.apply(console,t)}debug(...e){this._log(ek.levels.DEBUG,e)}info(...e){this._log(ek.levels.INFO,e)}warn(...e){this._log(ek.levels.WARNING,e)}makeError(e,t,n){if(VE)return this.makeError("censored error",t,{});t||(t=ek.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+=QE[t[e]>>4],n+=QE[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 i="";switch(t){case YE.NUMERIC_FAULT:{i="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":i+="-"+t;break;case"negative-power":case"negative-width":i+="-unsupported";break;case"unbound-bitwise-result":i+="-unbound-result"}break}case YE.CALL_EXCEPTION:case YE.INSUFFICIENT_FUNDS:case YE.MISSING_NEW:case YE.NONCE_EXPIRED:case YE.REPLACEMENT_UNDERPRICED:case YE.TRANSACTION_REPLACED:case YE.UNPREDICTABLE_GAS_LIMIT:i=t}i&&(e+=" [ See: https://links.ethers.org/v5-errors-"+i+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const s=new Error(e);return s.reason=a,s.code=t,Object.keys(n).forEach((function(e){s[e]=n[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,ek.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){JE&&this.throwError("platform missing String.prototype.normalize",ek.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:JE})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,ek.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,ek.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,ek.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,ek.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",ek.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",ek.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",ek.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return KE||(KE=new ek("logger/5.7.0")),KE}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",ek.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),qE){if(!e)return;this.globalLogger().throwError("error censorship permanent",ek.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}VE=!!e,qE=!!t}static setLogLevel(e){const t=WE[e.toLowerCase()];null!=t?ZE=t:ek.globalLogger().warn("invalid log level - "+e)}static from(e){return new ek(e)}}ek.errors=YE,ek.levels=XE;var tk=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(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(s,o)}c((r=r.apply(e,t||[])).next())}))};const nk=new ek("properties/5.7.0");function rk(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function ak(e){return tk(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 ik={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function sk(e){if(null==e||ik[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(!sk(r))return!1}return!0}return nk.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ok(e){if(sk(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>ck(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&rk(t,n,ck(r))}return t}return nk.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ck(e){return ok(e)}function lk(e){return nC.from(e).toNumber()}function uk(e){return nC.from(e).toHexString()}function dk(e){return"string"==typeof e?e:Number.isInteger(e)?uk(e):e.toString()}function pk(e,t){return Object.values(t).includes(e)?e:null}function hk(e){return Ek(Object.assign(Object.assign({},mk(e)),{displayNft:e.displayNft,image:e.image,totalBalance:e.totalBalance,numDistinctTokensOwned:e.numDistinctTokensOwned,isSpam:e.isSpam}))}function mk(e){return Ek(Object.assign(Object.assign({},e),{tokenType:Ck(e.tokenType),openSeaMetadata:Object.assign(Object.assign({},e.openSeaMetadata),{safelistRequestStatus:null!==e.openSeaMetadata.safelistRequestStatus?pk(e.openSeaMetadata.safelistRequestStatus,mE):null})}))}function fk(e,t){return{contractAddress:t||e.contractAddress,tokenId:e.tokenId}}function yk(e){return Ek(Object.assign(Object.assign({},e),{contract:(t=e.contract,Ek(Object.assign(Object.assign({},mk(t)),{spamClassifications:t.spamClassifications.map(wk)}))),tokenType:Ck(e.tokenType),acquiredAt:e.acquiredAt,collection:e.collection,mint:e.mint}));var t}function bk(e){switch(e){case"looksrare":return DE.LOOKSRARE;case"seaport":return DE.SEAPORT;case"x2y2":return DE.X2Y2;case"wyvern":return DE.WYVERN;case"cryptopunks":return DE.CRYPTOPUNKS;case"blur":return DE.BLUR;default:return DE.UNKNOWN}}function gk(e){if("OpenSea"===e)return SE.OPENSEA}function vk(e){switch(e.toLowerCase()){case"buyer":return OE.BUYER;case"seller":return OE.SELLER;default:throw new Error(`Unsupported NftSaleTakerType ${e}`)}}function wk(e){const t=pk(e,PE);return null==t?PE.Unknown:t}function Ck(e){switch(e){case"erc721":case"ERC721":return TE.ERC721;case"erc1155":case"ERC1155":return TE.ERC1155;case"no_supported_nft_standard":case"NO_SUPPORTED_NFT_STANDARD":return TE.NO_SUPPORTED_NFT_STANDARD;case"not_a_contract":case"NOT_A_CONTRACT":return TE.NOT_A_CONTRACT;default:return TE.UNKNOWN}}const xk="undefined"!=typeof window&&null!==window;function Ek(e){if(null!=e){if("Object"===e.constructor.name||Array.isArray(e))for(const t in e)e[t]=Ek(e[t]);return e}}function kk(e,t,n="getAssetTransfers"){return ME(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?dk(t.fromBlock):void 0,toBlock:null!=t.toBlock?dk(t.toBlock):void 0,maxCount:null!=t.maxCount?uk(t.maxCount):void 0})],n)}))}function Tk(e,t,n="getTransactionReceipts"){return ME(this,void 0,void 0,(function*(){return(yield e.getProvider())._send("alchemy_getTransactionReceipts",[t],n)}))}function Pk(e,t){return ME(this,void 0,void 0,(function*(){const n=yield e.getProvider();yield n.getNetwork();const r=yield ak({filter:Ak(e,t)}),a=yield n.send("eth_getLogs",[r.filter]);return a.forEach((e=>{null==e.removed&&(e.removed=!1)})),(i=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(i(e))})),t})(a);var i}))}function Ak(e,t){return ME(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 ak(a)),Array.isArray(r.address)?a.address=yield Promise.all(r.address.map((e=>ME(this,void 0,void 0,(function*(){return n._getAddress(e)}))))):null!=r.address&&(a.address=yield n._getAddress(r.address)),a}))}class _k{constructor(e){this.config=e}getBalance(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBalance(e,t)}))}isContractAddress(e){return ME(this,void 0,void 0,(function*(){const t=yield this.config.getProvider();return"0x"!==(yield t.getCode(e))}))}getCode(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getCode(e,t)}))}getStorageAt(e,t,n){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getStorageAt(e,t,n)}))}getTransactionCount(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransactionCount(e,t)}))}getBlock(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlock(e)}))}getBlockWithTransactions(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlockWithTransactions(e)}))}getNetwork(){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getNetwork()}))}getBlockNumber(){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlockNumber()}))}getGasPrice(){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getGasPrice()}))}getFeeData(){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getFeeData()}))}ready(){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).ready}))}call(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).call(e,t)}))}estimateGas(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).estimateGas(e)}))}getTransaction(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransaction(e)}))}getTransactionReceipt(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransactionReceipt(e)}))}sendTransaction(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).sendTransaction(e)}))}waitForTransaction(e,t,n){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).waitForTransaction(e,t,n)}))}getLogs(e){return ME(this,void 0,void 0,(function*(){return Pk(this.config,e)}))}send(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).send(e,t)}))}findContractDeployer(e){var t;return ME(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 Dk(0,r+1,e,this.config),i=yield Tk(this.config,{blockNumber:uk(a)},"findContractDeployer"),s=null===(t=i.receipts)||void 0===t?void 0:t.find((t=>t.contractAddress===e.toLowerCase()));return{deployerAddress:null==s?void 0:s.from,blockNumber:a}}))}getTokenBalances(e,t){return ME(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?uE.ERC20:t.type];return(null==t?void 0:t.type)===uE.ERC20&&t.pageKey&&e.push({pageKey:t.pageKey}),n._send("alchemy_getTokenBalances",e,"getTokenBalances")}}))}getTokensForOwner(e,t){var n;return ME(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:uE.ERC20];(null==t?void 0:t.pageKey)&&a.push({pageKey:t.pageKey});const i=yield r._send("alchemy_getTokenBalances",a,"getTokensForOwner"),s=i.tokenBalances.map((e=>({contractAddress:e.contractAddress,rawBalance:nC.from(e.tokenBalance).toString()}))),o=(yield Promise.allSettled(i.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=s.map(((e,t)=>Object.assign(Object.assign(Object.assign({},e),o[t]),{balance:null!==o[t].decimals?xC(e.rawBalance,o[t].decimals):void 0})));return{tokens:c.map((e=>Ek(e))),pageKey:i.pageKey}}))}getTokenMetadata(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_getTokenMetadata",[e],"getTokenMetadata")}))}getAssetTransfers(e){return ME(this,void 0,void 0,(function*(){return kk(this.config,e)}))}getTransactionReceipts(e){return ME(this,void 0,void 0,(function*(){return Tk(this.config,e)}))}resolveName(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).resolveName(e)}))}lookupAddress(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).lookupAddress(e)}))}}function Dk(e,t,n,r){return ME(this,void 0,void 0,(function*(){if(e>=t)return t;const a=Math.floor((e+t)/2),i=yield r.getProvider();return"0x"===(yield i.getCode(n,a))?Dk(a+1,t,n,r):Dk(e,a,n,r)}))}class Ok{constructor(e){this.config=e}traceCall(e,t,n){return ME(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[e,t,Fk(n)];return r._send("debug_traceCall",a,"traceCall")}))}traceTransaction(e,t,n){return ME(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[e,Fk(t,n)];return r._send("debug_traceTransaction",a,"traceTransaction")}))}traceBlock(e,t){return ME(this,void 0,void 0,(function*(){const r=yield this.config.getProvider();let a,i;if(n.isHexString(e,32))a="debug_traceBlockByHash",i=[e,Fk(t)];else{a="debug_traceBlockByNumber";i=["number"==typeof e?n.hexStripZeros(n.hexValue(e)):e,Fk(t)]}return r._send(a,i,"traceBlock")}))}}function Fk(e,t){return Object.assign({tracer:e.type},void 0!==e.onlyTopCall&&{tracerConfig:{onlyTopCall:e.onlyTopCall,timeout:t}})}function Sk(e){if(e===TE.ERC1155||e===TE.ERC721)return e}var Ik;!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"}(Ik||(Ik={})),Ik.DEBUG,Ik.INFO,Ik.WARN,Ik.ERROR,Ik.SILENT;const Mk={[Ik.DEBUG]:"log",[Ik.INFO]:"info",[Ik.WARN]:"warn",[Ik.ERROR]:"error"},Nk=Ik.INFO;function Uk(e,...t){Rk.debug(e,t)}function Lk(e,...t){Rk.info(e,t)}function Bk(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return e}}const Rk=new class{constructor(){this._logLevel=Nk}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Ik))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}debug(...e){this._log(Ik.DEBUG,...e)}info(...e){this._log(Ik.INFO,...e)}warn(...e){this._log(Ik.WARN,...e)}error(...e){this._log(Ik.ERROR,...e)}_log(e,...t){if(e<this._logLevel)return;const n=(new Date).toISOString(),r=Mk[e];if(!r)throw new Error(`Logger received an invalid logLevel (value: ${e})`);console[r](`[${n}] Alchemy:`,...t.map(Bk))}},jk="3.2.0";function Gk(e,t,n,r,a){var i;const s=e+"/"+t,o=Object.assign(Object.assign({},a),{headers:Object.assign(Object.assign(Object.assign({},null==a?void 0:a.headers),!xk&&{"Accept-Encoding":"gzip"}),{"Alchemy-Ethers-Sdk-Version":jk,"Alchemy-Ethers-Sdk-Method":n}),method:null!==(i=null==a?void 0:a.method)&&void 0!==i?i:"GET",url:s,params:r});return IE(o)}class zk{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&&Uk("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 $k(e,t,n,r,a,i){return ME(this,void 0,void 0,(function*(){let s;const o=new zk(e.maxRetries);for(let c=0;c<e.maxRetries+1;c++)try{void 0!==s&&Lk("requestHttp",`Retrying after error: ${s.message}`);try{yield o.backoff()}catch(e){break}const c=yield Gk(e._getRequestUrl(t),n,r,a,Object.assign(Object.assign({},i),{timeout:e.requestTimeout}));if(200===c.status)return Uk(n,`Successful request: ${n}`),c.data;Lk(n,`Request failed: ${n}, ${c.status}, ${c.data}`),s=new Error(c.status+": "+c.data)}catch(e){if(!IE.isAxiosError(e)||void 0===e.response)throw e;if(s=new Error(e.response.status+": "+e.response.data),!Hk(e,t))break}return Promise.reject(s)}))}function Hk(e,t){const n=t===zE.WEBHOOK?[429,500]:[429];return void 0!==e.response&&n.includes(e.response.status)}function qk(e,t,n,r,a,i,s){return LE(this,arguments,(function*(){let o=!0;const c=Object.assign({},s);for(;o;){const s=yield UE($k(e,t,n,r,c));yield yield UE(s),null!==s[i]?c[a]=s[i]:o=!1}}))}function Vk(e,t,n,r,a="getNftMetadata"){return ME(this,void 0,void 0,(function*(){return yk(yield $k(e,zE.NFT,"getNFTMetadata",a,{contractAddress:t,tokenId:nC.from(n).toString(),tokenType:Sk(null==r?void 0:r.tokenType),tokenUriTimeoutInMs:null==r?void 0:r.tokenUriTimeoutInMs,refreshCache:null==r?void 0:r.refreshCache}))}))}function Wk(e,t,n){return ME(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 $k(e,zE.NFT,"getNFTMetadataBatch","getNftMetadataBatch",{},{method:"POST",data:r})).nfts.map((e=>yk(e)))}}))}function Zk(e,t,n="getCollectionMetadata"){return ME(this,void 0,void 0,(function*(){const r=yield $k(e,zE.NFT,"getCollectionMetadata",n,{collectionSlug:t});return a=r,Ek(Object.assign(Object.assign({},a),{floorPrice:Object.assign(Object.assign({},a.floorPrice),{marketplace:gk(a.floorPrice.marketplace)})}));var a}))}function Kk(e,t,n,r="getNftsForOwner"){return ME(this,void 0,void 0,(function*(){const a=rT(null==n?void 0:n.omitMetadata),i=yield $k(e,zE.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 Ek(a?{ownedNfts:i.ownedNfts.map((e=>Object.assign(Object.assign({},yk(e)),{balance:e.balance}))),pageKey:i.pageKey,totalCount:i.totalCount,validAt:i.validAt}:{ownedNfts:i.ownedNfts.map((e=>Object.assign(Object.assign({},fk(e)),{balance:e.balance}))),pageKey:i.pageKey,totalCount:i.totalCount,validAt:i.validAt})}))}function Jk(e){switch(e){case TE.ERC721:return[dE.ERC721];case TE.ERC1155:return[dE.ERC1155];default:return[dE.ERC721,dE.ERC1155,dE.SPECIALNFT]}}function Xk(e,t={},n="getNftSales"){return ME(this,void 0,void 0,(function*(){const r=Object.assign({},t),a=yield $k(e,zE.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)?nC.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 Ek({nftSales:(i=a).nftSales.map((e=>Object.assign(Object.assign({},e),{marketplace:bk(e.marketplace),taker:vk(e.taker)}))),validAt:i.validAt,pageKey:i.pageKey});var i}))}function Yk(e,t,n,r="refreshNftMetadata"){return ME(this,void 0,void 0,(function*(){const a=nC.from(n).toString(),i=yield Vk(e,t,a,void 0,r),s=yield function(e,t,n,r){return ME(this,void 0,void 0,(function*(){return yk(yield $k(e,zE.NFT,"getNFTMetadata",r,{contractAddress:t,tokenId:nC.from(n).toString(),refreshCache:!0}))}))}(e,t,a,r);return i.timeLastUpdated!==s.timeLastUpdated}))}function Qk(e){return tT(e)?yk(e):fk(e)}function eT(e,t){return tT(e)?yk(e):fk(e,t)}function tT(e){return void 0!==e.name}function nT(e,t){return ME(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===dE.ERC1155?function(e){return e.erc1155Metadata.map((t=>({contractAddress:e.rawContract.address,tokenId:t.tokenId,tokenType:TE.ERC1155})))}(e):[{contractAddress:e.rawContract.address,tokenId:e.tokenId,tokenType:e.category===dE.ERC721?TE.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=>Wk(e,t.map((e=>e.token))))))).map((e=>e.nfts)).flat(),i=new Map;a.forEach((e=>{const t=`${e.contract.address.toLowerCase()}-${nC.from(e.tokenId).toString()}`;i.set(t,e)}));const s=n.map((e=>{const t=`${e.token.contractAddress.toLowerCase()}-${nC.from(e.token.tokenId).toString()}`;return Object.assign(Object.assign({},i.get(t)),e.metadata)}));return{nfts:s,pageKey:t.pageKey}}))}function rT(e){return void 0===e||!e}function aT(e){switch(e){case"does_not_exist":return FE.DOES_NOT_EXIST;case"already_queued":return FE.ALREADY_QUEUED;case"in_progress":return FE.IN_PROGRESS;case"finished":return FE.FINISHED;case"queued":return FE.QUEUED;case"queue_failed":return FE.QUEUE_FAILED;default:throw new Error("Unknown reingestion state: "+e)}}class iT{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},Vk(this.config,e,t,a)}getNftMetadataBatch(e,t){return Wk(this.config,e,t)}getContractMetadata(e){return function(e,t,n="getContractMetadata"){return ME(this,void 0,void 0,(function*(){return mk(yield $k(e,zE.NFT,"getContractMetadata",n,{contractAddress:t}))}))}(this.config,e)}getContractMetadataBatch(e){return function(e,t){return ME(this,void 0,void 0,(function*(){return{contracts:(yield $k(e,zE.NFT,"getContractMetadataBatch","getContractMetadataBatch",{},{method:"POST",data:{contractAddresses:t}})).contracts.map(mk)}}))}(this.config,e)}getCollectionMetadata(e){return Zk(this.config,e)}getNftsForOwnerIterator(e,t){return function(e,t,n,r="getNftsForOwnerIterator"){return LE(this,arguments,(function*(){var a,i;const s=rT(null==n?void 0:n.omitMetadata);try{for(var o,c=BE(qk(e,zE.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:s,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs,orderBy:null==n?void 0:n.orderBy}));!(o=yield UE(c.next())).done;){const e=o.value;for(const t of e.ownedNfts)yield yield UE(Object.assign(Object.assign({},Qk(t)),{balance:t.balance}))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(i=c.return)&&(yield UE(i.call(c)))}finally{if(a)throw a.error}}}))}(this.config,e,t)}getNftsForOwner(e,t){return Kk(this.config,e,t)}getNftsForContract(e,t){return function(e,t,n,r="getNftsForContract"){var a;return ME(this,void 0,void 0,(function*(){const i=rT(null==n?void 0:n.omitMetadata),s=yield $k(e,zE.NFT,"getNFTsForContract",r,{contractAddress:t,pageKey:null==n?void 0:n.pageKey,withMetadata:i,limit:null!==(a=null==n?void 0:n.pageSize)&&void 0!==a?a:void 0,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs});return Ek(i?{nfts:s.nfts.map((e=>yk(e))),pageKey:s.pageKey}:{nfts:s.nfts.map((e=>fk(e,t))),pageKey:s.pageKey})}))}(this.config,e,t)}getNftsForContractIterator(e,t){return function(e,t,n,r="getNftsForContractIterator"){return LE(this,arguments,(function*(){var a,i;const s=rT(null==n?void 0:n.omitMetadata);try{for(var o,c=BE(qk(e,zE.NFT,"getNFTsForContract",r,"pageKey","pageKey",{contractAddress:t,pageKey:null==n?void 0:n.pageKey,withMetadata:s}));!(o=yield UE(c.next())).done;){const e=o.value;for(const n of e.nfts)yield yield UE(eT(n,t))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(i=c.return)&&(yield UE(i.call(c)))}finally{if(a)throw a.error}}}))}(this.config,e,t)}getOwnersForContract(e,t){return function(e,t,n,r="getOwnersForContract"){return ME(this,void 0,void 0,(function*(){const a=yield $k(e,zE.NFT,"getOwnersForContract",r,Object.assign(Object.assign({},n),{contractAddress:t}));return null==n||n.withTokenBalances,Ek({owners:a.owners,pageKey:a.pageKey})}))}(this.config,e,t)}getOwnersForNft(e,t,n){return function(e,t,n,r,a="getOwnersForNft"){return ME(this,void 0,void 0,(function*(){return $k(e,zE.NFT,"getOwnersForNFT",a,Object.assign({contractAddress:t,tokenId:nC.from(n).toString()},r))}))}(this.config,e,t,n)}getContractsForOwner(e,t){return function(e,t,n,r="getContractsForOwner"){return ME(this,void 0,void 0,(function*(){const a=yield $k(e,zE.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 Ek({contracts:a.contracts.map(hk),pageKey:a.pageKey,totalCount:a.totalCount})}))}(this.config,e,t)}getTransfersForOwner(e,t,n){return function(e,t,n,r){return ME(this,void 0,void 0,(function*(){const a=yield e.getProvider(),i=yield a._getAddress(t),s=Jk(null==r?void 0:r.tokenType),o={fromBlock:"0x0",excludeZeroValue:!0,contractAddresses:null==r?void 0:r.contractAddresses,category:s,maxCount:100,pageKey:null==r?void 0:r.pageKey};n===pE.TO?o.toAddress=i:o.fromAddress=i;const c=yield kk(e,o,"getTransfersForOwner");return nT(e,c)}))}(this.config,e,t,n)}getTransfersForContract(e,t){return function(e,t,n){return ME(this,void 0,void 0,(function*(){const r=[dE.ERC721,dE.ERC1155,dE.SPECIALNFT],a=yield e.getProvider(),i={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},s=yield kk(e,i,"getTransfersForContract");return nT(e,s)}))}(this.config,e,t)}getMintedNfts(e,t){return ME(this,void 0,void 0,(function*(){return function(e,t,n){return ME(this,void 0,void 0,(function*(){const r=yield e.getProvider(),a=yield r._getAddress(t),i=Jk(null==n?void 0:n.tokenType),s={fromBlock:"0x0",fromAddress:"0x0000000000000000000000000000000000000000",toAddress:a,excludeZeroValue:!0,contractAddresses:null==n?void 0:n.contractAddresses,category:i,maxCount:100,pageKey:null==n?void 0:n.pageKey},o=yield kk(e,s,"getMintedNfts");return nT(e,o)}))}(this.config,e,t)}))}verifyNftOwnership(e,t){return function(e,t,n,r="verifyNftOwnership"){return ME(this,void 0,void 0,(function*(){if("string"==typeof n)return(yield Kk(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 Kk(e,t,{contractAddresses:n,omitMetadata:!0},r),i=n.reduce(((e,t)=>(e[t]=!1,e)),{});for(const e of a.ownedNfts)i[e.contractAddress]=!0;return i}}))}(this.config,e,t)}isSpamContract(e){return function(e,t,n="isSpamContract"){return ME(this,void 0,void 0,(function*(){return $k(e,zE.NFT,"isSpamContract",n,{contractAddress:t})}))}(this.config,e)}getSpamContracts(){return function(e,t="getSpamContracts"){return ME(this,void 0,void 0,(function*(){return $k(e,zE.NFT,"getSpamContracts",t,void 0)}))}(this.config)}reportSpam(e){return function(e,t,n="reportSpam"){return ME(this,void 0,void 0,(function*(){$k(e,zE.NFT,"reportSpam",n,{contractAddress:t})}))}(this.config,e)}isAirdropNft(e,t){return function(e,t,n,r="isAirdropNft"){return ME(this,void 0,void 0,(function*(){return $k(e,zE.NFT,"isAirdropNFT",r,{contractAddress:t,tokenId:n})}))}(this.config,e,t)}getFloorPrice(e){return function(e,t,n="getFloorPrice"){return ME(this,void 0,void 0,(function*(){return Ek(yield $k(e,zE.NFT,"getFloorPrice",n,{contractAddress:t}))}))}(this.config,e)}getNftSales(e){return Xk(this.config,e)}computeRarity(e,t){return function(e,t,n,r="computeRarity"){return ME(this,void 0,void 0,(function*(){return Ek(yield $k(e,zE.NFT,"computeRarity",r,{contractAddress:t,tokenId:nC.from(n).toString()}))}))}(this.config,e,t)}searchContractMetadata(e){return function(e,t,n="searchContractMetadata"){return ME(this,void 0,void 0,(function*(){return{contracts:(yield $k(e,zE.NFT,"searchContractMetadata",n,{query:t})).contracts.map(mk)}}))}(this.config,e)}summarizeNftAttributes(e){return function(e,t,n="summarizeNftAttributes"){return ME(this,void 0,void 0,(function*(){return $k(e,zE.NFT,"summarizeNFTAttributes",n,{contractAddress:t})}))}(this.config,e)}refreshNftMetadata(e,t){return Yk(this.config,e,t)}refreshContract(e){return function(e,t,n="refreshContract"){return ME(this,void 0,void 0,(function*(){const r=yield $k(e,zE.NFT,"reingestContract",n,{contractAddress:t});return{contractAddress:r.contractAddress,refreshState:aT(r.reingestionState),progress:r.progress}}))}(this.config,e)}}class sT{constructor(e){this.config=e}getAllWebhooks(){return ME(this,void 0,void 0,(function*(){this.verifyConfig();const e=yield this.sendWebhookRequest("team-webhooks","getAllWebhooks",{});return{webhooks:lT(e),totalCount:e.data.length}}))}getAddresses(e,t){return ME(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 ME(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 ME(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:nC.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 ME(this,void 0,void 0,(function*(){const n="string"==typeof e?e:e.id;let r,a,i,s;if("isActive"in t)r="update-webhook",a="updateWebhook",i="PUT",s={webhook_id:n,is_active:t.isActive};else if("addFilters"in t||"removeFilters"in t)r="update-webhook-nft-filters",a="updateWebhookNftFilters",i="PATCH",s={webhook_id:n,nft_filters_to_add:t.addFilters?t.addFilters.map(dT):[],nft_filters_to_remove:t.removeFilters?t.removeFilters.map(dT):[]};else if("addMetadataFilters"in t||"removeMetadataFilters"in t)r="update-webhook-nft-metadata-filters",a="updateWebhookNftMetadataFilters",i="PATCH",s={webhook_id:n,nft_metadata_filters_to_add:t.addMetadataFilters?t.addMetadataFilters.map(dT):[],nft_metadata_filters_to_remove:t.removeMetadataFilters?t.removeMetadataFilters.map(dT):[]};else if("addAddresses"in t||"removeAddresses"in t)r="update-webhook-addresses",a="webhook:updateWebhookAddresses",i="PATCH",s={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",i="PUT",s={webhook_id:n,addresses:yield this.resolveAddresses(t.newAddresses)}}yield this.sendWebhookRequest(r,a,{},{method:i,data:s})}))}createWebhook(e,t,n){return ME(this,void 0,void 0,(function*(){let r;if(t===xE.MINED_TRANSACTION||t===xE.DROPPED_TRANSACTION){if(!("appId"in n))throw new Error("Transaction Webhooks require an app id.");r=n.appId}let a,i,s,o=cT.get(this.config.network);if(t===xE.NFT_ACTIVITY||t===xE.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?cT.get(n.network):o;const e=n.filters.map((e=>e.tokenId?{contract_address:e.contractAddress,token_id:nC.from(e.tokenId).toString()}:{contract_address:e.contractAddress}));a=t===xE.NFT_ACTIVITY?{nft_filters:e}:{nft_metadata_filters:e}}else if(t===xE.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?cT.get(n.network):o,i=yield this.resolveAddresses(n.addresses)}else if(t==xE.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?cT.get(n.network):o,s=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),i&&{addresses:i}),s&&{graphql_query:s});return uT((yield this.sendWebhookRequest("create-webhook","createWebhook",{},{method:"POST",data:c})).data)}))}deleteWebhook(e){return ME(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 $k(this.config,zE.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 ME(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 oT={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},cT=Object.keys(exports.Network).reduce(((e,t)=>(t in oT&&e.set(oT[t],t),e)),new Map);function lT(e){return e.data.map(uT)}function uT(e){return Object.assign({id:e.id,network:oT[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 dT(e){return e.tokenId?{contract_address:e.contractAddress,token_id:nC.from(e.tokenId).toString()}:{contract_address:e.contractAddress}}const pT=[.9,1,1.1,1.2,1.3];class hT{constructor(e){this.config=e}sendPrivateTransaction(e,t,n){return ME(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=t?uk(t):void 0;return r._send("eth_sendPrivateTransaction",[{tx:e,maxBlockNumber:a,preferences:n}],"sendPrivateTransaction")}))}cancelPrivateTransaction(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("eth_cancelPrivateTransaction",[{txHash:e}],"cancelPrivateTransaction")}))}simulateAssetChangesBundle(e,t){return ME(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Ek(yield n._send("alchemy_simulateAssetChangesBundle",r,"simulateAssetChangesBundle"))}))}simulateAssetChanges(e,t){return ME(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Ek(yield n._send("alchemy_simulateAssetChanges",r,"simulateAssetChanges"))}))}simulateExecutionBundle(e,t){return ME(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Ek(n._send("alchemy_simulateExecutionBundle",r,"simulateExecutionBundle"))}))}simulateExecution(e,t){return ME(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Ek(n._send("alchemy_simulateExecution",r,"simulateExecution"))}))}getTransaction(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransaction(e)}))}sendTransaction(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).sendTransaction(e)}))}estimateGas(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).estimateGas(e)}))}getMaxPriorityFeePerGas(){return ME(this,void 0,void 0,(function*(){const e=yield this.config.getProvider();return lk(yield e._send("eth_maxPriorityFeePerGas",[],"getMaxPriorityFeePerGas"))}))}waitForTransaction(e,t,n){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).waitForTransaction(e,t,n)}))}sendGasOptimizedTransaction(e,t){return ME(this,void 0,void 0,(function*(){if(Array.isArray(e))return this._sendGasOptimizedTransaction(e,"sendGasOptimizedTransactionPreSigned");let n,r,a;const i=yield this.config.getProvider();try{n=yield this.estimateGas(e),r=yield this.getMaxPriorityFeePerGas();a=(yield i.getBlock("latest")).baseFeePerGas.toNumber()}catch(e){throw new Error(`Failed to estimate gas for transaction: ${e}`)}const s=function(e,t,n,r){return pT.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(s.map((e=>t.signTransaction(e))));return this._sendGasOptimizedTransaction(o,"sendGasOptimizedTransactionGenerated")}))}getGasOptimizedTransactionStatus(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_getGasOptimizedTransactionStatus",[e],"getGasOptimizedTransactionStatus")}))}_sendGasOptimizedTransaction(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_sendGasOptimizedTransaction",[{rawTransactions:e}],t)}))}}const mT="alchemy-pending-transactions",fT="alchemy-mined-transactions",yT=[mT,fT];class bT{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 gT(e){return"object"==typeof e&&"method"in e}function vT(e){return void 0===e?"*":Array.isArray(e)?e.join("|"):e}function wT(e){return void 0===e?"*":e.toString()}function CT(e){if(""===e)return;const t=e.split("|");return 1===t.length?t[0]:t}class xT{constructor(e){this.config=e}on(e,t){return(()=>{ME(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(()=>{ME(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(()=>{ME(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(()=>{ME(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 ME(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 ME(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 ME(this,void 0,void 0,(function*(){if(!gT(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 ME(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 ET=yv.custom((e=>{const t=Lv.parse(e);let n;try{n=rw(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`"),kT=lw.and(yv.object({chain:ET,opts:pw.optional().default(pw.parse({}))}));yv.instanceof(class{constructor(e){this.config=new HE(e),this.core=new _k(this.config),this.nft=new iT(this.config),this.ws=new xT(this.config),this.transact=new hT(this.config),this.notify=new sT(this.config),this.debug=new Ok(this.config)}});const TT=e=>({simulateUserOperation:async t=>zw(e,t)}),PT=e=>async(t,{overrides:n,feeOptions:r})=>{let[a,i]=await Promise.all([e.getBlock({blockTag:"latest"}),e.request({method:"rundler_maxPriorityFeePerGas",params:[]})]);const s=a.baseFeePerGas;if(null==s)throw new Error("baseFeePerGas is null");const o=Yv(i,n?.maxPriorityFeePerGas,r?.maxPriorityFeePerGas);return{...t,maxPriorityFeePerGas:o,maxFeePerGas:Yv(s+BigInt(o),n?.maxFeePerGas,r?.maxFeePerGas)}},AT=(e,t)=>()=>os([t.paymasterAddress??(e=>{switch(e.id){case Ov.id:case kv.id:case _v.id:case Mv.id:case Nv.id:case Sv.id:case Iv.id:return"0x4f84a207A80c39E9e8BaE717c1F25bA7AD1fB08F";case Cv.id:case bv.id:case xv.id:case Fv.id:case Pv.id:return"0x4Fd9098af9ddcB41DA48A1d78F91F1398965addc";case vv.id:return"0x0804Afe6EEFb73ce7F93CD0d5e7079a5a8068592";case Tv.id:case Dv.id:return"0xc03aac639bb21233e0139381970328db8bceeb67";default:throw new Error(`Unsupported chain: ${e}`)}})(e.chain),t.dummyData??"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"]);function _T(e,t){const n=t.gasEstimationOptions,r=n?.disableGasEstimation??!1,a=n?.fallbackFeeDataGetter??PT(e),i=n?.fallbackGasEstimator??Lw(e);return{gasEstimator:r?i:async(t,{overrides:n,account:r,feeOptions:a})=>ew(n)?{...t,...await i(t,{overrides:n,account:r,feeOptions:a,client:e})}:t,feeEstimator:r?a:async(t,{overrides:n,account:r,feeOptions:i})=>{let s=await t.maxFeePerGas,o=await t.maxPriorityFeePerGas;if(ew(n)){const c=await a(t,{overrides:n,feeOptions:i,account:r,client:e});s=await c.maxFeePerGas??s,o=await c.maxPriorityFeePerGas??o}return{...t,maxFeePerGas:s,maxPriorityFeePerGas:o}},paymasterAndData:r?FT(e,t):OT(e,t)}}const DT=(e,t,n,r)=>{let a=e;if(null!=t?.[a])return zv(t[a])?iw(t[a]):{multiplier:Number(t[a].multiplier)};if($v(n?.[e]))return{multiplier:Number(n[e].multiplier)};const i=r[e];return $a(i)&&di(i,"bigint")>0n?i:void 0};function OT(e,t){return{dummyPaymasterAndData:AT(e,t),paymasterAndData:async(n,{overrides:r,feeOptions:a,account:i})=>{const s=iw(await aw(n)),o=sw({maxFeePerGas:DT("maxFeePerGas",r,a,s),maxPriorityFeePerGas:DT("maxPriorityFeePerGas",r,a,s),callGasLimit:DT("callGasLimit",r,a,s),verificationGasLimit:DT("verificationGasLimit",r,a,s),preVerificationGas:DT("preVerificationGas",r,a,s)});if("0.7.0"===i.getEntryPoint().version){const e=DT("paymasterVerificationGasLimit",r,a,s);null!=e&&(o.paymasterVerificationGasLimit=e);const t=DT("paymasterPostOpGasLimit",r,a,s);null!=t&&(o.paymasterPostOpGasLimit=t)}const c=await e.request({method:"alchemy_requestGasAndPaymasterAndData",params:[{policyId:t.policyId,entryPoint:i.getEntryPoint().address,userOperation:s,dummySignature:s.signature,overrides:o}]});return{...n,...c}}}}const FT=(e,t)=>({dummyPaymasterAndData:AT(e,t),paymasterAndData:async(n,{account:r})=>{const a=await e.request({method:"alchemy_requestPaymasterAndData",params:[{policyId:t.policyId,entryPoint:r.getEntryPoint().address,userOperation:iw(await aw(n))}]});return{...n,...a}}});function ST(e){return async(t,{account:n})=>{const r=await e.request({method:"alchemy_simulateUserOperationAssetChanges",params:[iw(await aw(t)),n.getEntryPoint().address]});if(r.error)throw new Error(r.error.message);return t}}function IT(e){return{"Alchemy-Aa-Sdk-Signer":e.getSigner().signerType}}const MT=[{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"}],NT=[{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"}],UT=[{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}],LT=[{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"}],BT=[{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:[]}],RT=e=>({getExecutionFunctionConfig:async({selector:t,account:n=e.account})=>{if(!n)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","getExecutionFunctionConfig",e);return e.readContract({address:n.address,abi:MT,functionName:"getExecutionFunctionConfig",args:[t]})},getExecutionHooks:async({selector:t,account:n=e.account})=>{if(!n)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","getExecutionHooks",e);return e.readContract({address:n.address,abi:MT,functionName:"getExecutionHooks",args:[t]})},getPreValidationHooks:async({selector:t,account:n=e.account})=>{if(!n)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","getPreValidationHooks",e);return e.readContract({address:n.address,abi:MT,functionName:"getPreValidationHooks",args:[t]})},getInstalledPlugins:async({account:t=e.account})=>{if(!t)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","getInstalledPlugins",e);return e.readContract({address:t.address,abi:MT,functionName:"getInstalledPlugins"}).catch((()=>[]))}});async function jT(e,{overrides:t,context:n,account:r=e.account,...a}){if(!r)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","installPlugin",e);const i=await async function(e,t){const n=await e.readContract({abi:NT,address:t.pluginAddress,functionName:"pluginManifest"}),r=t.manifestHash??ns(function(e){const{abi:t,functionName:n,result:r}=e;let a=t[0];if(n){const e=Oo({abi:t,name:n});if(!e)throw new io(n,{docsPath:Ed});a=e}if("function"!==a.type)throw new io(void 0,{docsPath:Ed});if(!a.outputs)throw new so(a.name,{docsPath:Ed});let i=Array.isArray(r)?r:[r];return 0!==a.outputs.length||i[0]||(i=[]),To(a.outputs,i)}({abi:NT,functionName:"pluginManifest",result:n}));return jo({abi:UT,functionName:"installPlugin",args:[t.pluginAddress,r,t.pluginInitData??"0x",t.dependencies??[]]})}(e,a);return e.sendUserOperation({uo:i,overrides:t,account:r,context:n})}const GT={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"},zT={meta:{name:"Multi Owner Plugin",version:"1.0.0",addresses:GT},getContract:(e,t)=>{if(!e.chain)throw new Hy;return Pu({address:t||GT[e.chain.id],abi:qT,client:e})}},$T=e=>({updateOwners({args:t,overrides:n,context:r,account:a=e.account}){if(!a)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","updateOwners",e);const i=jo({abi:HT,functionName:"updateOwners",args:t});return e.sendUserOperation({uo:i,overrides:n,account:a,context:r})},installMultiOwnerPlugin({account:t=e.account,overrides:n,context:r,...a}){if(!t)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","installMultiOwnerPlugin",e);const i=e.chain;if(!i)throw new Hy;const s=a.dependencyOverrides??[],o=a.pluginAddress??zT.meta.addresses[i.id];if(!o)throw new Error("missing MultiOwnerPlugin address for chain "+i.name);return jT(e,{pluginAddress:o,pluginInitData:To([{type:"address[]"}],a.args),dependencies:s,overrides:n,account:t,context:r})},encodeUpdateOwners:({args:e})=>jo({abi:HT,functionName:"updateOwners",args:e}),encodeEip712Domain:()=>jo({abi:HT,functionName:"eip712Domain"}),async readEip712Domain({account:t=e.account}){if(!t)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","readEip712Domain",e);return e.readContract({address:t.address,abi:HT,functionName:"eip712Domain"})},encodeIsValidSignature:({args:e})=>jo({abi:HT,functionName:"isValidSignature",args:e}),async readIsValidSignature({args:t,account:n=e.account}){if(!n)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","readIsValidSignature",e);return e.readContract({address:n.address,abi:HT,functionName:"isValidSignature",args:t})}}),HT=[{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"}]}],qT=[{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"}],VT=(e,t,n,r=zT.meta.addresses[e.chain.id])=>{const a=async a=>{const[,i,s,o,c,l]=await e.readContract({abi:qT,address:r,functionName:"eip712Domain",account:t});return n().signTypedData({domain:{chainId:Number(o),name:i,salt:l,verifyingContract:c,version:s},types:{AlchemyModularAccountMessage:[{name:"message",type:"bytes"}]},message:{message:a},primaryType:"AlchemyModularAccountMessage"})};return{getDummySignature:()=>"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",signUserOperationHash:e=>n().signMessage({raw:e}),signMessage:({message:e})=>a(Id(e)),signTypedData:e=>a(md(e))}},WT=e=>(e.id,"0x000000e92D78D90000007F0082006FDA09BD5f11"),ZT={encodeExecute:async({target:e,data:t,value:n})=>jo({abi:LT,functionName:"execute",args:[e,n??0n,t]}),encodeBatchExecute:async e=>jo({abi:LT,functionName:"executeBatch",args:[e.map((e=>({target:e.target,data:e.data,value:e.value??0n})))]})};async function KT({transport:e,chain:t,signer:n,accountAddress:r,initCode:a,entryPoint:i=eb(t,{version:"0.6.0"}),factoryAddress:s=WT(t),owners:o=[],salt:c=0n}){const l=Vy({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!==pi(e))).sort(((e,t)=>{const n=pi(e),r=pi(t);return n<r?-1:n>r?1:0}));return cs([s,jo({abi:BT,functionName:"createAccount",args:[c,t]})])},d=await bw({client:l,entryPoint:i,accountAddress:r,getAccountInitCode:u}),p=await async function({transport:e,chain:t,entryPoint:n,source:r,accountAddress:a,getAccountInitCode:i,signMessage:s,signTypedData:o,encodeBatchExecute:c,encodeExecute:l,getDummySignature:u,signUserOperationHash:d,encodeUpgradeToAndCall:p}){const h=Vy({transport:n=>e({...n,chain:t,retryCount:0}),chain:t}),m=Pu({address:n.address,abi:n.abi,client:h}),f=await bw({client:h,entryPoint:n,accountAddress:a,getAccountInitCode:i});let y=hw.UNDEFINED;const b=async()=>{if(y===hw.DEPLOYED)return"0x";const e=await h.getBytecode({address:f});return(e?.length??0)>2?(y=hw.DEPLOYED,"0x"):(y=hw.NOT_DEPLOYED,i())},g=d??(async e=>s({message:{raw:ci(e)}})),v=p??(()=>{throw new rb(r)}),w=async()=>"0x"===await b(),C=mw({address:f,signMessage:s,signTypedData:o,signTransaction:()=>{throw new ab}}),x=async(e,t)=>{if(e)return t;const[n,r]=yw(await i());return lb({factoryAddress:n,factoryCalldata:r,signature:t})};if("0.6.0"!==n.version&&"0.7.0"!==n.version)throw new Zy(t,n.version);return{...C,source:r,signUserOperationHash:g,getFactoryAddress:async()=>yw(await i())[0],getFactoryData:async()=>yw(await i())[1],encodeBatchExecute:c??(()=>{throw new sb(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(),C.signMessage(e)]);return x(t,n)},signTypedDataWith6492:async e=>{const[t,n]=await Promise.all([w(),C.signTypedData(e)]);return x(t,n)},getImplementationAddress:async()=>{const e=await h.getStorageAt({address:C.address,slot:"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"});if(null==e)throw new ib("0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc","Proxy Implementation Address");return qa(e)}}}({transport:e,chain:t,entryPoint:i,accountAddress:d,source:"MultiOwnerModularAccount",getAccountInitCode:u,...ZT,...VT(l,d,(()=>n))});return{...p,publicKey:await n.getAddress(),getSigner:()=>n}}async function JT(e,{overrides:t,account:n=e.account,context:r,...a}){if(!n)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","uninstallPlugin",e);const i=await async function(e){return jo({abi:UT,functionName:"uninstallPlugin",args:[e.pluginAddress,e.config??"0x",e.pluginUninstallData??"0x"]})}(a);return e.sendUserOperation({uo:i,overrides:t,account:n,context:r})}const XT=e=>({installPlugin:async t=>jT(e,t),uninstallPlugin:async t=>JT(e,t)}),YT=e=>({...$T(e),async readOwners(t){const n=t?.account??e.account;if(!n)throw new tb;return zT.getContract(e,t?.pluginAddress).read.ownersOf([n.address])},async isOwnerOf(t){const n=t.account??e.account;if(!n)throw new tb;return zT.getContract(e,t.pluginAddress).read.isOwnerOf([n.address,t.address])}}),QT=({chain:e,connectionConfig:t,fetchOptions:n={}})=>{const r=ET.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}`}),Vy({chain:r,transport:zu(a,{fetchOptions:n})}).extend((()=>({updateHeaders(e){n.headers={...n.headers,...e}}})))};async function eP(e){const{chain:t,opts:n,...r}=kT.parse(e),a=QT({chain:t,connectionConfig:r}),i=await KT({transport:Lu(a),...e});return function({opts:e,account:t,useSimulation:n,gasManagerConfig:r,feeEstimator:a,gasEstimator:i,customMiddleware:s,signUserOperation:o,client:c}){const l=e?.feeOptions??Jv(c.chain),u=Gw({account:t,client:c,type:"AlchemySmartAccountClient",opts:{...e,feeOptions:l},customMiddleware:async(e,t)=>(fw(t.account)&&c.updateHeaders(IT(t.account)),s?s(e,t):e),feeEstimator:a??PT(c),userOperationSimulator:n?ST(c):void 0,gasEstimator:i,...r&&_T(c,{...r,gasEstimationOptions:{...r.gasEstimationOptions,disableGasEstimation:r.gasEstimationOptions?.disableGasEstimation??!1,fallbackFeeDataGetter:r.gasEstimationOptions?.fallbackFeeDataGetter??a,fallbackGasEstimator:r.gasEstimationOptions?.fallbackGasEstimator??i}}),signUserOperation:o}).extend(TT);return t&&fw(t)&&c.updateHeaders(IT(t)),u}({...e,client:a,account:i,opts:n}).extend(YT).extend(XT).extend(RT)}const tP=e=>(t,n,r)=>{const a=r.subscribe;r.subscribe=(e,t,n)=>{let i=e;if(t){const a=(null==n?void 0:n.equalityFn)||Object.is;let s=e(r.getState());i=n=>{const r=e(n);if(!a(s,r)){const e=s;t(s=r,e)}},(null==n?void 0:n.fireImmediately)&&t(s,s)}return a(i)};return e(t,n,r)};function nP(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),i=null!=(r=n.getItem(e))?r:null;return i instanceof Promise?i.then(a):a(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)};return r}const rP=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>rP(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>rP(t)(e)}}},aP=(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 i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const o=new Set,c=new Set;let l;try{l=i.getStorage()}catch(e){}if(!l)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)}),r,a);const u=rP(i.serialize),d=()=>{const e=i.partialize({...r()});let t;const n=u({state:e,version:i.version}).then((e=>l.setItem(i.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;s=!1,o.forEach((e=>e(r())));const t=(null==(e=i.onRehydrateStorage)?void 0:e.call(i,r()))||void 0;return rP(l.getItem.bind(l))(i.name).then((e=>{if(e)return i.deserialize(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===i.version)return e.state;if(i.migrate)return i.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=i.merge(e,null!=(t=r())?t:h),n(m,!0),d()})).then((()=>{null==t||t(m,void 0),s=!0,c.forEach((e=>e(m)))})).catch((e=>{null==t||t(void 0,e)}))};return a.persist={setOptions:e=>{i={...i,...e},e.getStorage&&(l=e.getStorage())},clearStorage:()=>{null==l||l.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>f(),hasHydrated:()=>s,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 i={storage:nP((()=>localStorage)),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const o=new Set,c=new Set;let l=i.storage;if(!l)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)}),r,a);const u=()=>{const e=i.partialize({...r()});return l.setItem(i.name,{state:e,version:i.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;s=!1,o.forEach((e=>{var t;return e(null!=(t=r())?t:p)}));const a=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,null!=(e=r())?e:p))||void 0;return rP(l.getItem.bind(l))(i.name).then((e=>{if(e){if("number"!=typeof e.version||e.version===i.version)return e.state;if(i.migrate)return i.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=i.merge(e,null!=(t=r())?t:p),n(h,!0),u()})).then((()=>{null==a||a(h,void 0),h=r(),s=!0,c.forEach((e=>e(h)))})).catch((e=>{null==a||a(void 0,e)}))};return a.persist={setOptions:e=>{i={...i,...e},e.storage&&(l=e.storage)},clearStorage:()=>{null==l||l.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:e=>(o.add(e),()=>{o.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},i.skipHydration||m(),h||p})(e,t),iP=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,i={setState:r,getState:a,getInitialState:()=>s,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()}},s=t=e(r,a,i);return i},sP=e=>e?iP(e):iP;class oP extends Gy{constructor(){super(["Signer not authenticated","Please authenticate to use this signer"].join("\n"),{docsPath:"/signers/alchemy-signer/introduction.html"})}}const cP=yv.object({sessionKey:yv.string().default("alchemy-signer-session"),storage:yv.enum(["localStorage","sessionStorage"]).default("localStorage").or(yv.custom()),expirationTimeMs:yv.number().default(9e5).describe("The time in milliseconds that a session should last before expiring [default: 15 minutes]"),client:yv.custom()});class lP{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}=cP.parse(e);this.sessionKey=t;const i="string"==typeof n?"localStorage"===n?localStorage:sessionStorage:n;this.expirationTimeMs=r,this.client=a,this.eventEmitter=new xn,this.store=sP(tP(aP(this.getInitialState,{name:this.sessionKey,storage:nP((()=>i))}))),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 uP;!function(e){e.INITIALIZING="INITIALIZING",e.CONNECTED="CONNECTED",e.DISCONNECTED="DISCONNECTED",e.AUTHENTICATING="AUTHENTICATING",e.AWAITING_EMAIL_AUTH="AWAITING_EMAIL_AUTH"}(uP||(uP={}));class dP{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===uP.CONNECTED&&t(this.store.getState().user)),{fireImmediately:!0});case"disconnected":return this.store.subscribe((({status:e})=>e),(e=>e===uP.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=Id(e);return this.inner.signRawMessage(t)}}),Object.defineProperty(this,"signTypedData",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=md(e);return this.inner.signRawMessage(t)}}),Object.defineProperty(this,"signTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{const n=t?.serializer??Kd,r=n(e),a=await this.inner.signRawMessage(ns(r));return n(e,{r:Zv(a,{count:32}),s:Zv(a,{count:32,offset:32}),v:BigInt(Zv(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 oP;return mw({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:uP.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:uP.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:uP.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:uP.CONNECTED})})),this.sessionManager.on("disconnected",(()=>{this.store.setState({user:null,status:uP.DISCONNECTED})})),this.sessionManager.on("initialized",(()=>{this.store.setState((e=>({status:e.user?uP.CONNECTED:uP.DISCONNECTED})))})),this.inner.on("authenticating",(()=>{this.store.setState({status:uP.AUTHENTICATING})}))}}),this.inner=e,this.store=sP(tP((()=>({user:null,status:uP.INITIALIZING})))),this.sessionManager=new lP({...t,client:this.inner}),this.store=sP(tP((()=>({user:null,status:uP.INITIALIZING})))),this.registerListeners(),this.sessionManager.initialize()}}"undefined"!=typeof process&&null!=process.versions&&process.versions.node;var pP={exports:{}};!function(e,t){var n="undefined"!=typeof self?self:be,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 i(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 s(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=i(e),t=s(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},c.prototype.delete=function(e){delete this.map[i(e)]},c.prototype.get=function(e){return e=i(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(i(e))},c.prototype.set=function(e,t){this.map[i(e)]=s(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,i){var s=new f(e,r);if(s.signal&&s.signal.aborted)return i(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(){i(new TypeError("Network request failed"))},o.ontimeout=function(){i(new TypeError("Network request failed"))},o.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},o.open(s.method,s.url,!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&n.blob&&(o.responseType="blob"),s.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",l),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",l)}),o.send(void 0===s._bodyInit?null:s._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}(pP,pP.exports);var hP=ge(pP.exports);const mP=pP.exports.fetch;function fP(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 yP="copy",bP="convert";function gP(e,t,n){if(t===yP)return n;if(t===bP)return e(n);if(t instanceof Array)return n.map((n=>gP(e,t[0],n)));if(t instanceof Object){const r={};for(const[a,i]of Object.entries(t)){if(i.derive){const e=i.derive(n);void 0!==e&&(n[a]=e)}if(a in n)null!=n[a]?r[a]=gP(e,i.schema,n[a]):r[a]=null;else if(i.required)throw new Error(`Missing key: ${a}`)}return r}}function vP(e,t){return{required:!0,schema:e,derive:t}}function wP(e){return{required:!0,schema:e}}function CP(e){return{required:!1,schema:e}}const xP={appid:CP(yP),appidExclude:CP(yP),credProps:CP(yP)},EP={type:wP(yP),id:wP(yP),rawId:wP(bP),authenticatorAttachment:CP(yP),response:wP({clientDataJSON:wP(bP),attestationObject:wP(bP),transports:vP(yP,(e=>e.getTransports?.()||[]))}),clientExtensionResults:vP(xP,(e=>e.getClientExtensionResults()))};function kP(e){return gP(fP,EP,e)}function TP(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 PP(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=()=>kP(t),t}(e);return{credentialId:(n=t.toJSON()).rawId,attestationObject:n.response.attestationObject,clientDataJson:n.response.clientDataJSON,transports:n.response.transports.map(TP)};var n}class AP 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 _P{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),i=await mP(n,{method:"POST",headers:{[a.stampHeaderName]:a.stampHeaderValue,"X-Client-Version":"@turnkey/http@2.9.0"},body:r,redirect:"follow"});if(!i.ok){let e;try{e=await i.json()}catch(e){throw new Error(`${i.status} ${i.statusText}`)}throw new AP(e)}return await i.json()}}var DP;!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"}(DP||(DP={}));class OP{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===DP.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:DP.InjectCredentialBundle,value:e},"*"),window.addEventListener("message",(e=>{e.origin===this.iframeOrigin&&(e.data?.type===DP.BundleInjected&&t(e.data.value),e.data?.type===DP.Error&&n(e.data.value))}),!1)}))}async injectKeyExportBundle(e){return this.iframe.contentWindow?.postMessage({type:DP.InjectKeyExportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===DP.BundleInjected&&e(n.data.value),n.data?.type===DP.Error&&t(n.data.value))}),!1)}))}async injectWalletExportBundle(e){return this.iframe.contentWindow?.postMessage({type:DP.InjectWalletExportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===DP.BundleInjected&&e(n.data.value),n.data?.type===DP.Error&&t(n.data.value))}),!1)}))}async injectImportBundle(e){return this.iframe.contentWindow?.postMessage({type:DP.InjectImportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===DP.BundleInjected&&e(n.data.value),n.data?.type===DP.Error&&t(n.data.value))}),!1)}))}async extractWalletEncryptedBundle(){return this.iframe.contentWindow?.postMessage({type:DP.ExtractWalletEncryptedBundle},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===DP.EncryptedBundleExtracted&&e(n.data.value),n.data?.type===DP.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:DP.StampRequest,value:e},"*"),new Promise((function(e,n){window.addEventListener("message",(r=>{r.origin===t&&(r.data?.type===DP.Stamp&&e({stampHeaderName:"X-Stamp",stampHeaderValue:r.data.value}),r.data?.type===DP.Error&&n(r.data.value))}),!1)}))}}function FP(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 SP="copy",IP="convert";function MP(e,t,n){if(t===SP)return n;if(t===IP)return e(n);if(t instanceof Array)return n.map((n=>MP(e,t[0],n)));if(t instanceof Object){const r={};for(const[a,i]of Object.entries(t)){if(i.derive){const e=i.derive(n);void 0!==e&&(n[a]=e)}if(a in n)null!=n[a]?r[a]=MP(e,i.schema,n[a]):r[a]=null;else if(i.required)throw new Error(`Missing key: ${a}`)}return r}}function NP(e){return{required:!0,schema:e}}function UP(e){return{required:!1,schema:e}}const LP={appid:UP(SP),appidExclude:UP(SP),credProps:UP(SP)},BP={type:NP(SP),id:NP(SP),rawId:NP(IP),authenticatorAttachment:UP(SP),response:NP({clientDataJSON:NP(IP),authenticatorData:NP(IP),signature:NP(IP),userHandle:NP(IP)}),clientExtensionResults:(RP=LP,jP=e=>e.getClientExtensionResults(),{required:!0,schema:RP,derive:jP})};var RP,jP;function GP(e){return MP(FP,BP,e)}let zP;function $P(e,...t){if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function HP(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")}zP=void 0!==globalThis?.Buffer?globalThis.Buffer:s.Buffer;
26
+ function ME(e,t,n,r){return new(n||(n=Promise))((function(a,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(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(s,o)}c((r=r.apply(e,t||[])).next())}))}function NE(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 UE(e){return this instanceof UE?(this.v=e,this):new UE(e)}function LE(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,a=n.apply(e,t||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){a[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||o(e,t)}))})}function o(e,t){try{!function(e){e.value instanceof UE?Promise.resolve(e.value.v).then(c,l):u(i[0][2],e)}(a[e](t))}catch(e){u(i[0][3],e)}}function c(e){o("next",e)}function l(e){o("throw",e)}function u(e,t){e(t),i.shift(),i.length&&o(i[0][0],i[0][1])}}function BE(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=NE(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,(lE=exports.Network||(exports.Network={})).ETH_MAINNET="eth-mainnet",lE.ETH_GOERLI="eth-goerli",lE.ETH_SEPOLIA="eth-sepolia",lE.OPT_MAINNET="opt-mainnet",lE.OPT_GOERLI="opt-goerli",lE.OPT_SEPOLIA="opt-sepolia",lE.ARB_MAINNET="arb-mainnet",lE.ARB_GOERLI="arb-goerli",lE.ARB_SEPOLIA="arb-sepolia",lE.MATIC_MAINNET="polygon-mainnet",lE.MATIC_MUMBAI="polygon-mumbai",lE.MATIC_AMOY="polygon-amoy",lE.ASTAR_MAINNET="astar-mainnet",lE.POLYGONZKEVM_MAINNET="polygonzkevm-mainnet",lE.POLYGONZKEVM_TESTNET="polygonzkevm-testnet",lE.BASE_MAINNET="base-mainnet",lE.BASE_GOERLI="base-goerli",lE.BASE_SEPOLIA="base-sepolia",function(e){e.DEFAULT_TOKENS="DEFAULT_TOKENS",e.ERC20="erc20"}(uE||(uE={})),function(e){e.EXTERNAL="external",e.INTERNAL="internal",e.ERC20="erc20",e.ERC721="erc721",e.ERC1155="erc1155",e.SPECIALNFT="specialnft"}(dE||(dE={})),function(e){e.TO="TO",e.FROM="FROM"}(pE||(pE={})),function(e){e.ASCENDING="asc",e.DESCENDING="desc"}(hE||(hE={})),function(e){e.VERIFIED="verified",e.APPROVED="approved",e.REQUESTED="requested",e.NOT_REQUESTED="not_requested"}(mE||(mE={})),exports.AlchemySubscription=void 0,(fE=exports.AlchemySubscription||(exports.AlchemySubscription={})).PENDING_TRANSACTIONS="alchemy_pendingTransactions",fE.MINED_TRANSACTIONS="alchemy_minedTransactions",function(e){e.NATIVE="NATIVE",e.ERC20="ERC20",e.ERC721="ERC721",e.ERC1155="ERC1155",e.SPECIAL_NFT="SPECIAL_NFT"}(yE||(yE={})),function(e){e.APPROVE="APPROVE",e.TRANSFER="TRANSFER"}(bE||(bE={})),function(e){e.ETHERSCAN="ETHERSCAN"}(gE||(gE={})),function(e){e.CREATE="CREATE",e.CALL="CALL",e.STATICCALL="STATICCALL",e.DELEGATECALL="DELEGATECALL"}(vE||(vE={})),function(e){e.UNSPECIFIED="TRANSACTION_JOB_STATUS_UNSPECIFIED",e.IN_PROGRESS="IN_PROGRESS",e.COMPLETE="COMPLETE",e.ABANDONED="ABANDONED"}(wE||(wE={})),function(e){e.V1="V1",e.V2="V2"}(CE||(CE={})),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"}(xE||(xE={})),function(e){e.PENDING="pending",e.LATEST="latest",e.SAFE="safe",e.FINALIZED="finalized",e.EARLIEST="earliest"}(EE||(EE={})),function(e){e.CALL_TRACER="callTracer",e.PRESTATE_TRACER="prestateTracer"}(kE||(kE={})),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"}(TE||(TE={})),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"}(PE||(PE={})),function(e){e.SPAM="SPAM",e.AIRDROPS="AIRDROPS"}(AE||(AE={})),function(e){e.TRANSFERTIME="TRANSFERTIME"}(_E||(_E={})),function(e){e.SEAPORT="seaport",e.LOOKSRARE="looksrare",e.X2Y2="x2y2",e.WYVERN="wyvern",e.CRYPTOPUNKS="cryptopunks",e.BLUR="blur",e.UNKNOWN="unknown"}(DE||(DE={})),function(e){e.BUYER="buyer",e.SELLER="seller"}(OE||(OE={})),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"}(FE||(FE={})),function(e){e.OPENSEA="OpenSea"}(SE||(SE={}));const RE="demo",jE=exports.Network.ETH_MAINNET;function GE(e,t){return`https://${e}.g.alchemy.com/v2/${t}`}var zE;!function(e){e[e.BASE=0]="BASE",e[e.NFT=1]="NFT",e[e.WEBHOOK=2]="WEBHOOK"}(zE||(zE={}));const $E={[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 HE{constructor(e){this.apiKey=(null==e?void 0:e.apiKey)||RE,this.network=(null==e?void 0:e.network)||jE,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===zE.NFT?(t=this.network,n=this.apiKey,`https://${t}.g.alchemy.com/nft/v3/${n}`):e===zE.WEBHOOK?"https://dashboard.alchemy.com/api":GE(this.network,this.apiKey);var t,n}getProvider(){return this._baseAlchemyProvider||(this._baseAlchemyProvider=(()=>ME(this,void 0,void 0,(function*(){const{AlchemyProvider:e}=yield Promise.resolve().then((function(){return require("./alchemy-provider-5870b6fa-e24212d7.cjs")})).then((function(e){return e.alchemyProvider5870b6fa}));return new e(this)})))()),this._baseAlchemyProvider}getWebSocketProvider(){return this._baseAlchemyWssProvider||(this._baseAlchemyWssProvider=(()=>ME(this,void 0,void 0,(function*(){const{AlchemyWebSocketProvider:e}=yield Promise.resolve().then((function(){return require("./alchemy-websocket-provider-213da986-84543bd0.cjs")}));return new e(this)})))()),this._baseAlchemyWssProvider}}let qE=!1,VE=!1;const WE={debug:1,default:2,info:2,warning:3,error:4,off:5};let ZE=WE.default,KE=null;const JE=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 XE,YE;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(XE||(XE={})),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"}(YE||(YE={}));const QE="0123456789abcdef";class ek{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==WE[n]&&this.throwArgumentError("invalid log level name","logLevel",e),ZE>WE[n]||console.log.apply(console,t)}debug(...e){this._log(ek.levels.DEBUG,e)}info(...e){this._log(ek.levels.INFO,e)}warn(...e){this._log(ek.levels.WARNING,e)}makeError(e,t,n){if(VE)return this.makeError("censored error",t,{});t||(t=ek.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+=QE[t[e]>>4],n+=QE[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 i="";switch(t){case YE.NUMERIC_FAULT:{i="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":i+="-"+t;break;case"negative-power":case"negative-width":i+="-unsupported";break;case"unbound-bitwise-result":i+="-unbound-result"}break}case YE.CALL_EXCEPTION:case YE.INSUFFICIENT_FUNDS:case YE.MISSING_NEW:case YE.NONCE_EXPIRED:case YE.REPLACEMENT_UNDERPRICED:case YE.TRANSACTION_REPLACED:case YE.UNPREDICTABLE_GAS_LIMIT:i=t}i&&(e+=" [ See: https://links.ethers.org/v5-errors-"+i+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const s=new Error(e);return s.reason=a,s.code=t,Object.keys(n).forEach((function(e){s[e]=n[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,ek.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){JE&&this.throwError("platform missing String.prototype.normalize",ek.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:JE})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,ek.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,ek.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,ek.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,ek.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",ek.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",ek.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",ek.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return KE||(KE=new ek("logger/5.7.0")),KE}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",ek.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),qE){if(!e)return;this.globalLogger().throwError("error censorship permanent",ek.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}VE=!!e,qE=!!t}static setLogLevel(e){const t=WE[e.toLowerCase()];null!=t?ZE=t:ek.globalLogger().warn("invalid log level - "+e)}static from(e){return new ek(e)}}ek.errors=YE,ek.levels=XE;var tk=function(e,t,n,r){return new(n||(n=Promise))((function(a,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function o(e){try{c(r.throw(e))}catch(e){i(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(s,o)}c((r=r.apply(e,t||[])).next())}))};const nk=new ek("properties/5.7.0");function rk(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function ak(e){return tk(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 ik={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function sk(e){if(null==e||ik[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(!sk(r))return!1}return!0}return nk.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ok(e){if(sk(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>ck(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&rk(t,n,ck(r))}return t}return nk.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ck(e){return ok(e)}function lk(e){return nC.from(e).toNumber()}function uk(e){return nC.from(e).toHexString()}function dk(e){return"string"==typeof e?e:Number.isInteger(e)?uk(e):e.toString()}function pk(e,t){return Object.values(t).includes(e)?e:null}function hk(e){return Ek(Object.assign(Object.assign({},mk(e)),{displayNft:e.displayNft,image:e.image,totalBalance:e.totalBalance,numDistinctTokensOwned:e.numDistinctTokensOwned,isSpam:e.isSpam}))}function mk(e){return Ek(Object.assign(Object.assign({},e),{tokenType:Ck(e.tokenType),openSeaMetadata:Object.assign(Object.assign({},e.openSeaMetadata),{safelistRequestStatus:null!==e.openSeaMetadata.safelistRequestStatus?pk(e.openSeaMetadata.safelistRequestStatus,mE):null})}))}function fk(e,t){return{contractAddress:t||e.contractAddress,tokenId:e.tokenId}}function yk(e){return Ek(Object.assign(Object.assign({},e),{contract:(t=e.contract,Ek(Object.assign(Object.assign({},mk(t)),{spamClassifications:t.spamClassifications.map(wk)}))),tokenType:Ck(e.tokenType),acquiredAt:e.acquiredAt,collection:e.collection,mint:e.mint}));var t}function bk(e){switch(e){case"looksrare":return DE.LOOKSRARE;case"seaport":return DE.SEAPORT;case"x2y2":return DE.X2Y2;case"wyvern":return DE.WYVERN;case"cryptopunks":return DE.CRYPTOPUNKS;case"blur":return DE.BLUR;default:return DE.UNKNOWN}}function gk(e){if("OpenSea"===e)return SE.OPENSEA}function vk(e){switch(e.toLowerCase()){case"buyer":return OE.BUYER;case"seller":return OE.SELLER;default:throw new Error(`Unsupported NftSaleTakerType ${e}`)}}function wk(e){const t=pk(e,PE);return null==t?PE.Unknown:t}function Ck(e){switch(e){case"erc721":case"ERC721":return TE.ERC721;case"erc1155":case"ERC1155":return TE.ERC1155;case"no_supported_nft_standard":case"NO_SUPPORTED_NFT_STANDARD":return TE.NO_SUPPORTED_NFT_STANDARD;case"not_a_contract":case"NOT_A_CONTRACT":return TE.NOT_A_CONTRACT;default:return TE.UNKNOWN}}const xk="undefined"!=typeof window&&null!==window;function Ek(e){if(null!=e){if("Object"===e.constructor.name||Array.isArray(e))for(const t in e)e[t]=Ek(e[t]);return e}}function kk(e,t,n="getAssetTransfers"){return ME(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?dk(t.fromBlock):void 0,toBlock:null!=t.toBlock?dk(t.toBlock):void 0,maxCount:null!=t.maxCount?uk(t.maxCount):void 0})],n)}))}function Tk(e,t,n="getTransactionReceipts"){return ME(this,void 0,void 0,(function*(){return(yield e.getProvider())._send("alchemy_getTransactionReceipts",[t],n)}))}function Pk(e,t){return ME(this,void 0,void 0,(function*(){const n=yield e.getProvider();yield n.getNetwork();const r=yield ak({filter:Ak(e,t)}),a=yield n.send("eth_getLogs",[r.filter]);return a.forEach((e=>{null==e.removed&&(e.removed=!1)})),(i=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(i(e))})),t})(a);var i}))}function Ak(e,t){return ME(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 ak(a)),Array.isArray(r.address)?a.address=yield Promise.all(r.address.map((e=>ME(this,void 0,void 0,(function*(){return n._getAddress(e)}))))):null!=r.address&&(a.address=yield n._getAddress(r.address)),a}))}class _k{constructor(e){this.config=e}getBalance(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBalance(e,t)}))}isContractAddress(e){return ME(this,void 0,void 0,(function*(){const t=yield this.config.getProvider();return"0x"!==(yield t.getCode(e))}))}getCode(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getCode(e,t)}))}getStorageAt(e,t,n){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getStorageAt(e,t,n)}))}getTransactionCount(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransactionCount(e,t)}))}getBlock(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlock(e)}))}getBlockWithTransactions(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlockWithTransactions(e)}))}getNetwork(){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getNetwork()}))}getBlockNumber(){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getBlockNumber()}))}getGasPrice(){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getGasPrice()}))}getFeeData(){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getFeeData()}))}ready(){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).ready}))}call(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).call(e,t)}))}estimateGas(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).estimateGas(e)}))}getTransaction(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransaction(e)}))}getTransactionReceipt(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransactionReceipt(e)}))}sendTransaction(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).sendTransaction(e)}))}waitForTransaction(e,t,n){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).waitForTransaction(e,t,n)}))}getLogs(e){return ME(this,void 0,void 0,(function*(){return Pk(this.config,e)}))}send(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).send(e,t)}))}findContractDeployer(e){var t;return ME(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 Dk(0,r+1,e,this.config),i=yield Tk(this.config,{blockNumber:uk(a)},"findContractDeployer"),s=null===(t=i.receipts)||void 0===t?void 0:t.find((t=>t.contractAddress===e.toLowerCase()));return{deployerAddress:null==s?void 0:s.from,blockNumber:a}}))}getTokenBalances(e,t){return ME(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?uE.ERC20:t.type];return(null==t?void 0:t.type)===uE.ERC20&&t.pageKey&&e.push({pageKey:t.pageKey}),n._send("alchemy_getTokenBalances",e,"getTokenBalances")}}))}getTokensForOwner(e,t){var n;return ME(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:uE.ERC20];(null==t?void 0:t.pageKey)&&a.push({pageKey:t.pageKey});const i=yield r._send("alchemy_getTokenBalances",a,"getTokensForOwner"),s=i.tokenBalances.map((e=>({contractAddress:e.contractAddress,rawBalance:nC.from(e.tokenBalance).toString()}))),o=(yield Promise.allSettled(i.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=s.map(((e,t)=>Object.assign(Object.assign(Object.assign({},e),o[t]),{balance:null!==o[t].decimals?xC(e.rawBalance,o[t].decimals):void 0})));return{tokens:c.map((e=>Ek(e))),pageKey:i.pageKey}}))}getTokenMetadata(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_getTokenMetadata",[e],"getTokenMetadata")}))}getAssetTransfers(e){return ME(this,void 0,void 0,(function*(){return kk(this.config,e)}))}getTransactionReceipts(e){return ME(this,void 0,void 0,(function*(){return Tk(this.config,e)}))}resolveName(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).resolveName(e)}))}lookupAddress(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).lookupAddress(e)}))}}function Dk(e,t,n,r){return ME(this,void 0,void 0,(function*(){if(e>=t)return t;const a=Math.floor((e+t)/2),i=yield r.getProvider();return"0x"===(yield i.getCode(n,a))?Dk(a+1,t,n,r):Dk(e,a,n,r)}))}class Ok{constructor(e){this.config=e}traceCall(e,t,n){return ME(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[e,t,Fk(n)];return r._send("debug_traceCall",a,"traceCall")}))}traceTransaction(e,t,n){return ME(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=[e,Fk(t,n)];return r._send("debug_traceTransaction",a,"traceTransaction")}))}traceBlock(e,t){return ME(this,void 0,void 0,(function*(){const r=yield this.config.getProvider();let a,i;if(n.isHexString(e,32))a="debug_traceBlockByHash",i=[e,Fk(t)];else{a="debug_traceBlockByNumber";i=["number"==typeof e?n.hexStripZeros(n.hexValue(e)):e,Fk(t)]}return r._send(a,i,"traceBlock")}))}}function Fk(e,t){return Object.assign({tracer:e.type},void 0!==e.onlyTopCall&&{tracerConfig:{onlyTopCall:e.onlyTopCall,timeout:t}})}function Sk(e){if(e===TE.ERC1155||e===TE.ERC721)return e}var Ik;!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"}(Ik||(Ik={})),Ik.DEBUG,Ik.INFO,Ik.WARN,Ik.ERROR,Ik.SILENT;const Mk={[Ik.DEBUG]:"log",[Ik.INFO]:"info",[Ik.WARN]:"warn",[Ik.ERROR]:"error"},Nk=Ik.INFO;function Uk(e,...t){Rk.debug(e,t)}function Lk(e,...t){Rk.info(e,t)}function Bk(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return e}}const Rk=new class{constructor(){this._logLevel=Nk}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Ik))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}debug(...e){this._log(Ik.DEBUG,...e)}info(...e){this._log(Ik.INFO,...e)}warn(...e){this._log(Ik.WARN,...e)}error(...e){this._log(Ik.ERROR,...e)}_log(e,...t){if(e<this._logLevel)return;const n=(new Date).toISOString(),r=Mk[e];if(!r)throw new Error(`Logger received an invalid logLevel (value: ${e})`);console[r](`[${n}] Alchemy:`,...t.map(Bk))}},jk="3.2.0";function Gk(e,t,n,r,a){var i;const s=e+"/"+t,o=Object.assign(Object.assign({},a),{headers:Object.assign(Object.assign(Object.assign({},null==a?void 0:a.headers),!xk&&{"Accept-Encoding":"gzip"}),{"Alchemy-Ethers-Sdk-Version":jk,"Alchemy-Ethers-Sdk-Method":n}),method:null!==(i=null==a?void 0:a.method)&&void 0!==i?i:"GET",url:s,params:r});return IE(o)}class zk{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&&Uk("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 $k(e,t,n,r,a,i){return ME(this,void 0,void 0,(function*(){let s;const o=new zk(e.maxRetries);for(let c=0;c<e.maxRetries+1;c++)try{void 0!==s&&Lk("requestHttp",`Retrying after error: ${s.message}`);try{yield o.backoff()}catch(e){break}const c=yield Gk(e._getRequestUrl(t),n,r,a,Object.assign(Object.assign({},i),{timeout:e.requestTimeout}));if(200===c.status)return Uk(n,`Successful request: ${n}`),c.data;Lk(n,`Request failed: ${n}, ${c.status}, ${c.data}`),s=new Error(c.status+": "+c.data)}catch(e){if(!IE.isAxiosError(e)||void 0===e.response)throw e;if(s=new Error(e.response.status+": "+e.response.data),!Hk(e,t))break}return Promise.reject(s)}))}function Hk(e,t){const n=t===zE.WEBHOOK?[429,500]:[429];return void 0!==e.response&&n.includes(e.response.status)}function qk(e,t,n,r,a,i,s){return LE(this,arguments,(function*(){let o=!0;const c=Object.assign({},s);for(;o;){const s=yield UE($k(e,t,n,r,c));yield yield UE(s),null!==s[i]?c[a]=s[i]:o=!1}}))}function Vk(e,t,n,r,a="getNftMetadata"){return ME(this,void 0,void 0,(function*(){return yk(yield $k(e,zE.NFT,"getNFTMetadata",a,{contractAddress:t,tokenId:nC.from(n).toString(),tokenType:Sk(null==r?void 0:r.tokenType),tokenUriTimeoutInMs:null==r?void 0:r.tokenUriTimeoutInMs,refreshCache:null==r?void 0:r.refreshCache}))}))}function Wk(e,t,n){return ME(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 $k(e,zE.NFT,"getNFTMetadataBatch","getNftMetadataBatch",{},{method:"POST",data:r})).nfts.map((e=>yk(e)))}}))}function Zk(e,t,n="getCollectionMetadata"){return ME(this,void 0,void 0,(function*(){const r=yield $k(e,zE.NFT,"getCollectionMetadata",n,{collectionSlug:t});return a=r,Ek(Object.assign(Object.assign({},a),{floorPrice:Object.assign(Object.assign({},a.floorPrice),{marketplace:gk(a.floorPrice.marketplace)})}));var a}))}function Kk(e,t,n,r="getNftsForOwner"){return ME(this,void 0,void 0,(function*(){const a=rT(null==n?void 0:n.omitMetadata),i=yield $k(e,zE.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 Ek(a?{ownedNfts:i.ownedNfts.map((e=>Object.assign(Object.assign({},yk(e)),{balance:e.balance}))),pageKey:i.pageKey,totalCount:i.totalCount,validAt:i.validAt}:{ownedNfts:i.ownedNfts.map((e=>Object.assign(Object.assign({},fk(e)),{balance:e.balance}))),pageKey:i.pageKey,totalCount:i.totalCount,validAt:i.validAt})}))}function Jk(e){switch(e){case TE.ERC721:return[dE.ERC721];case TE.ERC1155:return[dE.ERC1155];default:return[dE.ERC721,dE.ERC1155,dE.SPECIALNFT]}}function Xk(e,t={},n="getNftSales"){return ME(this,void 0,void 0,(function*(){const r=Object.assign({},t),a=yield $k(e,zE.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)?nC.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 Ek({nftSales:(i=a).nftSales.map((e=>Object.assign(Object.assign({},e),{marketplace:bk(e.marketplace),taker:vk(e.taker)}))),validAt:i.validAt,pageKey:i.pageKey});var i}))}function Yk(e,t,n,r="refreshNftMetadata"){return ME(this,void 0,void 0,(function*(){const a=nC.from(n).toString(),i=yield Vk(e,t,a,void 0,r),s=yield function(e,t,n,r){return ME(this,void 0,void 0,(function*(){return yk(yield $k(e,zE.NFT,"getNFTMetadata",r,{contractAddress:t,tokenId:nC.from(n).toString(),refreshCache:!0}))}))}(e,t,a,r);return i.timeLastUpdated!==s.timeLastUpdated}))}function Qk(e){return tT(e)?yk(e):fk(e)}function eT(e,t){return tT(e)?yk(e):fk(e,t)}function tT(e){return void 0!==e.name}function nT(e,t){return ME(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===dE.ERC1155?function(e){return e.erc1155Metadata.map((t=>({contractAddress:e.rawContract.address,tokenId:t.tokenId,tokenType:TE.ERC1155})))}(e):[{contractAddress:e.rawContract.address,tokenId:e.tokenId,tokenType:e.category===dE.ERC721?TE.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=>Wk(e,t.map((e=>e.token))))))).map((e=>e.nfts)).flat(),i=new Map;a.forEach((e=>{const t=`${e.contract.address.toLowerCase()}-${nC.from(e.tokenId).toString()}`;i.set(t,e)}));const s=n.map((e=>{const t=`${e.token.contractAddress.toLowerCase()}-${nC.from(e.token.tokenId).toString()}`;return Object.assign(Object.assign({},i.get(t)),e.metadata)}));return{nfts:s,pageKey:t.pageKey}}))}function rT(e){return void 0===e||!e}function aT(e){switch(e){case"does_not_exist":return FE.DOES_NOT_EXIST;case"already_queued":return FE.ALREADY_QUEUED;case"in_progress":return FE.IN_PROGRESS;case"finished":return FE.FINISHED;case"queued":return FE.QUEUED;case"queue_failed":return FE.QUEUE_FAILED;default:throw new Error("Unknown reingestion state: "+e)}}class iT{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},Vk(this.config,e,t,a)}getNftMetadataBatch(e,t){return Wk(this.config,e,t)}getContractMetadata(e){return function(e,t,n="getContractMetadata"){return ME(this,void 0,void 0,(function*(){return mk(yield $k(e,zE.NFT,"getContractMetadata",n,{contractAddress:t}))}))}(this.config,e)}getContractMetadataBatch(e){return function(e,t){return ME(this,void 0,void 0,(function*(){return{contracts:(yield $k(e,zE.NFT,"getContractMetadataBatch","getContractMetadataBatch",{},{method:"POST",data:{contractAddresses:t}})).contracts.map(mk)}}))}(this.config,e)}getCollectionMetadata(e){return Zk(this.config,e)}getNftsForOwnerIterator(e,t){return function(e,t,n,r="getNftsForOwnerIterator"){return LE(this,arguments,(function*(){var a,i;const s=rT(null==n?void 0:n.omitMetadata);try{for(var o,c=BE(qk(e,zE.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:s,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs,orderBy:null==n?void 0:n.orderBy}));!(o=yield UE(c.next())).done;){const e=o.value;for(const t of e.ownedNfts)yield yield UE(Object.assign(Object.assign({},Qk(t)),{balance:t.balance}))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(i=c.return)&&(yield UE(i.call(c)))}finally{if(a)throw a.error}}}))}(this.config,e,t)}getNftsForOwner(e,t){return Kk(this.config,e,t)}getNftsForContract(e,t){return function(e,t,n,r="getNftsForContract"){var a;return ME(this,void 0,void 0,(function*(){const i=rT(null==n?void 0:n.omitMetadata),s=yield $k(e,zE.NFT,"getNFTsForContract",r,{contractAddress:t,pageKey:null==n?void 0:n.pageKey,withMetadata:i,limit:null!==(a=null==n?void 0:n.pageSize)&&void 0!==a?a:void 0,tokenUriTimeoutInMs:null==n?void 0:n.tokenUriTimeoutInMs});return Ek(i?{nfts:s.nfts.map((e=>yk(e))),pageKey:s.pageKey}:{nfts:s.nfts.map((e=>fk(e,t))),pageKey:s.pageKey})}))}(this.config,e,t)}getNftsForContractIterator(e,t){return function(e,t,n,r="getNftsForContractIterator"){return LE(this,arguments,(function*(){var a,i;const s=rT(null==n?void 0:n.omitMetadata);try{for(var o,c=BE(qk(e,zE.NFT,"getNFTsForContract",r,"pageKey","pageKey",{contractAddress:t,pageKey:null==n?void 0:n.pageKey,withMetadata:s}));!(o=yield UE(c.next())).done;){const e=o.value;for(const n of e.nfts)yield yield UE(eT(n,t))}}catch(e){a={error:e}}finally{try{o&&!o.done&&(i=c.return)&&(yield UE(i.call(c)))}finally{if(a)throw a.error}}}))}(this.config,e,t)}getOwnersForContract(e,t){return function(e,t,n,r="getOwnersForContract"){return ME(this,void 0,void 0,(function*(){const a=yield $k(e,zE.NFT,"getOwnersForContract",r,Object.assign(Object.assign({},n),{contractAddress:t}));return null==n||n.withTokenBalances,Ek({owners:a.owners,pageKey:a.pageKey})}))}(this.config,e,t)}getOwnersForNft(e,t,n){return function(e,t,n,r,a="getOwnersForNft"){return ME(this,void 0,void 0,(function*(){return $k(e,zE.NFT,"getOwnersForNFT",a,Object.assign({contractAddress:t,tokenId:nC.from(n).toString()},r))}))}(this.config,e,t,n)}getContractsForOwner(e,t){return function(e,t,n,r="getContractsForOwner"){return ME(this,void 0,void 0,(function*(){const a=yield $k(e,zE.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 Ek({contracts:a.contracts.map(hk),pageKey:a.pageKey,totalCount:a.totalCount})}))}(this.config,e,t)}getTransfersForOwner(e,t,n){return function(e,t,n,r){return ME(this,void 0,void 0,(function*(){const a=yield e.getProvider(),i=yield a._getAddress(t),s=Jk(null==r?void 0:r.tokenType),o={fromBlock:"0x0",excludeZeroValue:!0,contractAddresses:null==r?void 0:r.contractAddresses,category:s,maxCount:100,pageKey:null==r?void 0:r.pageKey};n===pE.TO?o.toAddress=i:o.fromAddress=i;const c=yield kk(e,o,"getTransfersForOwner");return nT(e,c)}))}(this.config,e,t,n)}getTransfersForContract(e,t){return function(e,t,n){return ME(this,void 0,void 0,(function*(){const r=[dE.ERC721,dE.ERC1155,dE.SPECIALNFT],a=yield e.getProvider(),i={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},s=yield kk(e,i,"getTransfersForContract");return nT(e,s)}))}(this.config,e,t)}getMintedNfts(e,t){return ME(this,void 0,void 0,(function*(){return function(e,t,n){return ME(this,void 0,void 0,(function*(){const r=yield e.getProvider(),a=yield r._getAddress(t),i=Jk(null==n?void 0:n.tokenType),s={fromBlock:"0x0",fromAddress:"0x0000000000000000000000000000000000000000",toAddress:a,excludeZeroValue:!0,contractAddresses:null==n?void 0:n.contractAddresses,category:i,maxCount:100,pageKey:null==n?void 0:n.pageKey},o=yield kk(e,s,"getMintedNfts");return nT(e,o)}))}(this.config,e,t)}))}verifyNftOwnership(e,t){return function(e,t,n,r="verifyNftOwnership"){return ME(this,void 0,void 0,(function*(){if("string"==typeof n)return(yield Kk(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 Kk(e,t,{contractAddresses:n,omitMetadata:!0},r),i=n.reduce(((e,t)=>(e[t]=!1,e)),{});for(const e of a.ownedNfts)i[e.contractAddress]=!0;return i}}))}(this.config,e,t)}isSpamContract(e){return function(e,t,n="isSpamContract"){return ME(this,void 0,void 0,(function*(){return $k(e,zE.NFT,"isSpamContract",n,{contractAddress:t})}))}(this.config,e)}getSpamContracts(){return function(e,t="getSpamContracts"){return ME(this,void 0,void 0,(function*(){return $k(e,zE.NFT,"getSpamContracts",t,void 0)}))}(this.config)}reportSpam(e){return function(e,t,n="reportSpam"){return ME(this,void 0,void 0,(function*(){$k(e,zE.NFT,"reportSpam",n,{contractAddress:t})}))}(this.config,e)}isAirdropNft(e,t){return function(e,t,n,r="isAirdropNft"){return ME(this,void 0,void 0,(function*(){return $k(e,zE.NFT,"isAirdropNFT",r,{contractAddress:t,tokenId:n})}))}(this.config,e,t)}getFloorPrice(e){return function(e,t,n="getFloorPrice"){return ME(this,void 0,void 0,(function*(){return Ek(yield $k(e,zE.NFT,"getFloorPrice",n,{contractAddress:t}))}))}(this.config,e)}getNftSales(e){return Xk(this.config,e)}computeRarity(e,t){return function(e,t,n,r="computeRarity"){return ME(this,void 0,void 0,(function*(){return Ek(yield $k(e,zE.NFT,"computeRarity",r,{contractAddress:t,tokenId:nC.from(n).toString()}))}))}(this.config,e,t)}searchContractMetadata(e){return function(e,t,n="searchContractMetadata"){return ME(this,void 0,void 0,(function*(){return{contracts:(yield $k(e,zE.NFT,"searchContractMetadata",n,{query:t})).contracts.map(mk)}}))}(this.config,e)}summarizeNftAttributes(e){return function(e,t,n="summarizeNftAttributes"){return ME(this,void 0,void 0,(function*(){return $k(e,zE.NFT,"summarizeNFTAttributes",n,{contractAddress:t})}))}(this.config,e)}refreshNftMetadata(e,t){return Yk(this.config,e,t)}refreshContract(e){return function(e,t,n="refreshContract"){return ME(this,void 0,void 0,(function*(){const r=yield $k(e,zE.NFT,"reingestContract",n,{contractAddress:t});return{contractAddress:r.contractAddress,refreshState:aT(r.reingestionState),progress:r.progress}}))}(this.config,e)}}class sT{constructor(e){this.config=e}getAllWebhooks(){return ME(this,void 0,void 0,(function*(){this.verifyConfig();const e=yield this.sendWebhookRequest("team-webhooks","getAllWebhooks",{});return{webhooks:lT(e),totalCount:e.data.length}}))}getAddresses(e,t){return ME(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 ME(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 ME(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:nC.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 ME(this,void 0,void 0,(function*(){const n="string"==typeof e?e:e.id;let r,a,i,s;if("isActive"in t)r="update-webhook",a="updateWebhook",i="PUT",s={webhook_id:n,is_active:t.isActive};else if("addFilters"in t||"removeFilters"in t)r="update-webhook-nft-filters",a="updateWebhookNftFilters",i="PATCH",s={webhook_id:n,nft_filters_to_add:t.addFilters?t.addFilters.map(dT):[],nft_filters_to_remove:t.removeFilters?t.removeFilters.map(dT):[]};else if("addMetadataFilters"in t||"removeMetadataFilters"in t)r="update-webhook-nft-metadata-filters",a="updateWebhookNftMetadataFilters",i="PATCH",s={webhook_id:n,nft_metadata_filters_to_add:t.addMetadataFilters?t.addMetadataFilters.map(dT):[],nft_metadata_filters_to_remove:t.removeMetadataFilters?t.removeMetadataFilters.map(dT):[]};else if("addAddresses"in t||"removeAddresses"in t)r="update-webhook-addresses",a="webhook:updateWebhookAddresses",i="PATCH",s={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",i="PUT",s={webhook_id:n,addresses:yield this.resolveAddresses(t.newAddresses)}}yield this.sendWebhookRequest(r,a,{},{method:i,data:s})}))}createWebhook(e,t,n){return ME(this,void 0,void 0,(function*(){let r;if(t===xE.MINED_TRANSACTION||t===xE.DROPPED_TRANSACTION){if(!("appId"in n))throw new Error("Transaction Webhooks require an app id.");r=n.appId}let a,i,s,o=cT.get(this.config.network);if(t===xE.NFT_ACTIVITY||t===xE.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?cT.get(n.network):o;const e=n.filters.map((e=>e.tokenId?{contract_address:e.contractAddress,token_id:nC.from(e.tokenId).toString()}:{contract_address:e.contractAddress}));a=t===xE.NFT_ACTIVITY?{nft_filters:e}:{nft_metadata_filters:e}}else if(t===xE.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?cT.get(n.network):o,i=yield this.resolveAddresses(n.addresses)}else if(t==xE.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?cT.get(n.network):o,s=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),i&&{addresses:i}),s&&{graphql_query:s});return uT((yield this.sendWebhookRequest("create-webhook","createWebhook",{},{method:"POST",data:c})).data)}))}deleteWebhook(e){return ME(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 $k(this.config,zE.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 ME(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 oT={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},cT=Object.keys(exports.Network).reduce(((e,t)=>(t in oT&&e.set(oT[t],t),e)),new Map);function lT(e){return e.data.map(uT)}function uT(e){return Object.assign({id:e.id,network:oT[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 dT(e){return e.tokenId?{contract_address:e.contractAddress,token_id:nC.from(e.tokenId).toString()}:{contract_address:e.contractAddress}}const pT=[.9,1,1.1,1.2,1.3];class hT{constructor(e){this.config=e}sendPrivateTransaction(e,t,n){return ME(this,void 0,void 0,(function*(){const r=yield this.config.getProvider(),a=t?uk(t):void 0;return r._send("eth_sendPrivateTransaction",[{tx:e,maxBlockNumber:a,preferences:n}],"sendPrivateTransaction")}))}cancelPrivateTransaction(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("eth_cancelPrivateTransaction",[{txHash:e}],"cancelPrivateTransaction")}))}simulateAssetChangesBundle(e,t){return ME(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Ek(yield n._send("alchemy_simulateAssetChangesBundle",r,"simulateAssetChangesBundle"))}))}simulateAssetChanges(e,t){return ME(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Ek(yield n._send("alchemy_simulateAssetChanges",r,"simulateAssetChanges"))}))}simulateExecutionBundle(e,t){return ME(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Ek(n._send("alchemy_simulateExecutionBundle",r,"simulateExecutionBundle"))}))}simulateExecution(e,t){return ME(this,void 0,void 0,(function*(){const n=yield this.config.getProvider(),r=void 0!==t?[e,t]:[e];return Ek(n._send("alchemy_simulateExecution",r,"simulateExecution"))}))}getTransaction(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).getTransaction(e)}))}sendTransaction(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).sendTransaction(e)}))}estimateGas(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).estimateGas(e)}))}getMaxPriorityFeePerGas(){return ME(this,void 0,void 0,(function*(){const e=yield this.config.getProvider();return lk(yield e._send("eth_maxPriorityFeePerGas",[],"getMaxPriorityFeePerGas"))}))}waitForTransaction(e,t,n){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider()).waitForTransaction(e,t,n)}))}sendGasOptimizedTransaction(e,t){return ME(this,void 0,void 0,(function*(){if(Array.isArray(e))return this._sendGasOptimizedTransaction(e,"sendGasOptimizedTransactionPreSigned");let n,r,a;const i=yield this.config.getProvider();try{n=yield this.estimateGas(e),r=yield this.getMaxPriorityFeePerGas();a=(yield i.getBlock("latest")).baseFeePerGas.toNumber()}catch(e){throw new Error(`Failed to estimate gas for transaction: ${e}`)}const s=function(e,t,n,r){return pT.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(s.map((e=>t.signTransaction(e))));return this._sendGasOptimizedTransaction(o,"sendGasOptimizedTransactionGenerated")}))}getGasOptimizedTransactionStatus(e){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_getGasOptimizedTransactionStatus",[e],"getGasOptimizedTransactionStatus")}))}_sendGasOptimizedTransaction(e,t){return ME(this,void 0,void 0,(function*(){return(yield this.config.getProvider())._send("alchemy_sendGasOptimizedTransaction",[{rawTransactions:e}],t)}))}}const mT="alchemy-pending-transactions",fT="alchemy-mined-transactions",yT=[mT,fT];class bT{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 gT(e){return"object"==typeof e&&"method"in e}function vT(e){return void 0===e?"*":Array.isArray(e)?e.join("|"):e}function wT(e){return void 0===e?"*":e.toString()}function CT(e){if(""===e)return;const t=e.split("|");return 1===t.length?t[0]:t}class xT{constructor(e){this.config=e}on(e,t){return(()=>{ME(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(()=>{ME(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(()=>{ME(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(()=>{ME(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 ME(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 ME(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 ME(this,void 0,void 0,(function*(){if(!gT(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 ME(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 ET=yv.custom((e=>{const t=Lv.parse(e);let n;try{n=rw(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`"),kT=lw.and(yv.object({chain:ET,opts:pw.optional().default(pw.parse({}))}));yv.instanceof(class{constructor(e){this.config=new HE(e),this.core=new _k(this.config),this.nft=new iT(this.config),this.ws=new xT(this.config),this.transact=new hT(this.config),this.notify=new sT(this.config),this.debug=new Ok(this.config)}});const TT=e=>({simulateUserOperation:async t=>zw(e,t)}),PT=e=>async(t,{overrides:n,feeOptions:r})=>{let[a,i]=await Promise.all([e.getBlock({blockTag:"latest"}),e.request({method:"rundler_maxPriorityFeePerGas",params:[]})]);const s=a.baseFeePerGas;if(null==s)throw new Error("baseFeePerGas is null");const o=Yv(i,n?.maxPriorityFeePerGas,r?.maxPriorityFeePerGas);return{...t,maxPriorityFeePerGas:o,maxFeePerGas:Yv(s+BigInt(o),n?.maxFeePerGas,r?.maxFeePerGas)}},AT=(e,t)=>()=>os([t.paymasterAddress??(e=>{switch(e.id){case Ov.id:case kv.id:case _v.id:case Mv.id:case Nv.id:case Sv.id:case Iv.id:return"0x4f84a207A80c39E9e8BaE717c1F25bA7AD1fB08F";case Cv.id:case bv.id:case xv.id:case Fv.id:case Pv.id:return"0x4Fd9098af9ddcB41DA48A1d78F91F1398965addc";case vv.id:return"0x0804Afe6EEFb73ce7F93CD0d5e7079a5a8068592";case Tv.id:case Dv.id:return"0xc03aac639bb21233e0139381970328db8bceeb67";default:throw new Error(`Unsupported chain: ${e}`)}})(e.chain),t.dummyData??"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"]);function _T(e,t){const n=t.gasEstimationOptions,r=n?.disableGasEstimation??!1,a=n?.fallbackFeeDataGetter??PT(e),i=n?.fallbackGasEstimator??Lw(e);return{gasEstimator:r?i:async(t,{overrides:n,account:r,feeOptions:a})=>ew(n)?{...t,...await i(t,{overrides:n,account:r,feeOptions:a,client:e})}:t,feeEstimator:r?a:async(t,{overrides:n,account:r,feeOptions:i})=>{let s=await t.maxFeePerGas,o=await t.maxPriorityFeePerGas;if(ew(n)){const c=await a(t,{overrides:n,feeOptions:i,account:r,client:e});s=await c.maxFeePerGas??s,o=await c.maxPriorityFeePerGas??o}return{...t,maxFeePerGas:s,maxPriorityFeePerGas:o}},paymasterAndData:r?FT(e,t):OT(e,t)}}const DT=(e,t,n,r)=>{let a=e;if(null!=t?.[a])return zv(t[a])?iw(t[a]):{multiplier:Number(t[a].multiplier)};if($v(n?.[e]))return{multiplier:Number(n[e].multiplier)};const i=r[e];return $a(i)&&di(i,"bigint")>0n?i:void 0};function OT(e,t){return{dummyPaymasterAndData:AT(e,t),paymasterAndData:async(n,{overrides:r,feeOptions:a,account:i})=>{const s=iw(await aw(n)),o=sw({maxFeePerGas:DT("maxFeePerGas",r,a,s),maxPriorityFeePerGas:DT("maxPriorityFeePerGas",r,a,s),callGasLimit:DT("callGasLimit",r,a,s),verificationGasLimit:DT("verificationGasLimit",r,a,s),preVerificationGas:DT("preVerificationGas",r,a,s)});if("0.7.0"===i.getEntryPoint().version){const e=DT("paymasterVerificationGasLimit",r,a,s);null!=e&&(o.paymasterVerificationGasLimit=e);const t=DT("paymasterPostOpGasLimit",r,a,s);null!=t&&(o.paymasterPostOpGasLimit=t)}const c=await e.request({method:"alchemy_requestGasAndPaymasterAndData",params:[{policyId:t.policyId,entryPoint:i.getEntryPoint().address,userOperation:s,dummySignature:s.signature,overrides:o}]});return{...n,...c}}}}const FT=(e,t)=>({dummyPaymasterAndData:AT(e,t),paymasterAndData:async(n,{account:r})=>{const a=await e.request({method:"alchemy_requestPaymasterAndData",params:[{policyId:t.policyId,entryPoint:r.getEntryPoint().address,userOperation:iw(await aw(n))}]});return{...n,...a}}});function ST(e){return async(t,{account:n})=>{const r=await e.request({method:"alchemy_simulateUserOperationAssetChanges",params:[iw(await aw(t)),n.getEntryPoint().address]});if(r.error)throw new Error(r.error.message);return t}}function IT(e){return{"Alchemy-Aa-Sdk-Signer":e.getSigner().signerType}}const MT=[{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"}],NT=[{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"}],UT=[{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}],LT=[{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"}],BT=[{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:[]}],RT=e=>({getExecutionFunctionConfig:async({selector:t,account:n=e.account})=>{if(!n)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","getExecutionFunctionConfig",e);return e.readContract({address:n.address,abi:MT,functionName:"getExecutionFunctionConfig",args:[t]})},getExecutionHooks:async({selector:t,account:n=e.account})=>{if(!n)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","getExecutionHooks",e);return e.readContract({address:n.address,abi:MT,functionName:"getExecutionHooks",args:[t]})},getPreValidationHooks:async({selector:t,account:n=e.account})=>{if(!n)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","getPreValidationHooks",e);return e.readContract({address:n.address,abi:MT,functionName:"getPreValidationHooks",args:[t]})},getInstalledPlugins:async({account:t=e.account})=>{if(!t)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","getInstalledPlugins",e);return e.readContract({address:t.address,abi:MT,functionName:"getInstalledPlugins"}).catch((()=>[]))}});async function jT(e,{overrides:t,context:n,account:r=e.account,...a}){if(!r)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","installPlugin",e);const i=await async function(e,t){const n=await e.readContract({abi:NT,address:t.pluginAddress,functionName:"pluginManifest"}),r=t.manifestHash??ns(function(e){const{abi:t,functionName:n,result:r}=e;let a=t[0];if(n){const e=Oo({abi:t,name:n});if(!e)throw new io(n,{docsPath:Ed});a=e}if("function"!==a.type)throw new io(void 0,{docsPath:Ed});if(!a.outputs)throw new so(a.name,{docsPath:Ed});let i=Array.isArray(r)?r:[r];return 0!==a.outputs.length||i[0]||(i=[]),To(a.outputs,i)}({abi:NT,functionName:"pluginManifest",result:n}));return jo({abi:UT,functionName:"installPlugin",args:[t.pluginAddress,r,t.pluginInitData??"0x",t.dependencies??[]]})}(e,a);return e.sendUserOperation({uo:i,overrides:t,account:r,context:n})}const GT={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"},zT={meta:{name:"Multi Owner Plugin",version:"1.0.0",addresses:GT},getContract:(e,t)=>{if(!e.chain)throw new Hy;return Pu({address:t||GT[e.chain.id],abi:qT,client:e})}},$T=e=>({updateOwners({args:t,overrides:n,context:r,account:a=e.account}){if(!a)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","updateOwners",e);const i=jo({abi:HT,functionName:"updateOwners",args:t});return e.sendUserOperation({uo:i,overrides:n,account:a,context:r})},installMultiOwnerPlugin({account:t=e.account,overrides:n,context:r,...a}){if(!t)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","installMultiOwnerPlugin",e);const i=e.chain;if(!i)throw new Hy;const s=a.dependencyOverrides??[],o=a.pluginAddress??zT.meta.addresses[i.id];if(!o)throw new Error("missing MultiOwnerPlugin address for chain "+i.name);return jT(e,{pluginAddress:o,pluginInitData:To([{type:"address[]"}],a.args),dependencies:s,overrides:n,account:t,context:r})},encodeUpdateOwners:({args:e})=>jo({abi:HT,functionName:"updateOwners",args:e}),encodeEip712Domain:()=>jo({abi:HT,functionName:"eip712Domain"}),async readEip712Domain({account:t=e.account}){if(!t)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","readEip712Domain",e);return e.readContract({address:t.address,abi:HT,functionName:"eip712Domain"})},encodeIsValidSignature:({args:e})=>jo({abi:HT,functionName:"isValidSignature",args:e}),async readIsValidSignature({args:t,account:n=e.account}){if(!n)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","readIsValidSignature",e);return e.readContract({address:n.address,abi:HT,functionName:"isValidSignature",args:t})}}),HT=[{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"}]}],qT=[{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"}],VT=(e,t,n,r=zT.meta.addresses[e.chain.id])=>{const a=async a=>{const[,i,s,o,c,l]=await e.readContract({abi:qT,address:r,functionName:"eip712Domain",account:t});return n().signTypedData({domain:{chainId:Number(o),name:i,salt:l,verifyingContract:c,version:s},types:{AlchemyModularAccountMessage:[{name:"message",type:"bytes"}]},message:{message:a},primaryType:"AlchemyModularAccountMessage"})};return{getDummySignature:()=>"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",signUserOperationHash:e=>n().signMessage({raw:e}),signMessage:({message:e})=>a(Id(e)),signTypedData:e=>a(md(e))}},WT=e=>(e.id,"0x000000e92D78D90000007F0082006FDA09BD5f11"),ZT={encodeExecute:async({target:e,data:t,value:n})=>jo({abi:LT,functionName:"execute",args:[e,n??0n,t]}),encodeBatchExecute:async e=>jo({abi:LT,functionName:"executeBatch",args:[e.map((e=>({target:e.target,data:e.data,value:e.value??0n})))]})};async function KT({transport:e,chain:t,signer:n,accountAddress:r,initCode:a,entryPoint:i=eb(t,{version:"0.6.0"}),factoryAddress:s=WT(t),owners:o=[],salt:c=0n}){const l=Vy({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!==pi(e))).sort(((e,t)=>{const n=pi(e),r=pi(t);return n<r?-1:n>r?1:0}));return cs([s,jo({abi:BT,functionName:"createAccount",args:[c,t]})])},d=await bw({client:l,entryPoint:i,accountAddress:r,getAccountInitCode:u}),p=await async function({transport:e,chain:t,entryPoint:n,source:r,accountAddress:a,getAccountInitCode:i,signMessage:s,signTypedData:o,encodeBatchExecute:c,encodeExecute:l,getDummySignature:u,signUserOperationHash:d,encodeUpgradeToAndCall:p}){const h=Vy({transport:n=>e({...n,chain:t,retryCount:0}),chain:t}),m=Pu({address:n.address,abi:n.abi,client:h}),f=await bw({client:h,entryPoint:n,accountAddress:a,getAccountInitCode:i});let y=hw.UNDEFINED;const b=async()=>{if(y===hw.DEPLOYED)return"0x";const e=await h.getBytecode({address:f});return(e?.length??0)>2?(y=hw.DEPLOYED,"0x"):(y=hw.NOT_DEPLOYED,i())},g=d??(async e=>s({message:{raw:ci(e)}})),v=p??(()=>{throw new rb(r)}),w=async()=>"0x"===await b(),C=mw({address:f,signMessage:s,signTypedData:o,signTransaction:()=>{throw new ab}}),x=async(e,t)=>{if(e)return t;const[n,r]=yw(await i());return lb({factoryAddress:n,factoryCalldata:r,signature:t})};if("0.6.0"!==n.version&&"0.7.0"!==n.version)throw new Zy(t,n.version);return{...C,source:r,signUserOperationHash:g,getFactoryAddress:async()=>yw(await i())[0],getFactoryData:async()=>yw(await i())[1],encodeBatchExecute:c??(()=>{throw new sb(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(),C.signMessage(e)]);return x(t,n)},signTypedDataWith6492:async e=>{const[t,n]=await Promise.all([w(),C.signTypedData(e)]);return x(t,n)},getImplementationAddress:async()=>{const e=await h.getStorageAt({address:C.address,slot:"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"});if(null==e)throw new ib("0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc","Proxy Implementation Address");return qa(e)}}}({transport:e,chain:t,entryPoint:i,accountAddress:d,source:"MultiOwnerModularAccount",getAccountInitCode:u,...ZT,...VT(l,d,(()=>n))});return{...p,publicKey:await n.getAddress(),getSigner:()=>n}}async function JT(e,{overrides:t,account:n=e.account,context:r,...a}){if(!n)throw new tb;if(!Iw(e))throw new zy("SmartAccountClient","uninstallPlugin",e);const i=await async function(e){return jo({abi:UT,functionName:"uninstallPlugin",args:[e.pluginAddress,e.config??"0x",e.pluginUninstallData??"0x"]})}(a);return e.sendUserOperation({uo:i,overrides:t,account:n,context:r})}const XT=e=>({installPlugin:async t=>jT(e,t),uninstallPlugin:async t=>JT(e,t)}),YT=e=>({...$T(e),async readOwners(t){const n=t?.account??e.account;if(!n)throw new tb;return zT.getContract(e,t?.pluginAddress).read.ownersOf([n.address])},async isOwnerOf(t){const n=t.account??e.account;if(!n)throw new tb;return zT.getContract(e,t.pluginAddress).read.isOwnerOf([n.address,t.address])}}),QT=({chain:e,connectionConfig:t,fetchOptions:n={}})=>{const r=ET.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}`}),Vy({chain:r,transport:zu(a,{fetchOptions:n})}).extend((()=>({updateHeaders(e){n.headers={...n.headers,...e}}})))};async function eP(e){const{chain:t,opts:n,...r}=kT.parse(e),a=QT({chain:t,connectionConfig:r}),i=await KT({transport:Lu(a),...e});return function({opts:e,account:t,useSimulation:n,gasManagerConfig:r,feeEstimator:a,gasEstimator:i,customMiddleware:s,signUserOperation:o,client:c}){const l=e?.feeOptions??Jv(c.chain),u=Gw({account:t,client:c,type:"AlchemySmartAccountClient",opts:{...e,feeOptions:l},customMiddleware:async(e,t)=>(fw(t.account)&&c.updateHeaders(IT(t.account)),s?s(e,t):e),feeEstimator:a??PT(c),userOperationSimulator:n?ST(c):void 0,gasEstimator:i,...r&&_T(c,{...r,gasEstimationOptions:{...r.gasEstimationOptions,disableGasEstimation:r.gasEstimationOptions?.disableGasEstimation??!1,fallbackFeeDataGetter:r.gasEstimationOptions?.fallbackFeeDataGetter??a,fallbackGasEstimator:r.gasEstimationOptions?.fallbackGasEstimator??i}}),signUserOperation:o}).extend(TT);return t&&fw(t)&&c.updateHeaders(IT(t)),u}({...e,client:a,account:i,opts:n}).extend(YT).extend(XT).extend(RT)}const tP=e=>(t,n,r)=>{const a=r.subscribe;r.subscribe=(e,t,n)=>{let i=e;if(t){const a=(null==n?void 0:n.equalityFn)||Object.is;let s=e(r.getState());i=n=>{const r=e(n);if(!a(s,r)){const e=s;t(s=r,e)}},(null==n?void 0:n.fireImmediately)&&t(s,s)}return a(i)};return e(t,n,r)};function nP(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),i=null!=(r=n.getItem(e))?r:null;return i instanceof Promise?i.then(a):a(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)};return r}const rP=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>rP(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>rP(t)(e)}}},aP=(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 i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const o=new Set,c=new Set;let l;try{l=i.getStorage()}catch(e){}if(!l)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)}),r,a);const u=rP(i.serialize),d=()=>{const e=i.partialize({...r()});let t;const n=u({state:e,version:i.version}).then((e=>l.setItem(i.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;s=!1,o.forEach((e=>e(r())));const t=(null==(e=i.onRehydrateStorage)?void 0:e.call(i,r()))||void 0;return rP(l.getItem.bind(l))(i.name).then((e=>{if(e)return i.deserialize(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===i.version)return e.state;if(i.migrate)return i.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=i.merge(e,null!=(t=r())?t:h),n(m,!0),d()})).then((()=>{null==t||t(m,void 0),s=!0,c.forEach((e=>e(m)))})).catch((e=>{null==t||t(void 0,e)}))};return a.persist={setOptions:e=>{i={...i,...e},e.getStorage&&(l=e.getStorage())},clearStorage:()=>{null==l||l.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>f(),hasHydrated:()=>s,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 i={storage:nP((()=>localStorage)),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const o=new Set,c=new Set;let l=i.storage;if(!l)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)}),r,a);const u=()=>{const e=i.partialize({...r()});return l.setItem(i.name,{state:e,version:i.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;s=!1,o.forEach((e=>{var t;return e(null!=(t=r())?t:p)}));const a=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,null!=(e=r())?e:p))||void 0;return rP(l.getItem.bind(l))(i.name).then((e=>{if(e){if("number"!=typeof e.version||e.version===i.version)return e.state;if(i.migrate)return i.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=i.merge(e,null!=(t=r())?t:p),n(h,!0),u()})).then((()=>{null==a||a(h,void 0),h=r(),s=!0,c.forEach((e=>e(h)))})).catch((e=>{null==a||a(void 0,e)}))};return a.persist={setOptions:e=>{i={...i,...e},e.storage&&(l=e.storage)},clearStorage:()=>{null==l||l.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:e=>(o.add(e),()=>{o.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},i.skipHydration||m(),h||p})(e,t),iP=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,i={setState:r,getState:a,getInitialState:()=>s,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()}},s=t=e(r,a,i);return i},sP=e=>e?iP(e):iP;class oP extends Gy{constructor(){super(["Signer not authenticated","Please authenticate to use this signer"].join("\n"),{docsPath:"/signers/alchemy-signer/introduction.html"})}}const cP=yv.object({sessionKey:yv.string().default("alchemy-signer-session"),storage:yv.enum(["localStorage","sessionStorage"]).default("localStorage").or(yv.custom()),expirationTimeMs:yv.number().default(9e5).describe("The time in milliseconds that a session should last before expiring [default: 15 minutes]"),client:yv.custom()});class lP{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}=cP.parse(e);this.sessionKey=t;const i="string"==typeof n?"localStorage"===n?localStorage:sessionStorage:n;this.expirationTimeMs=r,this.client=a,this.eventEmitter=new xn,this.store=sP(tP(aP(this.getInitialState,{name:this.sessionKey,storage:nP((()=>i))}))),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 uP;!function(e){e.INITIALIZING="INITIALIZING",e.CONNECTED="CONNECTED",e.DISCONNECTED="DISCONNECTED",e.AUTHENTICATING="AUTHENTICATING",e.AWAITING_EMAIL_AUTH="AWAITING_EMAIL_AUTH"}(uP||(uP={}));class dP{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===uP.CONNECTED&&t(this.store.getState().user)),{fireImmediately:!0});case"disconnected":return this.store.subscribe((({status:e})=>e),(e=>e===uP.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=Id(e);return this.inner.signRawMessage(t)}}),Object.defineProperty(this,"signTypedData",{enumerable:!0,configurable:!0,writable:!0,value:async e=>{const t=md(e);return this.inner.signRawMessage(t)}}),Object.defineProperty(this,"signTransaction",{enumerable:!0,configurable:!0,writable:!0,value:async(e,t)=>{const n=t?.serializer??Kd,r=n(e),a=await this.inner.signRawMessage(ns(r));return n(e,{r:Zv(a,{count:32}),s:Zv(a,{count:32,offset:32}),v:BigInt(Zv(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 oP;return mw({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:uP.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:uP.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:uP.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:uP.CONNECTED})})),this.sessionManager.on("disconnected",(()=>{this.store.setState({user:null,status:uP.DISCONNECTED})})),this.sessionManager.on("initialized",(()=>{this.store.setState((e=>({status:e.user?uP.CONNECTED:uP.DISCONNECTED})))})),this.inner.on("authenticating",(()=>{this.store.setState({status:uP.AUTHENTICATING})}))}}),this.inner=e,this.store=sP(tP((()=>({user:null,status:uP.INITIALIZING})))),this.sessionManager=new lP({...t,client:this.inner}),this.store=sP(tP((()=>({user:null,status:uP.INITIALIZING})))),this.registerListeners(),this.sessionManager.initialize()}}"undefined"!=typeof process&&null!=process.versions&&process.versions.node;var pP={exports:{}};!function(e,t){var n="undefined"!=typeof self?self:be,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 i(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 s(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=i(e),t=s(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},c.prototype.delete=function(e){delete this.map[i(e)]},c.prototype.get=function(e){return e=i(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(i(e))},c.prototype.set=function(e,t){this.map[i(e)]=s(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,i){var s=new f(e,r);if(s.signal&&s.signal.aborted)return i(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(){i(new TypeError("Network request failed"))},o.ontimeout=function(){i(new TypeError("Network request failed"))},o.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},o.open(s.method,s.url,!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&n.blob&&(o.responseType="blob"),s.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",l),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",l)}),o.send(void 0===s._bodyInit?null:s._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}(pP,pP.exports);var hP=ge(pP.exports);const mP=pP.exports.fetch;function fP(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 yP="copy",bP="convert";function gP(e,t,n){if(t===yP)return n;if(t===bP)return e(n);if(t instanceof Array)return n.map((n=>gP(e,t[0],n)));if(t instanceof Object){const r={};for(const[a,i]of Object.entries(t)){if(i.derive){const e=i.derive(n);void 0!==e&&(n[a]=e)}if(a in n)null!=n[a]?r[a]=gP(e,i.schema,n[a]):r[a]=null;else if(i.required)throw new Error(`Missing key: ${a}`)}return r}}function vP(e,t){return{required:!0,schema:e,derive:t}}function wP(e){return{required:!0,schema:e}}function CP(e){return{required:!1,schema:e}}const xP={appid:CP(yP),appidExclude:CP(yP),credProps:CP(yP)},EP={type:wP(yP),id:wP(yP),rawId:wP(bP),authenticatorAttachment:CP(yP),response:wP({clientDataJSON:wP(bP),attestationObject:wP(bP),transports:vP(yP,(e=>e.getTransports?.()||[]))}),clientExtensionResults:vP(xP,(e=>e.getClientExtensionResults()))};function kP(e){return gP(fP,EP,e)}function TP(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 PP(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=()=>kP(t),t}(e);return{credentialId:(n=t.toJSON()).rawId,attestationObject:n.response.attestationObject,clientDataJson:n.response.clientDataJSON,transports:n.response.transports.map(TP)};var n}class AP 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 _P{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),i=await mP(n,{method:"POST",headers:{[a.stampHeaderName]:a.stampHeaderValue,"X-Client-Version":"@turnkey/http@2.9.0"},body:r,redirect:"follow"});if(!i.ok){let e;try{e=await i.json()}catch(e){throw new Error(`${i.status} ${i.statusText}`)}throw new AP(e)}return await i.json()}}var DP;!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"}(DP||(DP={}));class OP{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===DP.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:DP.InjectCredentialBundle,value:e},"*"),window.addEventListener("message",(e=>{e.origin===this.iframeOrigin&&(e.data?.type===DP.BundleInjected&&t(e.data.value),e.data?.type===DP.Error&&n(e.data.value))}),!1)}))}async injectKeyExportBundle(e){return this.iframe.contentWindow?.postMessage({type:DP.InjectKeyExportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===DP.BundleInjected&&e(n.data.value),n.data?.type===DP.Error&&t(n.data.value))}),!1)}))}async injectWalletExportBundle(e){return this.iframe.contentWindow?.postMessage({type:DP.InjectWalletExportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===DP.BundleInjected&&e(n.data.value),n.data?.type===DP.Error&&t(n.data.value))}),!1)}))}async injectImportBundle(e){return this.iframe.contentWindow?.postMessage({type:DP.InjectImportBundle,value:e},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===DP.BundleInjected&&e(n.data.value),n.data?.type===DP.Error&&t(n.data.value))}),!1)}))}async extractWalletEncryptedBundle(){return this.iframe.contentWindow?.postMessage({type:DP.ExtractWalletEncryptedBundle},"*"),new Promise(((e,t)=>{window.addEventListener("message",(n=>{n.origin===this.iframeOrigin&&(n.data?.type===DP.EncryptedBundleExtracted&&e(n.data.value),n.data?.type===DP.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:DP.StampRequest,value:e},"*"),new Promise((function(e,n){window.addEventListener("message",(r=>{r.origin===t&&(r.data?.type===DP.Stamp&&e({stampHeaderName:"X-Stamp",stampHeaderValue:r.data.value}),r.data?.type===DP.Error&&n(r.data.value))}),!1)}))}}function FP(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 SP="copy",IP="convert";function MP(e,t,n){if(t===SP)return n;if(t===IP)return e(n);if(t instanceof Array)return n.map((n=>MP(e,t[0],n)));if(t instanceof Object){const r={};for(const[a,i]of Object.entries(t)){if(i.derive){const e=i.derive(n);void 0!==e&&(n[a]=e)}if(a in n)null!=n[a]?r[a]=MP(e,i.schema,n[a]):r[a]=null;else if(i.required)throw new Error(`Missing key: ${a}`)}return r}}function NP(e){return{required:!0,schema:e}}function UP(e){return{required:!1,schema:e}}const LP={appid:UP(SP),appidExclude:UP(SP),credProps:UP(SP)},BP={type:NP(SP),id:NP(SP),rawId:NP(IP),authenticatorAttachment:UP(SP),response:NP({clientDataJSON:NP(IP),authenticatorData:NP(IP),signature:NP(IP),userHandle:NP(IP)}),clientExtensionResults:(RP=LP,jP=e=>e.getClientExtensionResults(),{required:!0,schema:RP,derive:jP})};var RP,jP;function GP(e){return MP(FP,BP,e)}let zP;function $P(e,...t){if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function HP(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")}zP=void 0!==globalThis?.Buffer?globalThis.Buffer:s.Buffer;
27
27
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
28
- const qP=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),VP=(e,t)=>e<<32-t|e>>>t;function WP(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)),$P(e),e}new Uint8Array(new Uint32Array([287454020]).buffer)[0];class ZP{clone(){return this._cloneInto()}}function KP(e){const t=t=>e().update(WP(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const JP=(e,t,n)=>e&t^~e&n,XP=(e,t,n)=>e&t^e&n^t&n;class YP extends ZP{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=qP(this.buffer)}update(e){HP(this);const{view:t,buffer:n,blockLen:r}=this,a=(e=WP(e)).length;for(let i=0;i<a;){const s=Math.min(r-this.pos,a-i);if(s!==r)n.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===r&&(this.process(t,0),this.pos=0);else{const t=qP(e);for(;r<=a-i;i+=r)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){HP(this),function(e,t){$P(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:i}=this;t[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>r-i&&(this.process(n,0),i=0);for(let e=i;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),i=BigInt(4294967295),s=Number(n>>a&i),o=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,s,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),a),this.process(n,0);const s=qP(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++)s.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:i,pos:s}=this;return e.length=r,e.pos=s,e.finished=a,e.destroyed=i,r%t&&e.buffer.set(n),e}}const QP=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]),eA=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),tA=new Uint32Array(64);class nA extends YP{constructor(){super(64,32,8,!1),this.A=0|eA[0],this.B=0|eA[1],this.C=0|eA[2],this.D=0|eA[3],this.E=0|eA[4],this.F=0|eA[5],this.G=0|eA[6],this.H=0|eA[7]}get(){const{A:e,B:t,C:n,D:r,E:a,F:i,G:s,H:o}=this;return[e,t,n,r,a,i,s,o]}set(e,t,n,r,a,i,s,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|a,this.F=0|i,this.G=0|s,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)tA[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=tA[e-15],n=tA[e-2],r=VP(t,7)^VP(t,18)^t>>>3,a=VP(n,17)^VP(n,19)^n>>>10;tA[e]=a+tA[e-7]+r+tA[e-16]|0}let{A:n,B:r,C:a,D:i,E:s,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(VP(s,6)^VP(s,11)^VP(s,25))+JP(s,o,c)+QP[e]+tA[e]|0,u=(VP(n,2)^VP(n,13)^VP(n,22))+XP(n,r,a)|0;l=c,c=o,o=s,s=i+t|0,i=a,a=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,a=a+this.C|0,i=i+this.D|0,s=s+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,a,i,s,o,c,l)}roundClean(){tA.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const rA=KP((()=>new nA));class aA{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=rA(t),r=zP.from(n).toString("hex"),a=zP.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=()=>GP(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 iA=e=>Buffer.from(e).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),sA=()=>{const e=new Uint8Array(32);return crypto.getRandomValues(e),e.buffer};class oA{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 oP;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:iA(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 oP;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 oP;const{wallets:t}=await this.turnkeyClient.getWallets({organizationId:this.user.orgId}),n=await Promise.all(t.map((({walletId:e})=>this.turnkeyClient.getWalletAccounts({organizationId:this.user.orgId,walletId:e})))).then((e=>e.flatMap((e=>e.accounts)))),r=n.find((e=>e.address===this.user.address));if(!r)throw new Error(`Could not find wallet associated with ${this.user.address}`);const{activity:a}=await this.turnkeyClient.exportWallet({organizationId:this.user.orgId,type:"ACTIVITY_TYPE_EXPORT_WALLET",timestampMs:Date.now().toString(),parameters:{walletId:r.walletId,targetPublicKey:e.publicKey()}}),{exportBundle:i}=await this.pollActivityCompletion(a,this.user.orgId,"exportWalletResult"),s=await e.injectWalletExportBundle(i);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 oP;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:i}}=await this.turnkeyClient.getActivity({activityId:e.id,organizationId:t});if("ACTIVITY_STATUS_COMPLETED"===r)return i[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 xn,this.connectionConfig=lw.parse(n),this.turnkeyClient=new _P({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 cA=yv.object({connection:lw,iframeConfig:yv.object({iframeElementId:yv.string().default("turnkey-iframe"),iframeContainerId:yv.string()}),rpId:yv.string().optional(),rootOrgId:yv.string().optional().default("24c1acf5-810f-41e0-a503-d5d13fa8e830")});class lA extends oA{constructor(e){const{connection:t,iframeConfig:n,rpId:r,rootOrgId:a}=cA.parse(e),i=new OP({iframeElementId:n.iframeElementId,iframeUrl:"https://auth.turnkey.com",iframeContainer:document.getElementById(n.iframeContainerId)});super({connection:t,rootOrgId:a,stamper:i}),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:iA(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 OP({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=sA(),r=sA(),a=await PP({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=i,this.iframeContainerId=n.iframeContainerId,this.webauthnStamper=new aA({rpId:r??window.location.hostname})}}const uA=yv.object({client:yv.custom().or(cA)}).extend({sessionConfig:cP.omit({client:!0}).optional()});class dA extends dP{constructor(e){const{sessionConfig:t,...n}=uA.parse(e);let r;r="connection"in n.client?new lA(n.client):n.client,super({client:r,sessionConfig:t})}}const pA=/^tuple(?<array>(\[(\d*)\])*)$/;function hA(e){let t=e.type;if(pA.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){t+=hA(e.components[r]),r<n-1&&(t+=", ")}const r=function(e,t){const n=e.exec(t);return n?.groups}(pA,e.type);return t+=`)${r?.array??""}`,hA({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function mA(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=hA(e[r]),r!==n-1&&(t+=", ")}return t}function fA(e,t,n){const r=e[t.name];if("function"==typeof r)return r;const a=e[n];return"function"==typeof a?a:n=>t(e,n)}function yA(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new RA(e.type);return`${e.name}(${bA(e.inputs,{includeName:t})})`}function bA(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${bA(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}function gA(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function vA(e){return gA(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const wA="2.37.0";let CA=({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,xA=`viem@${wA}`;class EA extends Error{constructor(e,t={}){const n=t.cause instanceof EA?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof EA&&t.cause.docsPath||t.docsPath,a=CA?.({...t,docsPath:r});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...xA?[`Version: ${xA}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=wA}walk(e){return kA(this,e)}}function kA(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?kA(e.cause,t):t?null:e}class TA extends EA{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,name:"AbiConstructorNotFoundError"})}}class PA extends EA{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,name:"AbiConstructorParamsNotFoundError"})}}class AA extends EA{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${bA(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`],name:"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 _A extends EA{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class DA extends EA{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n"),{name:"AbiEncodingArrayLengthMismatchError"})}}class OA extends EA{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${vA(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class FA extends EA{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n"),{name:"AbiEncodingLengthMismatchError"})}}class SA extends EA{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,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class IA extends EA{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,name:"AbiFunctionNotFoundError"})}}class MA extends EA{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${yA(e.abiItem)}\`, and`,`\`${t.type}\` in \`${yA(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class NA extends EA{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`,{name:"BytesSizeMismatchError"})}}class UA extends EA{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t,name:"InvalidAbiEncodingType"})}}class LA extends EA{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t,name:"InvalidAbiDecodingType"})}}class BA extends EA{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n"),{name:"InvalidArrayError"})}}class RA extends EA{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n"),{name:"InvalidDefinitionTypeError"})}}class jA extends EA{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class GA extends EA{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}class zA extends EA{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.`,{name:"InvalidBytesLengthError"})}}function $A(e,{dir:t,size:n=32}={}){return"string"==typeof e?HA(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new GA({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let a=0;a<n;a++){const i="right"===t;r[i?a:n-a-1]=e[i?a:e.length-a-1]}return r}(e,{dir:t,size:n})}function HA(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new GA({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}class qA extends EA{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})`}`,{name:"IntegerOutOfRangeError"})}}class VA extends EA{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.`,{name:"InvalidBytesBooleanError"})}}class WA extends EA{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function ZA(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 KA(e,{size:t}){if(vA(e)>t)throw new WA({givenSize:vA(e),maxSize:t})}function JA(e,t={}){const{signed:n}=t;t.size&&KA(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 XA(e,t={}){return Number(JA(e,t))}const YA=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function QA(e,t={}){return"number"==typeof e||"bigint"==typeof e?n_(e,t):"string"==typeof e?a_(e,t):"boolean"==typeof e?e_(e,t):t_(e,t)}function e_(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(KA(n,{size:t.size}),$A(n,{size:t.size})):n}function t_(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=YA[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(KA(r,{size:t.size}),$A(r,{dir:"right",size:t.size})):r}function n_(e,t={}){const{signed:n,size:r}=t,a=BigInt(e);let i;r?i=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(i=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof i&&n?-i-1n:0;if(i&&a>i||a<s){const t="bigint"==typeof e?"n":"";throw new qA({max:i?`${i}${t}`:void 0,min:`${s}${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?$A(o,{size:r}):o}const r_=new TextEncoder;function a_(e,t={}){return t_(r_.encode(e),t)}const i_=new TextEncoder;function s_(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=n_(e,t);return l_(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return KA(n,{size:t.size}),$A(n,{size:t.size});return n}(e,t):gA(e)?l_(e,t):u_(e,t)}const o_={zero:48,nine:57,A:65,F:70,a:97,f:102};function c_(e){return e>=o_.zero&&e<=o_.nine?e-o_.zero:e>=o_.A&&e<=o_.F?e-(o_.A-10):e>=o_.a&&e<=o_.f?e-(o_.a-10):void 0}function l_(e,t={}){let n=e;t.size&&(KA(n,{size:t.size}),n=$A(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const a=r.length/2,i=new Uint8Array(a);for(let e=0,t=0;e<a;e++){const n=c_(r.charCodeAt(t++)),a=c_(r.charCodeAt(t++));if(void 0===n||void 0===a)throw new EA(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);i[e]=16*n+a}return i}function u_(e,t={}){const n=i_.encode(e);return"number"==typeof t.size?(KA(n,{size:t.size}),$A(n,{dir:"right",size:t.size})):n}const d_=BigInt(2**32-1),p_=BigInt(32);function h_(e,t=!1){return t?{h:Number(e&d_),l:Number(e>>p_&d_)}:{h:0|Number(e>>p_&d_),l:0|Number(e&d_)}}function m_(e,t=!1){const n=e.length;let r=new Uint32Array(n),a=new Uint32Array(n);for(let i=0;i<n;i++){const{h:n,l:s}=h_(e[i],t);[r[i],a[i]]=[n,s]}return[r,a]}const f_="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function y_(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function b_(e,...t){if(!function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function g_(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 v_(e,t){b_(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function w_(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function C_(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function x_(e,t){return e<<32-t|e>>>t}const E_=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])()?e=>e:function(e){for(let n=0;n<e.length;n++)e[n]=(t=e[n])<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;var t;return e};function k_(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e)),b_(e),e}class T_{}function P_(e){const t=t=>e().update(k_(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const A_=BigInt(0),__=BigInt(1),D_=BigInt(2),O_=BigInt(7),F_=BigInt(256),S_=BigInt(113),I_=[],M_=[],N_=[];for(let e=0,t=__,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],I_.push(2*(5*r+n)),M_.push((e+1)*(e+2)/2%64);let a=A_;for(let e=0;e<7;e++)t=(t<<__^(t>>O_)*S_)%F_,t&D_&&(a^=__<<(__<<BigInt(e))-__);N_.push(a)}const U_=m_(N_,!0),L_=U_[0],B_=U_[1],R_=(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),j_=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class G_ extends T_{constructor(e,t,n,r=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=a,y_(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}clone(){return this._cloneInto()}keccak(){E_(this.state32),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,i=n[a],s=n[a+1],o=R_(i,s,1)^n[r],c=j_(i,s,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=M_[n],i=R_(t,a,r),s=j_(t,a,r),o=I_[n];t=e[o],a=e[o+1],e[o]=i,e[o+1]=s}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]^=L_[r],e[1]^=B_[r]}w_(n)}(this.state32,this.rounds),E_(this.state32),this.posOut=0,this.pos=0}update(e){g_(this),b_(e=k_(e));const{blockLen:t,state:n}=this,r=e.length;for(let a=0;a<r;){const i=Math.min(t-this.pos,r-a);for(let t=0;t<i;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){g_(this,!1),b_(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 i=Math.min(n-this.posOut,a-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return y_(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(v_(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,w_(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:a,enableXOF:i}=this;return e||(e=new G_(t,n,r,i,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=i,e.destroyed=this.destroyed,e}}const z_=(()=>{return e=1,t=136,n=32,P_((()=>new G_(t,e,n)));var e,t,n})();function $_(e,t){const n=t||"hex",r=z_(gA(e,{strict:!1})?s_(e):e);return"bytes"===n?r:QA(r)}const H_=e=>$_(s_(e));const q_=e=>{var t;return function(e){let t=!0,n="",r=0,a="",i=!1;for(let s=0;s<e.length;s++){const o=e[s];if(["(",")",","].includes(o)&&(t=!0),"("===o&&r++,")"===o&&r--,t)if(0!==r)" "!==o?(a+=o,n+=o):","!==e[s-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===o&&["event","function",""].includes(a))a="";else if(a+=o,")"===o){i=!0;break}}if(!i)throw new EA("Unable to normalize signature.");return a}("string"==typeof e?e:"function"===(t=e).type?`function ${t.name}(${mA(t.inputs)})${t.stateMutability&&"nonpayable"!==t.stateMutability?` ${t.stateMutability}`:""}${t.outputs?.length?` returns (${mA(t.outputs)})`:""}`:"event"===t.type?`event ${t.name}(${mA(t.inputs)})`:"error"===t.type?`error ${t.name}(${mA(t.inputs)})`:"constructor"===t.type?`constructor(${mA(t.inputs)})${"payable"===t.stateMutability?" payable":""}`:"fallback"===t.type?"fallback() external"+("payable"===t.stateMutability?" payable":""):"receive() external payable")};function V_(e){return t=q_(e),H_(t);var t}const W_=V_;class Z_ extends EA{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."],name:"InvalidAddressError"})}}class K_ extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const J_=new K_(8192);function X_(e,t){if(J_.has(`${e}.${t}`))return J_.get(`${e}.${t}`);const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=$_(u_(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 i=`0x${a.join("")}`;return J_.set(`${e}.${t}`,i),i}const Y_=/^0x[a-fA-F0-9]{40}$/,Q_=new K_(8192);function eD(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Q_.has(r))return Q_.get(r);const a=!(!Y_.test(e)||e.toLowerCase()!==e&&n&&X_(e)!==e);return Q_.set(r,a),a}function tD(e){return"string"==typeof e[0]?nD(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 nD(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}function rD(e,t,n,{strict:r}={}){return gA(e,{strict:!1})?oD(e,t,n,{strict:r}):sD(e,t,n,{strict:r})}function aD(e,t){if("number"==typeof t&&t>0&&t>vA(e)-1)throw new jA({offset:t,position:"start",size:vA(e)})}function iD(e,t,n){if("number"==typeof t&&"number"==typeof n&&vA(e)!==n-t)throw new jA({offset:n,position:"end",size:vA(e)})}function sD(e,t,n,{strict:r}={}){aD(e,t);const a=e.slice(t,n);return r&&iD(a,t,n),a}function oD(e,t,n,{strict:r}={}){aD(e,t);const a=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;return r&&iD(a,t,n),a}const cD=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,lD=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function uD(e,t){if(e.length!==t.length)throw new FA({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(dD({param:e[r],value:t[r]}));return n}({params:e,values:t}),r=pD(n);return 0===r.length?"0x":r}function dD({param:e,value:t}){const n=hD(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 BA(e);if(!r&&e.length!==t)throw new DA({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let a=!1;const i=[];for(let t=0;t<e.length;t++){const r=dD({param:n,value:e[t]});r.dynamic&&(a=!0),i.push(r)}if(r||a){const e=pD(i);if(r){const t=n_(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?tD([t,e]):t}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:tD(i.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 i=t.components[a],s=dD({param:i,value:e[Array.isArray(e)?a:i.name]});r.push(s),s.dynamic&&(n=!0)}return{dynamic:n,encoded:n?pD(r):tD(r.map((({encoded:e})=>e)))}}(t,{param:e});if("address"===e.type)return function(e){if(!eD(e))throw new Z_({address:e});return{dynamic:!1,encoded:HA(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){if("boolean"!=typeof e)throw new EA(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:HA(e_(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const n=e.type.startsWith("int"),[,,r="256"]=lD.exec(e.type)??[];return function(e,{signed:t,size:n=256}){if("number"==typeof n){const r=2n**(BigInt(n)-(t?1n:0n))-1n,a=t?-r-1n:0n;if(e>r||e<a)throw new qA({max:r.toString(),min:a.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:n_(e,{size:32,signed:t})}}(t,{signed:n,size:Number(r)})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=vA(e);if(!n){let t=e;return r%32!=0&&(t=HA(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:tD([HA(n_(r,{size:32})),t])}}if(r!==Number.parseInt(n,10))throw new OA({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:HA(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=a_(e),n=Math.ceil(vA(t)/32),r=[];for(let e=0;e<n;e++)r.push(HA(rD(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:tD([HA(n_(vA(t),{size:32})),...r])}}(t);throw new UA(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function pD(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:r,encoded:a}=e[n];t+=r?32:vA(a)}const n=[],r=[];let a=0;for(let i=0;i<e.length;i++){const{dynamic:s,encoded:o}=e[i];s?(n.push(n_(t+a,{size:32})),r.push(o),a+=vA(o)):n.push(o)}return tD([...n,...r])}function hD(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const mD=e=>rD(V_(e),0,4);function fD(e){const{abi:t,args:n=[],name:r}=e,a=gA(r,{strict:!1}),i=t.filter((e=>a?"function"===e.type?mD(e)===r:"event"===e.type&&W_(e)===r:"name"in e&&e.name===r));if(0===i.length)return;if(1===i.length)return i[0];let s;for(const e of i){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&&yD(t,r)}));if(t){if(s&&"inputs"in s&&s.inputs){const t=bD(e.inputs,s.inputs,n);if(t)throw new MA({abiItem:e,type:t[0]},{abiItem:s,type:t[1]})}s=e}}return s||i[0]}function yD(e,t){const n=typeof e,r=t.type;switch(r){case"address":return eD(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)=>yD(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=>yD(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function bD(e,t,n){for(const r in e){const a=e[r],i=t[r];if("tuple"===a.type&&"tuple"===i.type&&"components"in a&&"components"in i)return bD(a.components,i.components,n[r]);const s=[a.type,i.type];if(!(!s.includes("address")||!s.includes("bytes20"))||(s.includes("address")&&s.includes("string")||!(!s.includes("address")||!s.includes("bytes")))&&eD(n[r],{strict:!1}))return s}}function gD(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const vD="/docs/contract/encodeFunctionData";function wD(e){const{args:t}=e,{abi:n,functionName:r}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:function(e){const{abi:t,args:n,functionName:r}=e;let a=t[0];if(r){const e=fD({abi:t,args:n,name:r});if(!e)throw new IA(r,{docsPath:vD});a=e}if("function"!==a.type)throw new IA(void 0,{docsPath:vD});return{abi:[a],functionName:mD(yA(a))}}(e),a=n[0];return nD([r,("inputs"in a&&a.inputs?uD(a.inputs,t??[]):void 0)??"0x"])}const CD={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."},xD={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},ED={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class kD extends EA{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class TD extends EA{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class PD extends EA{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const AD={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 PD({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new TD({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new kD({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 kD({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 _D(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(AD);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function DD(e,t={}){void 0!==t.size&&KA(e,{size:t.size});return JA(t_(e,t),t)}function OD(e,t={}){let n=e;if(void 0!==t.size&&(KA(n,{size:t.size}),n=ZA(n)),n.length>1||n[0]>1)throw new VA(n);return Boolean(n[0])}function FD(e,t={}){void 0!==t.size&&KA(e,{size:t.size});return XA(t_(e,t),t)}function SD(e,t){const n="string"==typeof t?l_(t):t,r=_D(n);if(0===vA(n)&&e.length>0)throw new _A;if(vA(t)&&vA(t)<32)throw new AA({data:"string"==typeof t?t:t_(t),params:e,size:vA(t)});let a=0;const i=[];for(let t=0;t<e.length;++t){const n=e[t];r.setPosition(a);const[s,o]=ID(r,n,{staticPosition:0});a+=o,i.push(s)}return i}function ID(e,t,{staticPosition:n}){const r=hD(t.type);if(r){const[a,i]=r;return function(e,t,{length:n,staticPosition:r}){if(!n){const n=r+FD(e.readBytes(ND)),a=n+MD;e.setPosition(n);const i=FD(e.readBytes(MD)),s=UD(t);let o=0;const c=[];for(let n=0;n<i;++n){e.setPosition(a+(s?32*n:o));const[r,i]=ID(e,t,{staticPosition:a});o+=i,c.push(r)}return e.setPosition(r+32),[c,32]}if(UD(t)){const a=r+FD(e.readBytes(ND)),i=[];for(let r=0;r<n;++r){e.setPosition(a+32*r);const[n]=ID(e,t,{staticPosition:a});i.push(n)}return e.setPosition(r+32),[i,32]}let a=0;const i=[];for(let s=0;s<n;++s){const[n,s]=ID(e,t,{staticPosition:r+a});a+=s,i.push(n)}return[i,a]}(e,{...t,type:i},{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 i=0;if(UD(t)){const s=n+FD(e.readBytes(ND));for(let n=0;n<t.components.length;++n){const o=t.components[n];e.setPosition(s+i);const[c,l]=ID(e,o,{staticPosition:s});i+=l,a[r?n:o?.name]=c}return e.setPosition(n+32),[a,32]}for(let s=0;s<t.components.length;++s){const o=t.components[s],[c,l]=ID(e,o,{staticPosition:n});a[r?s:o?.name]=c,i+=l}return[a,i]}(e,t,{staticPosition:n});if("address"===t.type)return function(e){const t=e.readBytes(32);return[X_(t_(sD(t,-20))),32]}(e);if("bool"===t.type)return function(e){return[OD(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=FD(e.readBytes(32));e.setPosition(n+t);const r=FD(e.readBytes(32));if(0===r)return e.setPosition(n+32),["0x",32];const a=e.readBytes(r);return e.setPosition(n+32),[t_(a),32]}const i=t_(e.readBytes(Number.parseInt(a,10),32));return[i,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=Number.parseInt(t.type.split("int")[1]||"256",10),a=e.readBytes(32);return[r>48?DD(a,{signed:n}):FD(a,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=FD(e.readBytes(32)),r=t+n;e.setPosition(r);const a=FD(e.readBytes(32));if(0===a)return e.setPosition(t+32),["",32];const i=e.readBytes(a,32),s=function(e,t={}){let n=e;return void 0!==t.size&&(KA(n,{size:t.size}),n=ZA(n,{dir:"right"})),(new TextDecoder).decode(n)}(ZA(i));return e.setPosition(t+32),[s,32]}(e,{staticPosition:n});throw new LA(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const MD=32,ND=32;function UD(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(UD);const n=hD(e.type);return!(!n||!UD({...e,type:n[1]}))}const LD=(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 BD({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]?LD(t[n]):t[n]}`)).join(", ")})`}const RD={gwei:9,wei:18},jD={ether:-9,wei:9};function GD(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[a,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${a||"0"}${i?`.${i}`:""}`}function zD(e,t="wei"){return GD(e,RD[t])}function $D(e,t="wei"){return GD(e,jD[t])}class HD extends EA{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class qD extends EA{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function VD(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}class WD extends EA{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"),{name:"FeeConflictError"})}}class ZD extends EA{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class KD extends EA{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",VD(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class JD extends EA{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class XD extends EA{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:i,gasPrice:s,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=VD({chain:r&&`${r?.name} (id: ${r?.id})`,from:t?.address,to:u,value:void 0!==d&&`${zD(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:i,gasPrice:void 0!==s&&`${$D(s)} gwei`,maxFeePerGas:void 0!==o&&`${$D(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${$D(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",p].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class YD extends EA{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:a,functionName:i,sender:s}){const o=fD({abi:t,args:n,name:i}),c=o?BD({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=VD({address:r&&r,function:o?yA(o,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(i?.length??0).keys()].map((()=>" ")).join("")}${c}`,sender:s});super(e.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:e,docsPath:a,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],l&&"Contract Call:",l].filter(Boolean),name:"ContractFunctionExecutionError"}),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}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=r,this.functionName=i,this.sender=s}}class QD extends EA{constructor({abi:e,data:t,functionName:n,message:r}){let a,i,s,o,c;if(t&&"0x"!==t)try{i=function(e){const{abi:t,data:n}=e,r=rD(n,0,4);if("0x"===r)throw new _A;const a=[...t||[],xD,ED].find((e=>"error"===e.type&&r===mD(yA(e))));if(!a)throw new SA(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?SD(a.inputs,rD(n,4)):void 0,errorName:a.name}}({abi:e,data:t});const{abiItem:n,errorName:r,args:a}=i;if("Error"===r)o=a[0];else if("Panic"===r){const[e]=a;o=CD[e]}else{const e=n?yA(n,{includeName:!0}):void 0,t=n&&a?BD({abiItem:n,args:a,includeFunctionName:!1,includeName:!1}):void 0;s=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(e){a=e}else r&&(o=r);a instanceof SA&&(c=a.signature,s=[`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:s,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{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=i,this.raw=t,this.reason=o,this.signature=c}}class eO extends EA{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."],name:"ContractFunctionZeroDataError"})}}class tO extends EA{constructor({data:e,message:t}){super(t||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class nO extends EA{constructor({body:e,cause:t,details:n,headers:r,status:a,url:i}){super("HTTP request failed.",{cause:t,details:n,metaMessages:[a&&`Status: ${a}`,`URL: ${i}`,e&&`Request body: ${LD(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=r,this.status=a,this.url=i}}class rO extends EA{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${LD(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code,this.data=t.data}}class aO extends EA{constructor(e,{code:t,docsPath:n,metaMessages:r,name:a,shortMessage:i}){super(i,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages,name:a||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=a||e.name,this.code=e instanceof rO?e.code:t??-1}}class iO extends aO{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class sO extends aO{constructor(e){super(e,{code:sO.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(sO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class oO extends aO{constructor(e){super(e,{code:oO.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(oO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class cO extends aO{constructor(e,{method:t}={}){super(e,{code:cO.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}}Object.defineProperty(cO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class lO extends aO{constructor(e){super(e,{code:lO.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")})}}Object.defineProperty(lO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class uO extends aO{constructor(e){super(e,{code:uO.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(uO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class dO extends aO{constructor(e){super(e,{code:dO.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")})}}Object.defineProperty(dO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class pO extends aO{constructor(e){super(e,{code:pO.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(pO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class hO extends aO{constructor(e){super(e,{code:hO.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(hO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class mO extends aO{constructor(e){super(e,{code:mO.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(mO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class fO extends aO{constructor(e,{method:t}={}){super(e,{code:fO.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}}Object.defineProperty(fO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class yO extends aO{constructor(e){super(e,{code:yO.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(yO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class bO extends aO{constructor(e){super(e,{code:bO.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(bO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class gO extends iO{constructor(e){super(e,{code:gO.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(gO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class vO extends iO{constructor(e){super(e,{code:vO.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(vO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class wO extends iO{constructor(e,{method:t}={}){super(e,{code:wO.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}}Object.defineProperty(wO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class CO extends iO{constructor(e){super(e,{code:CO.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(CO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class xO extends iO{constructor(e){super(e,{code:xO.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(xO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class EO extends iO{constructor(e){super(e,{code:EO.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(EO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class kO extends iO{constructor(e){super(e,{code:kO.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(kO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class TO extends iO{constructor(e){super(e,{code:TO.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(TO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class PO extends iO{constructor(e){super(e,{code:PO.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(PO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class AO extends iO{constructor(e){super(e,{code:AO.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(AO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class _O extends iO{constructor(e){super(e,{code:_O.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(_O,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class DO extends iO{constructor(e){super(e,{code:DO.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(DO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class OO extends iO{constructor(e){super(e,{code:OO.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(OO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class FO extends aO{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const SO=3;function IO(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw new Error("Invalid yParityOrV value")}async function MO({hash:e,signature:t}){return n=await async function({hash:e,signature:t}){const n=gA(e)?e:QA(e),{secp256k1:r}=await Promise.resolve().then((function(){return require("./secp256k1-88c91671.cjs")})),a=(()=>{if("object"==typeof t&&"r"in t&&"s"in t){const{r:e,s:n,v:a,yParity:i}=t,s=IO(Number(i??a));return new r.Signature(JA(e),JA(n)).addRecoveryBit(s)}const e=gA(t)?t:QA(t);if(65!==vA(e))throw new Error("invalid signature length");const n=IO(XA(`0x${e.slice(130)}`));return r.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(n)})();return`0x${a.recoverPublicKey(n.substring(2)).toHex(!1)}`}({hash:e,signature:t}),X_(`0x${$_(`0x${n.substring(4)}`).substring(26)}`);var n}function NO(e,t="hex"){const n=UO(e),r=_D(new Uint8Array(n.length));return n.encode(r),"hex"===t?t_(r.bytes):r.bytes}function UO(e){return Array.isArray(e)?function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=LO(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=>UO(e)))):function(e){const t="string"==typeof e?l_(e):e,n=LO(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 LO(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 EA("Length is too large.")}function BO(e){const{chainId:t,nonce:n,to:r}=e,a=e.contractAddress??e.address,i=$_(nD(["0x05",NO([t?n_(t):"0x",a,n?n_(n):"0x"])]));return"bytes"===r?l_(i):i}async function RO(e){const{authorization:t,signature:n}=e;return MO({hash:BO(t),signature:n??t})}class jO extends EA{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:i,gasPrice:s,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=VD({from:t?.address,to:u,value:void 0!==d&&`${zD(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:i,gasPrice:void 0!==s&&`${$D(s)} gwei`,maxFeePerGas:void 0!==o&&`${$D(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${$D(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class GO extends EA{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,name:"ExecutionRevertedError"})}}Object.defineProperty(GO,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(GO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class zO extends EA{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${$D(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(zO,"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 $O extends EA{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${$D(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty($O,"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 HO extends EA{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(HO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class qO extends EA{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(qO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class VO extends EA{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(VO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class WO extends EA{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(WO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class ZO extends EA{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(ZO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class KO extends EA{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(KO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class JO extends EA{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(JO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class XO extends EA{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${$D(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${$D(n)} gwei`:""}).`].join("\n"),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(XO,"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 YO extends EA{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function QO(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof EA?e.walk((e=>e?.code===GO.code)):e;return r instanceof EA?new GO({cause:e,message:r.details}):GO.nodeMessage.test(n)?new GO({cause:e,message:e.details}):zO.nodeMessage.test(n)?new zO({cause:e,maxFeePerGas:t?.maxFeePerGas}):$O.nodeMessage.test(n)?new $O({cause:e,maxFeePerGas:t?.maxFeePerGas}):HO.nodeMessage.test(n)?new HO({cause:e,nonce:t?.nonce}):qO.nodeMessage.test(n)?new qO({cause:e,nonce:t?.nonce}):VO.nodeMessage.test(n)?new VO({cause:e,nonce:t?.nonce}):WO.nodeMessage.test(n)?new WO({cause:e}):ZO.nodeMessage.test(n)?new ZO({cause:e,gas:t?.gas}):KO.nodeMessage.test(n)?new KO({cause:e,gas:t?.gas}):JO.nodeMessage.test(n)?new JO({cause:e}):XO.nodeMessage.test(n)?new XO({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new YO({cause:e})}function eF(e,{format:t}){if(!t)return{};const n={};return function t(r){const a=Object.keys(r);for(const i of a)i in e&&(n[i]=e[i]),r[i]&&"object"==typeof r[i]&&!Array.isArray(r[i])&&t(r[i])}(t(e||{})),n}function tF(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 nF={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function rF(e){const t={};return void 0!==e.authorizationList&&(t.authorizationList=e.authorizationList.map((e=>({address:e.address,r:e.r?n_(BigInt(e.r)):e.r,s:e.s?n_(BigInt(e.s)):e.s,chainId:n_(e.chainId),nonce:n_(e.nonce),...void 0!==e.yParity?{yParity:n_(e.yParity)}:{},...void 0!==e.v&&void 0===e.yParity?{v:n_(e.v)}:{}})))),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=>t_(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=n_(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=n_(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=n_(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=n_(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=n_(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=n_(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=nF[e.type]),void 0!==e.value&&(t.value=n_(e.value)),t}function aF(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new zA({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new zA({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function iF(e){const{balance:t,nonce:n,state:r,stateDiff:a,code:i}=e,s={};if(void 0!==i&&(s.code=i),void 0!==t&&(s.balance=n_(t)),void 0!==n&&(s.nonce=n_(n)),void 0!==r&&(s.state=aF(r)),void 0!==a){if(s.state)throw new qD;s.stateDiff=aF(a)}return s}const sF=2n**256n-1n;function oF(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:a,to:i}=e,s=t?gD(t):void 0;if(s&&!eD(s.address))throw new Z_({address:s.address});if(i&&!eD(i))throw new Z_({address:i});if(void 0!==n&&(void 0!==r||void 0!==a))throw new WD;if(r&&r>sF)throw new zO({maxFeePerGas:r});if(a&&r&&a>r)throw new XO({maxFeePerGas:r,maxPriorityFeePerGas:a})}class cF extends EA{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class lF extends EA{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class uF extends EA{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${$D(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class dF extends EA{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.`,{name:"BlockNotFoundError"})}}const pF={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function hF(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?XA(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?XA(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?pF[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 e.authorizationList&&(t.authorizationList=e.authorizationList.map((e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)})))),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 mF=tF("transaction",hF);function fF(e){const t=(e.transactions??[]).map((e=>"string"==typeof e?e:hF(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 yF=tF("block",fF);async function bF(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:a}={}){const i=a??!1,s=void 0!==n?n_(n):void 0;let o=null;if(o=t?await e.request({method:"eth_getBlockByHash",params:[t,i]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[s||r,i]},{dedupe:Boolean(s)}),!o)throw new dF({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||fF)(o)}async function gF(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function vF(e,t){const{block:n,chain:r=e.chain,request:a,type:i="eip1559"}=t||{},s=await(async()=>"function"==typeof r?.fees?.baseFeeMultiplier?r.fees.baseFeeMultiplier({block:n,client:e,request:a}):r?.fees?.baseFeeMultiplier??1.2)();if(s<1)throw new cF;const o=10**(s.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(s*o))/BigInt(o),l=n||await fA(e,bF,"getBlock")({});if("function"==typeof r?.fees?.estimateFeesPerGas){const t=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:a,type:i});if(null!==t)return t}if("eip1559"===i){if("bigint"!=typeof l.baseFeePerGas)throw new lF;const t="bigint"==typeof a?.maxPriorityFeePerGas?a.maxPriorityFeePerGas:await async function(e,t){const{block:n,chain:r=e.chain,request:a}=t||{};try{const t=r?.fees?.maxPriorityFeePerGas??r?.fees?.defaultPriorityFee;if("function"==typeof t){const r=n||await fA(e,bF,"getBlock")({}),i=await t({block:r,client:e,request:a});if(null===i)throw new Error;return i}return void 0!==t?t:JA(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):fA(e,bF,"getBlock")({}),fA(e,gF,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new lF;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 fA(e,gF,"getGasPrice")({}))}}async function wF(e,{address:t,blockTag:n="latest",blockNumber:r}){return XA(await e.request({method:"eth_getTransactionCount",params:[t,"bigint"==typeof r?n_(r):n]},{dedupe:Boolean(r)}))}function CF(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=>l_(e))):e.blobs,a=[];for(const e of r)a.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?a:a.map((e=>t_(e)))}function xF(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=>l_(e))):e.blobs,a="string"==typeof e.commitments[0]?e.commitments.map((e=>l_(e))):e.commitments,i=[];for(let e=0;e<r.length;e++){const n=r[e],s=a[e];i.push(Uint8Array.from(t.computeBlobKzgProof(n,s)))}return"bytes"===n?i:i.map((e=>t_(e)))}function EF(e,t,n){return e&t^~e&n}function kF(e,t,n){return e&t^e&n^t&n}class TF extends T_{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=C_(this.buffer)}update(e){g_(this),b_(e=k_(e));const{view:t,buffer:n,blockLen:r}=this,a=e.length;for(let i=0;i<a;){const s=Math.min(r-this.pos,a-i);if(s!==r)n.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===r&&(this.process(t,0),this.pos=0);else{const t=C_(e);for(;r<=a-i;i+=r)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){g_(this),v_(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:a}=this;let{pos:i}=this;t[i++]=128,w_(this.buffer.subarray(i)),this.padOffset>r-i&&(this.process(n,0),i=0);for(let e=i;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),i=BigInt(4294967295),s=Number(n>>a&i),o=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,s,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),a),this.process(n,0);const s=C_(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++)s.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:i,pos:s}=this;return e.destroyed=i,e.finished=a,e.length=r,e.pos=s,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const PF=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),AF=Uint32Array.from([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]),_F=new Uint32Array(64);class DF extends TF{constructor(e=32){super(64,e,8,!1),this.A=0|PF[0],this.B=0|PF[1],this.C=0|PF[2],this.D=0|PF[3],this.E=0|PF[4],this.F=0|PF[5],this.G=0|PF[6],this.H=0|PF[7]}get(){const{A:e,B:t,C:n,D:r,E:a,F:i,G:s,H:o}=this;return[e,t,n,r,a,i,s,o]}set(e,t,n,r,a,i,s,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|a,this.F=0|i,this.G=0|s,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)_F[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=_F[e-15],n=_F[e-2],r=x_(t,7)^x_(t,18)^t>>>3,a=x_(n,17)^x_(n,19)^n>>>10;_F[e]=a+_F[e-7]+r+_F[e-16]|0}let{A:n,B:r,C:a,D:i,E:s,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(x_(s,6)^x_(s,11)^x_(s,25))+EF(s,o,c)+AF[e]+_F[e]|0,u=(x_(n,2)^x_(n,13)^x_(n,22))+kF(n,r,a)|0;l=c,c=o,o=s,s=i+t|0,i=a,a=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,a=a+this.C|0,i=i+this.D|0,s=s+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,a,i,s,o,c,l)}roundClean(){w_(_F)}destroy(){this.set(0,0,0,0,0,0,0,0),w_(this.buffer)}}const OF=P_((()=>new DF)),FF=OF;function SF(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=FF(gA(e,{strict:!1})?s_(e):e);return"bytes"===n?r:QA(r)}(t,"bytes");return a.set([n],0),"bytes"===r?a:t_(a)}function IF(e){const{commitments:t,version:n}=e,r=e.to??("string"==typeof t[0]?"hex":"bytes"),a=[];for(const e of t)a.push(SF({commitment:e,to:r,version:n}));return a}const MF=32,NF=4096,UF=MF*NF,LF=6*UF-1-1*NF*6,BF=1;class RF extends EA{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`],name:"BlobSizeTooLargeError"})}}class jF extends EA{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class GF extends EA{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`],name:"InvalidVersionedHashSizeError"})}}class zF extends EA{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${BF}`,`Received: ${t}`],name:"InvalidVersionedHashVersionError"})}}function $F(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?l_(e.data):e.data,r=vA(n);if(!r)throw new jF;if(r>LF)throw new RF({maxSize:LF,size:r});const a=[];let i=!0,s=0;for(;i;){const e=_D(new Uint8Array(UF));let t=0;for(;t<NF;){const r=n.slice(s,s+(MF-1));if(e.pushByte(0),e.pushBytes(r),r.length<31){e.pushByte(128),i=!1;break}t++,s+=31}a.push(e)}return"bytes"===t?a.map((e=>e.bytes)):a.map((e=>t_(e.bytes)))}({data:t,to:r}),i=e.commitments??CF({blobs:a,kzg:n,to:r}),s=e.proofs??xF({blobs:a,commitments:i,kzg:n,to:r}),o=[];for(let e=0;e<a.length;e++)o.push({blob:a[e],commitment:i[e],proof:s[e]});return o}function HF(e){if(e.type)return e.type;if(void 0!==e.authorizationList)return"eip7702";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 KD({transaction:e})}async function qF(e){return XA(await e.request({method:"eth_chainId"},{dedupe:!0}))}const VF=["blobVersionedHashes","chainId","fees","gas","nonce","type"],WF=new Map;async function ZF(e,t){const{account:n=e.account,blobs:r,chain:a,gas:i,kzg:s,nonce:o,nonceManager:c,parameters:l=VF,type:u}=t,d=n?gD(n):n,p={...t,...d?{from:d?.address}:{}};let h,m;async function f(){return h||(h=await fA(e,bF,"getBlock")({blockTag:"latest"}),h)}async function y(){if(m)return m;if(a)return a.id;if(void 0!==t.chainId)return t.chainId;const n=await fA(e,qF,"getChainId")({});return m=n,m}if(l.includes("nonce")&&void 0===o&&d)if(c){const t=await y();p.nonce=await c.consume({address:d.address,chainId:t,client:e})}else p.nonce=await fA(e,wF,"getTransactionCount")({address:d.address,blockTag:"pending"});if((l.includes("blobVersionedHashes")||l.includes("sidecars"))&&r&&s){const e=CF({blobs:r,kzg:s});if(l.includes("blobVersionedHashes")){const t=IF({commitments:e,to:"hex"});p.blobVersionedHashes=t}if(l.includes("sidecars")){const t=$F({blobs:r,commitments:e,proofs:xF({blobs:r,commitments:e,kzg:s}),to:"hex"});p.sidecars=t}}if(l.includes("chainId")&&(p.chainId=await y()),(l.includes("fees")||l.includes("type"))&&void 0===u)try{p.type=HF(p)}catch{let t=WF.get(e.uid);if(void 0===t){const n=await f();t="bigint"==typeof n?.baseFeePerGas,WF.set(e.uid,t)}p.type=t?"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 f(),{maxFeePerGas:r,maxPriorityFeePerGas:i}=await vF(e,{block:n,chain:a,request:p});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas<i)throw new uF({maxPriorityFeePerGas:i});p.maxPriorityFeePerGas=i,p.maxFeePerGas=r}}else{if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)throw new lF;if(void 0===t.gasPrice){const t=await f(),{gasPrice:n}=await vF(e,{block:t,chain:a,request:p,type:"legacy"});p.gasPrice=n}}return l.includes("gas")&&void 0===i&&(p.gas=await fA(e,KF,"estimateGas")({...p,account:d?{address:d.address,type:"json-rpc"}:d})),oF(p),delete p.parameters,p}async function KF(e,t){const{account:n=e.account}=t,r=n?gD(n):void 0;try{const{accessList:a,authorizationList:i,blobs:s,blobVersionedHashes:o,blockNumber:c,blockTag:l,data:u,gas:d,gasPrice:p,maxFeePerBlobGas:h,maxFeePerGas:m,maxPriorityFeePerGas:f,nonce:y,value:b,stateOverride:g,...v}=await ZF(e,{...t,parameters:"local"===r?.type?void 0:["blobVersionedHashes"]}),w=("bigint"==typeof c?n_(c):void 0)||l,C=function(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!eD(n,{strict:!1}))throw new Z_({address:n});if(t[n])throw new HD({address:n});t[n]=iF(r)}return t}(g),x=await(async()=>v.to?v.to:i&&i.length>0?await RO({authorization:i[0]}).catch((()=>{throw new EA("`to` is required. Could not infer from `authorizationList`")})):void 0)();oF(t);const E=e.chain?.formatters?.transactionRequest?.format,k=(E||rF)({...eF(v,{format:E}),from:r?.address,accessList:a,authorizationList:i,blobs:s,blobVersionedHashes:o,data:u,gas:d,gasPrice:p,maxFeePerBlobGas:h,maxFeePerGas:m,maxPriorityFeePerGas:f,nonce:y,to:x,value:b});function T(t){const{block:n,request:r,rpcStateOverride:a}=t;return e.request({method:"eth_estimateGas",params:a?[r,n??e.experimental_blockTag??"latest",a]:n?[r,n]:[r]})}let P=BigInt(await T({block:w,request:k,rpcStateOverride:C}));if(i){const A=await async function(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const a="bigint"==typeof n?n_(n):void 0,i=await e.request({method:"eth_getBalance",params:[t,a||r]});return BigInt(i)}(e,{address:k.from}),_=await Promise.all(i.map((async e=>{const{address:t}=e,n=await T({block:w,request:{authorizationList:void 0,data:u,from:r?.address,to:t,value:n_(A)},rpcStateOverride:C}).catch((()=>100000n));return 2n*BigInt(n)})));P+=_.reduce(((e,t)=>e+t),0n)}return P}catch(D){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=QO(e,n);return t instanceof YO?e:t})();return new jO(r,{docsPath:t,...n})}(D,{...t,account:r,chain:e.chain})}}class JF extends EA{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}`],name:"ChainMismatchError"})}}class XF extends EA{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"),{name:"ChainNotFoundError"})}}class YF extends EA{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const QF="/docs/contract/encodeDeployData";const eS=new Map,tS=new Map;let nS=0;function rS(e,t,n){const r=++nS,a=()=>eS.get(e)||[],i=()=>{const t=a();if(!t.some((e=>e.id===r)))return;const n=tS.get(e);if(1===t.length&&n){const e=n();e instanceof Promise&&e.catch((()=>{}))}(()=>{const t=a();eS.set(e,t.filter((e=>e.id!==r)))})()},s=a();if(eS.set(e,[...s,{id:r,fns:t}]),s&&s.length>0)return i;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&&tS.set(e,c),i}async function aS(e){return new Promise((t=>setTimeout(t,e)))}class iS extends EA{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 Client."].join("\n"),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class sS extends EA{constructor({docsPath:e,metaMessages:t,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:t,name:"AccountTypeNotSupportedError"})}}function oS({chain:e,currentChainId:t}){if(!e)throw new XF;if(t!==e.id)throw new JF({chain:e,currentChainId:t})}function cS(e,{docsPath:t,...n}){const r=(()=>{const t=QO(e,n);return t instanceof YO?e:t})();return new XD(r,{docsPath:t,...n})}async function lS(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const uS=new K_(128);async function dS(e,t){const{account:n=e.account,chain:r=e.chain,accessList:a,authorizationList:i,blobs:s,data:o,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,type:m,value:f,...y}=t;if(void 0===n)throw new iS({docsPath:"/docs/actions/wallet/sendTransaction"});const b=n?gD(n):null;try{oF(t);const n=await(async()=>t.to?t.to:null!==t.to&&i&&i.length>0?await RO({authorization:i[0]}).catch((()=>{throw new EA("`to` is required. Could not infer from `authorizationList`.")})):void 0)();if("json-rpc"===b?.type||null===b){let t;null!==r&&(t=await fA(e,qF,"getChainId")({}),oS({currentChainId:t,chain:r}));const g=e.chain?.formatters?.transactionRequest?.format,v=(g||rF)({...eF(y,{format:g}),accessList:a,authorizationList:i,blobs:s,chainId:t,data:o,from:b?.address,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:n,type:m,value:f}),w=uS.get(e.uid),C=w?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:C,params:[v]},{retryCount:0})}catch(t){if(!1===w)throw t;const n=t;if("InvalidInputRpcError"===n.name||"InvalidParamsRpcError"===n.name||"MethodNotFoundRpcError"===n.name||"MethodNotSupportedRpcError"===n.name)return await e.request({method:"wallet_sendTransaction",params:[v]},{retryCount:0}).then((t=>(uS.set(e.uid,!0),t))).catch((t=>{const r=t;if("MethodNotFoundRpcError"===r.name||"MethodNotSupportedRpcError"===r.name)throw uS.set(e.uid,!1),n;throw r}));throw n}}if("local"===b?.type){const t=await fA(e,ZF,"prepareTransactionRequest")({account:b,accessList:a,authorizationList:i,blobs:s,chain:r,data:o,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,nonceManager:b.nonceManager,parameters:[...VF,"sidecars"],type:m,value:f,...y,to:n}),g=r?.serializers?.transaction,v=await b.signTransaction(t,{serializer:g});return await fA(e,lS,"sendRawTransaction")({serializedTransaction:v})}if("smart"===b?.type)throw new sS({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new sS({docsPath:"/docs/actions/wallet/sendTransaction",type:b?.type})}catch(e){if(e instanceof sS)throw e;throw cS(e,{...t,account:b,chain:t.chain||void 0})}}async function pS(e,t){const{abi:n,account:r=e.account,address:a,args:i,dataSuffix:s,functionName:o,...c}=t;if(void 0===r)throw new iS({docsPath:"/docs/contract/writeContract"});const l=r?gD(r):null,u=wD({abi:n,args:i,functionName:o});try{return await fA(e,dS,"sendTransaction")({data:`${u}${s?s.replace("0x",""):""}`,to:a,account:l,...c})}catch(e){throw function(e,{abi:t,address:n,args:r,docsPath:a,functionName:i,sender:s}){const o=e instanceof tO?e:e instanceof EA?e.walk((e=>"data"in e))||e.walk():{},{code:c,data:l,details:u,message:d,shortMessage:p}=o,h=e instanceof _A?new eO({functionName:i}):[SO,uO.code].includes(c)&&(l||u||d||p)?new QD({abi:t,data:"object"==typeof l?l.data:l,functionName:i,message:o instanceof rO?u:p??d}):e;return new YD(h,{abi:t,args:r,contractAddress:n,docsPath:a,functionName:i,sender:s})}(e,{abi:n,address:a,args:i,docsPath:"/docs/contract/writeContract",functionName:o,sender:l?.address})}}class hS extends EA{constructor(e){super(`Call bundle failed with status: ${e.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=e}}function mS(e,{delay:t=100,retryCount:n=2,shouldRetry:r=(()=>!0)}={}){return new Promise(((a,i)=>{const s=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 aS(n),s({count:o+1})})({error:e});i(e)}};s()}))}const fS={"0x0":"reverted","0x1":"success"};function yS(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?XA(e.transactionIndex):null,status:e.status?fS[e.status]:null,type:e.type?pF[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const bS=tF("transactionReceipt",yS),gS="0x5792579257925792579257925792579257925792579257925792579257925792",vS=n_(0,{size:32});async function wS(e,t){const{account:n=e.account,capabilities:r,chain:a=e.chain,experimental_fallback:i,experimental_fallbackDelay:s=32,forceAtomic:o=!1,id:c,version:l="2.0.0"}=t,u=n?gD(n):null,d=t.calls.map((e=>{const t=e,n=t.abi?wD({abi:t.abi,functionName:t.functionName,args:t.args}):t.data;return{data:t.dataSuffix&&n?tD([n,t.dataSuffix]):n,to:t.to,value:t.value?n_(t.value):void 0}}));try{const t=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:o,calls:d,capabilities:r,chainId:n_(a.id),from:u?.address,id:c,version:l}]},{retryCount:0});return"string"==typeof t?{id:t}:t}catch(n){const c=n;if(i&&("MethodNotFoundRpcError"===c.name||"MethodNotSupportedRpcError"===c.name||"UnknownRpcError"===c.name||c.details.toLowerCase().includes("does not exist / is not available")||c.details.toLowerCase().includes("missing or invalid. request()")||c.details.toLowerCase().includes("did not match any variant of untagged enum")||c.details.toLowerCase().includes("account upgraded to unsupported contract")||c.details.toLowerCase().includes("eip-7702 not supported")||c.details.toLowerCase().includes("unsupported wc_ method")||c.details.toLowerCase().includes("feature toggled misconfigured"))){if(r){if(Object.values(r).some((e=>!e.optional))){const e="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new kO(new EA(e,{details:e}))}}if(o&&d.length>1){const e="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new OO(new EA(e,{details:e}))}const t=[];for(const n of d){const r=dS(e,{account:u,chain:a,data:n.data,to:n.to,value:n.value?JA(n.value):void 0});t.push(r),s>0&&await new Promise((e=>setTimeout(e,s)))}const n=await Promise.allSettled(t);if(n.every((e=>"rejected"===e.status)))throw n[0].reason;return{id:tD([...n.map((e=>"fulfilled"===e.status?e.value:vS)),n_(a.id,{size:32}),gS])}}throw cS(n,{...t,account:u,chain:t.chain})}}async function CS(e,t){const{atomic:n=!1,chainId:r,receipts:a,version:i="2.0.0",...s}=await async function(t){if(t.endsWith(gS.slice(2))){const n=ZA(oD(t,-64,-32)),r=oD(t,0,-64).slice(2).match(/.{1,64}/g),a=await Promise.all(r.map((t=>vS.slice(2)!==t?e.request({method:"eth_getTransactionReceipt",params:[`0x${t}`]},{dedupe:!0}):void 0))),i=a.some((e=>null===e))?100:a.every((e=>"0x1"===e?.status))?200:a.every((e=>"0x0"===e?.status))?500:600;return{atomic:!1,chainId:XA(n),receipts:a.filter(Boolean),status:i,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[t]})}(t.id),[o,c]=(()=>{const e=s.status;return e>=100&&e<200?["pending",e]:e>=200&&e<300?["success",e]:e>=300&&e<700?["failure",e]:"CONFIRMED"===e?["success",200]:"PENDING"===e?["pending",100]:[void 0,e]})();return{...s,atomic:n,chainId:r?XA(r):void 0,receipts:a?.map((e=>({...e,blockNumber:JA(e.blockNumber),gasUsed:JA(e.gasUsed),status:fS[e.status]})))??[],statusCode:c,status:o,version:i}}async function xS(e,t){const{id:n,pollingInterval:r=e.pollingInterval,status:a=(({statusCode:e})=>200===e||e>=300),retryCount:i=4,retryDelay:s=(({count:e})=>200*~~(1<<e)),timeout:o=6e4,throwOnFailure:c=!1}=t,l=LD(["waitForCallsStatus",e.uid,n]),{promise:u,resolve:d,reject:p}=function(){let e=()=>{},t=()=>{};return{promise:new Promise(((n,r)=>{e=n,t=r})),resolve:e,reject:t}}();let h;const m=rS(l,{resolve:d,reject:p},(t=>{const o=function(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let a=!0;const i=()=>a=!1;return(async()=>{let s;t&&(s=await e({unpoll:i}));const o=await(n?.(s))??r;await aS(o);const c=async()=>{a&&(await e({unpoll:i}),await aS(r),c())};c()})(),i}((async()=>{const r=e=>{clearTimeout(h),o(),e(),m()};try{const o=await mS((async()=>{const t=await CS(e,{id:n});if(c&&"failure"===t.status)throw new hS(t);return t}),{retryCount:i,delay:s});if(!a(o))return;r((()=>t.resolve(o)))}catch(e){r((()=>t.reject(e)))}}),{interval:r,emitOnBegin:!0});return o}));return h=o?setTimeout((()=>{m(),clearTimeout(h),p(new ES({id:n}))}),o):void 0,await u}class ES extends EA{constructor({id:e}){super(`Timed out while waiting for call bundle with id "${e}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const kS=256;let TS,PS=kS;function AS(e=11){if(!TS||PS+e>2*kS){TS="",PS=0;for(let e=0;e<kS;e++)TS+=(256+256*Math.random()|0).toString(16).substring(1)}return TS.substring(PS,PS+++e)}function _S(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:a}=e;if(t<=0)throw new YF({chainId:t});if(a&&!eD(a))throw new Z_({address:a});if(r&&r>sF)throw new zO({maxFeePerGas:r});if(n&&r&&n>r)throw new XO({maxFeePerGas:r,maxPriorityFeePerGas:n})}function DS(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 JD({storageKey:a[e]});if(!eD(r,{strict:!1}))throw new Z_({address:r});t.push([r,a])}return t}function OS(e,t){const n=HF(e);return"eip1559"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:i,value:s,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,data:u}=e;_S(e);const d=DS(l),p=[n_(n),a?n_(a):"0x",c?n_(c):"0x",o?n_(o):"0x",r?n_(r):"0x",i??"0x",s?n_(s):"0x",u??"0x",d,...FS(e,t)];return nD(["0x02",NO(p)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:r,data:a,nonce:i,to:s,value:o,accessList:c,gasPrice:l}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i}=e;if(t<=0)throw new YF({chainId:t});if(i&&!eD(i))throw new Z_({address:i});if(n||a)throw new EA("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>sF)throw new zO({maxFeePerGas:r})}(e);const u=DS(c),d=[n_(n),i?n_(i):"0x",l?n_(l):"0x",r?n_(r):"0x",s??"0x",o?n_(o):"0x",a??"0x",u,...FS(e,t)];return nD(["0x01",NO(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:i,value:s,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 jF;for(const e of t){const t=vA(e),n=XA(rD(e,0,1));if(32!==t)throw new GF({hash:e,size:t});if(n!==BF)throw new zF({hash:e,version:n})}}_S(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=>t_(e))),n=e.kzg,r=CF({blobs:t,kzg:n});if(void 0===p&&(p=IF({commitments:r})),void 0===h){h=$F({blobs:t,commitments:r,proofs:xF({blobs:t,commitments:r,kzg:n})})}}const m=DS(u),f=[n_(n),a?n_(a):"0x",l?n_(l):"0x",c?n_(c):"0x",r?n_(r):"0x",i??"0x",s?n_(s):"0x",d??"0x",m,o?n_(o):"0x",p??[],...FS(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 nD(["0x03",NO(h?[f,y,b,g]:f)])}(e,t):"eip7702"===n?function(e,t){const{authorizationList:n,chainId:r,gas:a,nonce:i,to:s,value:o,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{authorizationList:t}=e;if(t)for(const e of t){const{chainId:t}=e,n=e.address;if(!eD(n))throw new Z_({address:n});if(t<0)throw new YF({chainId:t})}_S(e)}(e);const p=DS(u),h=function(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const{chainId:e,nonce:r,...a}=n,i=n.address;t.push([e?QA(e):"0x",i,r?QA(r):"0x",...FS({},a)])}return t}(n);return nD(["0x04",NO([n_(r),i?n_(i):"0x",l?n_(l):"0x",c?n_(c):"0x",a?n_(a):"0x",s??"0x",o?n_(o):"0x",d??"0x",p,h,...FS(e,t)])])}(e,t):function(e,t){const{chainId:n=0,gas:r,data:a,nonce:i,to:s,value:o,gasPrice:c}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i}=e;if(i&&!eD(i))throw new Z_({address:i});if(void 0!==t&&t<=0)throw new YF({chainId:t});if(n||a)throw new EA("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>sF)throw new zO({maxFeePerGas:r})}(e);let l=[i?n_(i):"0x",c?n_(c):"0x",r?n_(r):"0x",s??"0x",o?n_(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 ZD({v:t.v});return e})(),r=ZA(t.r),a=ZA(t.s);l=[...l,n_(e),"0x00"===r?"0x":r,"0x00"===a?"0x":a]}else n>0&&(l=[...l,n_(n),"0x","0x"]);return NO(l)}(e,t)}function FS(e,t){const n=t??e,{v:r,yParity:a}=n;if(void 0===n.r)return[];if(void 0===n.s)return[];if(void 0===r&&void 0===a)return[];const i=ZA(n.r),s=ZA(n.s);return["number"==typeof a?a?n_(1):"0x":0n===r?"0x":1n===r?n_(1):27n===r?"0x":n_(1),"0x00"===i?"0x":i,"0x00"===s?"0x":s]}const SS=new K_(8192);function IS(e,t={}){return async(n,r={})=>{const{dedupe:a=!1,methods:i,retryDelay:s=150,retryCount:o=3,uid:c}={...t,...r},{method:l}=n;if(i?.exclude?.includes(l))throw new fO(new Error("method not supported"),{method:l});if(i?.include&&!i.include.includes(l))throw new fO(new Error("method not supported"),{method:l});return function(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(SS.get(n))return SS.get(n);const r=e().finally((()=>SS.delete(n)));return SS.set(n,r),r}((()=>mS((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case sO.code:throw new sO(t);case oO.code:throw new oO(t);case cO.code:throw new cO(t,{method:n.method});case lO.code:throw new lO(t);case uO.code:throw new uO(t);case dO.code:throw new dO(t);case pO.code:throw new pO(t);case hO.code:throw new hO(t);case mO.code:throw new mO(t);case fO.code:throw new fO(t,{method:n.method});case yO.code:throw new yO(t);case bO.code:throw new bO(t);case gO.code:throw new gO(t);case vO.code:throw new vO(t);case wO.code:throw new wO(t);case CO.code:throw new CO(t);case xO.code:throw new xO(t);case EO.code:throw new EO(t);case kO.code:throw new kO(t);case TO.code:throw new TO(t);case PO.code:throw new PO(t);case AO.code:throw new AO(t);case _O.code:throw new _O(t);case DO.code:throw new DO(t);case OO.code:throw new OO(t);case 5e3:throw new gO(t);default:if(e instanceof EA)throw e;throw new FO(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof nO){const e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e,10)}return~~(1<<e)*s},retryCount:o,shouldRetry:({error:e})=>function(e){if("code"in e&&"number"==typeof e.code)return-1===e.code||(e.code===yO.code||e.code===uO.code);if(e instanceof nO&&e.status)return 403===e.status||(408===e.status||(413===e.status||(429===e.status||(500===e.status||(502===e.status||(503===e.status||504===e.status))))));return!0}(e)})),{enabled:a,id:a?a_(`${c}.${LD(n)}`):void 0})}}function MS(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}class NS extends EA{constructor({domain:e}){super(`Invalid domain "${LD(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class US extends EA{constructor({primaryType:e,types:t}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(t))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class LS extends EA{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function BS({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},("number"==typeof e?.chainId||"bigint"==typeof e?.chainId)&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function RS(e){if("address"===e||"bool"===e||"string"===e||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new LS({type:e})}function jS(e,t){const{abi:n,args:r,bytecode:a,...i}=t,s=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 TA({docsPath:QF});if(!("inputs"in a))throw new PA({docsPath:QF});if(!a.inputs||0===a.inputs.length)throw new PA({docsPath:QF});return nD([r,uD(a.inputs,n)])}({abi:n,args:r,bytecode:a});return dS(e,{...i,...i.authorizationList?{to:null}:{},data:s})}async function GS(e,t={}){const{account:n=e.account,chainId:r}=t,a=n?gD(n):void 0,i=r?[a?.address,[n_(r)]]:[a?.address],s=await e.request({method:"wallet_getCapabilities",params:i}),o={};for(const[e,t]of Object.entries(s)){o[Number(e)]={};for(let[n,r]of Object.entries(t))"addSubAccount"===n&&(n="unstable_addSubAccount"),o[Number(e)][n]=r}return"number"==typeof r?o[r]:o}async function zS(e,t){const{account:n=e.account,chainId:r,nonce:a}=t;if(!n)throw new iS({docsPath:"/docs/eip7702/prepareAuthorization"});const i=gD(n),s=(()=>{if(t.executor)return"self"===t.executor?t.executor:gD(t.executor)})(),o={address:t.contractAddress??t.address,chainId:r,nonce:a};return void 0===o.chainId&&(o.chainId=e.chain?.id??await fA(e,qF,"getChainId")({})),void 0===o.nonce&&(o.nonce=await fA(e,wF,"getTransactionCount")({address:i.address,blockTag:"pending"}),("self"===s||s?.address&&function(e,t){if(!eD(e,{strict:!1}))throw new Z_({address:e});if(!eD(t,{strict:!1}))throw new Z_({address:t});return e.toLowerCase()===t.toLowerCase()}(s.address,i.address))&&(o.nonce+=1)),o}async function $S(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map((e=>function(e,t){if(!eD(e,{strict:!1}))throw new Z_({address:e});return X_(e,t)}(e)))}async function HS(e,t){const{id:n}=t;await e.request({method:"wallet_showCallsStatus",params:[n]})}async function qS(e,t){const{account:n=e.account,domain:r,message:a,primaryType:i}=t;if(!n)throw new iS({docsPath:"/docs/actions/wallet/signTypedData"});const s=gD(n),o={EIP712Domain:BS({domain:r}),...t.types};if(function(e){const{domain:t,message:n,primaryType:r,types:a}=e,i=(e,t)=>{for(const n of e){const{name:e,type:r}=n,s=t[e],o=r.match(lD);if(o&&("number"==typeof s||"bigint"==typeof s)){const[e,t,n]=o;n_(s,{signed:"int"===t,size:Number.parseInt(n,10)/8})}if("address"===r&&"string"==typeof s&&!eD(s))throw new Z_({address:s});const c=r.match(cD);if(c){const[e,t]=c;if(t&&vA(s)!==Number.parseInt(t,10))throw new NA({expectedSize:Number.parseInt(t,10),givenSize:vA(s)})}const l=a[r];l&&(RS(r),i(l,s))}};if(a.EIP712Domain&&t){if("object"!=typeof t)throw new NS({domain:t});i(a.EIP712Domain,t)}if("EIP712Domain"!==r){if(!a[r])throw new US({primaryType:r,types:a});i(a[r],n)}}({domain:r,message:a,primaryType:i,types:o}),s.signTypedData)return s.signTypedData({domain:r,message:a,primaryType:i,types:o});const c=function(e){const{domain:t,message:n,primaryType:r,types:a}=e,i=(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},s=a.EIP712Domain&&t?i(a.EIP712Domain,t):{},o=(()=>{if("EIP712Domain"!==r)return i(a[r],n)})();return LD({domain:s,message:o,primaryType:r,types:a})}({domain:r,message:a,primaryType:i,types:o});return e.request({method:"eth_signTypedData_v4",params:[s.address,c]},{retryCount:0})}function VS(e){return{addChain:t=>async function(e,{chain:t}){const{id:n,name:r,nativeCurrency:a,rpcUrls:i,blockExplorers:s}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:n_(n),chainName:r,nativeCurrency:a,rpcUrls:i.default.http,blockExplorerUrls:s?Object.values(s).map((({url:e})=>e)):void 0}]},{dedupe:!0,retryCount:0})}(e,t),deployContract:t=>jS(e,t),getAddresses:()=>async function(e){return"local"===e.account?.type?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map((e=>X_(e)))}(e),getCallsStatus:t=>CS(e,t),getCapabilities:t=>GS(e,t),getChainId:()=>qF(e),getPermissions:()=>async function(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}(e),prepareAuthorization:t=>zS(e,t),prepareTransactionRequest:t=>ZF(e,t),requestAddresses:()=>$S(e),requestPermissions:t=>async function(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}(e,t),sendCalls:t=>wS(e,t),sendRawTransaction:t=>lS(e,t),sendTransaction:t=>dS(e,t),showCallsStatus:t=>HS(e,t),signAuthorization:t=>async function(e,t){const{account:n=e.account}=t;if(!n)throw new iS({docsPath:"/docs/eip7702/signAuthorization"});const r=gD(n);if(!r.signAuthorization)throw new sS({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:r.type});const a=await zS(e,t);return r.signAuthorization(a)}(e,t),signMessage:t=>async function(e,{account:t=e.account,message:n}){if(!t)throw new iS({docsPath:"/docs/actions/wallet/signMessage"});const r=gD(t);if(r.signMessage)return r.signMessage({message:n});const a="string"==typeof n?a_(n):n.raw instanceof Uint8Array?QA(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 iS({docsPath:"/docs/actions/wallet/signTransaction"});const i=gD(n);oF({account:i,...t});const s=await fA(e,qF,"getChainId")({});null!==r&&oS({currentChainId:s,chain:r});const o=r?.formatters||e.chain?.formatters,c=o?.transactionRequest?.format||rF;return i.signTransaction?i.signTransaction({...a,chainId:s},{serializer:e.chain?.serializers?.transaction}):await e.request({method:"eth_signTransaction",params:[{...c(a),chainId:n_(s),from:i.address}]},{retryCount:0})}(e,t),signTypedData:t=>qS(e,t),switchChain:t=>async function(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:n_(t)}]},{retryCount:0})}(e,t),waitForCallsStatus:t=>xS(e,t),watchAsset:t=>async function(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}(e,t),writeContract:t=>pS(e,t)}}function WS(e){const{key:t="wallet",name:n="Wallet Client",transport:r}=e,a=function(e){const{batch:t,chain:n,ccipRead:r,key:a="base",name:i="Base Client",type:s="base"}=e,o=e.experimental_blockTag??("number"==typeof n?.experimental_preconfirmationTime?"pending":void 0),c=n?.blockTime??12e3,l=Math.min(Math.max(Math.floor(c/2),500),4e3),u=e.pollingInterval??l,d=e.cacheTime??u,p=e.account?gD(e.account):void 0,{config:h,request:m,value:f}=e.transport({chain:n,pollingInterval:u}),y={account:p,batch:t,cacheTime:d,ccipRead:r,chain:n,key:a,name:i,pollingInterval:u,request:m,transport:{...h,...f},type:s,uid:AS(),...o?{experimental_blockTag:o}:{}};return Object.assign(y,{extend:function e(t){return n=>{const r=n(t);for(const e in y)delete r[e];const a={...t,...r};return Object.assign(a,{extend:e(a)})}}(y)})}({...e,key:t,name:n,transport:r,type:"walletClient"});return a.extend(VS)}function ZS(e,t={}){const{key:n="custom",methods:r,name:a="Custom Provider",retryDelay:i}=t;return({retryCount:s})=>function({key:e,methods:t,name:n,request:r,retryCount:a=3,retryDelay:i=150,timeout:s,type:o},c){return{config:{key:e,methods:t,name:n,request:r,retryCount:a,retryDelay:i,timeout:s,type:o},request:IS(r,{methods:t,retryCount:a,retryDelay:i,uid:AS()}),value:c}}({key:n,methods:r,name:a,request:e.request.bind(e),retryCount:t.retryCount??s,retryDelay:i,type:"custom"})}const KS=e=>{if(null!=e)return n.hexlify(e)};class JS extends i.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 m(this,void 0,void 0,(function*(){if(!this.smartAccountClient)throw new tb;return Promise.resolve(a.getAddress(this.smartAccountClient.account.address))}))}signMessage(e){return m(this,void 0,void 0,(function*(){if(!this.smartAccountClient)throw new tb;return this.smartAccountClient.account.signMessageWith6492({message:"string"!=typeof e||gA(e)?{raw:gA(e)?s_(e):e}:e})}))}_signTypedData(e,t,n){return m(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}signTransaction(e){return m(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}sendTransaction(e){return m(this,void 0,void 0,(function*(){if(!this.smartAccountClient)throw new tb;const t=yield r.resolveProperties(e),n=yield this.smartAccountClient.sendUserOperation({uo:{target:t.to,data:KS(t.data),value:BigInt(parseInt(t.value,16))}});return{hash:yield this.smartAccountClient.waitForUserOperationTransaction({hash:n.hash})}}))}connect(e){return new JS(null!=e?e:this.provider,this._address,this._index,this.smartAccountClient,this.signer)}connectUnchecked(){return new JS(this.provider,this._address,this._index,this.smartAccountClient,this.signer)}}const XS=[exports.ChainId.MAINNET,exports.ChainId.OPTIMISM,exports.ChainId.ARBITRUM_ONE,exports.ChainId.POLYGON,exports.ChainId.BASE];let YS={};const QS="alchemy-iframe-container";function eI(){if(!document.getElementById(QS)){const e=document.createElement("iframe");e.setAttribute("id",QS),e.style.display="none",document.body.appendChild(e)}}function tI(e,t){const n=e,r=YS[n];if(r)return r;const a=t[e];if(!a)throw new Error(`ChainId ${e} is not support`);eI();try{const e=new dA({client:{connection:{apiKey:a},iframeConfig:{iframeContainerId:QS}}});return YS[n]=e,e}catch(e){const t=document.getElementById(QS);if(t){t.remove(),eI();const e=new dA({client:{connection:{apiKey:a},iframeConfig:{iframeContainerId:QS}}});return YS[n]=e,e}throw e}}var nI;!function(e){e.Request="request",e.Response="response"}(nI||(nI={})),exports.ErrorType=void 0,(exports.ErrorType||(exports.ErrorType={})).SendTransactionError="SendTransactionError";class rI{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 aI{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 iI 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 iI?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof iI&&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 sI(this,e)}}function sI(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?sI(e.cause,t):t?null:e}function oI(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 cI=oI({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}}}),lI=oI({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 uI extends iI{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 dI(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 pI(e,{size:t}){if(dI(e)>t)throw new uI({givenSize:dI(e),maxSize:t})}function hI(e,t={}){const{signed:n}=t;t.size&&pI(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 mI(e,t={}){return Number(hI(e,t))}function fI(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 yI={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559"};function bI(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?mI(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?mI(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?yI[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 gI=fI("transaction",bI);function vI(e){const t=e.transactions?.map((e=>"string"==typeof e?e:bI(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 wI=fI("block",vI);const CI={"0x0":"reverted","0x1":"success"};function xI(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?mI(e.transactionIndex):null,status:e.status?CI[e.status]:null,type:e.type?yI[e.type]||e.type:null}}const EI=fI("transactionReceipt",xI),kI={block:wI({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=bI(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?hI(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:gI({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?hI(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:EI({format:e=>({l1GasPrice:e.l1GasPrice?hI(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?hI(e.l1GasUsed):null,l1Fee:e.l1Fee?hI(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},TI=oI({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:kI}),PI=oI({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:kI}),AI=oI({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}}}),_I=oI({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}),DI=oI({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}),OI=oI({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}),FI=oI({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:kI}),SI=oI({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:kI}),II=oI({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}}}),MI=oI({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}),NI=oI({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}),UI={optimism:FI,optimismGoerli:SI,polygon:II,polygonMumbai:MI,arbitrum:cI,arbitrumGoerli:lI,linea:DI,lineaTestnet:OI,base:TI,baseGoerli:PI,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:AI.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:_I.nativeCurrency},scrollSepolia:NI};class LI 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 BI{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 rI({walletWindow:this.contextWindow,appInfo:t}),this.cyberAccount=null,Object.entries(UI).forEach((([e,n])=>{this[e]=new aI({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(UI).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 LI({name:exports.ErrorType.SendTransactionError,details:e.event.data.error,shortMessage:"Transaction failed"})):t(new LI({details:e.event.data.error})):n(e.event.data?.data))}sendTransaction(e){return this.messenger.sendMessage({name:"action",data:{type:nI.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:nI.Request,method:"getAuthToken"}}),new Promise(((e,t)=>{this.messenger.onMessage((n=>{this.resolveActionResponse(n,t,e)}))}))}}class RI{appId;name;cyberWallet;messenger;icon;constructor({appId:e,name:t,icon:n}){this.appId=e,this.name=t,this.icon=n,this.cyberWallet=new BI({contextWindow:window.parent,appInfo:{name:t,icon:n,appId:e}}),this.messenger=new rI({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 jI(e){try{return a.getAddress(e)}catch(e){return!1}}const GI=0,zI=2,$I={};const HI="DODO-WALLET-CACHED-LAST-CONNECTED";class qI{constructor({cacheKey:e,rpcUrl:t}){this._rpcUrl="",this.cacheKey=Object.assign({lastConnectedType:HI},e),this._rpcUrl=null!=t?t:""}setCacheType(e){localStorage.setItem(this.cacheKey.lastConnectedType,e),localStorage.setItem(this.cacheKey.autoConnectType,e)}removeAutoConnectCache(){localStorage.removeItem(this.cacheKey.autoConnectType)}setRpcUrl(e){this._rpcUrl=e}getAutoCacheType(){return localStorage.getItem(this.cacheKey.autoConnectType)}getLastConnectType(){return localStorage.getItem(this.cacheKey.lastConnectedType)}getConnectedWallet(){var e;return m(this,void 0,void 0,(function*(){if(O.getState().connectLoading){let e,t;yield Promise.race([new Promise((e=>{t=O.subscribe((t=>{!1===t.connectLoading&&e(!0)}))})),new Promise((t=>{e=setTimeout((()=>{t(!1)}),4e3)}))]),clearTimeout(e),t&&t()}return null===(e=O.getState().connected)||void 0===e?void 0:e.wallet}))}connectWalletProcess(e,t){return m(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&&O.getState().chainIdChanged(r),(null===(n=t.events)||void 0===n?void 0:n.connect)&&t.events.connect({chainId:e})},accountsChanged:e=>{var n;O.getState().accountsChanged(e),e.length||O.getState().disconnect(),(null===(n=t.events)||void 0===n?void 0:n.accountsChanged)&&t.events.accountsChanged(e)},chainChanged:e=>m(this,void 0,void 0,(function*(){var n,r;yield null===(n=O.getState().provider)||void 0===n?void 0:n.detectNetwork();const a=parseInt(e,16);a&&O.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;O.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 m(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 i=Object.assign({},e);O.getState().startConnecting(i.type);const{type:s,connector:o,supportMobile:c,supportExtension:l}=i;let u;if(!1===l&&c&&!_()){const{openSingleWalletConnectModal:n,closeSingleWalletConnectModal:r}=t,{connector:s,disconnect:o}=DM;if(i.disconnect=o,n)try{u=yield this.connectWalletProcess(s,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,i,s;(null===(i=null===(a=null==t?void 0:t.walletConnectParams)||void 0===a?void 0:a.qrModalOptions)||void 0===i?void 0:i.openCallback)&&(null===(s=null==t?void 0:t.walletConnectParams)||void 0===s||s.qrModalOptions.openCallback(r)),n({uri:r,wallet:e})}})})}))}finally{r&&r()}else u=yield this.connectWalletProcess(s,t)}else{if(!o)throw new Error(`${e.showName} is not valid.`);try{u=yield this.connectWalletProcess(o,t)}catch(e){throw O.getState().connectFailed(),console.error(e),e}}return u?(this.setCacheType(s),this._wallet=i,yield O.getState().connectSuccess(u,i,!!n)):O.getState().connectFailed(),u}))}disconnectWallet(){var e;return m(this,void 0,void 0,(function*(){this.getAutoCacheType()&&((null===(e=this._wallet)||void 0===e?void 0:e.disconnect)&&(yield this._wallet.disconnect()),this._wallet=void 0,this.removeAutoConnectCache(),O.getState().disconnect(this._rpcUrl))}))}}const VI=/(?:^[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,WI="io.metamask",ZI="io.metamask.mobile",KI={"com.coinbase.wallet":exports.WalletType.WalletLink,"com.bitget.web3":exports.WalletType.Bitkeep,"com.okex.wallet":exports.WalletType.OKX,[WI]: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,"so.onekey.app.wallet":exports.WalletType.OneKey,"com.bybit":exports.WalletType.Bybit,"io.zerion.wallet":exports.WalletType.Zerion,"https://www.safepal.com/download":exports.WalletType.SafePal,"com.risechain.wallet":exports.WalletType.Rise};function JI(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=>N(Object.assign(Object.assign({},e),{provider:n})),injected:()=>!0,disabled:()=>!1,connector:(e,t)=>S(n,t),isEip6963:!0}}const XI={autoConnectType:"DODO-WALLET-CACHED-PROVIDER"};let YI,QI,eM;const tM=[exports.ChainId.OPTIMISM,exports.ChainId.POLYGON,exports.ChainId.ARBITRUM_ONE,exports.ChainId.LINEA,exports.ChainId.BASE,exports.ChainId.SCROLL_ALPHA_TESTNET];const nM=80001,rM=2025,aM=9527,iM=534354,sM=421613,oM=42161,cM=43113,lM=43114,uM=2206132,dM=210425,pM=[1,5,137,nM,56,97,rM,aM,iM,sM,oM,cM,lM,322,321,65,66,uM];const hM={type:exports.WalletType.WalletLink,showName:"Coinbase Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47054%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47054%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8%2020C8%2026.6267%2013.3733%2032%2020%2032C26.6267%2032%2032%2026.6267%2032%2020C32%2013.3733%2026.6267%208%2020%208C13.3733%208%208%2013.3733%208%2020ZM16.9333%2016.1333C16.49%2016.1333%2016.1333%2016.49%2016.1333%2016.9333V23.0667C16.1333%2023.51%2016.49%2023.8667%2016.9333%2023.8667H23.0667C23.51%2023.8667%2023.8667%2023.51%2023.8667%2023.0667V16.9333C23.8667%2016.49%2023.51%2016.1333%2023.0667%2016.1333H16.9333Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47054%22%20x1%3D%2220%22%20y1%3D%220%22%20x2%3D%2220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23345FF8%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%231D43DC%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47054%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,getPackage:Z,connector:oe,mobileAndroidDeepLink:"https://go.cb-w.com/dapp?cburl=$formattedAPPUrl",mobileIOSDeepLink:"cbwallet://dapp?url=$formattedAPPUrl",isContractWallet:()=>{const e=O.getState().provider.provider;return!(!e||(null==e?void 0:e.isWalletLink)||(null==e?void 0:e.isToshi))},disabled:()=>!!_(),injected:()=>{var e,t;return _()&&((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)=>S(void 0,t),switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:null!==(t=e.provider)&&void 0!==t?t:O.getState().provider}))},getSupportEip5792ChainIds:()=>{const e=O.getState().provider.provider;return!e||(null==e?void 0:e.isWalletLink)||(null==e?void 0:e.isToshi)?[]:[exports.ChainId.BASE,84532]}},mM={type:exports.WalletType.ImToken,showName:"imToken",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47053%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47053%29%22%2F%3E%3Cpath%20d%3D%22M32.5485%2012.3424C33.3788%2023.5873%2026.1506%2028.9022%2019.6707%2029.469C13.6462%2029.9958%207.97553%2026.2941%207.47806%2020.6066C7.06768%2015.9078%209.97179%2013.9073%2012.2535%2013.7079C14.6002%2013.5022%2016.5724%2015.1206%2016.7435%2017.0801C16.9082%2018.964%2015.7327%2019.8215%2014.9152%2019.8929C14.2686%2019.9496%2013.4552%2019.5571%2013.3818%2018.7143C13.3188%2017.99%2013.5938%2017.8914%2013.5266%2017.1221C13.407%2015.7524%2012.2126%2015.5929%2011.5587%2015.6495C10.7673%2015.7189%209.33155%2016.6424%209.53303%2018.943C9.73561%2021.2636%2011.9606%2023.0972%2014.8774%2022.8421C18.025%2022.5671%2020.2164%2020.1164%2020.3812%2016.6792C20.3797%2016.4971%2020.418%2016.3169%2020.4935%2016.1512L20.4945%2016.1471C20.5284%2016.075%2020.5681%2016.0059%2020.6131%2015.9403C20.6803%2015.8396%2020.7664%2015.7283%2020.8776%2015.6065C20.8787%2015.6034%2020.8787%2015.6034%2020.8808%2015.6034C20.9616%2015.5121%2021.0592%2015.4134%2021.1694%2015.3074C22.5443%2014.0102%2027.4961%2010.9507%2032.1791%2011.9195C32.2781%2011.9407%2032.3676%2011.9933%2032.4342%2012.0696C32.5008%2012.1458%2032.5408%2012.2415%2032.5485%2012.3424Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47053%22%20x1%3D%2238.8816%22%20y1%3D%221.1184%22%20x2%3D%22-1.04289e-05%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2311C4D1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%230062AD%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47053%22%3E%3Crect%20width%3D%2240%22%20height%3D%2239.922%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://token.im/",supportMobile:!0,supportExtension:!1,switchChain:N,mobileDeepLink:"imtokenv2://navigate/DappView?url=$formattedAPPUrl",injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isImToken}},fM={type:exports.WalletType.Math,showName:"Math Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22black%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47067%29%22%3E%3Cpath%20d%3D%22M20%2036C28.8366%2036%2036%2028.8366%2036%2020C36%2011.1634%2028.8366%204%2020%204C11.1634%204%204%2011.1634%204%2020C4%2028.8366%2011.1634%2036%2020%2036Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M10.3333%2024.6543C10.7288%2024.6543%2011.0494%2024.9748%2011.0494%2025.3703C11.0494%2025.7658%2010.7288%2026.0864%2010.3333%2026.0864C9.93784%2026.0864%209.61726%2025.7658%209.61726%2025.3703C9.61726%2024.9748%209.93784%2024.6543%2010.3333%2024.6543ZM20%2024.6543C20.3954%2024.6543%2020.716%2024.9748%2020.716%2025.3703C20.716%2025.7658%2020.3954%2026.0864%2020%2026.0864C19.6045%2026.0864%2019.2839%2025.7658%2019.2839%2025.3703C19.2839%2024.9748%2019.6045%2024.6543%2020%2024.6543ZM29.6666%2024.6543C30.0621%2024.6543%2030.3827%2024.9748%2030.3827%2025.3703C30.3827%2025.7658%2030.0621%2026.0864%2029.6666%2026.0864C29.2712%2026.0864%2028.9506%2025.7658%2028.9506%2025.3703C28.9506%2024.9748%2029.2712%2024.6543%2029.6666%2024.6543ZM12.4814%2021.79C13.0746%2021.79%2013.5555%2022.2709%2013.5555%2022.8641C13.5555%2023.4573%2013.0746%2023.9382%2012.4814%2023.9382C11.8882%2023.9382%2011.4074%2023.4573%2011.4074%2022.8641C11.4074%2022.2709%2011.8882%2021.79%2012.4814%2021.79ZM17.4938%2021.79C18.087%2021.79%2018.5679%2022.2709%2018.5679%2022.8641C18.5679%2023.4573%2018.087%2023.9382%2017.4938%2023.9382C16.9006%2023.9382%2016.4197%2023.4573%2016.4197%2022.8641C16.4197%2022.2709%2016.9006%2021.79%2017.4938%2021.79ZM22.5062%2021.79C23.0994%2021.79%2023.5802%2022.2709%2023.5802%2022.8641C23.5802%2023.4573%2023.0994%2023.9382%2022.5062%2023.9382C21.913%2023.9382%2021.4321%2023.4573%2021.4321%2022.8641C21.4321%2022.2709%2021.913%2021.79%2022.5062%2021.79ZM27.5185%2021.79C28.1117%2021.79%2028.5926%2022.2709%2028.5926%2022.8641C28.5926%2023.4573%2028.1117%2023.9382%2027.5185%2023.9382C26.9253%2023.9382%2026.4444%2023.4573%2026.4444%2022.8641C26.4444%2022.2709%2026.9253%2021.79%2027.5185%2021.79ZM7.82713%2022.1481C8.22259%2022.1481%208.54317%2022.4687%208.54317%2022.8641C8.54317%2023.2596%208.22259%2023.5802%207.82713%2023.5802C7.43167%2023.5802%207.11108%2023.2596%207.11108%2022.8641C7.11108%2022.4687%207.43167%2022.1481%207.82713%2022.1481ZM32.1728%2022.1481C32.5683%2022.1481%2032.8889%2022.4687%2032.8889%2022.8641C32.8889%2023.2596%2032.5683%2023.5802%2032.1728%2023.5802C31.7774%2023.5802%2031.4568%2023.2596%2031.4568%2022.8641C31.4568%2022.4687%2031.7774%2022.1481%2032.1728%2022.1481ZM14.9876%2018.9259C15.7786%2018.9259%2016.4197%2019.567%2016.4197%2020.358C16.4197%2021.1489%2015.7786%2021.79%2014.9876%2021.79C14.1967%2021.79%2013.5555%2021.1489%2013.5555%2020.358C13.5555%2019.567%2014.1967%2018.9259%2014.9876%2018.9259ZM25.0123%2018.9259C25.8033%2018.9259%2026.4444%2019.567%2026.4444%2020.358C26.4444%2021.1489%2025.8033%2021.79%2025.0123%2021.79C24.2214%2021.79%2023.5802%2021.1489%2023.5802%2020.358C23.5802%2019.567%2024.2214%2018.9259%2025.0123%2018.9259ZM10.3333%2019.2839C10.9265%2019.2839%2011.4074%2019.7648%2011.4074%2020.358C11.4074%2020.9512%2010.9265%2021.432%2010.3333%2021.432C9.74011%2021.432%209.25922%2020.9512%209.25922%2020.358C9.25922%2019.7648%209.74011%2019.2839%2010.3333%2019.2839ZM20%2019.2839C20.5932%2019.2839%2021.0741%2019.7648%2021.0741%2020.358C21.0741%2020.9512%2020.5932%2021.432%2020%2021.432C19.4068%2021.432%2018.9259%2020.9512%2018.9259%2020.358C18.9259%2019.7648%2019.4068%2019.2839%2020%2019.2839ZM29.6666%2019.2839C30.2598%2019.2839%2030.7407%2019.7648%2030.7407%2020.358C30.7407%2020.9512%2030.2598%2021.432%2029.6666%2021.432C29.0734%2021.432%2028.5926%2020.9512%2028.5926%2020.358C28.5926%2019.7648%2029.0734%2019.2839%2029.6666%2019.2839ZM12.4814%2016.4197C13.2724%2016.4197%2013.9136%2017.0608%2013.9136%2017.8518C13.9136%2018.6427%2013.2724%2019.2839%2012.4814%2019.2839C11.6905%2019.2839%2011.0494%2018.6427%2011.0494%2017.8518C11.0494%2017.0608%2011.6905%2016.4197%2012.4814%2016.4197ZM17.4938%2016.4197C18.2847%2016.4197%2018.9259%2017.0608%2018.9259%2017.8518C18.9259%2018.6427%2018.2847%2019.2839%2017.4938%2019.2839C16.7029%2019.2839%2016.0617%2018.6427%2016.0617%2017.8518C16.0617%2017.0608%2016.7029%2016.4197%2017.4938%2016.4197ZM22.5062%2016.4197C23.2971%2016.4197%2023.9382%2017.0608%2023.9382%2017.8518C23.9382%2018.6427%2023.2971%2019.2839%2022.5062%2019.2839C21.7152%2019.2839%2021.0741%2018.6427%2021.0741%2017.8518C21.0741%2017.0608%2021.7152%2016.4197%2022.5062%2016.4197ZM27.5185%2016.4197C28.3094%2016.4197%2028.9506%2017.0608%2028.9506%2017.8518C28.9506%2018.6427%2028.3094%2019.2839%2027.5185%2019.2839C26.7276%2019.2839%2026.0864%2018.6427%2026.0864%2017.8518C26.0864%2017.0608%2026.7276%2016.4197%2027.5185%2016.4197ZM14.9876%2013.9135C15.7786%2013.9135%2016.4197%2014.5547%2016.4197%2015.3456C16.4197%2016.1365%2015.7786%2016.7777%2014.9876%2016.7777C14.1967%2016.7777%2013.5555%2016.1365%2013.5555%2015.3456C13.5555%2014.5547%2014.1967%2013.9135%2014.9876%2013.9135ZM25.0123%2013.9135C25.8033%2013.9135%2026.4444%2014.5547%2026.4444%2015.3456C26.4444%2016.1365%2025.8033%2016.7777%2025.0123%2016.7777C24.2214%2016.7777%2023.5802%2016.1365%2023.5802%2015.3456C23.5802%2014.5547%2024.2214%2013.9135%2025.0123%2013.9135Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47067%22%3E%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22white%22%20transform%3D%22translate%284%204%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://mathwallet.org",supportMobile:!0,supportExtension:!0,connector:S,switchChain:N,injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isMathWallet}},yM={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)=>S(window.gamestop,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.gamestop}))},bM={type:exports.WalletType.Brave,showName:"Brave",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47062%29%22%3E%3Cmask%20id%3D%22mask0_6996_47062%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%227%22%20y%3D%227%22%20width%3D%2226%22%20height%3D%2226%22%3E%3Cpath%20d%3D%22M33%207H7V33H33V7Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_6996_47062%29%22%3E%3Cpath%20d%3D%22M31.1202%2016.2236L30.3185%2014.0461L30.876%2012.7961C30.9111%2012.7173%2030.9214%2012.6297%2030.9058%2012.5448C30.8902%2012.4599%2030.8493%2012.3818%2030.7886%2012.3205L29.2725%2010.7881C28.947%2010.4579%2028.5345%2010.2269%2028.0829%2010.122C27.6313%2010.0172%2027.1591%2010.0428%2026.7215%2010.1959L26.2969%2010.3435L23.981%207.83436L20.0524%207.8125H20.0268L16.0728%207.84347L13.7586%2010.3726L13.3468%2010.2269C12.9064%2010.072%2012.4308%2010.0459%2011.9761%2010.1518C11.5213%2010.2576%2011.1062%2010.491%2010.7794%2010.8245L9.23603%2012.3861C9.18759%2012.4349%209.15506%2012.4973%209.1427%2012.5649C9.13034%2012.6326%209.13874%2012.7024%209.16679%2012.7651L9.74806%2014.0625L8.94995%2016.2382L9.46563%2018.2006L11.818%2027.1438C12.089%2028.174%2012.7125%2029.0767%2013.5801%2029.6948C13.5801%2029.6948%2016.4354%2031.7083%2019.2525%2033.5378C19.4752%2033.7157%2019.7518%2033.8125%2020.0369%2033.8125C20.3219%2033.8125%2020.5985%2033.7157%2020.8213%2033.5378C23.9864%2031.4641%2026.49%2029.6875%2026.49%2029.6875C27.357%2029.069%2027.9798%2028.1664%2028.2503%2027.1365L30.5899%2018.1897L31.1202%2016.2236Z%22%20fill%3D%22url%28%23paint0_linear_6996_47062%29%22%2F%3E%3Cpath%20d%3D%22M20.6827%2023.9297C20.5327%2023.8625%2020.378%2023.8065%2020.2199%2023.762H19.9411C19.7829%2023.8065%2019.6282%2023.8625%2019.4783%2023.9297L18.7767%2024.2212C18.5544%2024.3141%2018.1973%2024.4799%2017.9841%2024.5856L16.694%2025.2579C16.6473%2025.2731%2016.6062%2025.3019%2016.5759%2025.3406C16.5457%2025.3794%2016.5278%2025.4263%2016.5245%2025.4753C16.5212%2025.5243%2016.5325%2025.5732%2016.5572%2025.6156C16.5819%2025.6581%2016.6187%2025.6921%2016.663%2025.7135L17.7836%2026.5043C17.9804%2026.6428%2018.2902%2026.887%2018.4724%2027.051L18.7876%2027.3225C18.9699%2027.4792%2019.2668%2027.7398%2019.4473%2027.9001L19.7461%2028.1643C19.8384%2028.2413%2019.9548%2028.2834%2020.075%2028.2834C20.1952%2028.2834%2020.3116%2028.2413%2020.4039%2028.1643L20.7173%2027.891L21.3769%2027.3152L21.694%2027.0382C21.8762%2026.8797%2022.1841%2026.6355%2022.3809%2026.4916L23.5016%2025.6899C23.5459%2025.6686%2023.5828%2025.6344%2023.6074%2025.5918C23.6319%2025.5492%2023.6431%2025.5001%2023.6394%2025.4512C23.6357%2025.4021%2023.6171%2025.3554%2023.5864%2025.317C23.5556%2025.2786%2023.514%2025.2505%2023.467%2025.2361L22.1787%2024.5819C21.9637%2024.4727%2021.6065%2024.3086%2021.3824%2024.2175L20.6827%2023.9297Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M28.6273%2016.7103L28.6637%2016.5937C28.6659%2016.4377%2028.6561%2016.2818%2028.6345%2016.1273C28.526%2015.8513%2028.3867%2015.5884%2028.2191%2015.3437L27.4902%2014.2741C27.3554%2014.0737%2027.1258%2013.7566%2026.9709%2013.569L25.9942%2012.3463C25.9051%2012.2271%2025.8084%2012.1139%2025.7045%2012.0074H25.6845C25.6845%2012.0074%2025.4877%2012.042%2025.2508%2012.0875L23.7584%2012.3754L23.1043%2012.5012C22.8871%2012.5114%2022.67%2012.4798%2022.4647%2012.4082L21.2858%2012.0274C21.0561%2011.9527%2020.6771%2011.8452%2020.4421%2011.7942C20.1944%2011.7678%2019.9446%2011.7678%2019.6968%2011.7942C19.4618%2011.8488%2019.0827%2011.9545%2018.8531%2012.0292L17.6742%2012.4119C17.469%2012.4835%2017.2519%2012.515%2017.0347%2012.5048L16.3805%2012.3809L14.8863%2012.0948C14.6494%2012.0493%2014.4545%2012.0128%2014.4526%2012.0146H14.4326C14.3287%2012.1212%2014.232%2012.2344%2014.1429%2012.3536L13.168%2013.5762C13.0186%2013.7584%2012.7835%2014.0828%2012.6487%2014.2814L11.9198%2015.351C11.794%2015.5355%2011.679%2015.7271%2011.5755%2015.925C11.513%2016.1456%2011.4799%2016.3736%2011.4771%2016.6028L11.5135%2016.7194C11.531%2016.7943%2011.5536%2016.868%2011.5809%2016.9399C11.7322%2017.1222%2011.9909%2017.4246%2012.1567%2017.6014L14.7077%2020.3128C14.7924%2020.4116%2014.8491%2020.5314%2014.8719%2020.6596C14.8946%2020.7877%2014.8826%2020.9197%2014.8371%2021.0416L14.4198%2022.0311C14.325%2022.2932%2014.3179%2022.5791%2014.3998%2022.8456L14.4836%2023.0751C14.6206%2023.4481%2014.8553%2023.7772%2015.1633%2024.0281L15.5641%2024.3543C15.6683%2024.4294%2015.7898%2024.4769%2015.9173%2024.4921C16.0448%2024.5075%2016.1741%2024.4901%2016.293%2024.4418L17.718%2023.7621C17.9795%2023.6312%2018.2243%2023.469%2018.4468%2023.2792L19.5875%2022.2497C19.633%2022.2087%2019.6697%2022.159%2019.6955%2022.1035C19.7214%2022.0481%2019.7358%2021.9879%2019.7381%2021.9267C19.7403%2021.8656%2019.7302%2021.8045%2019.7084%2021.7473C19.6866%2021.6901%2019.6535%2021.6379%2019.6112%2021.5937L17.0365%2019.859C16.939%2019.7899%2016.8696%2019.688%2016.8408%2019.572C16.812%2019.4559%2016.8259%2019.3335%2016.8797%2019.2267L17.8783%2017.3499C17.9351%2017.235%2017.9686%2017.1101%2017.9771%2016.9822C17.9855%2016.8543%2017.9687%2016.726%2017.9275%2016.6046C17.8035%2016.3731%2017.6033%2016.1916%2017.3608%2016.0908L14.2303%2014.9082C14.0044%2014.8226%2014.0171%2014.726%2014.2558%2014.7114L16.0944%2014.5292C16.3827%2014.5109%2016.6721%2014.5367%2016.9526%2014.6058L18.5525%2015.0522C18.6661%2015.0864%2018.7634%2015.1607%2018.8264%2015.2612C18.8894%2015.3617%2018.9138%2015.4817%2018.8951%2015.5988L18.2664%2019.0318C18.2244%2019.2219%2018.2139%2019.4177%2018.2355%2019.6112C18.261%2019.6933%2018.476%2019.7934%2018.711%2019.8518L19.6859%2020.0595C19.969%2020.1115%2020.2592%2020.1115%2020.5423%2020.0595L21.4188%2019.8609C21.6538%2019.808%2021.867%2019.6968%2021.8943%2019.6149C21.9154%2019.4212%2021.9042%2019.2254%2021.8616%2019.0355L21.2293%2015.6025C21.2105%2015.4853%2021.235%2015.3654%2021.2979%2015.2648C21.3609%2015.1643%2021.4582%2015.0901%2021.5718%2015.0558L23.1716%2014.6076C23.4522%2014.5385%2023.7416%2014.5127%2024.0299%2014.531L25.8685%2014.7023C26.109%2014.7242%2026.12%2014.8135%2025.8958%2014.8991L22.7672%2016.0854C22.5247%2016.1862%2022.3245%2016.3677%2022.2005%2016.5992C22.1175%2016.8443%2022.1352%2017.1124%2022.2497%2017.3445L23.2501%2019.2213C23.3039%2019.328%2023.3177%2019.4505%2023.289%2019.5665C23.2603%2019.6825%2023.1908%2019.7844%2023.0933%2019.8536L20.5205%2021.5919C20.478%2021.6361%2020.4451%2021.6884%2020.4232%2021.7456C20.4014%2021.8028%2020.3914%2021.8638%2020.3935%2021.925C20.3957%2021.9861%2020.4102%2022.0462%2020.4361%2022.1017C20.462%2022.1572%2020.4987%2022.2069%2020.5441%2022.2479L21.6866%2023.2774C21.9093%2023.4666%2022.154%2023.6281%2022.4155%2023.7584L23.8404%2024.4363C23.9595%2024.4844%2024.0889%2024.5015%2024.2164%2024.4858C24.3438%2024.4702%2024.4653%2024.4224%2024.5693%2024.347L24.9702%2024.019C25.2785%2023.7676%2025.5133%2023.4378%2025.6499%2023.0642L25.7336%2022.8346C25.8155%2022.5681%2025.8085%2022.2823%2025.7136%2022.0201L25.2945%2021.0307C25.249%2020.9087%2025.237%2020.7768%2025.2598%2020.6486C25.2825%2020.5205%2025.3392%2020.4007%2025.4239%2020.3018L27.9749%2017.5868C28.1407%2017.4046%2028.3976%2017.113%2028.5489%2016.9254C28.5797%2016.8555%2028.6059%2016.7837%2028.6273%2016.7103Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47062%22%20x1%3D%228.95724%22%20y1%3D%2220.8136%22%20x2%3D%2231.1129%22%20y2%3D%2220.8136%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23F1562B%22%2F%3E%3Cstop%20offset%3D%220.3%22%20stop-color%3D%22%23F1542B%22%2F%3E%3Cstop%20offset%3D%220.41%22%20stop-color%3D%22%23F04D2A%22%2F%3E%3Cstop%20offset%3D%220.49%22%20stop-color%3D%22%23EF4229%22%2F%3E%3Cstop%20offset%3D%220.5%22%20stop-color%3D%22%23EF4029%22%2F%3E%3Cstop%20offset%3D%220.56%22%20stop-color%3D%22%23E83E28%22%2F%3E%3Cstop%20offset%3D%220.67%22%20stop-color%3D%22%23E13C26%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23DF3C26%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47062%22%3E%3Crect%20width%3D%2226%22%20height%3D%2226%22%20fill%3D%22white%22%20transform%3D%22translate%287%207%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!1,supportExtension:!0,switchChain:N,link:"https://wallet-docs.brave.com/",injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isBraveWallet}},gM={type:exports.WalletType.FoxWallet,showName:"FoxWallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47068%29%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M17.5234%2021.6769C17.5775%2021.6943%2017.6339%2021.7073%2017.6902%2021.7138C17.6902%2021.7138%2017.4541%2021.8026%2016.9666%2021.6358C16.9666%2021.6358%2016.6004%2021.4863%2016.3274%2021.5123C16.0089%2021.5404%2015.79%2021.9543%2015.79%2021.9543C15.8529%2021.9196%2015.92%2021.8936%2015.9894%2021.8763C16.206%2021.8329%2016.1324%2021.8698%2016.1324%2021.8698C16.1324%2021.8698%2015.7164%2022.0453%2015.6882%2022.1991C15.6817%2022.2381%2015.7987%2022.1276%2016.1064%2022.1384C16.4855%2022.1493%2016.8149%2022.3703%2016.9492%2022.4071C17.2265%2022.4808%2017.623%2022.4981%2017.9892%2022.2121C17.9892%2022.2121%2018.325%2022.0019%2018.429%2021.6119C18.455%2021.5036%2018.4724%2021.3931%2018.4767%2021.2826C18.4789%2021.1851%2018.4681%2021.0876%2018.4464%2020.9901C18.4442%2020.9879%2018.247%2021.4451%2017.5234%2021.6769Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M24.6821%2025.956C25.4166%2025.0351%2025.8152%2023.8933%2025.8152%2022.7146C25.8152%2021.5381%2025.4144%2020.3941%2024.6821%2019.4733L29.3859%2018.9555C29.3859%2018.9555%2029.8756%2020.2966%2030.0034%2021.0138C30.0207%2021.1048%2030.0489%2021.2911%2030.0489%2021.2911C30.0489%2021.2911%2029.3187%2023.0635%2028.1986%2024.0363C26.6949%2025.345%2024.6821%2025.956%2024.6821%2025.956ZM13.5433%2025.891L11.7406%2026.2246C11.1686%2024.7751%2010.9584%2023.2086%2011.1318%2021.6616C11.3029%2020.1125%2011.8533%2018.6305%2012.7286%2017.3435C12.7676%2017.2871%2012.8456%2017.1766%2012.8456%2017.1766L14.8368%2022.7861L13.5433%2025.891Z%22%20fill%3D%22url%28%23paint0_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M20.0674%2014.386C20.0739%2014.3774%2020.0782%2014.3752%2020.0847%2014.3665C20.1324%2014.3145%2021.2525%2013.112%2019.9179%2011.0732C18.932%209.57169%2016.4252%209.61286%2015.4004%208.83069C15.4762%209.43303%2016.0655%209.97686%2016.0027%2010.8002C15.9767%2011.0732%2015.9269%2011.3419%2015.851%2011.604C15.7297%2012.0742%2015.617%2012.5227%2015.786%2013.4002C15.9182%2014.0849%2016.2302%2014.5832%2016.7134%2014.8844C17.268%2015.2267%2018.035%2015.3025%2018.8215%2015.0902C19.3459%2014.9472%2019.8139%2014.6829%2020.0674%2014.386Z%22%20fill%3D%22url%28%23paint1_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.7379%2013.5064C22.0261%2013.0103%2022.0803%2012.4318%2021.9026%2011.7904C21.6556%2010.8934%2021.1876%2010.3041%2020.8084%209.83177C20.6893%209.68227%2020.5788%209.5436%2020.4878%209.41143C20.1281%208.88277%2019.9721%208.24143%2020.0501%207.60876C19.5929%207.9381%2018.7133%208.55777%2018.1521%209.2186C18.9646%209.6086%2019.5994%2010.0333%2020.0999%2010.7981C20.9558%2012.1024%2020.9406%2013.1554%2020.7781%2013.8098C20.7326%2013.9896%2021.0771%2014.1499%2021.0143%2014.2886C21.3068%2014.0806%2021.5516%2013.8141%2021.7379%2013.5064Z%22%20fill%3D%22url%28%23paint2_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M27.9668%2018.9231C27.0113%2018.8321%2025.0764%2018.5959%2025.0764%2018.5959C20.7236%2018.3533%2018.2536%2019.6598%2016.3903%2021.3693C14.9516%2022.7993%2013.6689%2026.5043%2013.6689%2026.5043L12.1111%2026.4198C12.1111%2026.4198%2012.6072%2024.9421%2013.1814%2023.8653C13.8401%2022.6324%2013.9874%2022.7321%2013.8379%2022.5284C13.1424%2021.5729%2012.8152%2020.8211%2012.5357%2019.2134C12.5357%2019.2134%2012.8629%2019.4713%2013.1099%2019.3131C13.1099%2019.3131%2012.5487%2018.3381%2012.4621%2017.2851C12.3082%2015.4196%2013.1814%2012.8716%2013.2031%2012.8131C13.1944%2012.8391%2013.1489%2013.0579%2013.6602%2013.3851C13.6971%2013.2312%2013.7361%2013.0796%2013.7772%2012.9322C13.9571%2012.0526%2014.4402%2010.1307%2015.4044%208.82855C15.4044%208.82855%2015.9439%2010.7114%2017.2981%2011.5651C19.9349%2013.2291%2021.5859%2013.2377%2021.5859%2013.2377C25.3104%2013.6537%2026.9008%2015.4824%2026.9008%2015.4824C29.5744%2018.3663%2032.0033%2018.3403%2032.0033%2018.3403C31.1301%2019.1744%2027.9668%2018.9231%2027.9668%2018.9231Z%22%20fill%3D%22url%28%23paint3_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M32.049%2018.3402C32.049%2018.3402%2031.6698%2020.4375%2029.683%2020.6823C29.683%2020.6823%2022.4767%2020.6368%2021.9502%2027.1823L21.8288%2029.0218L13.1838%2026.502C13.1838%2026.502%2013.9985%2023.7222%2015.7817%2021.4905C15.7817%2021.4905%2018.8085%2017.2157%2027.4318%2018.3423C27.4318%2018.3423%2028.4393%2018.546%2029.852%2018.6782C31.0437%2018.7887%2032.049%2018.3402%2032.049%2018.3402Z%22%20fill%3D%22url%28%23paint4_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M27.1458%2017.3415C27.1458%2017.3415%2025.2738%2016.3687%2022.9446%2016.4597C22.9446%2016.4597%2024.2121%2015.4695%2025.9238%2015.7122L27.1458%2017.3415Z%22%20fill%3D%22%23722B00%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.4115%2026.2854C22.4115%2026.2854%2023.0204%2026.7057%2023.9867%2026.4826C23.9867%2026.4826%2022.4245%2027.3882%2019.1312%2026.1467C19.1312%2026.1467%2015.736%2024.6279%2013.3462%2024.9746C11.81%2025.1977%2010.4537%2026.4176%209.63032%2027.3449C8.63799%2028.4672%208.76149%2027.9429%2011.2553%2027.6331C11.8555%2027.5594%2011.5088%2027.7284%2011.5088%2027.7284C11.5088%2027.7284%208.17866%2029.1259%207.95332%2030.3674C7.89699%2030.6772%208.83082%2029.8019%2011.2943%2029.8799C14.319%2029.9752%2016.9494%2031.7302%2018.0305%2032.0206C20.2449%2032.6121%2023.4212%2032.7486%2026.3354%2030.4627C26.3354%2030.4627%2029.0242%2028.7749%2029.8562%2025.6571C30.0729%2024.7926%2030.2007%2023.9064%2030.2375%2023.0159C30.2809%2021.8546%2029.9277%2020.6326%2029.9277%2020.6326C29.9277%2020.6326%2027.9647%2024.9897%2022.4115%2026.2854Z%22%20fill%3D%22url%28%23paint5_linear_6996_47068%29%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47068%22%20x1%3D%2220.3513%22%20y1%3D%2216.8741%22%20x2%3D%2220.7275%22%20y2%3D%2226.2095%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23DADB48%22%2F%3E%3Cstop%20offset%3D%220.6562%22%20stop-color%3D%22%23637621%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47068%22%20x1%3D%2220.5689%22%20y1%3D%2212.0214%22%20x2%3D%2215.9952%22%20y2%3D%2212.0214%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23EC6F01%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F4B23D%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47068%22%20x1%3D%2220.1979%22%20y1%3D%2212.7904%22%20x2%3D%2219.9276%22%20y2%3D%228.37438%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23F4B33E%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FB6F1B%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_6996_47068%22%20x1%3D%2212.0063%22%20y1%3D%2216.933%22%20x2%3D%2228.093%22%20y2%3D%2223.2866%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FB6D1A%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F3B23E%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_6996_47068%22%20x1%3D%2215.6112%22%20y1%3D%2226.2219%22%20x2%3D%2230.8869%22%20y2%3D%2219.5079%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23F3B63F%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FB701C%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_6996_47068%22%20x1%3D%2214.036%22%20y1%3D%2231.164%22%20x2%3D%2227.2614%22%20y2%3D%2222.9179%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23EC6F00%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F4B33E%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47068%22%3E%3Crect%20width%3D%2226%22%20height%3D%2226%22%20fill%3D%22white%22%20transform%3D%22translate%287%207%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!1,switchChain:N,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}},vM={type:exports.WalletType.BinanceChain,showName:"Binance Web3 Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_7345_82351%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%234D4D4D%22%2F%3E%3Cpath%20d%3D%22M20%2038.6666C30.3093%2038.6666%2038.6667%2030.3092%2038.6667%2019.9999C38.6667%209.6906%2030.3093%201.33325%2020%201.33325C9.69069%201.33325%201.33334%209.6906%201.33334%2019.9999C1.33334%2030.3092%209.69069%2038.6666%2020%2038.6666Z%22%20fill%3D%22%234D4D4D%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14.8214%2017.8718L20%2012.6932L25.1787%2017.8772L28.192%2014.8638L20%206.6665L11.808%2014.8585L14.8214%2017.8718ZM6.66669%2019.9998L9.68002%2016.9865L12.6934%2019.9998L9.68002%2023.0132L6.66669%2019.9998ZM14.8214%2022.1278L20%2027.3065L25.1787%2022.1225L28.1974%2025.1358L20%2033.3332L11.808%2025.1412L11.8027%2025.1358L14.8214%2022.1278ZM27.3067%2019.9998L30.32%2016.9865L33.3334%2019.9998L30.32%2023.0132L27.3067%2019.9998Z%22%20fill%3D%22%23F3BA2F%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M23.36%2019.9998L20%2016.6292L17.5147%2019.1198L17.2267%2019.4078L16.6347%2019.9998L16.6293%2020.0052L16.6347%2020.0105L19.9947%2023.3705L23.36%2020.0052V19.9998Z%22%20fill%3D%22%23F3BA2F%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_7345_82351%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportChains:[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,supportExtension:!0,disabled:()=>!1,injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isBinance},connector:(e,t)=>pe(e,t),switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:null!==(t=e.provider)&&void 0!==t?t:O.getState().provider}))},isInstalled:()=>{var e;return!!((null===(e=window.ethereum)||void 0===e?void 0:e.isBinance)||window.BinanceChain||na())}},wM={type:exports.WalletType.kuCoinWallet,showName:"Halo Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%2308C082%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M26.9013%2013.0737C26.6763%2012.5218%2026.4011%2011.9917%2026.0791%2011.4901H26.0785C25.4995%2010.5874%2025.7628%209.38621%2026.6656%208.80718C27.5683%208.22873%2028.7695%208.49151%2029.3485%209.39426C33.0136%2015.1116%2031.8584%2022.5371%2026.9261%2026.9002C27.4703%2026.6796%2027.9931%2026.4094%2028.4878%2026.0929C28.7937%2025.8905%2029.1605%2025.7732%2029.555%2025.7709C30.6273%2025.7709%2031.4985%2026.638%2031.5002%2027.7098C31.5013%2028.4113%2031.1322%2029.0254%2030.5767%2029.3681C24.863%2033.009%2017.4553%2031.8498%2013.099%2026.9255C13.3237%2027.4779%2013.5989%2028.0084%2013.9212%2028.5102C14.5002%2029.4118%2014.2369%2030.6147%2013.3341%2031.192C12.4314%2031.7716%2011.2302%2031.5094%2010.6512%2030.6055C6.98616%2024.8888%208.14133%2017.4633%2013.0737%2013.099C12.5218%2013.324%2011.9918%2013.5993%2011.4902%2013.9212C10.5875%2014.5002%209.38621%2014.2369%208.80718%2013.3341C8.22873%2012.4314%208.49151%2011.2302%209.39426%2010.6512C15.1116%206.98616%2022.5371%208.14133%2026.9013%2013.0737ZM15.096%2023.1437C13.3606%2020.4372%2014.1465%2016.8366%2016.8509%2015.0988V15.0983L16.8567%2015.0949C19.5655%2013.3584%2023.1685%2014.1461%2024.9055%2016.8544V16.8555C26.642%2019.5644%2025.8537%2023.1679%2023.1449%2024.9044C20.4361%2026.6397%2016.8325%2025.8531%2015.096%2023.1437ZM17.7681%2020.5844C17.4455%2020.2618%2017.4455%2019.738%2017.7681%2019.4154L19.416%2017.7675C19.4928%2017.6907%2019.5839%2017.6297%2019.6843%2017.5881C19.7846%2017.5465%2019.8922%2017.5251%2020.0008%2017.5251C20.1094%2017.5251%2020.2169%2017.5465%2020.3173%2017.5881C20.4176%2017.6297%2020.5088%2017.6907%2020.5856%2017.7675L22.2335%2019.4154C22.3103%2019.4922%2022.3713%2019.5833%2022.4128%2019.6836C22.4544%2019.7838%2022.4758%2019.8914%2022.4758%2019.9999C22.4758%2020.1085%2022.4544%2020.216%2022.4128%2020.3163C22.3713%2020.4166%2022.3103%2020.5077%2022.2335%2020.5844L20.5856%2022.2329C20.4304%2022.3878%2020.2201%2022.4749%2020.0008%2022.4749C19.7815%2022.4749%2019.5712%2022.3878%2019.416%2022.2329L17.7681%2020.5844Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://halo.social/",disabled:()=>{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 S(null!==(n=window.haloEthereum)&&void 0!==n?n:window.kucoin,t)},switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:e.provider||(null!==(t=window.haloEthereum)&&void 0!==t?t:window.kucoin)}))},isInstalled:()=>{var e;return!!(null!==(e=window.haloEthereum)&&void 0!==e?e:window.kucoin)}},CM={type:exports.WalletType.Coin98,showName:"Coin98",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47072%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip1_6996_47072%29%22%3E%3Cpath%20d%3D%22M32.6961%200H7.30486C3.25283%200%200%203.252%200%207.304V32.696C0%2036.748%203.25283%2040%207.30486%2040H32.6951C36.6903%2040%2040%2036.748%2040%2032.696V7.304C40%203.252%2036.7481%200%2032.6961%200ZM26.5341%209.986C29.5013%209.986%2031.8979%2012.382%2031.8979%2015.35C31.8979%2016.262%2031.6691%2017.118%2031.2695%2017.917C30.5851%2017.404%2029.8439%2016.947%2029.0446%2016.662C29.2725%2016.262%2029.3874%2015.806%2029.3874%2015.35C29.3874%2013.809%2028.1316%2012.554%2026.5911%2012.554C25.0496%2012.554%2023.7948%2013.809%2023.7948%2015.35C23.7948%2015.806%2023.9087%2016.262%2024.1375%2016.662C23.3382%2016.947%2022.539%2017.347%2021.9116%2017.917C21.4551%2017.118%2021.2832%2016.262%2021.2832%2015.349C21.1704%2012.382%2023.567%209.986%2026.5341%209.986ZM13.4659%2030.014C10.4998%2030.014%208.10309%2027.618%208.10309%2024.651H10.6706C10.6706%2026.191%2011.9264%2027.447%2013.4669%2027.447C15.0074%2027.447%2016.2631%2026.191%2016.2631%2024.651H18.8306C18.8306%2027.618%2016.433%2030.014%2013.4659%2030.014ZM13.4659%2022.482C10.0432%2022.482%207.24694%2019.686%207.24694%2016.262C7.24694%2012.839%2010.0432%209.986%2013.4669%209.986C16.8905%209.986%2019.7437%2012.782%2019.7437%2016.262C19.6868%2019.686%2016.8895%2022.482%2013.4659%2022.482ZM26.5341%2030.014C23.1105%2030.014%2020.2572%2027.218%2020.2572%2023.794C20.2572%2020.314%2023.0535%2017.518%2026.5341%2017.518C29.9578%2017.518%2032.754%2020.314%2032.754%2023.795C32.754%2027.218%2029.9578%2030.014%2026.5341%2030.014ZM30.2425%2023.738C30.2425%2025.792%2028.5881%2027.389%2026.5341%2027.389C24.4801%2027.389%2022.8247%2025.735%2022.8247%2023.738C22.8247%2021.683%2024.4801%2020.028%2026.5341%2020.028C28.5881%2020.086%2030.2425%2021.74%2030.2425%2023.738ZM17.1182%2016.262C17.1182%2018.317%2015.4639%2019.972%2013.4099%2019.972C11.3549%2019.972%209.70054%2018.317%209.70054%2016.262C9.70054%2014.208%2011.3549%2012.553%2013.4099%2012.553C15.5209%2012.553%2017.1182%2014.207%2017.1182%2016.262Z%22%20fill%3D%22%23D9B432%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47072%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3CclipPath%20id%3D%22clip1_6996_47072%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://coin98.com/wallet",disabled:()=>{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 S(null===(n=window.coin98)||void 0===n?void 0:n.provider,t)},switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.coin98)||void 0===t?void 0:t.provider)}))},isInstalled:()=>{var e;return!!(null===(e=window.coin98)||void 0===e?void 0:e.provider)}},xM={type:exports.WalletType.frontier,showName:"Frontier",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47060%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%23CC703C%22%2F%3E%3Cpath%20d%3D%22M28.8973%209L28.7753%209.3228L28.3759%2010.3548L28.1105%2011.02C26.0949%2016.0081%2024.5274%2018.3752%2022.8605%2018.3752C22.4393%2018.3863%2022.0204%2018.3096%2021.6304%2018.1501C21.2405%2017.9904%2020.8881%2017.7513%2020.5957%2017.4481L20.383%2017.2552C19.8536%2016.7667%2019.6309%2016.6462%2019.121%2016.6462C18.8557%2016.6462%2018.3803%2016.9846%2017.7797%2017.7798C16.9752%2018.9192%2016.291%2020.1392%2015.7384%2021.4198L15.6706%2021.57H22.8206L21.9302%2023.4209H15.2543V31H13.2908V9H28.8973ZM26.1151%2010.8474H15.2543V18.1783C16.5556%2015.9215%2017.7927%2014.7886%2019.1231%2014.7886C19.5705%2014.7743%2020.016%2014.8531%2020.4314%2015.0199C20.8468%2015.1867%2021.223%2015.4379%2021.5361%2015.7577L21.7555%2015.9567C22.2497%2016.4128%2022.44%2016.5177%2022.8624%2016.5177C23.327%2016.5184%2024.5626%2014.5558%2026.1151%2010.8474Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47060%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://www.frontier.xyz/download",injected:()=>{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 S(null===(n=window.frontier)||void 0===n?void 0:n.ethereum,t)},switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.frontier)||void 0===t?void 0:t.ethereum)}))},isInstalled:()=>{var e;return!!(null===(e=window.frontier)||void 0===e?void 0:e.ethereum)}},EM={type:exports.WalletType.LedgerUSB,showName:"Ledger",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47064%29%22%3E%3Cpath%20d%3D%22M22.8376%2029.1957V30.5203H31.9293V24.546H30.6045V29.1957H22.8376ZM22.8376%209.47949V10.8042H30.6045V15.454H31.9293V9.47949H22.8376ZM18.4295%2015.454H17.1049V24.5457H23.0794V23.3509H18.4295V15.454ZM8%2024.546V30.5206H17.0917V29.1957H9.32468V24.546H8ZM8%209.47949V15.454H9.32468V10.8042H17.0917V9.47949H8Z%22%20fill%3D%22black%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47064%22%3E%3Crect%20width%3D%2224%22%20height%3D%2221.0411%22%20fill%3D%22white%22%20transform%3D%22translate%288%209.47949%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportChains:[exports.ChainId.MAINNET,exports.ChainId.BSC,exports.ChainId.POLYGON],disabled:()=>!E(),getPackage:H,connector:e=>m(void 0,void 0,void 0,(function*(){return E()&&e?(yield H()).default(e):void 0})),needReadProvider:!0},kM={type:exports.WalletType.openBlock,showName:"OpenBlock",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M24.8394%2011.3075C28.3377%2011.3075%2031.1736%2014.1434%2031.1736%2017.6417V17.7911L28.9613%2020.0015L31.1736%2022.2099V22.3614C31.1736%2025.8597%2028.3377%2028.6957%2024.8394%2028.6957H8.81738L13.9384%2024.9696H22.4796C25.2233%2024.9696%2027.4476%2022.7453%2027.4476%2020.0015C27.4476%2017.2578%2025.2233%2015.0335%2022.4796%2015.0335H13.9384L8.81738%2011.3075H24.8394ZM15.1309%2017.89C13.9648%2017.89%2013.0195%2018.8354%2013.0195%2020.0015C13.0195%2021.1676%2013.9648%2022.1129%2015.1309%2022.1129H22.4869C23.653%2022.1129%2024.5983%2021.1676%2024.5983%2020.0015C24.5983%2018.8354%2023.653%2017.89%2022.4869%2017.89H15.1309Z%22%20fill%3D%22%234A3DE6%22%2F%3E%3C%2Fsvg%3E",supportChains:[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)=>S(window.openblock,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.openblock})),isInstalled:()=>!!window.openblock},TM={type:exports.WalletType.OneKey,showName:"OneKey",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47075%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%2344D62C%22%2F%3E%3Cpath%20d%3D%22M21.8071%208.48083H16.2432L15.2671%2011.4322H18.3573V17.6495H21.8071V8.48083Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M26.3455%2025.1739C26.3455%2028.6782%2023.5044%2031.5191%2020%2031.5191C16.4955%2031.5191%2013.6548%2028.6782%2013.6548%2025.1739C13.6548%2021.6694%2016.4955%2018.8286%2020%2018.8286C23.5044%2018.8286%2026.3455%2021.6694%2026.3455%2025.1739ZM23.4648%2025.1739C23.4648%2027.0875%2021.9137%2028.6386%2020%2028.6386C18.0867%2028.6386%2016.5355%2027.0875%2016.5355%2025.1739C16.5355%2023.2605%2018.0867%2021.7091%2020%2021.7091C21.9137%2021.7091%2023.4648%2023.2605%2023.4648%2025.1739Z%22%20fill%3D%22black%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47075%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://onekey.so",supportMobile:!0,injected:()=>{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 S(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 N(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)}))},isInstalled:()=>{var e,t;return!!(null!==(t=null===(e=window.$onekey)||void 0===e?void 0:e.ethereum)&&void 0!==t?t:window.onekey)}},PM={type:exports.WalletType.Bitkeep,showName:"Bitget Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_9886_837%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M40%200H0V40H40V0Z%22%20fill%3D%22%23001F29%22%2F%3E%3Cpath%20d%3D%22M17.1833%207.4768C15.7517%207.47608%2014.3225%207.47534%2012.8859%207.47754C12.0172%207.47754%2011.6914%208.56812%2012.3375%209.21405L22.1169%2018.9936C22.4221%2019.2727%2022.6125%2019.5762%2022.6194%2019.9761C22.6125%2020.376%2022.4221%2020.6794%2022.1169%2020.9586L12.3375%2030.738C11.6914%2031.3841%2012.0172%2032.4746%2012.8859%2032.4746C14.3225%2032.4768%2015.7517%2032.4761%2017.1833%2032.4753C17.9%2032.475%2018.6175%2032.4746%2019.3367%2032.4746C20.2776%2032.4746%2020.8374%2031.9719%2021.34%2031.4692L30.1598%2022.6494C30.8637%2021.9455%2031.4936%2021.0109%2031.485%2019.9761C31.4936%2018.9412%2030.8637%2018.0066%2030.1598%2017.3027L21.34%208.48288C20.8374%207.98022%2020.2776%207.47754%2019.3367%207.47754C18.6175%207.47754%2017.9%207.47717%2017.1833%207.4768Z%22%20fill%3D%22%2300F0FF%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_9886_837%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://bitkeep.com/download?type=2",mobileDeepLink:"https://bkcode.vip?action=dapp&url=$APP_URL",supportMobile:!0,injected:()=>{var e;return _()&&((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 S(null===(n=window.bitkeep)||void 0===n?void 0:n.ethereum,t)},connectorInjected:(e,t)=>{var n;return S(null===(n=window.bitkeep)||void 0===n?void 0:n.ethereum,t)},switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.bitkeep)||void 0===t?void 0:t.ethereum)}))},isInstalled:()=>{var e;return!(!(null===(e=window.bitkeep)||void 0===e?void 0:e.ethereum)&&!window.isBitKeep)}},AM={type:exports.WalletType.Nabox,showName:"Nabox",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.625%2014.3018V26.4113L12.1312%2028.4326V19.7701L15.6249%2021.788V30.4448L19.1322%2032.4661V20.3554L8.625%2014.3018Z%22%20fill%3D%22%232AC98B%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M16.5894%2013.1937L20.1024%2011.1348L24.4673%2013.689L20.9565%2015.7388L16.5894%2013.1937ZM20.107%207L9.5166%2013.196L20.9372%2019.8919V33L24.4013%2030.9822V17.7213L27.9018%2015.6716V28.921L31.4171%2026.8519V13.6173L20.107%207Z%22%20fill%3D%22%232AC98B%22%2F%3E%3C%2Fsvg%3E",link:"https://nabox.io/",supportMobile:!0,disabled:()=>!window.NaboxWallet,injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isNabox},connector:(e,t)=>S(window.NaboxWallet,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.NaboxWallet})),isInstalled:()=>!!window.NaboxWallet},_M={type:exports.WalletType.OKX,showName:"OKX Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M16.2222%2010H10.4444C10.199%2010%2010%2010.199%2010%2010.4444V16.2222C10%2016.4677%2010.199%2016.6667%2010.4444%2016.6667H16.2222C16.4677%2016.6667%2016.6667%2016.4677%2016.6667%2016.2222V10.4444C16.6667%2010.199%2016.4677%2010%2016.2222%2010ZM22.8918%2016.6667H17.114C16.8685%2016.6667%2016.6695%2016.8657%2016.6695%2017.1111V22.8889C16.6695%2023.1343%2016.8685%2023.3333%2017.114%2023.3333H22.8918C23.1372%2023.3333%2023.3362%2023.1343%2023.3362%2022.8889V17.1111C23.3362%2016.8657%2023.1372%2016.6667%2022.8918%2016.6667ZM23.7778%2010H29.5556C29.801%2010%2030%2010.199%2030%2010.4444V16.2222C30%2016.4677%2029.801%2016.6667%2029.5556%2016.6667H23.7778C23.5323%2016.6667%2023.3333%2016.4677%2023.3333%2016.2222V10.4444C23.3333%2010.199%2023.5323%2010%2023.7778%2010ZM16.2222%2023.3333H10.4444C10.199%2023.3333%2010%2023.5323%2010%2023.7778V29.5556C10%2029.801%2010.199%2030%2010.4444%2030H16.2222C16.4677%2030%2016.6667%2029.801%2016.6667%2029.5556V23.7778C16.6667%2023.5323%2016.4677%2023.3333%2016.2222%2023.3333ZM23.7778%2023.3333H29.5556C29.801%2023.3333%2030%2023.5323%2030%2023.7778V29.5556C30%2029.801%2029.801%2030%2029.5556%2030H23.7778C23.5323%2030%2023.3333%2029.801%2023.3333%2029.5556V23.7778C23.3333%2023.5323%2023.5323%2023.3333%2023.7778%2023.3333Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://www.okx.com/",mobileDeepLink:"okx://wallet/dapp/details?dappUrl=$APP_URL",injected:()=>_()&&!!window.okxwallet,disabled:()=>!window.okxwallet,connector:(e,t)=>S(window.okxwallet,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.okxwallet})),isInstalled:()=>!!window.okxwallet},DM={type:exports.WalletType.WalletConnect,showName:"WalletConnect",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_radial_6996_47051%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M27.2897%2015.446C23.2637%2011.518%2016.7363%2011.518%2012.7103%2015.446L12.1785%2015.9649C11.9772%2016.1613%2011.9772%2016.4797%2012.1785%2016.6761L13.836%2018.2933C13.9366%2018.3915%2014.0998%2018.3915%2014.2005%2018.2933L14.9145%2017.5966C17.7232%2014.8563%2022.2769%2014.8563%2025.0855%2017.5966L25.7523%2018.2471C25.8529%2018.3453%2026.0161%2018.3453%2026.1168%2018.2471L27.7743%2016.63C27.9756%2016.4336%2027.9756%2016.1151%2027.7743%2015.9187L27.2897%2015.446ZM32.1928%2020.2297L30.7176%2018.7904C30.5163%2018.594%2030.1899%2018.594%2029.9886%2018.7904L25.2677%2023.3965C25.2174%2023.4456%2025.1358%2023.4456%2025.0854%2023.3965L20.3644%2018.7903L20.3644%2018.7903C20.1631%2018.5939%2019.8367%2018.5939%2019.6354%2018.7903L14.9146%2023.3965C14.8643%2023.4456%2014.7827%2023.4456%2014.7324%2023.3965L10.0114%2018.7903C9.81008%2018.5939%209.48371%2018.5939%209.28241%2018.7903L7.80722%2020.2296C7.60593%2020.426%207.60593%2020.7444%207.80722%2020.9408L14.4591%2027.4308C14.6604%2027.6272%2014.9868%2027.6272%2015.1881%2027.4308L19.9089%2022.8248C19.9592%2022.7757%2020.0408%2022.7757%2020.0912%2022.8248L24.8121%2027.4308C25.0134%2027.6272%2025.3398%2027.6272%2025.5411%2027.4308L32.1928%2020.9409C32.3941%2020.7445%2032.3941%2020.4261%2032.1928%2020.2297Z%22%20fill%3D%22white%22%2F%3E%3Cdefs%3E%3CradialGradient%20id%3D%22paint0_radial_6996_47051%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%280%2020%29%20scale%2840%29%22%3E%3Cstop%20stop-color%3D%22%235D9DF6%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23006FFF%22%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,getPackage:K,connector:(e,t)=>ce(e,t),disconnect:()=>m(void 0,void 0,void 0,(function*(){return(yield K()).disconnect()})),needReadProvider:!0},OM={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:W,connector:(e,t)=>se(e,t)},FM={type:exports.WalletType.Gnosis,showName:"Gnosis",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47074%29%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47074%29%22%3E%3Cmask%20id%3D%22mask0_6996_47074%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%224%22%20y%3D%224%22%20width%3D%2232%22%20height%3D%2232%22%3E%3Cpath%20d%3D%22M36%204H4V36H36V4Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_6996_47074%29%22%3E%3Cmask%20id%3D%22mask1_6996_47074%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%224%22%20y%3D%224%22%20width%3D%2232%22%20height%3D%2232%22%3E%3Cpath%20d%3D%22M20%2036C28.8366%2036%2036%2028.8366%2036%2020C36%2011.1634%2028.8366%204%2020%204C11.1634%204%204%2011.1634%204%2020C4%2028.8366%2011.1634%2036%2020%2036Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask1_6996_47074%29%22%3E%3Cpath%20d%3D%22M36.0641%201.39203H2.46411V38.288H36.0641V1.39203Z%22%20fill%3D%22url%28%23paint1_linear_6996_47074%29%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M28.9623%2019.994H26.7763C26.1235%2019.994%2025.5946%2020.5233%2025.5946%2021.1757V24.3482C25.5946%2025.001%2025.0653%2025.53%2024.4128%2025.53H15.7162C15.0634%2025.53%2014.5344%2026.0593%2014.5344%2026.7117V28.8977C14.5344%2029.5505%2015.0637%2030.0794%2015.7162%2030.0794H24.9162C25.569%2030.0794%2026.0909%2029.5501%2026.0909%2028.8977V27.1441C26.0909%2026.4913%2026.6202%2026.0279%2027.2727%2026.0279H28.9623C29.6151%2026.0279%2030.144%2025.4986%2030.144%2024.8461V21.1617C30.144%2020.5089%2029.6147%2019.994%2028.9623%2019.994Z%22%20fill%3D%22%23121312%22%2F%3E%3Cpath%20d%3D%22M14.5338%2015.6515C14.5338%2014.9987%2015.0631%2014.4698%2015.7156%2014.4698H24.4068C25.0596%2014.4698%2025.5885%2013.9405%2025.5885%2013.288V11.1021C25.5885%2010.4493%2025.0593%209.92035%2024.4068%209.92035H15.2119C14.5591%209.92035%2014.0301%2010.4496%2014.0301%2011.1021V12.7863C14.0301%2013.4391%2013.5009%2013.968%2012.8484%2013.968H11.1661C10.5133%2013.968%209.98438%2014.4973%209.98438%2015.1498V18.8381C9.98438%2019.4909%2010.5156%2019.9933%2011.1684%2019.9933H13.3543C14.0071%2019.9933%2014.5361%2019.464%2014.5361%2018.8115L14.5338%2015.6515Z%22%20fill%3D%22%23121312%22%2F%3E%3Cpath%20d%3D%22M19.0351%2017.6964H21.135C21.8191%2017.6964%2022.3746%2018.2519%2022.3746%2018.936V21.0359C22.3746%2021.72%2021.8191%2022.2755%2021.135%2022.2755H19.0351C18.351%2022.2755%2017.7954%2021.72%2017.7954%2021.0359V18.936C17.7954%2018.2519%2018.351%2017.6964%2019.0351%2017.6964Z%22%20fill%3D%22%23121312%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47074%22%20x1%3D%221.25943%22%20y1%3D%2234.5582%22%20x2%3D%2242.4153%22%20y2%3D%22-3.99282%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2312FF80%22%2F%3E%3Cstop%20offset%3D%220.13%22%20stop-color%3D%22%2315FD85%22%2F%3E%3Cstop%20offset%3D%220.29%22%20stop-color%3D%22%231FF896%22%2F%3E%3Cstop%20offset%3D%220.49%22%20stop-color%3D%22%2330F1B2%22%2F%3E%3Cstop%20offset%3D%220.69%22%20stop-color%3D%22%2348E7D9%22%2F%3E%3Cstop%20offset%3D%220.87%22%20stop-color%3D%22%235FDDFF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47074%22%20x1%3D%223.52203%22%20y1%3D%2233.2685%22%20x2%3D%2241.0897%22%20y2%3D%221.22211%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2312FF80%22%2F%3E%3Cstop%20offset%3D%220.13%22%20stop-color%3D%22%2315FD85%22%2F%3E%3Cstop%20offset%3D%220.29%22%20stop-color%3D%22%231FF896%22%2F%3E%3Cstop%20offset%3D%220.49%22%20stop-color%3D%22%2330F1B2%22%2F%3E%3Cstop%20offset%3D%220.69%22%20stop-color%3D%22%2348E7D9%22%2F%3E%3Cstop%20offset%3D%220.87%22%20stop-color%3D%22%235FDDFF%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47074%22%3E%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22white%22%20transform%3D%22translate%284%204%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportChains:[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:()=>m(void 0,void 0,void 0,(function*(){return!(yield(yield q()).getIsSafe())})),getPackage:q,connector:(e,t)=>m(void 0,void 0,void 0,(function*(){return(yield q()).default(t)}))},SM={type:exports.WalletType.uAuth,showName:"Unstoppable",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M33%209.00916V17.8605L7%2028.3194L33%209.00916Z%22%20fill%3D%22%2300C9FF%22%2F%3E%3Cpath%20d%3D%22M28.1258%208.625V23.8942C28.1258%2026.028%2027.2697%2028.0745%2025.7459%2029.5833C24.222%2031.0922%2022.1553%2031.9398%2020.0003%2031.9398C17.8453%2031.9398%2015.7785%2031.0922%2014.2547%2029.5833C12.7308%2028.0745%2011.8748%2026.028%2011.8748%2023.8942V17.4602L16.7492%2014.804V23.8942C16.7036%2024.2909%2016.7431%2024.6928%2016.8652%2025.0732C16.9874%2025.4538%2017.1892%2025.8045%2017.4577%2026.1024C17.7263%2026.4003%2018.0553%2026.6387%2018.4234%2026.8018C18.7914%2026.9651%2019.1901%2027.0495%2019.5934%2027.0495C19.9966%2027.0495%2020.3953%2026.9651%2020.7634%2026.8018C21.1314%2026.6387%2021.4605%2026.4003%2021.729%2026.1024C21.9975%2025.8045%2022.1995%2025.4538%2022.3215%2025.0732C22.4436%2024.6928%2022.4832%2024.2909%2022.4375%2023.8942V11.7064L28.1258%208.625Z%22%20fill%3D%22%230D67FE%22%2F%3E%3C%2Fsvg%3E",getPackage:V,connector:(e,t)=>m(void 0,void 0,void 0,(function*(){var n;return(yield V()).default(Object.assign(Object.assign({},e),{uAuthParams:Object.assign(Object.assign({walletConnect:()=>DM.connector?DM.connector(e,t):Promise.resolve(void 0)},e.uAuthParams),{clientID:null===(n=e.uAuthParams)||void 0===n?void 0:n.clientID})}),t)})),disconnect:()=>m(void 0,void 0,void 0,(function*(){const{disconnectWallet:e}=yield V();yield e()}))},IM={type:exports.WalletType.Blocto,showName:"Blocto",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M20.7145%2014.1513C18.4586%2014.1513%2016.2568%2015.0211%2014.6108%2016.5641C12.8053%2018.2569%2011.6628%2020.7569%2011.0078%2023.1086C10.5789%2024.6468%2010.364%2026.2429%2010.364%2027.8406C10.364%2028.3234%2010.3838%2028.8023%2010.4219%2029.2757C10.4687%2029.8513%2011.0292%2030.2502%2011.5874%2030.0995C12.0743%2029.9687%2012.5865%2029.8981%2013.1146%2029.8981C14.1992%2029.8981%2015.2157%2030.1931%2016.0871%2030.7084C16.1085%2030.7211%2016.1291%2030.7339%2016.1505%2030.7457C17.5667%2031.5901%2019.2373%2032.054%2021.0189%2031.9945C25.6661%2031.8407%2029.4625%2028.0594%2029.6337%2023.413C29.8208%2018.3298%2025.7564%2014.1505%2020.7152%2014.1505L20.7145%2014.1513ZM20.7145%2027.154C18.4619%2027.154%2016.6358%2025.3279%2016.6358%2023.0761C16.6358%2020.8243%2018.4619%2018.9975%2020.7145%2018.9975C22.967%2018.9975%2024.7931%2020.8235%2024.7931%2023.0761C24.7931%2025.3287%2022.967%2027.154%2020.7145%2027.154Z%22%20fill%3D%22%2314AAFF%22%2F%3E%3Cpath%20d%3D%22M17.0453%2011.3412C17.0453%2012.5171%2016.4293%2013.6081%2015.4175%2014.2075C14.7824%2014.5842%2014.1869%2015.029%2013.6478%2015.5356C12.4513%2016.6568%2011.5585%2018.0325%2010.8972%2019.3963C10.7664%2019.6642%2010.3628%2019.5691%2010.3628%2019.2709V11.3412C10.3628%209.49618%2011.859%208%2013.7041%208C15.5491%208%2017.0453%209.49618%2017.0453%2011.3412Z%22%20fill%3D%22%230077FF%22%2F%3E%3C%2Fsvg%3E",supportChains:[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:J,connector:ie,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 N(Object.assign(Object.assign({},e),{provider:null!==(t=e.provider)&&void 0!==t?t:O.getState().provider}))},needReadProvider:!0},MM={type:exports.WalletType.Rainbow,showName:"Rainbow",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2014.133H10.933C19.181%2014.133%2025.867%2020.819%2025.867%2029.067V30.667H29.067C29.4914%2030.667%2029.8983%2030.4984%2030.1984%2030.1984C30.4984%2029.8983%2030.667%2029.4913%2030.667%2029.067C30.667%2018.168%2021.832%209.33398%2010.933%209.33398C10.5087%209.33398%2010.1017%209.50256%209.80164%209.80261C9.50158%2010.1027%209.33301%2010.5096%209.33301%2010.934V14.133Z%22%20fill%3D%22url%28%23paint1_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M26.3999%2029.067H30.6669C30.6669%2029.4914%2030.4983%2029.8983%2030.1983%2030.1984C29.8982%2030.4984%2029.4912%2030.667%2029.0669%2030.667H26.3999V29.067Z%22%20fill%3D%22url%28%23paint2_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M10.934%209.33301V13.6H9.33398V10.934C9.33398%2010.5097%209.50256%2010.1027%209.80261%209.80264C10.1027%209.50258%2010.5096%209.33301%2010.934%209.33301Z%22%20fill%3D%22url%28%23paint3_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2013.6H10.933C19.476%2013.6%2026.4%2020.525%2026.4%2029.067V30.667H21.6V29.067C21.6%2023.176%2016.824%2018.4%2010.933%2018.4H9.33301V13.6Z%22%20fill%3D%22url%28%23paint4_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M22.1331%2029.067H26.4001V30.667H22.1331V29.067Z%22%20fill%3D%22url%28%23paint5_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2017.867V13.6H10.933V17.867H9.33301Z%22%20fill%3D%22url%28%23paint6_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2020.5329C9.33301%2020.7431%209.37439%2020.9511%209.4548%2021.1452C9.53521%2021.3394%209.65306%2021.5157%209.80164%2021.6643C9.95021%2021.8129%2010.1266%2021.9307%2010.3207%2022.0112C10.5148%2022.0916%2010.7229%2022.1329%2010.933%2022.1329C11.8436%2022.1328%2012.7454%2022.3121%2013.5867%2022.6605C14.428%2023.0089%2015.1925%2023.5197%2015.8364%2024.1636C16.4803%2024.8075%2016.991%2025.5719%2017.3395%2026.4133C17.6879%2027.2546%2017.8671%2028.1563%2017.867%2029.0669C17.867%2029.2771%2017.9084%2029.4851%2017.9888%2029.6792C18.0692%2029.8734%2018.1871%2030.0497%2018.3356%2030.1983C18.4842%2030.3469%2018.6606%2030.4647%2018.8547%2030.5452C19.0488%2030.6256%2019.2569%2030.6669%2019.467%2030.6669H22.134V29.0669C22.134%2022.8809%2017.119%2017.8669%2010.934%2017.8669H9.33401L9.33301%2020.5329Z%22%20fill%3D%22url%28%23paint7_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M17.8669%2029.067H22.1329V30.667H19.4669C19.0426%2030.667%2018.6356%2030.4984%2018.3356%2030.1984C18.0355%2029.8983%2017.8669%2029.4914%2017.8669%2029.067Z%22%20fill%3D%22url%28%23paint8_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M10.934%2022.1329C10.5096%2022.1329%2010.1027%2021.9644%209.80261%2021.6643C9.50256%2021.3643%209.33398%2020.9573%209.33398%2020.5329V17.8669H10.934V22.1329Z%22%20fill%3D%22url%28%23paint9_radial_6996_47058%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47058%22%20x1%3D%2220%22%20y1%3D%220%22%20x2%3D%2220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23174299%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23001E59%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22paint1_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.933%2029.067%29%20rotate%28-90%29%20scale%2819.7333%29%22%3E%3Cstop%20offset%3D%220.77%22%20stop-color%3D%22%23FF4000%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47058%22%20x1%3D%2226.1329%22%20y1%3D%2229.867%22%20x2%3D%2230.6669%22%20y2%3D%2229.867%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FF4000%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_6996_47058%22%20x1%3D%2210.133%22%20y1%3D%229.33301%22%20x2%3D%2210.133%22%20y2%3D%2213.867%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238754C9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF4000%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22paint4_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.933%2029.067%29%20rotate%28-90%29%20scale%2815.4667%29%22%3E%3Cstop%20offset%3D%220.724%22%20stop-color%3D%22%23FFF700%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_6996_47058%22%20x1%3D%2222.1331%22%20y1%3D%2229.867%22%20x2%3D%2226.4001%22%20y2%3D%2229.867%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_6996_47058%22%20x1%3D%2210.133%22%20y1%3D%2217.867%22%20x2%3D%2210.133%22%20y2%3D%2213.6%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22paint7_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.933%2029.0669%29%20rotate%28-90%29%20scale%2811.2%29%22%3E%3Cstop%20offset%3D%220.595%22%20stop-color%3D%22%2300AAFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22paint8_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2817.5999%2029.867%29%20scale%284.53333%2012.0889%29%22%3E%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22paint9_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.133%2022.3999%29%20rotate%28-90%29%20scale%284.53333%2085.9653%29%22%3E%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://rainbow.me",getPackage:X,connector:(e,t)=>le(e,t),needReadProvider:!0},NM={type:exports.WalletType.trust,showName:"TrustWallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47056%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.223%208.63789C19.6801%208.25612%2020.3449%208.25612%2020.802%208.63789C23.9045%2011.229%2027.4422%2011.2092%2028.8199%2011.2015C28.8884%2011.2012%2028.9516%2011.2008%2029.0091%2011.2008C29.3389%2011.2008%2029.655%2011.3331%2029.8865%2011.5681C30.118%2011.8032%2030.2456%2012.1212%2030.2406%2012.4511C30.1753%2016.7785%2030.0018%2019.8711%2029.6607%2022.1401C29.3197%2024.4076%2028.7956%2025.9726%2027.9443%2027.1557C27.0866%2028.3477%2025.9847%2029.0228%2024.8252%2029.6636C24.6238%2029.7749%2024.4186%2029.8862%2024.2089%2030C23.1924%2030.5514%2022.0672%2031.1617%2020.7304%2032.1207C20.3013%2032.4285%2019.7237%2032.4285%2019.2946%2032.1207C17.959%2031.1627%2016.8353%2030.5526%2015.8204%2030.0016C15.6096%2029.8872%2015.4035%2029.7753%2015.2012%2029.6634C14.0426%2029.0224%2012.9421%2028.347%2012.0861%2027.1546C11.2367%2025.9714%2010.7143%2024.4065%2010.3746%2022.1395C10.0347%2019.8708%209.86207%2016.7784%209.79677%2012.4511C9.79179%2012.1212%209.91934%2011.8032%2010.1508%2011.5681C10.3823%2011.3331%2010.6984%2011.2008%2011.0283%2011.2008C11.0852%2011.2008%2011.1477%2011.2012%2011.2156%2011.2015C12.5821%2011.2092%2016.1202%2011.2292%2019.223%208.63789ZM12.2823%2013.6542C12.3602%2017.2983%2012.5276%2019.8846%2012.8108%2021.7745C13.1253%2023.8737%2013.567%2024.9934%2014.0872%2025.7181C14.6008%2026.4335%2015.2757%2026.8894%2016.3937%2027.5079C16.5753%2027.6084%2016.7672%2027.7124%2016.9688%2027.8217C17.8188%2028.2826%2018.843%2028.838%2020.0125%2029.6214C21.1837%2028.837%2022.2094%2028.2812%2023.0609%2027.8199C23.2616%2027.7112%2023.4527%2027.6076%2023.6337%2027.5076C24.7531%2026.8889%2025.4297%2026.4328%2025.9447%2025.717C26.4662%2024.9923%2026.9091%2023.8727%2027.2247%2021.7738C27.5088%2019.8843%2027.677%2017.2982%2027.755%2013.6544C25.9743%2013.5889%2022.9109%2013.2048%2020.0125%2011.1384C17.1177%2013.2023%2014.0588%2013.5879%2012.2823%2013.6542Z%22%20fill%3D%22%233375BB%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47056%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://trustwallet.com/",supportMobile:!0,supportExtension:!0,mobileDeepLink:"https://link.trustwallet.com/open_url?url=$APP_URL",injected:()=>{var e;return(null===(e=window.ethereum)||void 0===e?void 0:e.isTrust)&&!window.safepalProvider},disabled:()=>{var e;return!((null===(e=window.ethereum)||void 0===e?void 0:e.isTrust)||window.trustWallet)},connector:(e,t)=>S(window.trustWallet,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.trustWallet})),isInstalled:()=>!!window.trustWallet},UM={type:exports.WalletType.tokenPocket,showName:"TokenPocket",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47055%29%22%3E%3Cpath%20d%3D%22M40%2013.75C40%206.15609%2033.8439%200%2026.25%200H13.75C6.15609%200%200%206.15609%200%2013.75V26.25C0%2033.8439%206.15609%2040%2013.75%2040H26.25C33.8439%2040%2040%2033.8439%2040%2026.25V13.75Z%22%20fill%3D%22%232980FE%22%2F%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%232980FE%22%2F%3E%3Cpath%20d%3D%22M15.8904%2017.1345H15.8955C15.8904%2017.1038%2015.8904%2017.068%2015.8904%2017.0373V17.1345Z%22%20fill%3D%22%2329AEFF%22%2F%3E%3Cpath%20d%3D%22M26.0782%2018.1068H20.4395V28.2842C20.4395%2028.7652%2020.8283%2029.1541%2021.3093%2029.1541H25.2084C25.6894%2029.1541%2026.0782%2028.7652%2026.0782%2028.2842V18.1068Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M17.7173%2010.8203H17.528H7.43238C6.95137%2010.8203%206.5625%2011.2092%206.5625%2011.6902V15.2208C6.5625%2015.7018%206.95137%2016.0907%207.43238%2016.0907H9.80148H10.743V17.1345V28.3098C10.743%2028.7908%2011.1319%2029.1797%2011.6129%2029.1797H15.3175C15.7985%2029.1797%2016.1873%2028.7908%2016.1873%2028.3098V17.1345V17.0373V16.0907H17.1289H17.5126H17.702C19.1552%2016.0907%2020.3371%2014.9087%2020.3371%2013.4555C20.3525%2012.0023%2019.1705%2010.8203%2017.7173%2010.8203Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M26.0835%2018.1068V25.209C26.2779%2025.255%2026.4775%2025.2909%2026.6822%2025.3216C26.9687%2025.3625%2027.2655%2025.3881%2027.5623%2025.3932C27.5776%2025.3932%2027.593%2025.3932%2027.6135%2025.3932V19.7441C26.7589%2019.6878%2026.0835%2018.9766%2026.0835%2018.1068Z%22%20fill%3D%22url%28%23paint0_linear_6996_47055%29%22%2F%3E%3Cpath%20d%3D%22M27.7259%2010.8203C23.704%2010.8203%2020.4395%2014.0849%2020.4395%2018.1068C20.4395%2021.5658%2022.8495%2024.4619%2026.0834%2025.209V18.1068C26.0834%2017.2011%2026.8202%2016.4642%2027.7259%2016.4642C28.6316%2016.4642%2029.3684%2017.2011%2029.3684%2018.1068C29.3684%2018.8692%2028.8516%2019.5088%2028.1455%2019.693C28.0124%2019.7288%2027.8691%2019.7493%2027.7259%2019.7493V25.3932C27.8691%2025.3932%2028.0073%2025.3881%2028.1455%2025.383C31.9729%2025.1629%2035.0123%2021.9905%2035.0123%2018.1068C35.0174%2014.0849%2031.7529%2010.8203%2027.7259%2010.8203Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M27.7258%2025.3932V19.7493C27.6849%2019.7493%2027.6491%2019.7493%2027.6082%2019.7441V25.3932C27.6491%2025.3932%2027.69%2025.3932%2027.7258%2025.3932Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47055%22%20x1%3D%2227.7284%22%20y1%3D%2221.751%22%20x2%3D%2226.0842%22%20y2%3D%2221.751%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22white%22%2F%3E%3Cstop%20offset%3D%220.9667%22%20stop-color%3D%22white%22%20stop-opacity%3D%220.3233%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22white%22%20stop-opacity%3D%220.3%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47055%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://www.tokenpocket.pro/",supportMobile:!0,supportExtension:!0,mobileDeepLink:`tpdapp://open?params=${encodeURI('{\n "url": "$APP_URL"\n }')}`,injected:()=>{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 S(null===(n=window.tokenpocket)||void 0===n?void 0:n.ethereum,t)},switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.tokenpocket)||void 0===t?void 0:t.ethereum)}))},isInstalled:()=>{var e;return!!(null===(e=window.tokenpocket)||void 0===e?void 0:e.ethereum)}},LM={type:exports.WalletType.Cyber,showName:"CyberWallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_10558_4010%29%22%3E%3Cpath%20d%3D%22M40%2012C40%205.37258%2034.6274%200%2028%200H12C5.37258%200%200%205.37258%200%2012V28C0%2034.6274%205.37258%2040%2012%2040H28C34.6274%2040%2040%2034.6274%2040%2028V12Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M24.5625%2020.8286L31.3525%2027.4911C31.4334%2027.5695%2031.498%2027.663%2031.5426%2027.7664C31.5872%2027.8698%2031.611%2027.981%2031.6125%2028.0936C31.6136%2028.2063%2031.5921%2028.318%2031.5491%2028.4221C31.5062%2028.5263%2031.4427%2028.6207%2031.3625%2028.6999L30.8625%2029.1874C30.782%2029.2719%2030.6855%2029.3397%2030.5787%2029.3867C30.4718%2029.4337%2030.3567%2029.4591%2030.24%2029.4613C30.1232%2029.4635%2030.0072%2029.4425%2029.8987%2029.3996C29.7901%2029.3566%2029.6911%2029.2926%2029.6075%2029.2111L21.315%2021.0749C21.1719%2020.9346%2021.0581%2020.7674%2020.98%2020.5829C20.9019%2020.3984%2020.8611%2020.2002%2020.86%2019.9999C20.8596%2019.7991%2020.8997%2019.6003%2020.9779%2019.4154C21.0561%2019.2305%2021.1707%2019.0632%2021.315%2018.9236L29.6075%2010.7874C29.7718%2010.6258%2029.9934%2010.5359%2030.2238%2010.5374C30.4534%2010.5377%2030.674%2010.6274%2030.8388%2010.7874L31.3525%2011.2999C31.4328%2011.3787%2031.4967%2011.4726%2031.5404%2011.5762C31.5842%2011.6799%2031.607%2011.7911%2031.6075%2011.9036C31.6076%2012.0162%2031.5851%2012.1277%2031.5413%2012.2314C31.4975%2012.3351%2031.4333%2012.429%2031.3525%2012.5074L24.5613%2019.1724C24.4518%2019.2807%2024.3648%2019.4097%2024.3055%2019.5518C24.2462%2019.694%2024.2157%2019.8465%2024.2157%2020.0005C24.2157%2020.1545%2024.2462%2020.307%2024.3055%2020.4492C24.3648%2020.5913%2024.453%2020.7203%2024.5625%2020.8286ZM15.4375%2019.1786L8.64875%2012.5149C8.56681%2012.4364%208.50137%2012.3424%208.45629%2012.2382C8.41121%2012.1341%208.3874%2012.0221%208.38625%2011.9086C8.38545%2011.7952%208.40763%2011.6828%208.45146%2011.5782C8.49528%2011.4735%208.55985%2011.3789%208.64125%2011.2999L9.1375%2010.8124C9.27986%2010.6686%209.46491%2010.5748%209.665%2010.5449C9.79687%2010.5282%209.9308%2010.5414%2010.0569%2010.5833C10.183%2010.6253%2010.2981%2010.695%2010.3938%2010.7874L18.6838%2018.9249C18.8267%2019.0652%2018.9406%2019.2324%2019.0187%2019.4169C19.0967%2019.6014%2019.1376%2019.7995%2019.1388%2019.9999C19.1388%2020.2004%2019.0986%2020.3989%2019.0204%2020.5836C18.9422%2020.7682%2018.8278%2020.9353%2018.6838%2021.0749L10.3938%2029.2124C10.2292%2029.3736%2010.0078%2029.4634%209.7775%2029.4624C9.5474%2029.4623%209.32636%2029.3726%209.16125%2029.2124L8.64875%2028.7074C8.56825%2028.6284%208.50417%2028.5343%208.46019%2028.4305C8.41621%2028.3266%208.39321%2028.2151%208.3925%2028.1024C8.39294%2027.9898%208.41595%2027.8785%208.46018%2027.775C8.50441%2027.6715%208.56896%2027.578%208.65%2027.4999L15.4375%2020.8374C15.5472%2020.729%2015.6343%2020.6%2015.6937%2020.4577C15.7531%2020.3154%2015.7837%2020.1628%2015.7837%2020.0086C15.7837%2019.8544%2015.7531%2019.7018%2015.6937%2019.5595C15.6343%2019.4173%2015.5472%2019.287%2015.4375%2019.1786Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_10558_4010%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://wallet.cyber.co",disabled:()=>m(void 0,void 0,void 0,(function*(){return!(yield(yield Y()).getIsCyber())})),getPackage:Y,connector:(e,t)=>ue(e,t),supportChains:tM,switchChain:e=>m(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},BM={type:exports.WalletType.uniPass,showName:"UniPass",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47070%29%22%3E%3Cpath%20d%3D%22M19.1103%2030.3416C21.2844%2027.5455%2024.9114%2026.3075%2028.3414%2027.1909L28.4555%2027.2206L28.377%2027.3096C28.1373%2027.5845%2027.8839%2027.8473%2027.6179%2028.0969L27.5912%2028.1221H27.5541C24.6835%2027.588%2021.7545%2028.6977%2019.9584%2030.9999L19.9124%2031.0607L19.8695%2031.1171H19.8339C19.4682%2031.1111%2019.1031%2031.0879%2018.7397%2031.0473L18.6225%2031.034L18.6877%2030.9347C18.8138%2030.7301%2018.9621%2030.5299%2019.1103%2030.3416ZM26.2775%2028.9271L26.3932%2028.9286H26.6141L26.4347%2029.0561C24.9424%2030.1187%2023.2108%2030.796%2021.3936%2031.0281L21.1757%2031.0548L21.3343%2030.9065C22.6619%2029.629%2024.4351%2028.919%2026.2775%2028.9271ZM23.6902%2025.1537C23.7631%2025.1382%2023.8385%2025.138%2023.9114%2025.1533C23.9844%2025.1686%2024.0533%2025.1991%2024.1138%2025.2427C24.1743%2025.2862%2024.225%2025.342%2024.2626%2025.4064C24.3002%2025.4707%2024.324%2025.5422%2024.3322%2025.6163V25.6015C24.3481%2025.7335%2024.314%2025.8667%2024.2366%2025.9748C24.1592%2026.0829%2024.0442%2026.1581%2023.9141%2026.1857C21.7298%2026.657%2019.7818%2027.884%2018.4135%2029.6507C18.1308%2030.0157%2017.8741%2030.4002%2017.6455%2030.8013L17.6188%2030.8487L17.5668%2030.8368C17.2555%2030.7671%2016.9382%2030.6841%2016.6417%2030.5877L16.5542%2030.5596L16.5957%2030.4824C16.8781%2029.9623%2017.2029%2029.4664%2017.5668%2028.9998C18.9537%2027.2083%2020.8811%2025.9116%2023.0631%2025.302C23.2715%2025.2499%2023.4806%2025.2005%2023.6903%2025.1537H23.6902ZM22.6331%2023.3108C25.2019%2022.6404%2027.9174%2022.8056%2030.386%2023.7823L30.4513%2023.809L30.4275%2023.8757C30.3184%2024.1678%2030.1972%2024.4551%2030.0643%2024.7371L30.0361%2024.7994L29.9723%2024.7742C25.3004%2022.9233%2019.9676%2024.3722%2016.8745%2028.3326C16.4247%2028.9104%2016.0315%2029.53%2015.7002%2030.183L15.669%2030.2438L15.6068%2030.2156C15.3221%2030.094%2015.0389%2029.9591%2014.7646%2029.8108L14.7023%2029.7767L14.7335%2029.7144C15.098%2028.9937%2015.5315%2028.31%2016.0278%2027.6728C17.6867%2025.5284%2020.0096%2023.9944%2022.6331%2023.3108ZM14.2157%2027.0326C14.2948%2027.0246%2014.3747%2027.0343%2014.4496%2027.0609C14.5245%2027.0875%2014.5926%2027.1304%2014.649%2027.1865V27.1895C14.7362%2027.2776%2014.7905%2027.393%2014.8026%2027.5164C14.8148%2027.6398%2014.7841%2027.7636%2014.7157%2027.867C14.4288%2028.304%2014.1679%2028.7575%2013.9343%2029.2252L13.8987%2029.2993L13.8291%2029.2533C13.5671%2029.0774%2013.3124%2028.8909%2013.0655%2028.6943L13.0195%2028.6573L13.0462%2028.6039C13.2801%2028.1453%2013.539%2027.6998%2013.8216%2027.2695C13.8657%2027.2034%2013.9239%2027.1478%2013.9921%2027.1068C14.0602%2027.0659%2014.1366%2027.0405%2014.2157%2027.0326ZM16.2251%2021.8444L16.2621%2021.8578C16.6571%2022.0062%2017.0717%2022.0961%2017.4927%2022.1247L17.7122%2022.1395L17.5268%2022.2581C16.0995%2023.1717%2014.8397%2024.3237%2013.8024%2025.6638C13.2502%2026.3739%2012.7629%2027.1321%2012.3464%2027.9293L12.3019%2028.0153L12.2322%2027.9471C12.0024%2027.7202%2011.7726%2027.4771%2011.5576%2027.2265L11.525%2027.188L11.5487%2027.145C12.6881%2025.0639%2014.2745%2023.2613%2016.1939%2021.8667L16.225%2021.8444H16.2251ZM14.9678%2025.7513C18.9166%2021.2068%2025.3094%2019.6599%2030.899%2021.8964L30.9539%2021.923L30.9435%2021.9809C30.9286%2022.0639%2030.9138%2022.1454%2030.8975%2022.227C30.851%2022.4549%2030.7976%2022.6814%2030.7374%2022.9061L30.7151%2022.9861L30.6395%2022.9535C29.063%2022.2963%2027.3717%2021.9591%2025.6637%2021.9616C25.1145%2021.9617%2024.5659%2021.9959%2024.0209%2022.0639C20.8225%2022.4547%2017.8843%2024.0224%2015.7787%2026.4615C15.7307%2026.5175%2015.6716%2026.563%2015.6052%2026.5951C15.5387%2026.6273%2015.4664%2026.6454%2015.3926%2026.6483C15.3189%2026.6512%2015.2453%2026.6389%2015.1766%2026.6121C15.1078%2026.5853%2015.0453%2026.5446%2014.9929%2026.4926L14.9814%2026.4809C14.8882%2026.3831%2014.8351%2026.2538%2014.8326%2026.1188C14.8301%2025.9837%2014.8783%2025.8525%2014.9678%2025.7513ZM25.5732%2024.9135C26.9255%2024.8631%2028.2749%2025.0725%2029.5483%2025.5304L29.6313%2025.56L29.5868%2025.6356C29.4242%2025.9115%2029.2496%2026.1801%2029.0635%2026.4407L29.0308%2026.4867L28.9804%2026.4689C28.0083%2026.1458%2026.9905%2025.9816%2025.9662%2025.9826H25.6207C25.4851%2025.988%2025.3525%2025.9419%2025.2494%2025.8537C25.1463%2025.7654%2025.0803%2025.6414%2025.0647%2025.5066L25.0631%2025.4883C25.0577%2025.4168%2025.0668%2025.345%2025.0897%2025.2771C25.1126%2025.2092%2025.1489%2025.1466%2025.1965%2025.0929C25.2441%2025.0393%2025.302%2024.9958%2025.3667%2024.965C25.4314%2024.9342%2025.5016%2024.9167%2025.5732%2024.9135ZM14.4696%2020.5901L14.5141%2020.6465C14.7186%2020.879%2014.9467%2021.0896%2015.1946%2021.2751L15.2717%2021.3315L15.1961%2021.3893V21.3789C13.4756%2022.7183%2012.0327%2024.3802%2010.9482%2026.2717L10.8904%2026.371L10.8252%2026.2761C10.6265%2025.993%2010.4397%2025.6905%2010.2707%2025.3865L10.2499%2025.3495L10.2721%2025.3124C10.6206%2024.7446%2010.9997%2024.1962%2011.4079%2023.6696C12.285%2022.5398%2013.2951%2021.5198%2014.4162%2020.6316L14.4696%2020.5901ZM11.1411%2021.0951C11.2142%2021.0929%2011.287%2021.1056%2011.3551%2021.1325C11.4231%2021.1593%2011.485%2021.1998%2011.5369%2021.2513H11.5339C11.6314%2021.3491%2011.6876%2021.4805%2011.6909%2021.6185C11.6942%2021.7564%2011.6444%2021.8904%2011.5517%2021.9927C11.2592%2022.316%2010.9793%2022.6503%2010.7125%2022.995C10.4034%2023.394%2010.1101%2023.8051%209.83327%2024.2271L9.75765%2024.3428L9.70578%2024.2152C9.55906%2023.8563%209.43089%2023.4901%209.32175%2023.1181L9.31135%2023.084L9.33215%2023.0558C9.51007%2022.8052%209.68943%2022.5621%209.86591%2022.3352C10.1509%2021.9723%2010.4476%2021.6187%2010.7555%2021.2751C10.8042%2021.2204%2010.8635%2021.1763%2010.9298%2021.1454C10.9961%2021.1144%2011.068%2021.0973%2011.1411%2021.0951ZM13.4435%2016.2904V17.5773L13.4139%2017.5981C11.8107%2018.7382%2010.3831%2020.1069%209.17647%2021.6606L9.02818%2021.8474L9.00149%2021.6798C8.93393%2021.2379%208.89332%2020.7923%208.8799%2020.3454V20.3173L8.90364%2020.2936C10.1865%2018.7815%2011.6771%2017.4586%2013.3309%2016.3645L13.4435%2016.2904ZM23.5124%2018.9992C26.0674%2018.6791%2028.6619%2018.9849%2031.0725%2019.8903L31.1199%2019.9081V20C31.1199%2020.3084%2031.1066%2020.6272%2031.0799%2020.9459L31.071%2021.0438L30.9806%2021.0068C29.2411%2020.3068%2027.3831%2019.9484%2025.508%2019.9511C24.0908%2019.9496%2022.6806%2020.1493%2021.3195%2020.5442L21.1074%2020.6049L21.2424%2020.43C21.4996%2020.0941%2021.7064%2019.7225%2021.8562%2019.3269L21.8711%2019.2913L21.9081%2019.2824C22.4377%2019.1609%2022.9732%2019.0664%2023.5124%2018.9992ZM13.5429%2018.719L13.5696%2018.8257C13.6452%2019.1366%2013.7556%2019.438%2013.8987%2019.7242L13.921%2019.7776L13.875%2019.8132C13.5021%2020.106%2013.141%2020.4137%2012.7927%2020.7354C12.6908%2020.8283%2012.5572%2020.8787%2012.4194%2020.8762C12.2815%2020.8737%2012.1498%2020.8186%2012.0513%2020.7221L12.0386%2020.7089C11.9903%2020.657%2011.9526%2020.5961%2011.928%2020.5296C11.9033%2020.463%2011.892%2020.3923%2011.8949%2020.3214C11.8977%2020.2505%2011.9146%2020.1809%2011.9445%2020.1166C11.9744%2020.0522%2012.0167%2019.9945%2012.0691%2019.9466C12.5122%2019.538%2012.9743%2019.1506%2013.4539%2018.7857L13.5429%2018.719ZM30.0212%2017.6978C30.0875%2017.6534%2030.163%2017.6243%2030.242%2017.6127C30.321%2017.601%2030.4016%2017.6072%2030.4779%2017.6307C30.6781%2017.6915%2030.8753%2017.7553%2031.071%2017.8234L31.1169%2017.8412V18.9814L31.0191%2018.9458C30.7366%2018.8421%2030.4513%2018.7462%2030.1636%2018.6582C30.0455%2018.622%2029.9434%2018.5462%2029.8746%2018.4436C29.8057%2018.341%2029.7743%2018.2178%2029.7855%2018.0948L29.7874%2018.0776C29.7969%2018.0012%2029.8226%2017.9278%2029.863%2017.8623C29.9033%2017.7968%2029.9573%2017.7407%2030.0212%2017.6978ZM12.9543%2014.1613L12.9943%2014.2147C13.1908%2014.4784%2013.327%2014.7821%2013.3932%2015.1043L13.4035%2015.1487L13.3605%2015.1754C11.7602%2016.1656%2010.2962%2017.3609%209.00594%2018.7308L8.8799%2018.8628V17.3283L8.90214%2017.309C10.1135%2016.1251%2011.4538%2015.0807%2012.8979%2014.1954L12.9543%2014.1613ZM23.1357%2017.0036C24.9708%2016.7694%2026.8313%2016.827%2028.6483%2017.174C28.7791%2017.1996%2028.8956%2017.273%2028.9752%2017.38C29.0547%2017.4869%2029.0914%2017.6197%2029.0783%2017.7523V17.7567C29.0713%2017.831%2029.0489%2017.903%2029.0126%2017.9682C28.9762%2018.0333%2028.9266%2018.0902%2028.8671%2018.1351C28.8075%2018.18%2028.7392%2018.212%2028.6666%2018.2291C28.5939%2018.2462%2028.5185%2018.2479%2028.4452%2018.2342C27.4259%2018.0378%2026.3903%2017.9385%2025.3523%2017.9376C24.6585%2017.9385%2023.9652%2017.9821%2023.2766%2018.0681C22.9207%2018.1132%2022.5661%2018.1691%2022.2136%2018.2357L22.1201%2018.2549V18.1585C22.1364%2018.031%2022.1364%2017.9065%2022.1364%2017.7878V17.1622L22.1972%2017.1518C22.5082%2017.0912%2022.8212%2017.0418%2023.1357%2017.0036ZM22.7607%2015.0064C25.5529%2014.6496%2028.3894%2014.9108%2031.0695%2015.7715L31.1199%2015.7878V16.916L31.0235%2016.8835C29.1473%2016.247%2027.1794%2015.9229%2025.1982%2015.9241C24.4273%2015.9255%2023.6573%2015.975%2022.8926%2016.0724C22.6895%2016.0976%2022.476%2016.1287%2022.2209%2016.1703L22.1364%2016.1836V15.0954L22.1987%2015.0865C22.3857%2015.0573%2022.573%2015.0306%2022.7607%2015.0064ZM11.1617%2013.2969L11.1997%2013.2971C11.4779%2013.3014%2011.753%2013.3566%2012.0113%2013.4599L12.1433%2013.5133L12.0232%2013.5889C10.9552%2014.2711%209.94466%2015.0392%209.00149%2015.8856L8.8799%2015.9939V15.5787C8.87813%2015.0663%209.05067%2014.5685%209.36918%2014.1672C9.58201%2013.8952%209.85413%2013.6755%2010.1648%2013.5247C10.4754%2013.3738%2010.8164%2013.2959%2011.1617%2013.2969ZM22.384%2013.0107C25.0873%2012.6701%2027.831%2012.8569%2030.4631%2013.5608C30.6455%2013.6097%2030.8427%2013.6661%2031.068%2013.7343L31.1185%2013.7491V14.867L31.0235%2014.8374C29.088%2014.2274%2027.0704%2013.9174%2025.041%2013.9181C24.1983%2013.9187%2023.3565%2013.9717%2022.5205%2014.0768L22.2966%2014.1064L22.1394%2014.1286V13.3695C22.1394%2013.2865%2022.1483%2013.2005%2022.1483%2013.1027V13.0433L22.2788%2013.0255L22.384%2013.0107ZM25.4947%2010.846C27.2618%2010.8946%2029.0173%2011.1488%2030.7255%2011.6037L30.7596%2011.6126L30.7745%2011.6452C30.9159%2011.9847%2031.0155%2012.3402%2031.071%2012.7038L31.0843%2012.8269L30.9761%2012.7957C30.8101%2012.7468%2030.6436%2012.6998%2030.4764%2012.6549C28.8409%2012.2181%2027.1601%2011.9733%2025.468%2011.9254C25.3939%2011.9235%2025.321%2011.9064%2025.2538%2011.875C25.1867%2011.8435%2025.1268%2011.7986%2025.0779%2011.7429C25.029%2011.6871%2024.9922%2011.6219%2024.9698%2011.5512C24.9473%2011.4806%2024.9398%2011.4061%2024.9476%2011.3324L24.9492%2011.3173C24.9654%2011.1851%2025.0302%2011.0636%2025.1311%2010.9765C25.2319%2010.8894%2025.3615%2010.8429%2025.4947%2010.846ZM23.6325%2010.8712C23.7095%2010.8671%2023.7866%2010.8796%2023.8584%2010.9078C23.9302%2010.9361%2023.9951%2010.9795%2024.0487%2011.035C24.1023%2011.0906%2024.1433%2011.157%2024.1689%2011.2298C24.1946%2011.3026%2024.2043%2011.38%2024.1974%2011.4569H24.2033C24.1913%2011.5852%2024.1334%2011.7049%2024.0402%2011.794C23.9471%2011.883%2023.8249%2011.9355%2023.6962%2011.9417C23.2811%2011.9654%2022.8644%2011.9996%2022.4493%2012.0455L22.3366%2012.0574L22.3722%2011.9506C22.4857%2011.6001%2022.641%2011.2646%2022.8348%2010.9513L22.8541%2010.9216H22.8911C23.1417%2010.9009%2023.3878%2010.8831%2023.6325%2010.8712ZM26.6408%208.88001C27.2697%208.87952%2027.8917%209.01127%2028.4664%209.2667C29.0411%209.52213%2029.5557%209.89554%2029.9768%2010.3627L30.125%2010.5317L29.9026%2010.4813C28.1999%2010.0953%2026.4593%209.90035%2024.7133%209.9001C24.4687%209.9001%2024.2196%209.90455%2023.972%209.91489H23.7437L23.926%209.78145C24.6405%209.24232%2025.5007%208.93078%2026.3947%208.8874C26.4806%208.88001%2026.5607%208.88001%2026.6408%208.88001Z%22%20fill%3D%22url%28%23paint0_linear_6996_47070%29%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47070%22%20x1%3D%228.87986%22%20y1%3D%229.16911%22%20x2%3D%222232.59%22%20y2%3D%222232.59%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23398BFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238864FF%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47070%22%3E%3Crect%20width%3D%2222.24%22%20height%3D%2222.24%22%20fill%3D%22white%22%20transform%3D%22translate%288.87988%208.88%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://unipass.id",supportChains:pM,getPackage:Q,connector:(e,t)=>de(e,t),disconnect:()=>m(void 0,void 0,void 0,(function*(){const{disconnectWallet:e}=yield Q();yield e()})),notSupported:{sign:!0},contract:{signTypedData:({typedData:e})=>m(void 0,void 0,void 0,(function*(){const{signTypedData:t}=yield Q();return t(e)}))},switchChain:e=>m(void 0,void 0,void 0,(function*(){const{switchChain:t}=yield Q();return yield t(e),{result:!0}})),isContractWallet:()=>!0,needReadProvider:!0},RM={type:exports.WalletType.Gate,showName:"Gate Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47059%29%22%3E%3Cpath%20d%3D%22M20%2026.6C18.2496%2026.6%2016.5709%2025.9047%2015.3331%2024.6669C14.0954%2023.4291%2013.4%2021.7504%2013.4%2020C13.4%2018.2496%2014.0954%2016.5709%2015.3331%2015.3331C16.5709%2014.0954%2018.2496%2013.4%2020%2013.4V8C17.6266%208%2015.3065%208.70379%2013.3332%2010.0224C11.3598%2011.3409%209.8217%2013.2151%208.91345%2015.4078C8.0052%2017.6005%207.76756%2020.0133%208.23058%2022.3411C8.69361%2024.6688%209.83649%2026.8071%2011.5147%2028.4853C13.1929%2030.1635%2015.3311%2031.3064%2017.6589%2031.7695C19.9867%2032.2324%2022.3995%2031.9948%2024.5922%2031.0866C26.785%2030.1783%2028.659%2028.6402%2029.9776%2026.6668C31.2962%2024.6934%2032%2022.3734%2032%2020H26.6C26.6%2021.7504%2025.9047%2023.4291%2024.6669%2024.6669C23.4291%2025.9047%2021.7504%2026.6%2020%2026.6Z%22%20fill%3D%22%232354E6%22%2F%3E%3Cpath%20d%3D%22M26.6%2013.4H20V19.9999H26.6V13.4Z%22%20fill%3D%22%2317E6A1%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47059%22%3E%3Crect%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22white%22%20transform%3D%22translate%288%208%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!1,link:"https://chromewebstore.google.com/detail/gate-wallet/cpmkedoipcpimgecpmgpldfpohjplkpp",disabled:()=>!window.gatewallet,connector:(e,t)=>S(window.gatewallet,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.gatewallet})),isInstalled:()=>!!window.gatewallet},jM={type:exports.WalletType.Rabby,showName:"Rabby Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M31.6568%2021.4761C32.5816%2019.4024%2028.008%2013.609%2023.6391%2011.1949C20.8846%209.32499%2018.0155%209.58224%2017.4336%2010.403C16.1588%2012.2055%2021.6581%2013.7315%2025.3349%2015.513C24.5448%2015.8577%2023.8001%2016.4755%2023.3618%2017.2665C21.9906%2015.765%2018.9815%2014.4717%2015.45%2015.513C13.07%2016.2156%2011.0925%2017.8702%2010.3286%2020.3701C10.1002%2020.2695%209.85027%2020.2276%209.60151%2020.2479C9.35274%2020.2683%209.11299%2020.3504%208.90395%2020.4868C8.69492%2020.6232%208.52321%2020.8096%208.40438%2021.0291C8.28554%2021.2486%208.22334%2021.4943%208.22339%2021.7439C8.22339%2022.5751%208.89364%2023.2471%209.72051%2023.2471C9.87451%2023.2471%2010.354%2023.1447%2010.354%2023.1447L18.0155%2023.1999C14.9513%2028.0771%2012.5293%2028.7902%2012.5293%2029.6355C12.5293%2030.4799%2014.8463%2030.2506%2015.7169%2029.9365C19.881%2028.428%2024.3531%2023.7292%2025.1214%2022.3765C28.3449%2022.7799%2031.0539%2022.8289%2031.6568%2021.4761Z%22%20fill%3D%22url%28%23paint0_linear_6996_47069%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M25.3358%2015.513C25.5064%2015.4456%2025.4793%2015.1936%2025.432%2014.995C25.3244%2014.5391%2023.4685%2012.6999%2021.7247%2011.8756C19.3499%2010.753%2017.6008%2010.8116%2017.3418%2011.3287C17.8257%2012.3236%2020.0692%2013.2581%2022.4115%2014.2337C23.4108%2014.6502%2024.4284%2015.0737%2025.3358%2015.513Z%22%20fill%3D%22url%28%23paint1_linear_6996_47069%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.3205%2025.5282C21.8402%2025.3445%2021.2977%2025.1747%2020.6808%2025.0207C21.3388%2023.8404%2021.477%2022.0921%2020.8558%2020.987C19.9834%2019.4356%2018.8897%2018.6096%2016.346%2018.6096C14.9478%2018.6096%2011.1818%2019.0821%2011.1144%2022.2365C11.1074%2022.5681%2011.1144%2022.8709%2011.138%2023.15L18.0155%2023.1999C17.088%2024.676%2016.22%2025.7706%2015.4605%2026.6027C16.3723%2026.8372%2017.1257%2027.0341%2017.8169%2027.2152C18.4732%2027.3867%2019.0734%2027.5442%2019.7025%2027.7052C20.6176%2027.0321%2021.4918%2026.3051%2022.3205%2025.5282Z%22%20fill%3D%22url%28%23paint2_linear_6996_47069%29%22%2F%3E%3Cpath%20d%3D%22M10.2367%2022.8263C10.5167%2025.222%2011.8747%2026.16%2014.6484%2026.4383C17.4222%2026.7165%2019.0121%2026.5301%2021.1304%2026.7235C22.8997%2026.8845%2024.4791%2027.7893%2025.0644%2027.4769C25.5921%2027.196%2025.2972%2026.1793%2024.5919%2025.5274C23.6767%2024.6821%2022.4106%2024.0941%2020.1837%2023.8859C20.6273%2022.6661%2020.5031%2020.9564%2019.8136%2020.0271C18.8161%2018.6814%2016.9768%2018.0733%2014.6484%2018.3384C12.2159%2018.6166%209.88406%2019.8189%2010.2367%2022.8263Z%22%20fill%3D%22url%28%23paint3_linear_6996_47069%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47069%22%20x1%3D%2215.1726%22%20y1%3D%2219.6395%22%20x2%3D%2231.4651%22%20y2%3D%2224.2446%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238697FF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23ABB7FF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47069%22%20x1%3D%2228.7159%22%20y1%3D%2219.3289%22%20x2%3D%2216.9262%22%20y2%3D%227.54961%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238697FF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235156D8%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47069%22%20x1%3D%2222.6478%22%20y1%3D%2225.9395%22%20x2%3D%2211.3419%22%20y2%3D%2219.461%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23465EED%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238697FF%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_6996_47069%22%20x1%3D%2216.1447%22%20y1%3D%2219.517%22%20x2%3D%2223.8062%22%20y2%3D%2229.219%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238898FF%22%2F%3E%3Cstop%20offset%3D%220.984%22%20stop-color%3D%22%236277F1%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!1,link:"https://rabby.io",disabled:()=>!window.rabby,connector:(e,t)=>S(window.rabby,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.rabby})),isInstalled:()=>!!window.rabby},GM={type:exports.WalletType.SocialLogin,showName:"Social Login",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%2341454F%22%2F%3E%3Cpath%20d%3D%22M7.33317%2016.6666C7.01234%2016.6666%206.73768%2016.5524%206.50921%2016.3239C6.28074%2016.0955%206.1665%2015.8208%206.1665%2015.5V8.49998C6.1665%208.17915%206.28074%207.90449%206.50921%207.67602C6.73768%207.44755%207.01234%207.33331%207.33317%207.33331H16.6665C16.9873%207.33331%2017.262%207.44755%2017.4905%207.67602C17.7189%207.90449%2017.8332%208.17915%2017.8332%208.49998V15.5C17.8332%2015.8208%2017.7189%2016.0955%2017.4905%2016.3239C17.262%2016.5524%2016.9873%2016.6666%2016.6665%2016.6666H7.33317ZM11.9998%2012.5833L16.6665%209.66665V8.49998L11.9998%2011.4166L7.33317%208.49998V9.66665L11.9998%2012.5833Z%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47057%29%22%3E%3Cpath%20d%3D%22M35%2012C35%208.1332%2031.8668%205%2028%205C24.1332%205%2021%208.1332%2021%2012C21%2015.2816%2023.2596%2018.0368%2026.3088%2018.7928V14.1392H24.864V12H26.3088V11.0788C26.3088%208.696%2027.3868%207.5928%2029.7248%207.5928C30.1672%207.5928%2030.9344%207.6796%2031.2452%207.7664V9.704C31.08%209.6872%2030.7944%209.6788%2030.436%209.6788C29.288%209.6788%2028.8456%2010.1128%2028.8456%2011.244V12H31.1332L30.7412%2014.1392H28.8484V18.9496C32.3148%2018.5296%2035%2015.5784%2035%2012Z%22%20fill%3D%22%230866FF%22%2F%3E%3Cpath%20d%3D%22M30.741%2014.1392L31.133%2012H28.8454V11.244C28.8454%2010.1128%2029.2878%209.67877%2030.4358%209.67877C30.7914%209.67877%2031.0798%209.68717%2031.245%209.70397V7.76637C30.9314%207.67957%2030.167%207.59277%2029.7246%207.59277C27.3866%207.59277%2026.3086%208.69597%2026.3086%2011.0788V12H24.8638V14.1392H26.3086V18.7928C26.849%2018.9272%2027.4174%2019%2027.9998%2019C28.2882%2019%2028.571%2018.9832%2028.8482%2018.9496V14.1392H30.741Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cg%20clip-path%3D%22url%28%23clip1_6996_47057%29%22%3E%3Cpath%20d%3D%22M18.16%2028.1458C18.16%2027.6908%2018.1192%2027.2533%2018.0433%2026.8333H12V29.3183H15.4533C15.3017%2030.1175%2014.8467%2030.7941%2014.1642%2031.2491V32.865H16.2467C17.46%2031.745%2018.16%2030.1%2018.16%2028.1458Z%22%20fill%3D%22%234285F4%22%2F%3E%3Cpath%20d%3D%22M11.9998%2034.4166C13.7323%2034.4166%2015.1848%2033.845%2016.2465%2032.865L14.164%2031.2491C13.5923%2031.6341%2012.8632%2031.8675%2011.9998%2031.8675C10.3315%2031.8675%208.91398%2030.7416%208.40648%2029.225H6.27148V30.8816C7.32732%2032.9758%209.49148%2034.4166%2011.9998%2034.4166Z%22%20fill%3D%22%2334A853%22%2F%3E%3Cpath%20d%3D%22M8.40683%2029.2191C8.2785%2028.8341%208.20266%2028.4258%208.20266%2028C8.20266%2027.5741%208.2785%2027.1658%208.40683%2026.7808V25.1241H6.27183C5.83433%2025.9875%205.5835%2026.9616%205.5835%2028C5.5835%2029.0383%205.83433%2030.0125%206.27183%2030.8758L7.93433%2029.5808L8.40683%2029.2191Z%22%20fill%3D%22%23FBBC05%22%2F%3E%3Cpath%20d%3D%22M11.9998%2024.1383C12.9448%2024.1383%2013.7848%2024.465%2014.4557%2025.095L16.2932%2023.2575C15.179%2022.2191%2013.7323%2021.5833%2011.9998%2021.5833C9.49148%2021.5833%207.32732%2023.0241%206.27148%2025.1241L8.40648%2026.7808C8.91398%2025.2641%2010.3315%2024.1383%2011.9998%2024.1383Z%22%20fill%3D%22%23EA4335%22%2F%3E%3C%2Fg%3E%3Cmask%20id%3D%22mask0_6996_47057%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2221%22%20y%3D%2223%22%20width%3D%2214%22%20height%3D%2211%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2023.1875H35V33.1875H21V23.1875Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_6996_47057%29%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M30.4337%2030.0246C30.0063%2030.0701%2029.6594%2029.903%2029.393%2029.5916C29.0418%2029.1808%2028.9574%2028.7127%2029.1402%2028.214C29.3069%2027.7594%2029.6334%2027.4588%2030.1419%2027.3691C30.7188%2027.2672%2031.3177%2027.6378%2031.5221%2028.2202C31.5767%2028.3755%2031.6009%2028.5366%2031.6071%2028.657C31.6027%2029.3858%2031.1069%2029.953%2030.4337%2030.0246M26.4813%2029.7218C25.9785%2030.1611%2025.2701%2030.1317%2024.7948%2029.6635C24.2491%2029.126%2024.2598%2028.2133%2024.8177%2027.6913C25.4058%2027.1412%2026.3517%2027.2859%2026.7543%2027.9895C26.879%2028.2076%2026.9426%2028.4426%2026.9414%2028.7393C26.9325%2029.0949%2026.794%2029.4486%2026.4813%2029.7218M34.9499%2029.4469C34.7791%2027.5043%2034.0783%2025.7445%2032.9424%2024.136C32.8905%2024.0626%2032.834%2023.9963%2032.7464%2023.9592C31.9026%2023.602%2031.0266%2023.3471%2030.1181%2023.1926C29.9989%2023.1723%2029.9355%2023.2133%2029.8877%2023.3095C29.817%2023.4514%2029.7358%2023.5887%2029.6689%2023.732C29.6179%2023.8414%2029.5394%2023.8715%2029.4213%2023.8558C28.4643%2023.7284%2027.5068%2023.726%2026.5498%2023.855C26.4382%2023.8701%2026.3642%2023.842%2026.3176%2023.7379C26.2651%2023.6203%2026.1929%2023.5106%2026.1429%2023.3921C26.0697%2023.2191%2025.9594%2023.1662%2025.7605%2023.2054C24.9295%2023.3688%2024.1234%2023.6042%2023.3407%2023.9169C23.1873%2023.9782%2023.0786%2024.0698%2022.9882%2024.2024C21.8942%2025.8055%2021.2034%2027.5449%2021.0378%2029.4632C20.9846%2030.0796%2020.9897%2030.6961%2021.0396%2031.3123C21.0489%2031.4278%2021.0656%2031.5383%2021.1823%2031.6175C22.1825%2032.2966%2023.2662%2032.8136%2024.4332%2033.1726C24.5437%2033.2065%2024.6147%2033.1837%2024.6808%2033.093C24.8865%2032.811%2025.0771%2032.5207%2025.2499%2032.219C25.3126%2032.1094%2025.2889%2032.0536%2025.1685%2032.0088C24.8908%2031.9053%2024.6174%2031.791%2024.3601%2031.6458C24.2977%2031.6106%2024.1728%2031.5951%2024.2103%2031.5032C24.251%2031.4033%2024.3511%2031.3249%2024.4798%2031.3286C24.5314%2031.33%2024.5828%2031.3608%2024.6331%2031.3809C26.7182%2032.21%2028.8228%2032.2754%2030.9476%2031.528C31.1073%2031.4718%2031.2621%2031.4029%2031.421%2031.3446C31.5272%2031.3056%2031.7282%2031.3859%2031.7557%2031.4856C31.7893%2031.6076%2031.6646%2031.6202%2031.5934%2031.6577C31.3429%2031.7896%2031.0857%2031.9099%2030.8169%2032.004C30.6906%2032.0482%2030.6571%2032.109%2030.7283%2032.2266C30.8989%2032.5089%2031.0738%2032.7881%2031.2685%2033.0563C31.352%2033.1714%2031.4437%2033.1948%2031.58%2033.1525C32.7222%2032.7981%2033.7861%2032.2945%2034.7713%2031.6371C34.8755%2031.5675%2034.9317%2031.4845%2034.9387%2031.365C34.9586%2031.0281%2034.9804%2030.6913%2035%2030.3779C34.983%2030.0513%2034.9764%2029.7483%2034.9499%2029.4469%22%20fill%3D%22%235A6AEF%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47057%22%3E%3Crect%20width%3D%2214%22%20height%3D%2214%22%20fill%3D%22white%22%20transform%3D%22translate%2821%205%29%22%2F%3E%3C%2FclipPath%3E%3CclipPath%20id%3D%22clip1_6996_47057%22%3E%3Crect%20width%3D%2214%22%20height%3D%2214%22%20fill%3D%22white%22%20transform%3D%22translate%285%2021%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,getPackage:ne,connector:me,switchChain:e=>m(void 0,void 0,void 0,(function*(){return(yield ne()).switchChain(e)})),disconnect:()=>m(void 0,void 0,void 0,(function*(){return(yield ne()).disconnect()}))},zM={type:exports.WalletType.Alchemy,showName:"Alchemy",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M27.9663%2022.8488L20.3716%209.93638C20.3349%209.87262%2020.2815%209.81951%2020.2172%209.7824C20.1528%209.74529%2020.0796%209.72551%2020.005%209.72505C19.9304%209.72458%2019.857%209.74344%2019.7921%209.77974C19.7273%209.81603%2019.6734%209.86847%2019.6358%209.93176L17.3613%2013.8009C17.2867%2013.9275%2017.2476%2014.0712%2017.2476%2014.2174C17.2476%2014.3637%2017.2867%2014.5073%2017.3613%2014.634L22.3134%2023.0577C22.388%2023.1844%2022.4953%2023.2896%2022.6245%2023.3628C22.7536%2023.436%2022.9002%2023.4744%2023.0493%2023.4742H27.5983C27.6728%2023.474%2027.7459%2023.4546%2027.8103%2023.418C27.8748%2023.3813%2027.9283%2023.3287%2027.9655%2023.2654C28.0028%2023.2021%2028.0224%2023.1303%2028.0225%2023.0571C28.0227%2022.9841%2028.0032%2022.9123%2027.9663%2022.8488Z%22%20fill%3D%22url%28%23paint0_linear_6996_47071%29%22%2F%3E%3Cpath%20d%3D%22M8.05856%2029.5973L15.6532%2016.6849C15.6905%2016.6216%2015.7441%2016.5691%2015.8085%2016.5326C15.873%2016.4961%2015.9461%2016.4769%2016.0205%2016.4769C16.095%2016.4769%2016.1681%2016.4961%2016.2326%2016.5326C16.297%2016.5691%2016.3506%2016.6216%2016.3878%2016.6849L18.6636%2020.5505C18.738%2020.6774%2018.7773%2020.8212%2018.7773%2020.9676C18.7773%2021.1141%2018.738%2021.258%2018.6636%2021.3848L13.7113%2029.8085C13.6371%2029.9352%2013.53%2030.0405%2013.401%2030.1137C13.272%2030.1868%2013.1256%2030.2252%2012.9767%2030.225H8.42648C8.35152%2030.2254%208.27781%2030.2063%208.21283%2030.1696C8.14784%2030.1329%208.09392%2030.08%208.05654%2030.0162C8.01916%2029.9524%207.99965%2029.88%208%2029.8065C8.00036%2029.7329%208.02056%2029.6607%208.05856%2029.5973Z%22%20fill%3D%22url%28%23paint1_linear_6996_47071%29%22%2F%3E%3Cpath%20d%3D%22M16.3868%2030.2222H31.5761C31.6506%2030.2221%2031.7238%2030.2028%2031.7883%2030.1662C31.8526%2030.1295%2031.9062%2030.0769%2031.9434%2030.0135C31.9805%2029.9501%2032%2029.8782%2032%2029.8051C32%2029.7319%2031.9803%2029.6601%2031.9429%2029.5968L29.6706%2025.7288C29.5961%2025.6021%2029.4888%2025.4968%2029.3597%2025.4236C29.2305%2025.3506%2029.0839%2025.3121%2028.9348%2025.3123H19.0304C18.8813%2025.3121%2018.7347%2025.3506%2018.6056%2025.4236C18.4764%2025.4968%2018.3691%2025.6021%2018.2946%2025.7288L16.02%2029.5968C15.9827%2029.6601%2015.963%2029.7319%2015.9629%2029.8051C15.9627%2029.8782%2015.9822%2029.9501%2016.0194%2030.0135C16.0566%2030.0769%2016.1101%2030.1295%2016.1746%2030.1662C16.2391%2030.2028%2016.3123%2030.2221%2016.3868%2030.2222Z%22%20fill%3D%22url%28%23paint2_linear_6996_47071%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47071%22%20x1%3D%2220.0001%22%20y1%3D%2211.2488%22%20x2%3D%2217.8821%22%20y2%3D%2230.2265%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2305D5FF%22%2F%3E%3Cstop%20offset%3D%220.723958%22%20stop-color%3D%22%23363FF9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235533FF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47071%22%20x1%3D%2220%22%20y1%3D%2211.2488%22%20x2%3D%2217.882%22%20y2%3D%2230.2265%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2305D5FF%22%2F%3E%3Cstop%20offset%3D%220.723958%22%20stop-color%3D%22%23363FF9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235533FF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47071%22%20x1%3D%2220%22%20y1%3D%2211.2488%22%20x2%3D%2217.882%22%20y2%3D%2230.2264%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2305D5FF%22%2F%3E%3Cstop%20offset%3D%220.723958%22%20stop-color%3D%22%23363FF9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235533FF%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,getPackage:re,connector:fe,supportChains:XS,isContractWallet:()=>!0,contract:{signTypedData:({typedData:e})=>m(void 0,void 0,void 0,(function*(){const{signTypedData:t}=yield re();return t(e)}))},disconnect:()=>m(void 0,void 0,void 0,(function*(){return(yield re()).disconnect()}))},$M={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.OKCHAIN,exports.ChainId.LINEA,exports.ChainId.BASE,exports.ChainId.MANTA,exports.ChainId.BTR,exports.ChainId.SCROLL],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)=>S(window.bybitWallet,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.bybitWallet})),isInstalled:()=>!!window.bybitWallet},HM={type:exports.WalletType.Zerion,showName:"Zerion",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_10156_10455%29%22%3E%3Cg%20clip-path%3D%22url%28%23clip1_10156_10455%29%22%3E%3Cmask%20id%3D%22mask0_10156_10455%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%3E%3Cpath%20d%3D%22M40%200H0V40H40V0Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_10156_10455%29%22%3E%3Cpath%20d%3D%22M40%2012C40%205.37258%2034.6274%200%2028%200H12C5.37258%200%200%205.37258%200%2012V28C0%2034.6274%205.37258%2040%2012%2040H28C34.6274%2040%2040%2034.6274%2040%2028V12Z%22%20fill%3D%22%232461ED%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.878%2019.4668C18.9564%2017.3476%2014.1848%2014.5995%2010.5936%2012.3596C9.53404%2011.5962%2010.0718%209.97607%2011.3524%209.97607H29.1216C30.1128%209.97607%2030.776%2011.0812%2030.2791%2011.9175C29.0851%2013.9797%2027.3419%2016.5979%2025.886%2018.6738C25.1044%2019.7881%2023.8305%2019.9795%2022.878%2019.4668ZM17.1585%2020.1549C20.9502%2022.1761%2026.2642%2025.25%2030.0398%2027.5743C31.2089%2028.2943%2030.7417%2030.0216%2029.3792%2030.0216C27.1494%2030.0216%2023.526%2030.0223%2019.9214%2030.0227C16.3541%2030.0234%2012.8052%2030.0238%2010.6437%2030.0238C9.55454%2030.0238%208.99626%2028.8936%209.45883%2028.1052C11.022%2025.4413%2012.7789%2022.7527%2014.2395%2020.7451C14.8889%2019.8496%2016.2106%2019.6491%2017.1585%2020.1549Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_10156_10455%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3CclipPath%20id%3D%22clip1_10156_10455%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://zerion.io/",switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.bybitWallet}))},qM={type:exports.WalletType.Holdstation,showName:"Holdstation",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_10677_681%29%22%3E%3Cpath%20d%3D%22M40%2012C40%205.37258%2034.6274%200%2028%200H12C5.37258%200%200%205.37258%200%2012V28C0%2034.6274%205.37258%2040%2012%2040H28C34.6274%2040%2040%2034.6274%2040%2028V12Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20d%3D%22M12.9622%2014.4597L12.7066%2016.0422H11.5435L11.7994%2014.4597H10.3906L9.65332%2019.0214H11.0621L11.32%2017.4253H12.4831L12.2249%2019.0214H13.6337L14.371%2014.4597H12.9622Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M15.3385%2019.3443H14.1372L14.1375%2019.3411H12.729L12.7284%2019.3443H11.4724L11.2534%2020.7274H12.5049L11.9917%2023.9027H13.4002L13.9133%2020.7274H15.1198L15.3385%2019.3443Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M23.5343%2023.9027H22.1255L22.8629%2019.3411H24.2716L23.5343%2023.9027Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M22.6403%2019.3443H21.4386L21.4392%2019.3411H20.0304L20.0298%2019.3443H18.7739L18.5552%2020.7274H19.8063L19.2931%2023.9027H20.7019L21.2151%2020.7274H22.4216L22.6403%2019.3443Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M20.4111%2017.6427L20.9256%2014.4597H19.5171L18.7798%2019.0214H20.0505H22.0225L22.2454%2017.6427H20.4111Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M18.521%2015.0573C17.7365%2014.1495%2016.2291%2014.1662%2015.1549%2015.0946C14.0804%2016.0233%2013.8457%2017.512%2014.6302%2018.4199C15.4147%2019.3277%2016.9218%2019.311%2017.9963%2018.3823C19.0708%2017.4539%2019.3055%2015.9651%2018.521%2015.0573ZM17.1562%2017.4102C16.7172%2017.7898%2016.1013%2017.7965%2015.7805%2017.4256C15.4597%2017.0547%2015.5557%2016.4462%2015.995%2016.0666C16.434%2015.687%2017.0499%2015.6803%2017.3707%2016.0512C17.6912%2016.4224%2017.5952%2017.031%2017.1562%2017.4102Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M28.4541%2019.9406C27.6696%2019.0327%2026.1625%2019.0494%2025.088%2019.9781C24.0135%2020.9069%2023.7788%2022.3956%2024.5633%2023.3034C25.3478%2024.2113%2026.8549%2024.1946%2027.9294%2023.2659C29.0036%2022.3372%2029.2386%2020.8484%2028.4541%2019.9406ZM27.0889%2022.2935C26.6501%2022.6731%2026.0341%2022.6798%2025.7133%2022.3089C25.3925%2021.938%2025.4885%2021.3295%2025.9278%2020.9499C26.3667%2020.5703%2026.9827%2020.5636%2027.3035%2020.9345C27.6243%2021.3057%2027.5283%2021.9139%2027.0889%2022.2935Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M25.0412%2014.4597H24.3497H22.9408L22.2036%2019.0214H23.4583H24.3494C25.3663%2019.0214%2026.7402%2018.0262%2026.92%2016.7384C27.1002%2015.4501%2026.2865%2014.4597%2025.0412%2014.4597ZM25.5042%2016.8258C25.3468%2017.4507%2024.7865%2017.6244%2024.5347%2017.6244H23.8384L24.1271%2015.838H24.7762C25.2254%2015.8383%2025.6615%2016.2009%2025.5042%2016.8258Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M11.1909%2019.8248L10.969%2021.4551C10.969%2021.4551%2010.7757%2021.1083%2010.6543%2021.0049C10.5329%2020.9015%2010.1733%2020.6587%209.81361%2020.67C9.45395%2020.6812%209.38875%2020.7891%209.64277%2020.915C9.89679%2021.0409%2010.5127%2021.1892%2010.8027%2021.6388C11.0927%2022.0884%2011.1039%2023.3675%209.84508%2023.835C8.58625%2024.3026%207.84284%2023.5354%207.70508%2023.3614L7.95684%2021.7625C7.95684%2021.7625%208.2205%2022.2406%208.59814%2022.4384C8.97579%2022.6363%209.44624%2022.5913%209.56633%2022.5255C9.68612%2022.4596%209.0869%2022.3036%208.73622%2022.091C8.38554%2021.8781%207.90289%2021.538%208.17264%2020.4365C8.44271%2019.3347%2010.3653%2018.7997%2011.1909%2019.8248Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M32.0831%2019.3411L31.7707%2021.2749L30.8258%2019.3411H29.4174L28.6802%2023.9027H30.0886L30.4081%2021.9268L31.3458%2023.9027H31.3647H32.7545L33.4919%2019.3411H32.0831Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M13.6436%2024.4619C6.45288%2024.6777%206.50587%2025.4869%206.50587%2025.4869C7.2419%2025.4619%209.36616%2025.5023%2012.2907%2025.5428C15.658%2025.5893%2020.087%2025.6362%2024.6815%2025.5826C33.2862%2025.4824%2032.7671%2024.6446%2032.7671%2024.6446C29.002%2024.5694%2018.9034%2024.3809%2018.9034%2024.3809C17.5071%2020.9282%2018.185%2019.3418%2018.185%2019.3418C15.1622%2019.3418%2013.6436%2024.4619%2013.6436%2024.4619Z%22%20fill%3D%22url%28%23paint0_radial_10677_681%29%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CradialGradient%20id%3D%22paint0_radial_10677_681%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2832.9384%2024.7522%29%20rotate%28-178.206%29%20scale%2824.9363%2080.5053%29%22%3E%3Cstop%20stop-color%3D%22%23FFBC95%22%2F%3E%3Cstop%20offset%3D%220.4679%22%20stop-color%3D%22%23FF7A78%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23664EFF%22%2F%3E%3C%2FradialGradient%3E%3CclipPath%20id%3D%22clip0_10677_681%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!1,link:"https://holdstation.com/",disabled:()=>{var e;return!(null===(e=window.ethereum)||void 0===e?void 0:e.isHoldstation)},injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isHoldstation},switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.ethereum}))},VM={type:exports.WalletType.SafePal,showName:"SafePal",logo:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22none%22%20viewBox%3D%220%200%2040%2040%22%3E%3Cg%20clip-path%3D%22url%28%23a%29%22%3E%3Cpath%20fill%3D%22%234a21ef%22%20d%3D%22M30.37%200H9.63A9.63%209.63%200%200%200%200%209.63v20.74A9.63%209.63%200%200%200%209.63%2040h20.74A9.63%209.63%200%200%200%2040%2030.37V9.63A9.63%209.63%200%200%200%2030.37%200%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M18.627%208.77a2.58%202.58%200%200%200-1.825.755l-7.601%207.602a1.47%201.47%200%200%200-.432%201.042c0%20.378.144.755.432%201.043l4.981%204.981v-8.819c0-.658.53-1.191%201.188-1.191h10.472l5.413-5.414zm-4.444%2017.072H24.65c.658%200%201.192-.534%201.192-1.192v-8.819l4.981%204.982a1.47%201.47%200%200%201%200%202.085L23.222%2030.5a2.58%202.58%200%200%201-1.825.755H8.77z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22%23fff%22%20rx%3D%2212%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://www.safepal.com/",disabled:()=>!window.safepalProvider,injected:()=>window.safepalProvider,switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.ethereum})),connector:(e,t)=>S(window.safepalProvider,t)},WM={type:exports.WalletType.Rise,showName:"Rise Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_11156_1385%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22%237967E5%22%2F%3E%3Cpath%20d%3D%22M23.7198%209.77002H11.8364V13.1769H23.7198C24.6573%2013.1769%2025.4174%2013.9397%2025.4174%2014.8804V16.5839H17.0335C14.1632%2016.5839%2011.8364%2018.9107%2011.8364%2021.781V30.2117H15.2317V22.2003L23.8242%2030.2113H28.8134L17.8502%2019.9909H25.4174V16.6005H28.8134V14.8804C28.8134%2012.058%2026.5323%209.77002%2023.7198%209.77002Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_11156_1385%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://risechain.com/",getPackage:ae,connector:ye,switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider})),isContractWallet:()=>!0};var ZM=Object.freeze({__proto__:null,WalletLink:hM,ImToken:mM,Math:fM,GameStop:yM,Brave:bM,FoxWallet:gM,BSC:vM,KuCoin:wM,Coin98:CM,Frontier:xM,Ledger:EM,OpenBlock:kM,OneKey:TM,Bitkeep:PM,Nabox:AM,OKXWallet:_M,WalletConnect:DM,Portis:OM,Gnosis:FM,UAuth:SM,Blocto:IM,Rainbow:MM,Trust:NM,TokenPocket:UM,Cyber:LM,UniPass:BM,Gate:RM,Rabby:jM,SocialLogin:GM,Alchemy:zM,Bybit:$M,Zerion:HM,Holdstation:qM,SafePal:VM,Rise:WM});const KM={type:exports.WalletType.injected,showName:"MetaMask",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M29.3231%2019.9841L30.3121%2018.8232L29.8821%2018.5079L30.57%2017.8773L30.0397%2017.476L30.7277%2016.96L30.2834%2016.616L31%2013.119L29.9107%209.87988M29.9107%209.87988L22.9166%2012.474H17.0834L10.0893%209.87988L9%2013.119L9.73094%2016.616L9.27231%2016.96L9.97459%2017.476L9.4443%2017.8773L10.1322%2018.5079L9.70228%2018.8232L10.6912%2019.9841L9.18632%2024.6278L10.5765%2029.3717L15.4638%2028.0245L16.4098%2028.7984L18.3446%2030.117H21.6554L23.5902%2028.7984L24.5362%2028.0245L29.4378%2029.3717L30.8423%2024.6278L29.3231%2019.9841%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M29.9107%209.87994L21.3257%2016.2005L22.9166%2012.4741L29.9107%209.87994Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M10.0894%209.87994L18.6027%2016.2578L17.0835%2012.4741L10.0894%209.87994Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M26.8293%2024.5422L24.5361%2028.0106L29.4378%2029.3578L30.8423%2024.6138L26.8293%2024.5422Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M9.18652%2024.6138L10.5768%2029.3578L15.464%2028.0106L13.1852%2024.5422L9.18652%2024.6138Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M15.2058%2018.6657L13.8442%2020.7152L18.6885%2020.9302L18.5309%2015.7419L15.2058%2018.6657Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M24.8084%2018.6656L21.426%2015.6845L21.3257%2020.9301L26.17%2020.7151L24.8084%2018.6656Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M15.4639%2028.0107L18.402%2026.6061L15.8652%2024.6569L15.4639%2028.0107Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M21.6123%2026.6061L24.5361%2028.0107L24.1348%2024.6569L21.6123%2026.6061Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M24.5361%2028.0107L21.6123%2026.6061L21.856%2028.498L21.8273%2029.3006L24.5361%2028.0107Z%22%20fill%3D%22%23D7C1B3%22%2F%3E%3Cpath%20d%3D%22M15.4639%2028.0107L18.187%2029.3006L18.1727%2028.498L18.402%2026.6061L15.4639%2028.0107Z%22%20fill%3D%22%23D7C1B3%22%2F%3E%3Cpath%20d%3D%22M18.2298%2023.3953L15.8076%2022.693L17.5275%2021.9047L18.2298%2023.3953Z%22%20fill%3D%22%232F343B%22%2F%3E%3Cpath%20d%3D%22M21.77%2023.3953L22.4866%2021.9047L24.2065%2022.693L21.77%2023.3953Z%22%20fill%3D%22%232F343B%22%2F%3E%3Cpath%20d%3D%22M15.4639%2028.0106L15.8939%2024.5422L13.1851%2024.6138L15.4639%2028.0106Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M24.1206%2024.5422L24.5362%2028.0106L26.8294%2024.6138L24.1206%2024.5422Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M26.17%2020.7155L21.3257%2020.9305L21.77%2023.3956L22.4866%2021.9051L24.2065%2022.6934L26.17%2020.7155Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M15.8078%2022.6934L17.5276%2021.9051L18.2299%2023.3956L18.6885%2020.9305L13.8442%2020.7155L15.8078%2022.6934Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M13.8442%2020.7155L15.8651%2024.6569L15.8078%2022.6934L13.8442%2020.7155Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M24.2064%2022.6934L24.1348%2024.6569L26.1699%2020.7155L24.2064%2022.6934Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M18.6886%2020.9301L18.23%2023.3953L18.8033%2026.319L18.9323%2022.478L18.6886%2020.9301Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M21.3257%2020.9301L21.082%2022.4637L21.1967%2026.319L21.77%2023.3953L21.3257%2020.9301Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M21.7701%2023.3953L21.1968%2026.3191L21.6124%2026.6057L24.1349%2024.6565L24.2065%2022.693L21.7701%2023.3953Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M15.8076%2022.693L15.8649%2024.6565L18.4018%2026.6057L18.8031%2026.3191L18.2298%2023.3953L15.8076%2022.693Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M21.8274%2029.3002L21.8561%2028.4975L21.6267%2028.3112H18.3733L18.1727%2028.4975L18.187%2029.3002L15.4639%2028.0103L16.4098%2028.7842L18.3446%2030.1171H21.6554L23.5903%2028.7842L24.5362%2028.0103L21.8274%2029.3002Z%22%20fill%3D%22%23C0AD9E%22%2F%3E%3Cpath%20d%3D%22M21.6126%2026.6062L21.197%2026.3195H18.8035L18.4022%2026.6062L18.1729%2028.498L18.3735%2028.3117H21.6269L21.8562%2028.498L21.6126%2026.6062Z%22%20fill%3D%22%232F343B%22%2F%3E%3Cpath%20d%3D%22M30.2833%2016.6161L30.9999%2013.119L29.9107%209.87994L21.6123%2015.9855L24.8084%2018.6656L29.3231%2019.9842L30.312%2018.8233L29.882%2018.508L30.57%2017.8917L30.0397%2017.476L30.7276%2016.9601L30.2833%2016.6161Z%22%20fill%3D%22%23763E1A%22%2F%3E%3Cpath%20d%3D%22M9%2013.119L9.73094%2016.616L9.27231%2016.96L9.96026%2017.4903L9.42997%2017.8916L10.1179%2018.5079L9.68795%2018.8232L10.6912%2019.9841L15.2059%2018.6656L18.402%2015.9854L10.0893%209.87988L9%2013.119Z%22%20fill%3D%22%23763E1A%22%2F%3E%3Cpath%20d%3D%22M29.323%2019.9842L24.8084%2018.6656L26.1699%2020.7152L24.1348%2024.6565L26.8292%2024.6135H30.8423L29.323%2019.9842Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M15.2061%2018.6656L10.6914%2019.9842L9.18652%2024.6135H13.1852L15.8654%2024.6565L13.8445%2020.7152L15.2061%2018.6656Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M21.3258%2020.9301L21.6125%2015.9855L22.9167%2012.4741H17.0835L18.4021%2015.9855L18.6887%2020.9301L18.8034%2022.478V26.3191H21.1969L21.2112%2022.478L21.3258%2020.9301Z%22%20fill%3D%22%23F5841F%22%2F%3E%3C%2Fsvg%3E",supportMobile:!0,switchChain:N,disabled:()=>!1,injected:()=>window.ethereum,connector:(e,t)=>he(e,t),disconnect:()=>m(void 0,void 0,void 0,(function*(){const e=O.getState().provider;e&&function(e){m(this,void 0,void 0,(function*(){try{return I(e,{method:"wallet_revokePermissions",params:[{eth_accounts:{}}]})}catch(e){console.error(e)}}))}(e)}))},JM=Object.assign({MetamaskWallet:KM},ZM),XM=Object.values(ZM),YM=Object.values(JM),QM=Object.assign(Object.assign({},kM),{disabled:()=>!1,type:exports.WalletType.openBlockIframe,connector:$}),eN=[DM.showName,KM.showName,hM.showName];function tN(e){return m(this,void 0,void 0,(function*(){const t=[],n=[],r=_();[...YM,...null!=e?e:[]].forEach((e=>{const a=`${e.type}-${e.showName}`;let i=!1;if(i=r?!1===e.supportMobile:!1===e.supportExtension,i)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((()=>m(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()))),O.getState().setDisabledWalletKeyList(t)}))}function nN(e,t){return!e||!t||t.includes(e)}function rN({PORTIS_ID:e,chainId:t,includes:n,excludes:r,excludeNames:a,keysSort:i,mobileKeysSort:s,lastConnectedFirst:o,showAllInjected:c,afterHooks:l,extendsWalleObject:u,showNotSupport:d,eip6963WalletList:p,eip6963IgnoreIncludes:h,supportChainIds:m}={}){var f,y,b;if("undefined"==typeof window)return[];const g=_(),v=(!n||n.includes(exports.WalletType.injected))&&(!r||!r.includes(exports.WalletType.injected)),w={PORTIS_ID:e},C=null==p?void 0:p.filter((e=>![WI,ZI].includes(e.info.rdns)));let x,E=[],k=!1;const T=Object.assign({},JM);u&&Object.entries(u).forEach((([e,t])=>{T[e]=t}));const P=Object.values(T),A=P.filter((e=>e.type!==exports.WalletType.injected));if(v){if(g&&(XM.some((e=>!!(e.injected&&e.injected()&&nN(t,e.supportChains))&&(x=Object.assign({},e),!0))),!x&&(null==C?void 0:C.length))){const[e]=C,n=XM.find((t=>t.type===KI[e.info.rdns])),r=JI(e);n?nN(t,n.supportChains)&&(x=Object.assign(Object.assign(Object.assign({},n),r),{type:n.type,logo:n.logo})):x=r}x||(x=KM),x.connector=null!==(y=null!==(f=x.connectorInjected)&&void 0!==f?f:x.connector)&&void 0!==y?y:(e,t)=>S(void 0,t),x.switchChain=null!==(b=x.switchChain)&&void 0!==b?b:N,E.push(x),x.injected?k=x.injected():x.disabled&&(k=!x.disabled())}const D=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(w))return!1;if(t&&e.supportChains&&!e.supportChains.includes(t))return!1;if(t&&!g&&e.supportChainsPC&&!e.supportChainsPC.includes(t))return!1;if(m&&(e.supportChains||e.supportChainsPC)){const t=m.some((t=>{var n,r;return!!(null===(n=e.supportChains)||void 0===n?void 0:n.includes(t))||!(g||!(null===(r=e.supportChainsPC)||void 0===r?void 0:r.includes(t)))}));if(!t)return!1}return!!(!n||n.includes(e.type)||h&&e.isEip6963)};if(g)k?D(DM)&&E.push(DM):P.forEach((e=>!(!D(e)||!e.supportMobile&&!d||e.showName===(null==x?void 0:x.showName))&&(E.push(e),!0)));else{let e=[];A.forEach((t=>{if(!D(t))return!1;if(!1===t.supportExtension)if(t.injected){if(!d&&!c)return!1}else if(!d)return!1;return e.push(t),!0})),E=[...E,...e]}g&&k||!(null==C?void 0:C.length)||C.forEach((e=>{const{info:t}=e,n=KI[t.rdns],r=JI(e);let a=!1;n&&(a=E.some(((e,t)=>e.type===n&&(E.splice(t,1,Object.assign(Object.assign(Object.assign({},e),r),{type:e.type,logo:e.logo})),!0))),a||(a=XM.some((e=>e.type===n&&(D(e)&&E.push(Object.assign(Object.assign(Object.assign({},e),r),{type:e.type,logo:e.logo})),!0))))),a||E.push(r)}));const O=g&&null!=s?s:i;if(O){let e=O.map((e=>{const t=T[e];if(!t)throw new Error(`unknown key ${e}`);return t.showName}));g?k?e=[KM.showName,...e.filter((e=>e!==KM.showName))]:(e=e.filter((e=>!eN.includes(e))),e=[...eN,...e]):e.includes(KM.showName)||(e=[KM.showName,...e]),E.sort(((t,n)=>{let r=e.indexOf(t.showName),a=e.indexOf(n.showName);return-1===r&&(r=999),-1===a&&(a=999),r-a}))}if(o&&"undefined"!=typeof window&&localStorage.getItem(HI)){const e=localStorage.getItem(HI);E.sort(((t,n)=>(e===t.type?1:2)-(e===n.type?1:2)))}return l&&(E=l({isMobile:g,PORTIS_ID:e,chainId:t,includes:n,excludes:r,excludeNames:a,showAllInjected:c,hasInjectedWallet:k,walletList:E,showNotSupport:d})),E.forEach((e=>{e.getPackage&&e.getPackage()})),E}function aN(){return m(this,void 0,void 0,(function*(){if("undefined"!=typeof window&&window.top!==window){if(yield(yield Y()).getIsCyber())return LM;if(yield(yield q()).getIsSafe())return FM;if(yield z())return QM}}))}var iN=[{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"}];function sN(){return e=>({getCallsStatus:t=>CS(e,t),getCapabilities:t=>GS(e,t),sendCalls:t=>wS(e,t),showCallsStatus:t=>HS(e,t),waitForCallsStatus:t=>xS(e,t),writeContracts:t=>async function(e,t){const n=t.contracts.map((e=>{const{address:t,abi:n,functionName:r,args:a,value:i}=e;return{data:wD({abi:n,functionName:r,args:a}),to:t,value:i}}));return fA(e,wS,"sendCalls")({...t,calls:n})}(e,t)})}const oN={block:yF({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=hF(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?JA(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:mF({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?JA(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:bS({format:e=>({l1GasPrice:e.l1GasPrice?JA(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?JA(e.l1GasUsed):null,l1Fee:e.l1Fee?JA(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})};const cN={blockTime:2e3,contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:oN,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&&!eD(t))throw new Z_({address:t});if(n&&!eD(n))throw new Z_({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:a,isSystemTx:i,mint:s,to:o,value:c}=e;return nD(["0x7e",NO([t,r,o??"0x",s?QA(s):"0x",c?QA(c):"0x",a?QA(a):"0x",i?"0x1":"0x",n??"0x"])])}(e):OS(e,t)}}},lN=MS({...cN,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:{...cN.contracts,disputeGameFactory:{1:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{1:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{1:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{1:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),uN=11155111,dN=MS({...cN,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:{...cN.contracts,disputeGameFactory:{[uN]:{address:"0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"}},l2OutputOracle:{[uN]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[uN]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[uN]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:uN});var pN;function hN(){const{provider:e}=O.getState();if(!e)throw new Error("provider is undefined");return e}exports.WatchResult=void 0,(pN=exports.WatchResult||(exports.WatchResult={}))[pN.Failed=0]="Failed",pN[pN.Success=1]="Success",pN[pN.Warning=2]="Warning";const mN=e=>m(void 0,void 0,void 0,(function*(){const{value:t,from:n,to:r,data:a}=e,i={from:n,to:r,value:t,data:a};t&&!/^0x0*$/.test(t)||delete i.value;const s=hN();try{return(yield s.estimateGas(i)).add(5e4)}catch(t){s.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})),fN=e=>m(void 0,void 0,void 0,(function*(){var t,n,r,a,i;const s=hN(),o=O.getState().chainId,c=yield s.send("eth_chainId",[]);if(Number(c)!==Number(o))throw new Error("Network not matched, please refresh page and try again.");const l=null===(t=O.getState().connected)||void 0===t?void 0:t.wallet;if(null===(n=null==l?void 0:l.notSupported)||void 0===n?void 0:n.sendTransaction)throw new Error("Not supported sendTransaction.");if(null===(r=null==l?void 0:l.contract)||void 0===r?void 0:r.sendTransaction)return l.contract.sendTransaction(e);const u=null===(a=null==l?void 0:l.getSupportEip5792ChainIds)||void 0===a?void 0:a.call(l);if(null==u?void 0:u.includes(o)){let t=lN,n="https://api.developer.coinbase.com/rpc/v1/base/pE-_rU5q_IliJGUVkVI-82ZoyiCeCSFx";84532===o&&(t=dN,n="https://api.developer.coinbase.com/rpc/v1/base-sepolia/pE-_rU5q_IliJGUVkVI-82ZoyiCeCSFx");const r=WS({chain:t,transport:ZS(s.provider)}).extend(sN()),a=yield r.sendCalls({account:e.from,calls:[e],capabilities:{paymasterService:{url:n}}}),i=()=>new Promise((e=>{setTimeout((()=>m(void 0,void 0,void 0,(function*(){var t;const n=yield r.getCallsStatus({id:a.id});if("pending"===n.status){const t=yield i();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.id)}))),700)}));return{hash:yield i()}}try{const t=yield s.getSigner().sendTransaction(e);if((null===(i=O.getState().connected)||void 0===i?void 0:i.isSafe)&&O.getState().account){const e=yield q(),n=yield e.getSafeTxHash(O.getState().chainId,O.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 yN(e,t,n){if(!jI(e)||e===c.AddressZero)throw Error(`Invalid 'address' parameter '${e}'.`);const r=null!=n?n:hN(),a=O.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 bN=new Map;function gN(e){var t,n,r;return m(this,void 0,void 0,(function*(){const a=hN(),i=null===(t=O.getState().connected)||void 0===t?void 0:t.wallet,s=O.getState().account;if(null===(n=null==i?void 0:i.notSupported)||void 0===n?void 0:n.sign)throw new Error("Not supported sign.");return(null===(r=null==i?void 0:i.contract)||void 0===r?void 0:r.sign)?i.contract.sign(e):a.send("eth_sign",[s,e])}))}exports.ALCHEMY_EVENT_TYPES=yT,exports.ALCHEMY_MINED_TRANSACTIONS_EVENT_TYPE=fT,exports.ALCHEMY_PENDING_TRANSACTIONS_EVENT_TYPE=mT,exports.BN=Kw,exports.BaseError=La,exports.BigNumber=nC,exports.Core=class{constructor(e){this.isOpenBlockIframe=!1,this.isSafeIframe=!1;const{providerConfig:t,walletListConfig:n,cacheKey:r}=e;this.providerConfig=t,YI=t,"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&&VI.test(e.uuid)&&"com.risechain.wallet"!==e.rdns&&O.setState((n=>{const r=[...n.eip6963WalletList];return r.some((t=>t.info.rdns===e.rdns))?{}:{eip6963WalletList:[...r,t.detail]}}))}catch(t){console.error(t,e)}})),window.dispatchEvent(new Event("eip6963:requestProvider"))),this.walletListConfig=n,this.setDisabledState(),this.connectController=new qI({cacheKey:Object.assign(Object.assign({},XI),r),rpcUrl:t.rpcUrl})}setDisabledState(){var e,t;return tN((null===(e=this.walletListConfig)||void 0===e?void 0:e.extendsWalleObject)?Object.values(null===(t=this.walletListConfig)||void 0===t?void 0:t.extendsWalleObject):void 0)}setWalletListConfig(e){this.walletListConfig=Object.assign(Object.assign({},this.walletListConfig),e)}autoConnect(e){var t;return m(this,void 0,void 0,(function*(){try{const n=e=>this.connectToWallet(e,void 0,{isAutoConnect:!0}),r=yield aN();if(r)return n(r);if(!O.getState().connected){const r=this.connectController.getAutoCacheType(),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 i=_()?a.find((e=>{var t;return null===(t=e.injected)||void 0===t?void 0:t.call(e)})):void 0;if(i)return n(i);this.providerConfig.rpcUrl&&O.getState().setRpcUrlProvider(this.providerConfig.rpcUrl,this.providerConfig.chainId)}}catch(e){console.error(e)}}))}setRpcUrl(e){this.connectController.setRpcUrl(e)}getWalletList(e,t){var n;return rN(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 m(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(O.getState().disabledWalletKeyList.includes(`${e.type}-${e.showName}`)||!e.connector&&!e.disabled&&!e.injected){let{link:t,supportExtension:n,supportMobile:r}=e;if(!1===n&&r&&!_())return!0;if(k()?t=e.mobileAndroidDeepLink||e.mobileDeepLink||e.link:A()&&(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=RE,exports.DEFAULT_NETWORK=jE,exports.DefaultJsonRpcProvider=Ia,exports.EthersEvent=class extends bT{get fromAddress(){const e=this.tag.split(":");if(e[0]===mT)return e[1]&&"*"!==e[1]?CT(e[1]):void 0}get toAddress(){const e=this.tag.split(":");if(e[0]===mT)return e[2]&&"*"!==e[2]?CT(e[2]):void 0}get hashesOnly(){const e=this.tag.split(":");if(yT.includes(e[0]))return e[3]&&"*"!==e[3]?"true"===e[3]:void 0}get includeRemoved(){const e=this.tag.split(":");if(e[0]===fT)return e[2]&&"*"!==e[2]?"true"===e[2]:void 0}get addresses(){const e=this.tag.split(":");if(e[0]===fT)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=$E,exports.EventEmitter=xn,exports.FixedNumber=bC,exports.HD_PATH_LIST=[{path:"m/44'/60'/x'/0/0",name:"Ledger Live"},{path:"m/44'/60'/0'/x",name:"Legacy"}],exports.Hash=T_,exports.HttpRequestError=_c,exports.IS_BROWSER=xk,exports.InvalidAddressError=Ti,exports.Logger=ha,exports.OpenBlockIframeWallet=QM,exports.Q=lr,exports.SUPPORTED_CHAIN_ID=pM,exports.Utf8ErrorFuncs=ga,exports.VERSION=jk,exports.X=function(){return function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t}()},exports.Z=function(e,t,n){return{id:n||lr(),jsonrpc:"2.0",method:e,params:t||[]}},exports.__awaiter=m,exports.__awaiter$1=ME,exports._fetchData=Oa,exports._toEscapedUtf8String=function(e,t){return'"'+va(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?Ca(e):Ca(55296+((e-=65536)>>10&1023))+Ca(56320+(1023&e))})).join("")+'"'},exports._toUtf8String=xa,exports._tslib=x,exports.abytes=b_,exports.aexists=g_,exports.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");y_(e.outputLen),y_(e.blockLen)},exports.allWalletList=YM,exports.allWalletObject=JM,exports.anumber=y_,exports.approve=(e,t,n)=>m(void 0,void 0,void 0,(function*(){const r=yN(e,iN).interface.encodeFunctionData("approve",[t,n]),a={from:O.getState().account,to:e,data:r,value:"0x0",gasLimit:void 0},i=yield mN(a);return i&&(a.gasLimit=i),yield fN(a)})),exports.browserPonyfill=pP,exports.call=au,exports.clean=w_,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)&&wC.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 i=[];for(;n.length;){if(n.length<=3){i.unshift(n);break}{const e=n.length-3;i.unshift(n.substring(e)),n=n.substring(0,e)}}return r+i.join(",")+a},exports.commonjsGlobal=be,exports.concat=os,exports.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];b_(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const a=e[t];n.set(a,r),r+=a.length}return n},exports.connect=function({appName:e,appLogoUrl:t,appId:n}){return m(this,void 0,void 0,(function*(){return QI&&eM||(QI||(QI=new RI({name:e,icon:t,appId:n})),void 0===eM&&(eM=yield Promise.race([QI.start(),new Promise((e=>setTimeout(e,300)))]))),{app:QI,cyberAccount:eM}}))},exports.connectOpenBlockIframe=$,exports.convertTransactionType=function(e,t,n){return m(this,void 0,void 0,(function*(){const r=t;if(!n)return r;r.type=GI;const a=yield function(e){return m(this,void 0,void 0,(function*(){if(void 0!==$I[e])return $I[e];const t=O.getState().provider;if(!t)return!1;const n=void 0!==(yield t.getBlock("latest")).baseFeePerGas;return $I[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=zI)}return r}))},exports.convertWeb3Provider=F,exports.createProvider=function(e){var t,n,r;return m(this,void 0,void 0,(function*(){const{rpcUrl:i,JsonRpcProvider:s=Ia}=e,o=null!==(t=e.chainId)&&void 0!==t?t:1,c=rw(o),l=null!==(r=null===(n=e.alchemyParams)||void 0===n?void 0:n.apiKeyObject)&&void 0!==r?r:{},u=tI(o,l),d=l[o];if(!d)throw new Error(`ChainId ${o} is not support`);const p=yield eP({apiKey:d,chain:c,signer:u});const h=new class extends s{constructor(e,t){super(e,t),this.smartAccountClient=p}getSigner(){const e=p.account.address;return new JS(h,e,0,p,u)}disconnect(){return u.disconnect()}listAccounts(){return m(this,void 0,void 0,(function*(){return[p.account.address]}))}getAddress(){const e=p.account.address;return Promise.resolve(a.getAddress(e))}}(i,o);return h}))},exports.decode=ra,exports.decode$1=e=>Hn((e=>In(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))))(e)),exports.decodeErrorResult=rc,exports.deepCopy=ck,exports.eB=function(e){var t=ea(),n=ta(!0,e);if(t){var r=document.createElement("a");r.href=n,document.body.appendChild(r),r.click(),document.body.removeChild(r)}},exports.eD=ea,exports.eI={CLOSE_MODAL:{code:100001,message:"[binance-w3w] User closed modal"},REJECT_SESSION:{code:100002,message:"[binance-w3w] User rejected connection"},PROVIDER_NOT_READY:{code:100003,message:"[binance-w3w] Provider is not ready"},CONNECTING:{code:100004,message:"[binance-w3w] Already processing session request. Please wait"},CONNECTED:{code:100005,message:"[binance-w3w] Already connected"}},exports.eM=na,exports.eN=function(){if(Xr){var e=function(){var e=Yr("name","og:site_name","og:title","twitter:title");return e||(e=document.title),e}(),t=Yr("description","og:description","twitter:description","keywords"),n=location.origin,r=function(){for(var e=document.getElementsByTagName("link"),t=[],n=0;n<e.length;n++){var r=e[n],a=r.getAttribute("rel");if(a&&a.toLowerCase().indexOf("icon")>-1){var i=r.getAttribute("href");if(i)if(-1===i.toLowerCase().indexOf("https:")&&-1===i.toLowerCase().indexOf("http:")&&0!==i.indexOf("//")){var s=location.protocol+"//"+location.host;if(0===i.indexOf("/"))s+=i;else{var o=location.pathname.split("/");o.pop(),s+=o.join("/")+"/"+i}t.push(s)}else if(0===i.indexOf("//")){var c=location.protocol+i;t.push(c)}else t.push(i)}}return t}();return{description:t,url:n,icons:r,name:e}}},exports.eP=Qr,exports.eR=Jr,exports.eT={REJECT_ERR:{code:200001,message:"[binance-w3w] User rejected the operation"},METHOD_NOT_SUPPORT:{code:200002,message:"[binance-w3w] Does not support calling method"},MISSING_RESPONSE:{code:200003,message:"[binance-w3w] Missing JSON RPC response"},INVALID_PARAM:{code:200004,message:"[binance-w3w] Invalid request param"}},exports.eU=function(){return!!navigator.userAgent.match(/Android/i)},exports.eg=function e(){var t=this;Wn(this,e),cr(this,"events",new xn),cr(this,"on",(function(e,n){return t.events.on(e,n)})),cr(this,"once",(function(e,n){return t.events.once(e,n)})),cr(this,"off",(function(e,n){return t.events.off(e,n)})),cr(this,"removeListener",(function(e,n){return t.events.removeListener(e,n)})),cr(this,"removeAllListeners",(function(){return t.events.removeAllListeners()}))},exports.eh=function(e){try{window.localStorage.removeItem(e)}catch(e){}},exports.ei=Kr,exports.ej={INTERNAL_ERR:{code:300001,message:"[binance-w3w] Internal error"}},exports.ek=ta,exports.el=function(e,t){var n=fr(vr(t));if(!n)throw new Error("Missing key: required for decryption");if(!function(e,t){var n=hr(e.data),r=hr(e.iv),a=mr(hr(e.hmac),!1),i=mr(Wr(t,br(n,r)),!1);return pr(a)===pr(i)}(e,n))return null;var r,a=hr(e.data),i=function(e,t,n){var r=new $r(t,e).decrypt(n),a=new Uint8Array(r);return qr.unpad(a)}(hr(e.iv),n,a),s=gr(i);try{r=JSON.parse(s)}catch(e){return null}return r},exports.encode=aa,exports.encodeAbiParameters=To,exports.ep=function(e){var t=null;try{var n=window.localStorage.getItem(e);n&&(t=JSON.parse(n))}catch(e){t=null}return t},exports.eu=function(e,t,n){var r=fr(vr(t)),a=fr(vr(n||Kr(128))),i=mr(a,!1),s=function(e){return fr(Buffer.from(e,dr))}(JSON.stringify(e)),o=function(e,t,n){var r=new $r(t,e),a=qr.pad(n),i=r.encrypt(a);return new Uint8Array(i)}(a,r,s);return{data:mr(o,!1),hmac:mr(Wr(r,br(o,a)),!1),iv:i}},exports.ev=function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}},exports.eventemitter3=Cn,exports.fetchJson=Fa,exports.formatEther=function(e){return xC(e,18)},exports.formatUnits=xC,exports.fromHex=lk,exports.getAlchemyConnector=fe,exports.getAlchemyEventTag=function(e){if(!gT(e))throw new Error("Event tag requires AlchemyEventType");if(e.method===exports.AlchemySubscription.PENDING_TRANSACTIONS)return function(e){const t=vT(e.fromAddress),n=vT(e.toAddress),r=wT(e.hashesOnly);return mT+":"+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=>vT(e.to)+","+vT(e.from))).join("|")}(e.addresses),n=wT(e.includeRemoved),r=wT(e.hashesOnly);return fT+":"+t+":"+n+":"+r}(e);throw new Error(`Unrecognized AlchemyFilterEvent: ${e}`)},exports.getAlchemyHttpUrl=GE,exports.getAlchemyPackage=re,exports.getAlchemySigner=tI,exports.getAlchemyWsUrl=function(e,t){return`wss://${e}.g.alchemy.com/v2/${t}`},exports.getAugmentedNamespace=ve,exports.getBinanceConnector=pe,exports.getBinancePackage=ee,exports.getBloctoConnector=ie,exports.getBloctoPackage=J,exports.getChainNameByChainId=e=>{switch(Number(e)){case 1:case 5:return"eth";case 137:case nM:return"polygon";case 56:case 97:return"bsc";case rM:case aM:return"rangers";case iM:return"scroll";case sM:case oM:return"arbitrum";case cM:case lM:return"avalanche";case 322:case 321:return"kcc";case 65:case 66:return"okc";case uM:case dM:return"platon";default:return"polygon"}},exports.getContract=yN,exports.getCyberAccount=()=>eM,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=ue,exports.getCyberPackage=Y,exports.getDefaultExportFromCjs=ge,exports.getENVByChainId=e=>{switch(Number(e)){case 1:case 137:case 56:case rM:case oM:case lM:case 321:case dM:case 66:return"prod";default:return"test"}},exports.getEstimateGas=mN,exports.getGasPrice=()=>m(void 0,void 0,void 0,(function*(){const e=hN();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=q,exports.getIsAndroid=k,exports.getIsCyber=function(){var e,t,n,r;return m(this,void 0,void 0,(function*(){const a=YI;if(eM)return!0;try{return QI||((null===(e=null==a?void 0:a.cyberParams)||void 0===e?void 0:e.appId)||console.warn("cyberParams.appId is required"),QI=new RI({name:null!==(t=null==a?void 0:a.appName)&&void 0!==t?t:"DODO",icon:null!==(n=null==a?void 0:a.appLogoUrl)&&void 0!==n?n:"https://app.dodoex.io/DODO.svg",appId:null===(r=null==a?void 0:a.cyberParams)||void 0===r?void 0:r.appId})),eM=yield Promise.race([QI.start(),new Promise((e=>setTimeout(e,400)))]),!!eM}catch(e){return!1}}))},exports.getIsIOS=A,exports.getIsMobile=_,exports.getIsOpenBlockIframe=z,exports.getIsolatedEnvironmentWallet=aN,exports.getLedgerUSBPackage=H,exports.getMetamaskConnector=he,exports.getMetamaskPackage=te,exports.getOwnerProvider=function(){if(!window.ethereum)throw new Error("Method not implemented.");return new e.Web3Provider(window.ethereum)},exports.getPortisConnector=se,exports.getPortisPackage=W,exports.getProviderByChain=function(t,n){return m(this,void 0,void 0,(function*(){if(!t||t===O.getState().chainId&&O.getState().provider)return O.getState().provider;if(bN.has(t))return bN.get(t);const r=new e.JsonRpcProvider(n,t);return bN.set(t,r),r}))},exports.getRainbowConnectPackage=X,exports.getRainbowConnector=le,exports.getRiseConnector=ye,exports.getRisePackage=ae,exports.getSocialLoginConnector=me,exports.getSocialLoginPackage=ne,exports.getUAuthPackage=V,exports.getUniPassConnector=de,exports.getUniPassPackage=Q,exports.getUrl=Ua,exports.getWalletConnectConnector=ce,exports.getWalletConnectPackage=K,exports.getWalletDisabledState=tN,exports.getWalletLinkConnector=oe,exports.getWalletLinkPackage=Z,exports.getWalletList=rN,exports.getWindow=D,exports.hash=we,exports.inherits_browser=ke,exports.injectedConnect=S,exports.isAddress=ss,exports.isAddress$1=jI,exports.isAlchemyEvent=gT,exports.isHex=$a,exports.isLargeIOS=P,exports.isSmallIOS=T,exports.isSupportWebHid=E,exports.keccak256=Vw,exports.logWarn=function(e,...t){Rk.warn(e,t)},exports.m=hP,exports.minimalisticAssert=xe,exports.noop=function(){},exports.parseEther=function(e){return EC(e,18)},exports.parseUnits=EC,exports.personalSign=function(e,t){var n,r,a;return m(this,void 0,void 0,(function*(){const i=hN(),s=null===(n=O.getState().connected)||void 0===n?void 0:n.wallet;if(null===(r=null==s?void 0:s.notSupported)||void 0===r?void 0:r.personalSign)throw new Error("Not supported personalSign.");return(null===(a=null==s?void 0:s.contract)||void 0===a?void 0:a.personalSign)?s.contract.personalSign(e,t):i.getSigner().signMessage(e)}))},exports.poll=function(e,t){return t||(t={}),null==(t=r.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,i=!1;const s=()=>!i&&(i=!0,a&&clearTimeout(a),!0);t.timeout&&(a=setTimeout((()=>{s()&&r(new Error("timeout"))}),t.timeout));const o=t.retryLimit;let c=0;!function a(){return e().then((function(e){if(void 0!==e)s()&&n(e);else if(t.oncePoll)t.oncePoll.once("poll",a);else if(t.onceBlock)t.onceBlock.once("block",a);else if(!i){if(c++,c>o)return void(s()&&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){s()&&r(e)}))}()}))},exports.randomBytes=function(e=32){if(f_&&"function"==typeof f_.getRandomValues)return f_.getRandomValues(new Uint8Array(e));if(f_&&"function"==typeof f_.randomBytes)return Uint8Array.from(f_.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")},exports.registerNetworkWithMetamask=N,exports.require$$1=Zw,exports.sendTransaction=fN,exports.sha256=OF,exports.sha3=Hw,exports.sign=gN,exports.signTransaction=function(e){return m(this,void 0,void 0,(function*(){const t=yield r.resolveProperties(e);delete t.from;const n=Vw(l.serialize(t)),a=yield gN(n);return l.serialize(t,a)}))},exports.signTypedData=function({account:e,typedData:t}){var n,r,a;return m(this,void 0,void 0,(function*(){const i=hN(),s=null===(n=O.getState().connected)||void 0===n?void 0:n.wallet;if(null===(r=null==s?void 0:s.notSupported)||void 0===r?void 0:r.signTypedData)throw new Error("Not supported sign.");if(null===(a=null==s?void 0:s.contract)||void 0===a?void 0:a.signTypedData)return s.contract.signTypedData({account:e,typedData:t});try{if(i){const n=yield i.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=XM,exports.standaloneListObject=ZM,exports.stringify=ac,exports.supportChains=tM,exports.toBytes=k_,exports.toHex=uk,exports.toUtf8Bytes=wa,exports.toUtf8CodePoints=function(e,t=exports.UnicodeNormalizationForm.current){return va(wa(e,t))},exports.toUtf8String=Ea,exports.useWalletStore=O,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 i;return m(this,void 0,void 0,(function*(){const s=hN();for(;!t.killSwitch;){try{if(null===(i=O.getState().connected)||void 0===i?void 0:i.isSafe){const t=yield q(),n=yield t.getSafeTxStatus(O.getState().chainId,e,O.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,i]=yield Promise.all([a?a(e):s.getTransactionReceipt(e),s.getTransactionCount(null!=r?r:"")]);let o;if(console.log("[TX Watch] Web3",t,"/Current Nonce ",i,"/TX Nonce",n),t&&(o=t.status?exports.WatchResult.Success:exports.WatchResult.Failed),void 0===o&&void 0!==n&&i>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}))},exports.xB=function(e){return hr(e).buffer},exports.xK=function(e){var t="0x0";return"number"==typeof e&&(t="0x".concat(e.toString(16))),"string"==typeof e&&(t=e.startsWith("0x")?e:"0x0"),t},exports.xM=function(e,t){return mr(new Uint8Array(e),!t)},exports.xg=function(){return("undefined"==typeof process?"undefined":nr(process))<"u"&&nr(process.versions)<"u"&&nr(process.versions.node)<"u"},exports.xl=["eth_requestAccounts","eth_accounts","eth_chainId","eth_signTransaction","eth_sendTransaction","eth_sign","personal_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_watchAsset"];
28
+ const qP=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),VP=(e,t)=>e<<32-t|e>>>t;function WP(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)),$P(e),e}new Uint8Array(new Uint32Array([287454020]).buffer)[0];class ZP{clone(){return this._cloneInto()}}function KP(e){const t=t=>e().update(WP(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const JP=(e,t,n)=>e&t^~e&n,XP=(e,t,n)=>e&t^e&n^t&n;class YP extends ZP{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=qP(this.buffer)}update(e){HP(this);const{view:t,buffer:n,blockLen:r}=this,a=(e=WP(e)).length;for(let i=0;i<a;){const s=Math.min(r-this.pos,a-i);if(s!==r)n.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===r&&(this.process(t,0),this.pos=0);else{const t=qP(e);for(;r<=a-i;i+=r)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){HP(this),function(e,t){$P(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:i}=this;t[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>r-i&&(this.process(n,0),i=0);for(let e=i;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),i=BigInt(4294967295),s=Number(n>>a&i),o=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,s,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),a),this.process(n,0);const s=qP(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++)s.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:i,pos:s}=this;return e.length=r,e.pos=s,e.finished=a,e.destroyed=i,r%t&&e.buffer.set(n),e}}const QP=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]),eA=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),tA=new Uint32Array(64);class nA extends YP{constructor(){super(64,32,8,!1),this.A=0|eA[0],this.B=0|eA[1],this.C=0|eA[2],this.D=0|eA[3],this.E=0|eA[4],this.F=0|eA[5],this.G=0|eA[6],this.H=0|eA[7]}get(){const{A:e,B:t,C:n,D:r,E:a,F:i,G:s,H:o}=this;return[e,t,n,r,a,i,s,o]}set(e,t,n,r,a,i,s,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|a,this.F=0|i,this.G=0|s,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)tA[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=tA[e-15],n=tA[e-2],r=VP(t,7)^VP(t,18)^t>>>3,a=VP(n,17)^VP(n,19)^n>>>10;tA[e]=a+tA[e-7]+r+tA[e-16]|0}let{A:n,B:r,C:a,D:i,E:s,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(VP(s,6)^VP(s,11)^VP(s,25))+JP(s,o,c)+QP[e]+tA[e]|0,u=(VP(n,2)^VP(n,13)^VP(n,22))+XP(n,r,a)|0;l=c,c=o,o=s,s=i+t|0,i=a,a=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,a=a+this.C|0,i=i+this.D|0,s=s+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,a,i,s,o,c,l)}roundClean(){tA.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const rA=KP((()=>new nA));class aA{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=rA(t),r=zP.from(n).toString("hex"),a=zP.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=()=>GP(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 iA=e=>Buffer.from(e).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),sA=()=>{const e=new Uint8Array(32);return crypto.getRandomValues(e),e.buffer};class oA{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 oP;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:iA(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 oP;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 oP;const{wallets:t}=await this.turnkeyClient.getWallets({organizationId:this.user.orgId}),n=await Promise.all(t.map((({walletId:e})=>this.turnkeyClient.getWalletAccounts({organizationId:this.user.orgId,walletId:e})))).then((e=>e.flatMap((e=>e.accounts)))),r=n.find((e=>e.address===this.user.address));if(!r)throw new Error(`Could not find wallet associated with ${this.user.address}`);const{activity:a}=await this.turnkeyClient.exportWallet({organizationId:this.user.orgId,type:"ACTIVITY_TYPE_EXPORT_WALLET",timestampMs:Date.now().toString(),parameters:{walletId:r.walletId,targetPublicKey:e.publicKey()}}),{exportBundle:i}=await this.pollActivityCompletion(a,this.user.orgId,"exportWalletResult"),s=await e.injectWalletExportBundle(i);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 oP;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:i}}=await this.turnkeyClient.getActivity({activityId:e.id,organizationId:t});if("ACTIVITY_STATUS_COMPLETED"===r)return i[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 xn,this.connectionConfig=lw.parse(n),this.turnkeyClient=new _P({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 cA=yv.object({connection:lw,iframeConfig:yv.object({iframeElementId:yv.string().default("turnkey-iframe"),iframeContainerId:yv.string()}),rpId:yv.string().optional(),rootOrgId:yv.string().optional().default("24c1acf5-810f-41e0-a503-d5d13fa8e830")});class lA extends oA{constructor(e){const{connection:t,iframeConfig:n,rpId:r,rootOrgId:a}=cA.parse(e),i=new OP({iframeElementId:n.iframeElementId,iframeUrl:"https://auth.turnkey.com",iframeContainer:document.getElementById(n.iframeContainerId)});super({connection:t,rootOrgId:a,stamper:i}),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:iA(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 OP({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=sA(),r=sA(),a=await PP({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=i,this.iframeContainerId=n.iframeContainerId,this.webauthnStamper=new aA({rpId:r??window.location.hostname})}}const uA=yv.object({client:yv.custom().or(cA)}).extend({sessionConfig:cP.omit({client:!0}).optional()});class dA extends dP{constructor(e){const{sessionConfig:t,...n}=uA.parse(e);let r;r="connection"in n.client?new lA(n.client):n.client,super({client:r,sessionConfig:t})}}const pA=/^tuple(?<array>(\[(\d*)\])*)$/;function hA(e){let t=e.type;if(pA.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){t+=hA(e.components[r]),r<n-1&&(t+=", ")}const r=function(e,t){const n=e.exec(t);return n?.groups}(pA,e.type);return t+=`)${r?.array??""}`,hA({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function mA(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=hA(e[r]),r!==n-1&&(t+=", ")}return t}function fA(e,t,n){const r=e[t.name];if("function"==typeof r)return r;const a=e[n];return"function"==typeof a?a:n=>t(e,n)}function yA(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new RA(e.type);return`${e.name}(${bA(e.inputs,{includeName:t})})`}function bA(e,{includeName:t=!1}={}){return e?e.map((e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${bA(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t}))).join(t?", ":","):""}function gA(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function vA(e){return gA(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const wA="2.37.0";let CA=({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,xA=`viem@${wA}`;class EA extends Error{constructor(e,t={}){const n=t.cause instanceof EA?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof EA&&t.cause.docsPath||t.docsPath,a=CA?.({...t,docsPath:r});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...xA?[`Version: ${xA}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=wA}walk(e){return kA(this,e)}}function kA(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?kA(e.cause,t):t?null:e}class TA extends EA{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,name:"AbiConstructorNotFoundError"})}}class PA extends EA{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,name:"AbiConstructorParamsNotFoundError"})}}class AA extends EA{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join("\n"),{metaMessages:[`Params: (${bA(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`],name:"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 _A extends EA{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class DA extends EA{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n"),{name:"AbiEncodingArrayLengthMismatchError"})}}class OA extends EA{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${vA(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class FA extends EA{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n"),{name:"AbiEncodingLengthMismatchError"})}}class SA extends EA{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,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class IA extends EA{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,name:"AbiFunctionNotFoundError"})}}class MA extends EA{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${yA(e.abiItem)}\`, and`,`\`${t.type}\` in \`${yA(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class NA extends EA{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`,{name:"BytesSizeMismatchError"})}}class UA extends EA{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t,name:"InvalidAbiEncodingType"})}}class LA extends EA{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t,name:"InvalidAbiDecodingType"})}}class BA extends EA{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n"),{name:"InvalidArrayError"})}}class RA extends EA{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n"),{name:"InvalidDefinitionTypeError"})}}class jA extends EA{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class GA extends EA{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}class zA extends EA{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.`,{name:"InvalidBytesLengthError"})}}function $A(e,{dir:t,size:n=32}={}){return"string"==typeof e?HA(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new GA({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let a=0;a<n;a++){const i="right"===t;r[i?a:n-a-1]=e[i?a:e.length-a-1]}return r}(e,{dir:t,size:n})}function HA(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new GA({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}class qA extends EA{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})`}`,{name:"IntegerOutOfRangeError"})}}class VA extends EA{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.`,{name:"InvalidBytesBooleanError"})}}class WA extends EA{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function ZA(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 KA(e,{size:t}){if(vA(e)>t)throw new WA({givenSize:vA(e),maxSize:t})}function JA(e,t={}){const{signed:n}=t;t.size&&KA(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 XA(e,t={}){return Number(JA(e,t))}const YA=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function QA(e,t={}){return"number"==typeof e||"bigint"==typeof e?n_(e,t):"string"==typeof e?a_(e,t):"boolean"==typeof e?e_(e,t):t_(e,t)}function e_(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(KA(n,{size:t.size}),$A(n,{size:t.size})):n}function t_(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=YA[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(KA(r,{size:t.size}),$A(r,{dir:"right",size:t.size})):r}function n_(e,t={}){const{signed:n,size:r}=t,a=BigInt(e);let i;r?i=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(i=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof i&&n?-i-1n:0;if(i&&a>i||a<s){const t="bigint"==typeof e?"n":"";throw new qA({max:i?`${i}${t}`:void 0,min:`${s}${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?$A(o,{size:r}):o}const r_=new TextEncoder;function a_(e,t={}){return t_(r_.encode(e),t)}const i_=new TextEncoder;function s_(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=n_(e,t);return l_(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return KA(n,{size:t.size}),$A(n,{size:t.size});return n}(e,t):gA(e)?l_(e,t):u_(e,t)}const o_={zero:48,nine:57,A:65,F:70,a:97,f:102};function c_(e){return e>=o_.zero&&e<=o_.nine?e-o_.zero:e>=o_.A&&e<=o_.F?e-(o_.A-10):e>=o_.a&&e<=o_.f?e-(o_.a-10):void 0}function l_(e,t={}){let n=e;t.size&&(KA(n,{size:t.size}),n=$A(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const a=r.length/2,i=new Uint8Array(a);for(let e=0,t=0;e<a;e++){const n=c_(r.charCodeAt(t++)),a=c_(r.charCodeAt(t++));if(void 0===n||void 0===a)throw new EA(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);i[e]=16*n+a}return i}function u_(e,t={}){const n=i_.encode(e);return"number"==typeof t.size?(KA(n,{size:t.size}),$A(n,{dir:"right",size:t.size})):n}const d_=BigInt(2**32-1),p_=BigInt(32);function h_(e,t=!1){return t?{h:Number(e&d_),l:Number(e>>p_&d_)}:{h:0|Number(e>>p_&d_),l:0|Number(e&d_)}}function m_(e,t=!1){const n=e.length;let r=new Uint32Array(n),a=new Uint32Array(n);for(let i=0;i<n;i++){const{h:n,l:s}=h_(e[i],t);[r[i],a[i]]=[n,s]}return[r,a]}const f_="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function y_(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function b_(e,...t){if(!function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function g_(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 v_(e,t){b_(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function w_(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function C_(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function x_(e,t){return e<<32-t|e>>>t}const E_=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])()?e=>e:function(e){for(let n=0;n<e.length;n++)e[n]=(t=e[n])<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;var t;return e};function k_(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e)),b_(e),e}class T_{}function P_(e){const t=t=>e().update(k_(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const A_=BigInt(0),__=BigInt(1),D_=BigInt(2),O_=BigInt(7),F_=BigInt(256),S_=BigInt(113),I_=[],M_=[],N_=[];for(let e=0,t=__,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],I_.push(2*(5*r+n)),M_.push((e+1)*(e+2)/2%64);let a=A_;for(let e=0;e<7;e++)t=(t<<__^(t>>O_)*S_)%F_,t&D_&&(a^=__<<(__<<BigInt(e))-__);N_.push(a)}const U_=m_(N_,!0),L_=U_[0],B_=U_[1],R_=(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),j_=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class G_ extends T_{constructor(e,t,n,r=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=a,y_(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}clone(){return this._cloneInto()}keccak(){E_(this.state32),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,i=n[a],s=n[a+1],o=R_(i,s,1)^n[r],c=j_(i,s,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=M_[n],i=R_(t,a,r),s=j_(t,a,r),o=I_[n];t=e[o],a=e[o+1],e[o]=i,e[o+1]=s}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]^=L_[r],e[1]^=B_[r]}w_(n)}(this.state32,this.rounds),E_(this.state32),this.posOut=0,this.pos=0}update(e){g_(this),b_(e=k_(e));const{blockLen:t,state:n}=this,r=e.length;for(let a=0;a<r;){const i=Math.min(t-this.pos,r-a);for(let t=0;t<i;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){g_(this,!1),b_(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 i=Math.min(n-this.posOut,a-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return y_(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(v_(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,w_(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:a,enableXOF:i}=this;return e||(e=new G_(t,n,r,i,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=i,e.destroyed=this.destroyed,e}}const z_=(()=>{return e=1,t=136,n=32,P_((()=>new G_(t,e,n)));var e,t,n})();function $_(e,t){const n=t||"hex",r=z_(gA(e,{strict:!1})?s_(e):e);return"bytes"===n?r:QA(r)}const H_=e=>$_(s_(e));const q_=e=>{var t;return function(e){let t=!0,n="",r=0,a="",i=!1;for(let s=0;s<e.length;s++){const o=e[s];if(["(",")",","].includes(o)&&(t=!0),"("===o&&r++,")"===o&&r--,t)if(0!==r)" "!==o?(a+=o,n+=o):","!==e[s-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===o&&["event","function",""].includes(a))a="";else if(a+=o,")"===o){i=!0;break}}if(!i)throw new EA("Unable to normalize signature.");return a}("string"==typeof e?e:"function"===(t=e).type?`function ${t.name}(${mA(t.inputs)})${t.stateMutability&&"nonpayable"!==t.stateMutability?` ${t.stateMutability}`:""}${t.outputs?.length?` returns (${mA(t.outputs)})`:""}`:"event"===t.type?`event ${t.name}(${mA(t.inputs)})`:"error"===t.type?`error ${t.name}(${mA(t.inputs)})`:"constructor"===t.type?`constructor(${mA(t.inputs)})${"payable"===t.stateMutability?" payable":""}`:"fallback"===t.type?"fallback() external"+("payable"===t.stateMutability?" payable":""):"receive() external payable")};function V_(e){return t=q_(e),H_(t);var t}const W_=V_;class Z_ extends EA{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."],name:"InvalidAddressError"})}}class K_ extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const J_=new K_(8192);function X_(e,t){if(J_.has(`${e}.${t}`))return J_.get(`${e}.${t}`);const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=$_(u_(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 i=`0x${a.join("")}`;return J_.set(`${e}.${t}`,i),i}const Y_=/^0x[a-fA-F0-9]{40}$/,Q_=new K_(8192);function eD(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Q_.has(r))return Q_.get(r);const a=!(!Y_.test(e)||e.toLowerCase()!==e&&n&&X_(e)!==e);return Q_.set(r,a),a}function tD(e){return"string"==typeof e[0]?nD(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 nD(e){return`0x${e.reduce(((e,t)=>e+t.replace("0x","")),"")}`}function rD(e,t,n,{strict:r}={}){return gA(e,{strict:!1})?oD(e,t,n,{strict:r}):sD(e,t,n,{strict:r})}function aD(e,t){if("number"==typeof t&&t>0&&t>vA(e)-1)throw new jA({offset:t,position:"start",size:vA(e)})}function iD(e,t,n){if("number"==typeof t&&"number"==typeof n&&vA(e)!==n-t)throw new jA({offset:n,position:"end",size:vA(e)})}function sD(e,t,n,{strict:r}={}){aD(e,t);const a=e.slice(t,n);return r&&iD(a,t,n),a}function oD(e,t,n,{strict:r}={}){aD(e,t);const a=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;return r&&iD(a,t,n),a}const cD=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,lD=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function uD(e,t){if(e.length!==t.length)throw new FA({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(dD({param:e[r],value:t[r]}));return n}({params:e,values:t}),r=pD(n);return 0===r.length?"0x":r}function dD({param:e,value:t}){const n=hD(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 BA(e);if(!r&&e.length!==t)throw new DA({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let a=!1;const i=[];for(let t=0;t<e.length;t++){const r=dD({param:n,value:e[t]});r.dynamic&&(a=!0),i.push(r)}if(r||a){const e=pD(i);if(r){const t=n_(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?tD([t,e]):t}}if(a)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:tD(i.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 i=t.components[a],s=dD({param:i,value:e[Array.isArray(e)?a:i.name]});r.push(s),s.dynamic&&(n=!0)}return{dynamic:n,encoded:n?pD(r):tD(r.map((({encoded:e})=>e)))}}(t,{param:e});if("address"===e.type)return function(e){if(!eD(e))throw new Z_({address:e});return{dynamic:!1,encoded:HA(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){if("boolean"!=typeof e)throw new EA(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:HA(e_(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const n=e.type.startsWith("int"),[,,r="256"]=lD.exec(e.type)??[];return function(e,{signed:t,size:n=256}){if("number"==typeof n){const r=2n**(BigInt(n)-(t?1n:0n))-1n,a=t?-r-1n:0n;if(e>r||e<a)throw new qA({max:r.toString(),min:a.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:n_(e,{size:32,signed:t})}}(t,{signed:n,size:Number(r)})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=vA(e);if(!n){let t=e;return r%32!=0&&(t=HA(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:tD([HA(n_(r,{size:32})),t])}}if(r!==Number.parseInt(n,10))throw new OA({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:HA(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=a_(e),n=Math.ceil(vA(t)/32),r=[];for(let e=0;e<n;e++)r.push(HA(rD(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:tD([HA(n_(vA(t),{size:32})),...r])}}(t);throw new UA(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function pD(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:r,encoded:a}=e[n];t+=r?32:vA(a)}const n=[],r=[];let a=0;for(let i=0;i<e.length;i++){const{dynamic:s,encoded:o}=e[i];s?(n.push(n_(t+a,{size:32})),r.push(o),a+=vA(o)):n.push(o)}return tD([...n,...r])}function hD(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const mD=e=>rD(V_(e),0,4);function fD(e){const{abi:t,args:n=[],name:r}=e,a=gA(r,{strict:!1}),i=t.filter((e=>a?"function"===e.type?mD(e)===r:"event"===e.type&&W_(e)===r:"name"in e&&e.name===r));if(0===i.length)return;if(1===i.length)return i[0];let s;for(const e of i){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&&yD(t,r)}));if(t){if(s&&"inputs"in s&&s.inputs){const t=bD(e.inputs,s.inputs,n);if(t)throw new MA({abiItem:e,type:t[0]},{abiItem:s,type:t[1]})}s=e}}return s||i[0]}function yD(e,t){const n=typeof e,r=t.type;switch(r){case"address":return eD(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)=>yD(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=>yD(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function bD(e,t,n){for(const r in e){const a=e[r],i=t[r];if("tuple"===a.type&&"tuple"===i.type&&"components"in a&&"components"in i)return bD(a.components,i.components,n[r]);const s=[a.type,i.type];if(!(!s.includes("address")||!s.includes("bytes20"))||(s.includes("address")&&s.includes("string")||!(!s.includes("address")||!s.includes("bytes")))&&eD(n[r],{strict:!1}))return s}}function gD(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}const vD="/docs/contract/encodeFunctionData";function wD(e){const{args:t}=e,{abi:n,functionName:r}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:function(e){const{abi:t,args:n,functionName:r}=e;let a=t[0];if(r){const e=fD({abi:t,args:n,name:r});if(!e)throw new IA(r,{docsPath:vD});a=e}if("function"!==a.type)throw new IA(void 0,{docsPath:vD});return{abi:[a],functionName:mD(yA(a))}}(e),a=n[0];return nD([r,("inputs"in a&&a.inputs?uD(a.inputs,t??[]):void 0)??"0x"])}const CD={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."},xD={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},ED={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class kD extends EA{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class TD extends EA{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class PD extends EA{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const AD={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 PD({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new TD({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new kD({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 kD({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 _D(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(AD);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function DD(e,t={}){void 0!==t.size&&KA(e,{size:t.size});return JA(t_(e,t),t)}function OD(e,t={}){let n=e;if(void 0!==t.size&&(KA(n,{size:t.size}),n=ZA(n)),n.length>1||n[0]>1)throw new VA(n);return Boolean(n[0])}function FD(e,t={}){void 0!==t.size&&KA(e,{size:t.size});return XA(t_(e,t),t)}function SD(e,t){const n="string"==typeof t?l_(t):t,r=_D(n);if(0===vA(n)&&e.length>0)throw new _A;if(vA(t)&&vA(t)<32)throw new AA({data:"string"==typeof t?t:t_(t),params:e,size:vA(t)});let a=0;const i=[];for(let t=0;t<e.length;++t){const n=e[t];r.setPosition(a);const[s,o]=ID(r,n,{staticPosition:0});a+=o,i.push(s)}return i}function ID(e,t,{staticPosition:n}){const r=hD(t.type);if(r){const[a,i]=r;return function(e,t,{length:n,staticPosition:r}){if(!n){const n=r+FD(e.readBytes(ND)),a=n+MD;e.setPosition(n);const i=FD(e.readBytes(MD)),s=UD(t);let o=0;const c=[];for(let n=0;n<i;++n){e.setPosition(a+(s?32*n:o));const[r,i]=ID(e,t,{staticPosition:a});o+=i,c.push(r)}return e.setPosition(r+32),[c,32]}if(UD(t)){const a=r+FD(e.readBytes(ND)),i=[];for(let r=0;r<n;++r){e.setPosition(a+32*r);const[n]=ID(e,t,{staticPosition:a});i.push(n)}return e.setPosition(r+32),[i,32]}let a=0;const i=[];for(let s=0;s<n;++s){const[n,s]=ID(e,t,{staticPosition:r+a});a+=s,i.push(n)}return[i,a]}(e,{...t,type:i},{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 i=0;if(UD(t)){const s=n+FD(e.readBytes(ND));for(let n=0;n<t.components.length;++n){const o=t.components[n];e.setPosition(s+i);const[c,l]=ID(e,o,{staticPosition:s});i+=l,a[r?n:o?.name]=c}return e.setPosition(n+32),[a,32]}for(let s=0;s<t.components.length;++s){const o=t.components[s],[c,l]=ID(e,o,{staticPosition:n});a[r?s:o?.name]=c,i+=l}return[a,i]}(e,t,{staticPosition:n});if("address"===t.type)return function(e){const t=e.readBytes(32);return[X_(t_(sD(t,-20))),32]}(e);if("bool"===t.type)return function(e){return[OD(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=FD(e.readBytes(32));e.setPosition(n+t);const r=FD(e.readBytes(32));if(0===r)return e.setPosition(n+32),["0x",32];const a=e.readBytes(r);return e.setPosition(n+32),[t_(a),32]}const i=t_(e.readBytes(Number.parseInt(a,10),32));return[i,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=Number.parseInt(t.type.split("int")[1]||"256",10),a=e.readBytes(32);return[r>48?DD(a,{signed:n}):FD(a,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,{staticPosition:t}){const n=FD(e.readBytes(32)),r=t+n;e.setPosition(r);const a=FD(e.readBytes(32));if(0===a)return e.setPosition(t+32),["",32];const i=e.readBytes(a,32),s=function(e,t={}){let n=e;return void 0!==t.size&&(KA(n,{size:t.size}),n=ZA(n,{dir:"right"})),(new TextDecoder).decode(n)}(ZA(i));return e.setPosition(t+32),[s,32]}(e,{staticPosition:n});throw new LA(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const MD=32,ND=32;function UD(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(UD);const n=hD(e.type);return!(!n||!UD({...e,type:n[1]}))}const LD=(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 BD({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]?LD(t[n]):t[n]}`)).join(", ")})`}const RD={gwei:9,wei:18},jD={ether:-9,wei:9};function GD(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[a,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${a||"0"}${i?`.${i}`:""}`}function zD(e,t="wei"){return GD(e,RD[t])}function $D(e,t="wei"){return GD(e,jD[t])}class HD extends EA{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class qD extends EA{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function VD(e){const t=Object.entries(e).map((([e,t])=>void 0===t||!1===t?null:[e,t])).filter(Boolean),n=t.reduce(((e,[t])=>Math.max(e,t.length)),0);return t.map((([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`)).join("\n")}class WD extends EA{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"),{name:"FeeConflictError"})}}class ZD extends EA{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class KD extends EA{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",VD(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class JD extends EA{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class XD extends EA{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:i,gasPrice:s,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=VD({chain:r&&`${r?.name} (id: ${r?.id})`,from:t?.address,to:u,value:void 0!==d&&`${zD(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:i,gasPrice:void 0!==s&&`${$D(s)} gwei`,maxFeePerGas:void 0!==o&&`${$D(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${$D(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",p].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class YD extends EA{constructor(e,{abi:t,args:n,contractAddress:r,docsPath:a,functionName:i,sender:s}){const o=fD({abi:t,args:n,name:i}),c=o?BD({abiItem:o,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=VD({address:r&&r,function:o?yA(o,{includeName:!0}):void 0,args:c&&"()"!==c&&`${[...Array(i?.length??0).keys()].map((()=>" ")).join("")}${c}`,sender:s});super(e.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:e,docsPath:a,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],l&&"Contract Call:",l].filter(Boolean),name:"ContractFunctionExecutionError"}),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}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=r,this.functionName=i,this.sender=s}}class QD extends EA{constructor({abi:e,data:t,functionName:n,message:r}){let a,i,s,o,c;if(t&&"0x"!==t)try{i=function(e){const{abi:t,data:n}=e,r=rD(n,0,4);if("0x"===r)throw new _A;const a=[...t||[],xD,ED].find((e=>"error"===e.type&&r===mD(yA(e))));if(!a)throw new SA(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?SD(a.inputs,rD(n,4)):void 0,errorName:a.name}}({abi:e,data:t});const{abiItem:n,errorName:r,args:a}=i;if("Error"===r)o=a[0];else if("Panic"===r){const[e]=a;o=CD[e]}else{const e=n?yA(n,{includeName:!0}):void 0,t=n&&a?BD({abiItem:n,args:a,includeFunctionName:!1,includeName:!1}):void 0;s=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(r?.length??0).keys()].map((()=>" ")).join("")}${t}`:""]}}catch(e){a=e}else r&&(o=r);a instanceof SA&&(c=a.signature,s=[`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:s,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{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=i,this.raw=t,this.reason=o,this.signature=c}}class eO extends EA{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."],name:"ContractFunctionZeroDataError"})}}class tO extends EA{constructor({data:e,message:t}){super(t||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class nO extends EA{constructor({body:e,cause:t,details:n,headers:r,status:a,url:i}){super("HTTP request failed.",{cause:t,details:n,metaMessages:[a&&`Status: ${a}`,`URL: ${i}`,e&&`Request body: ${LD(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=r,this.status=a,this.url=i}}class rO extends EA{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${n}`,`Request body: ${LD(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code,this.data=t.data}}class aO extends EA{constructor(e,{code:t,docsPath:n,metaMessages:r,name:a,shortMessage:i}){super(i,{cause:e,docsPath:n,metaMessages:r||e?.metaMessages,name:a||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=a||e.name,this.code=e instanceof rO?e.code:t??-1}}class iO extends aO{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class sO extends aO{constructor(e){super(e,{code:sO.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(sO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class oO extends aO{constructor(e){super(e,{code:oO.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(oO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class cO extends aO{constructor(e,{method:t}={}){super(e,{code:cO.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}}Object.defineProperty(cO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class lO extends aO{constructor(e){super(e,{code:lO.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")})}}Object.defineProperty(lO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class uO extends aO{constructor(e){super(e,{code:uO.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(uO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class dO extends aO{constructor(e){super(e,{code:dO.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")})}}Object.defineProperty(dO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class pO extends aO{constructor(e){super(e,{code:pO.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(pO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class hO extends aO{constructor(e){super(e,{code:hO.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(hO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class mO extends aO{constructor(e){super(e,{code:mO.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(mO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class fO extends aO{constructor(e,{method:t}={}){super(e,{code:fO.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}}Object.defineProperty(fO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class yO extends aO{constructor(e){super(e,{code:yO.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(yO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class bO extends aO{constructor(e){super(e,{code:bO.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(bO,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class gO extends iO{constructor(e){super(e,{code:gO.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(gO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class vO extends iO{constructor(e){super(e,{code:vO.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(vO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class wO extends iO{constructor(e,{method:t}={}){super(e,{code:wO.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}}Object.defineProperty(wO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class CO extends iO{constructor(e){super(e,{code:CO.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(CO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class xO extends iO{constructor(e){super(e,{code:xO.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(xO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class EO extends iO{constructor(e){super(e,{code:EO.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(EO,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class kO extends iO{constructor(e){super(e,{code:kO.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(kO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class TO extends iO{constructor(e){super(e,{code:TO.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(TO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class PO extends iO{constructor(e){super(e,{code:PO.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(PO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class AO extends iO{constructor(e){super(e,{code:AO.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(AO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class _O extends iO{constructor(e){super(e,{code:_O.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(_O,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class DO extends iO{constructor(e){super(e,{code:DO.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(DO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class OO extends iO{constructor(e){super(e,{code:OO.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(OO,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class FO extends aO{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const SO=3;function IO(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw new Error("Invalid yParityOrV value")}async function MO({hash:e,signature:t}){return n=await async function({hash:e,signature:t}){const n=gA(e)?e:QA(e),{secp256k1:r}=await Promise.resolve().then((function(){return require("./secp256k1-91126b50.cjs")})),a=(()=>{if("object"==typeof t&&"r"in t&&"s"in t){const{r:e,s:n,v:a,yParity:i}=t,s=IO(Number(i??a));return new r.Signature(JA(e),JA(n)).addRecoveryBit(s)}const e=gA(t)?t:QA(t);if(65!==vA(e))throw new Error("invalid signature length");const n=IO(XA(`0x${e.slice(130)}`));return r.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(n)})();return`0x${a.recoverPublicKey(n.substring(2)).toHex(!1)}`}({hash:e,signature:t}),X_(`0x${$_(`0x${n.substring(4)}`).substring(26)}`);var n}function NO(e,t="hex"){const n=UO(e),r=_D(new Uint8Array(n.length));return n.encode(r),"hex"===t?t_(r.bytes):r.bytes}function UO(e){return Array.isArray(e)?function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=LO(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=>UO(e)))):function(e){const t="string"==typeof e?l_(e):e,n=LO(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 LO(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 EA("Length is too large.")}function BO(e){const{chainId:t,nonce:n,to:r}=e,a=e.contractAddress??e.address,i=$_(nD(["0x05",NO([t?n_(t):"0x",a,n?n_(n):"0x"])]));return"bytes"===r?l_(i):i}async function RO(e){const{authorization:t,signature:n}=e;return MO({hash:BO(t),signature:n??t})}class jO extends EA{constructor(e,{account:t,docsPath:n,chain:r,data:a,gas:i,gasPrice:s,maxFeePerGas:o,maxPriorityFeePerGas:c,nonce:l,to:u,value:d}){const p=VD({from:t?.address,to:u,value:void 0!==d&&`${zD(d)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:i,gasPrice:void 0!==s&&`${$D(s)} gwei`,maxFeePerGas:void 0!==o&&`${$D(o)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${$D(c)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class GO extends EA{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,name:"ExecutionRevertedError"})}}Object.defineProperty(GO,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(GO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class zO extends EA{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${$D(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(zO,"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 $O extends EA{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${$D(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty($O,"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 HO extends EA{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(HO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class qO extends EA{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(qO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class VO extends EA{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(VO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class WO extends EA{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(WO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class ZO extends EA{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(ZO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class KO extends EA{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(KO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class JO extends EA{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(JO,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class XO extends EA{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${$D(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${$D(n)} gwei`:""}).`].join("\n"),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(XO,"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 YO extends EA{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function QO(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof EA?e.walk((e=>e?.code===GO.code)):e;return r instanceof EA?new GO({cause:e,message:r.details}):GO.nodeMessage.test(n)?new GO({cause:e,message:e.details}):zO.nodeMessage.test(n)?new zO({cause:e,maxFeePerGas:t?.maxFeePerGas}):$O.nodeMessage.test(n)?new $O({cause:e,maxFeePerGas:t?.maxFeePerGas}):HO.nodeMessage.test(n)?new HO({cause:e,nonce:t?.nonce}):qO.nodeMessage.test(n)?new qO({cause:e,nonce:t?.nonce}):VO.nodeMessage.test(n)?new VO({cause:e,nonce:t?.nonce}):WO.nodeMessage.test(n)?new WO({cause:e}):ZO.nodeMessage.test(n)?new ZO({cause:e,gas:t?.gas}):KO.nodeMessage.test(n)?new KO({cause:e,gas:t?.gas}):JO.nodeMessage.test(n)?new JO({cause:e}):XO.nodeMessage.test(n)?new XO({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new YO({cause:e})}function eF(e,{format:t}){if(!t)return{};const n={};return function t(r){const a=Object.keys(r);for(const i of a)i in e&&(n[i]=e[i]),r[i]&&"object"==typeof r[i]&&!Array.isArray(r[i])&&t(r[i])}(t(e||{})),n}function tF(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 nF={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function rF(e){const t={};return void 0!==e.authorizationList&&(t.authorizationList=e.authorizationList.map((e=>({address:e.address,r:e.r?n_(BigInt(e.r)):e.r,s:e.s?n_(BigInt(e.s)):e.s,chainId:n_(e.chainId),nonce:n_(e.nonce),...void 0!==e.yParity?{yParity:n_(e.yParity)}:{},...void 0!==e.v&&void 0===e.yParity?{v:n_(e.v)}:{}})))),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=>t_(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=n_(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=n_(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=n_(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=n_(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=n_(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=n_(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=nF[e.type]),void 0!==e.value&&(t.value=n_(e.value)),t}function aF(e){if(e&&0!==e.length)return e.reduce(((e,{slot:t,value:n})=>{if(66!==t.length)throw new zA({size:t.length,targetSize:66,type:"hex"});if(66!==n.length)throw new zA({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e}),{})}function iF(e){const{balance:t,nonce:n,state:r,stateDiff:a,code:i}=e,s={};if(void 0!==i&&(s.code=i),void 0!==t&&(s.balance=n_(t)),void 0!==n&&(s.nonce=n_(n)),void 0!==r&&(s.state=aF(r)),void 0!==a){if(s.state)throw new qD;s.stateDiff=aF(a)}return s}const sF=2n**256n-1n;function oF(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:a,to:i}=e,s=t?gD(t):void 0;if(s&&!eD(s.address))throw new Z_({address:s.address});if(i&&!eD(i))throw new Z_({address:i});if(void 0!==n&&(void 0!==r||void 0!==a))throw new WD;if(r&&r>sF)throw new zO({maxFeePerGas:r});if(a&&r&&a>r)throw new XO({maxFeePerGas:r,maxPriorityFeePerGas:a})}class cF extends EA{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class lF extends EA{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class uF extends EA{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${$D(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class dF extends EA{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.`,{name:"BlockNotFoundError"})}}const pF={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function hF(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?XA(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?XA(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?pF[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 e.authorizationList&&(t.authorizationList=e.authorizationList.map((e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)})))),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 mF=tF("transaction",hF);function fF(e){const t=(e.transactions??[]).map((e=>"string"==typeof e?e:hF(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 yF=tF("block",fF);async function bF(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:a}={}){const i=a??!1,s=void 0!==n?n_(n):void 0;let o=null;if(o=t?await e.request({method:"eth_getBlockByHash",params:[t,i]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[s||r,i]},{dedupe:Boolean(s)}),!o)throw new dF({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||fF)(o)}async function gF(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function vF(e,t){const{block:n,chain:r=e.chain,request:a,type:i="eip1559"}=t||{},s=await(async()=>"function"==typeof r?.fees?.baseFeeMultiplier?r.fees.baseFeeMultiplier({block:n,client:e,request:a}):r?.fees?.baseFeeMultiplier??1.2)();if(s<1)throw new cF;const o=10**(s.toString().split(".")[1]?.length??0),c=e=>e*BigInt(Math.ceil(s*o))/BigInt(o),l=n||await fA(e,bF,"getBlock")({});if("function"==typeof r?.fees?.estimateFeesPerGas){const t=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:a,type:i});if(null!==t)return t}if("eip1559"===i){if("bigint"!=typeof l.baseFeePerGas)throw new lF;const t="bigint"==typeof a?.maxPriorityFeePerGas?a.maxPriorityFeePerGas:await async function(e,t){const{block:n,chain:r=e.chain,request:a}=t||{};try{const t=r?.fees?.maxPriorityFeePerGas??r?.fees?.defaultPriorityFee;if("function"==typeof t){const r=n||await fA(e,bF,"getBlock")({}),i=await t({block:r,client:e,request:a});if(null===i)throw new Error;return i}return void 0!==t?t:JA(await e.request({method:"eth_maxPriorityFeePerGas"}))}catch{const[t,r]=await Promise.all([n?Promise.resolve(n):fA(e,bF,"getBlock")({}),fA(e,gF,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new lF;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 fA(e,gF,"getGasPrice")({}))}}async function wF(e,{address:t,blockTag:n="latest",blockNumber:r}){return XA(await e.request({method:"eth_getTransactionCount",params:[t,"bigint"==typeof r?n_(r):n]},{dedupe:Boolean(r)}))}function CF(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=>l_(e))):e.blobs,a=[];for(const e of r)a.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===n?a:a.map((e=>t_(e)))}function xF(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=>l_(e))):e.blobs,a="string"==typeof e.commitments[0]?e.commitments.map((e=>l_(e))):e.commitments,i=[];for(let e=0;e<r.length;e++){const n=r[e],s=a[e];i.push(Uint8Array.from(t.computeBlobKzgProof(n,s)))}return"bytes"===n?i:i.map((e=>t_(e)))}function EF(e,t,n){return e&t^~e&n}function kF(e,t,n){return e&t^e&n^t&n}class TF extends T_{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=C_(this.buffer)}update(e){g_(this),b_(e=k_(e));const{view:t,buffer:n,blockLen:r}=this,a=e.length;for(let i=0;i<a;){const s=Math.min(r-this.pos,a-i);if(s!==r)n.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===r&&(this.process(t,0),this.pos=0);else{const t=C_(e);for(;r<=a-i;i+=r)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){g_(this),v_(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:a}=this;let{pos:i}=this;t[i++]=128,w_(this.buffer.subarray(i)),this.padOffset>r-i&&(this.process(n,0),i=0);for(let e=i;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),i=BigInt(4294967295),s=Number(n>>a&i),o=Number(n&i),c=r?4:0,l=r?0:4;e.setUint32(t+c,s,r),e.setUint32(t+l,o,r)}(n,r-8,BigInt(8*this.length),a),this.process(n,0);const s=C_(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++)s.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:i,pos:s}=this;return e.destroyed=i,e.finished=a,e.length=r,e.pos=s,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const PF=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),AF=Uint32Array.from([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]),_F=new Uint32Array(64);class DF extends TF{constructor(e=32){super(64,e,8,!1),this.A=0|PF[0],this.B=0|PF[1],this.C=0|PF[2],this.D=0|PF[3],this.E=0|PF[4],this.F=0|PF[5],this.G=0|PF[6],this.H=0|PF[7]}get(){const{A:e,B:t,C:n,D:r,E:a,F:i,G:s,H:o}=this;return[e,t,n,r,a,i,s,o]}set(e,t,n,r,a,i,s,o){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|a,this.F=0|i,this.G=0|s,this.H=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)_F[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=_F[e-15],n=_F[e-2],r=x_(t,7)^x_(t,18)^t>>>3,a=x_(n,17)^x_(n,19)^n>>>10;_F[e]=a+_F[e-7]+r+_F[e-16]|0}let{A:n,B:r,C:a,D:i,E:s,F:o,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(x_(s,6)^x_(s,11)^x_(s,25))+EF(s,o,c)+AF[e]+_F[e]|0,u=(x_(n,2)^x_(n,13)^x_(n,22))+kF(n,r,a)|0;l=c,c=o,o=s,s=i+t|0,i=a,a=r,r=n,n=t+u|0}n=n+this.A|0,r=r+this.B|0,a=a+this.C|0,i=i+this.D|0,s=s+this.E|0,o=o+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,a,i,s,o,c,l)}roundClean(){w_(_F)}destroy(){this.set(0,0,0,0,0,0,0,0),w_(this.buffer)}}const OF=P_((()=>new DF)),FF=OF;function SF(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=FF(gA(e,{strict:!1})?s_(e):e);return"bytes"===n?r:QA(r)}(t,"bytes");return a.set([n],0),"bytes"===r?a:t_(a)}function IF(e){const{commitments:t,version:n}=e,r=e.to??("string"==typeof t[0]?"hex":"bytes"),a=[];for(const e of t)a.push(SF({commitment:e,to:r,version:n}));return a}const MF=32,NF=4096,UF=MF*NF,LF=6*UF-1-1*NF*6,BF=1;class RF extends EA{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`],name:"BlobSizeTooLargeError"})}}class jF extends EA{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class GF extends EA{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`],name:"InvalidVersionedHashSizeError"})}}class zF extends EA{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${BF}`,`Received: ${t}`],name:"InvalidVersionedHashVersionError"})}}function $F(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?l_(e.data):e.data,r=vA(n);if(!r)throw new jF;if(r>LF)throw new RF({maxSize:LF,size:r});const a=[];let i=!0,s=0;for(;i;){const e=_D(new Uint8Array(UF));let t=0;for(;t<NF;){const r=n.slice(s,s+(MF-1));if(e.pushByte(0),e.pushBytes(r),r.length<31){e.pushByte(128),i=!1;break}t++,s+=31}a.push(e)}return"bytes"===t?a.map((e=>e.bytes)):a.map((e=>t_(e.bytes)))}({data:t,to:r}),i=e.commitments??CF({blobs:a,kzg:n,to:r}),s=e.proofs??xF({blobs:a,commitments:i,kzg:n,to:r}),o=[];for(let e=0;e<a.length;e++)o.push({blob:a[e],commitment:i[e],proof:s[e]});return o}function HF(e){if(e.type)return e.type;if(void 0!==e.authorizationList)return"eip7702";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 KD({transaction:e})}async function qF(e){return XA(await e.request({method:"eth_chainId"},{dedupe:!0}))}const VF=["blobVersionedHashes","chainId","fees","gas","nonce","type"],WF=new Map;async function ZF(e,t){const{account:n=e.account,blobs:r,chain:a,gas:i,kzg:s,nonce:o,nonceManager:c,parameters:l=VF,type:u}=t,d=n?gD(n):n,p={...t,...d?{from:d?.address}:{}};let h,m;async function f(){return h||(h=await fA(e,bF,"getBlock")({blockTag:"latest"}),h)}async function y(){if(m)return m;if(a)return a.id;if(void 0!==t.chainId)return t.chainId;const n=await fA(e,qF,"getChainId")({});return m=n,m}if(l.includes("nonce")&&void 0===o&&d)if(c){const t=await y();p.nonce=await c.consume({address:d.address,chainId:t,client:e})}else p.nonce=await fA(e,wF,"getTransactionCount")({address:d.address,blockTag:"pending"});if((l.includes("blobVersionedHashes")||l.includes("sidecars"))&&r&&s){const e=CF({blobs:r,kzg:s});if(l.includes("blobVersionedHashes")){const t=IF({commitments:e,to:"hex"});p.blobVersionedHashes=t}if(l.includes("sidecars")){const t=$F({blobs:r,commitments:e,proofs:xF({blobs:r,commitments:e,kzg:s}),to:"hex"});p.sidecars=t}}if(l.includes("chainId")&&(p.chainId=await y()),(l.includes("fees")||l.includes("type"))&&void 0===u)try{p.type=HF(p)}catch{let t=WF.get(e.uid);if(void 0===t){const n=await f();t="bigint"==typeof n?.baseFeePerGas,WF.set(e.uid,t)}p.type=t?"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 f(),{maxFeePerGas:r,maxPriorityFeePerGas:i}=await vF(e,{block:n,chain:a,request:p});if(void 0===t.maxPriorityFeePerGas&&t.maxFeePerGas&&t.maxFeePerGas<i)throw new uF({maxPriorityFeePerGas:i});p.maxPriorityFeePerGas=i,p.maxFeePerGas=r}}else{if(void 0!==t.maxFeePerGas||void 0!==t.maxPriorityFeePerGas)throw new lF;if(void 0===t.gasPrice){const t=await f(),{gasPrice:n}=await vF(e,{block:t,chain:a,request:p,type:"legacy"});p.gasPrice=n}}return l.includes("gas")&&void 0===i&&(p.gas=await fA(e,KF,"estimateGas")({...p,account:d?{address:d.address,type:"json-rpc"}:d})),oF(p),delete p.parameters,p}async function KF(e,t){const{account:n=e.account}=t,r=n?gD(n):void 0;try{const{accessList:a,authorizationList:i,blobs:s,blobVersionedHashes:o,blockNumber:c,blockTag:l,data:u,gas:d,gasPrice:p,maxFeePerBlobGas:h,maxFeePerGas:m,maxPriorityFeePerGas:f,nonce:y,value:b,stateOverride:g,...v}=await ZF(e,{...t,parameters:"local"===r?.type?void 0:["blobVersionedHashes"]}),w=("bigint"==typeof c?n_(c):void 0)||l,C=function(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!eD(n,{strict:!1}))throw new Z_({address:n});if(t[n])throw new HD({address:n});t[n]=iF(r)}return t}(g),x=await(async()=>v.to?v.to:i&&i.length>0?await RO({authorization:i[0]}).catch((()=>{throw new EA("`to` is required. Could not infer from `authorizationList`")})):void 0)();oF(t);const E=e.chain?.formatters?.transactionRequest?.format,k=(E||rF)({...eF(v,{format:E}),from:r?.address,accessList:a,authorizationList:i,blobs:s,blobVersionedHashes:o,data:u,gas:d,gasPrice:p,maxFeePerBlobGas:h,maxFeePerGas:m,maxPriorityFeePerGas:f,nonce:y,to:x,value:b});function T(t){const{block:n,request:r,rpcStateOverride:a}=t;return e.request({method:"eth_estimateGas",params:a?[r,n??e.experimental_blockTag??"latest",a]:n?[r,n]:[r]})}let P=BigInt(await T({block:w,request:k,rpcStateOverride:C}));if(i){const A=await async function(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const a="bigint"==typeof n?n_(n):void 0,i=await e.request({method:"eth_getBalance",params:[t,a||r]});return BigInt(i)}(e,{address:k.from}),_=await Promise.all(i.map((async e=>{const{address:t}=e,n=await T({block:w,request:{authorizationList:void 0,data:u,from:r?.address,to:t,value:n_(A)},rpcStateOverride:C}).catch((()=>100000n));return 2n*BigInt(n)})));P+=_.reduce(((e,t)=>e+t),0n)}return P}catch(D){throw function(e,{docsPath:t,...n}){const r=(()=>{const t=QO(e,n);return t instanceof YO?e:t})();return new jO(r,{docsPath:t,...n})}(D,{...t,account:r,chain:e.chain})}}class JF extends EA{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}`],name:"ChainMismatchError"})}}class XF extends EA{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"),{name:"ChainNotFoundError"})}}class YF extends EA{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const QF="/docs/contract/encodeDeployData";const eS=new Map,tS=new Map;let nS=0;function rS(e,t,n){const r=++nS,a=()=>eS.get(e)||[],i=()=>{const t=a();if(!t.some((e=>e.id===r)))return;const n=tS.get(e);if(1===t.length&&n){const e=n();e instanceof Promise&&e.catch((()=>{}))}(()=>{const t=a();eS.set(e,t.filter((e=>e.id!==r)))})()},s=a();if(eS.set(e,[...s,{id:r,fns:t}]),s&&s.length>0)return i;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&&tS.set(e,c),i}async function aS(e){return new Promise((t=>setTimeout(t,e)))}class iS extends EA{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 Client."].join("\n"),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class sS extends EA{constructor({docsPath:e,metaMessages:t,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:t,name:"AccountTypeNotSupportedError"})}}function oS({chain:e,currentChainId:t}){if(!e)throw new XF;if(t!==e.id)throw new JF({chain:e,currentChainId:t})}function cS(e,{docsPath:t,...n}){const r=(()=>{const t=QO(e,n);return t instanceof YO?e:t})();return new XD(r,{docsPath:t,...n})}async function lS(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const uS=new K_(128);async function dS(e,t){const{account:n=e.account,chain:r=e.chain,accessList:a,authorizationList:i,blobs:s,data:o,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,type:m,value:f,...y}=t;if(void 0===n)throw new iS({docsPath:"/docs/actions/wallet/sendTransaction"});const b=n?gD(n):null;try{oF(t);const n=await(async()=>t.to?t.to:null!==t.to&&i&&i.length>0?await RO({authorization:i[0]}).catch((()=>{throw new EA("`to` is required. Could not infer from `authorizationList`.")})):void 0)();if("json-rpc"===b?.type||null===b){let t;null!==r&&(t=await fA(e,qF,"getChainId")({}),oS({currentChainId:t,chain:r}));const g=e.chain?.formatters?.transactionRequest?.format,v=(g||rF)({...eF(y,{format:g}),accessList:a,authorizationList:i,blobs:s,chainId:t,data:o,from:b?.address,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,to:n,type:m,value:f}),w=uS.get(e.uid),C=w?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:C,params:[v]},{retryCount:0})}catch(t){if(!1===w)throw t;const n=t;if("InvalidInputRpcError"===n.name||"InvalidParamsRpcError"===n.name||"MethodNotFoundRpcError"===n.name||"MethodNotSupportedRpcError"===n.name)return await e.request({method:"wallet_sendTransaction",params:[v]},{retryCount:0}).then((t=>(uS.set(e.uid,!0),t))).catch((t=>{const r=t;if("MethodNotFoundRpcError"===r.name||"MethodNotSupportedRpcError"===r.name)throw uS.set(e.uid,!1),n;throw r}));throw n}}if("local"===b?.type){const t=await fA(e,ZF,"prepareTransactionRequest")({account:b,accessList:a,authorizationList:i,blobs:s,chain:r,data:o,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:h,nonceManager:b.nonceManager,parameters:[...VF,"sidecars"],type:m,value:f,...y,to:n}),g=r?.serializers?.transaction,v=await b.signTransaction(t,{serializer:g});return await fA(e,lS,"sendRawTransaction")({serializedTransaction:v})}if("smart"===b?.type)throw new sS({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new sS({docsPath:"/docs/actions/wallet/sendTransaction",type:b?.type})}catch(e){if(e instanceof sS)throw e;throw cS(e,{...t,account:b,chain:t.chain||void 0})}}async function pS(e,t){const{abi:n,account:r=e.account,address:a,args:i,dataSuffix:s,functionName:o,...c}=t;if(void 0===r)throw new iS({docsPath:"/docs/contract/writeContract"});const l=r?gD(r):null,u=wD({abi:n,args:i,functionName:o});try{return await fA(e,dS,"sendTransaction")({data:`${u}${s?s.replace("0x",""):""}`,to:a,account:l,...c})}catch(e){throw function(e,{abi:t,address:n,args:r,docsPath:a,functionName:i,sender:s}){const o=e instanceof tO?e:e instanceof EA?e.walk((e=>"data"in e))||e.walk():{},{code:c,data:l,details:u,message:d,shortMessage:p}=o,h=e instanceof _A?new eO({functionName:i}):[SO,uO.code].includes(c)&&(l||u||d||p)?new QD({abi:t,data:"object"==typeof l?l.data:l,functionName:i,message:o instanceof rO?u:p??d}):e;return new YD(h,{abi:t,args:r,contractAddress:n,docsPath:a,functionName:i,sender:s})}(e,{abi:n,address:a,args:i,docsPath:"/docs/contract/writeContract",functionName:o,sender:l?.address})}}class hS extends EA{constructor(e){super(`Call bundle failed with status: ${e.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=e}}function mS(e,{delay:t=100,retryCount:n=2,shouldRetry:r=(()=>!0)}={}){return new Promise(((a,i)=>{const s=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 aS(n),s({count:o+1})})({error:e});i(e)}};s()}))}const fS={"0x0":"reverted","0x1":"success"};function yS(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?XA(e.transactionIndex):null,status:e.status?fS[e.status]:null,type:e.type?pF[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const bS=tF("transactionReceipt",yS),gS="0x5792579257925792579257925792579257925792579257925792579257925792",vS=n_(0,{size:32});async function wS(e,t){const{account:n=e.account,capabilities:r,chain:a=e.chain,experimental_fallback:i,experimental_fallbackDelay:s=32,forceAtomic:o=!1,id:c,version:l="2.0.0"}=t,u=n?gD(n):null,d=t.calls.map((e=>{const t=e,n=t.abi?wD({abi:t.abi,functionName:t.functionName,args:t.args}):t.data;return{data:t.dataSuffix&&n?tD([n,t.dataSuffix]):n,to:t.to,value:t.value?n_(t.value):void 0}}));try{const t=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:o,calls:d,capabilities:r,chainId:n_(a.id),from:u?.address,id:c,version:l}]},{retryCount:0});return"string"==typeof t?{id:t}:t}catch(n){const c=n;if(i&&("MethodNotFoundRpcError"===c.name||"MethodNotSupportedRpcError"===c.name||"UnknownRpcError"===c.name||c.details.toLowerCase().includes("does not exist / is not available")||c.details.toLowerCase().includes("missing or invalid. request()")||c.details.toLowerCase().includes("did not match any variant of untagged enum")||c.details.toLowerCase().includes("account upgraded to unsupported contract")||c.details.toLowerCase().includes("eip-7702 not supported")||c.details.toLowerCase().includes("unsupported wc_ method")||c.details.toLowerCase().includes("feature toggled misconfigured"))){if(r){if(Object.values(r).some((e=>!e.optional))){const e="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new kO(new EA(e,{details:e}))}}if(o&&d.length>1){const e="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new OO(new EA(e,{details:e}))}const t=[];for(const n of d){const r=dS(e,{account:u,chain:a,data:n.data,to:n.to,value:n.value?JA(n.value):void 0});t.push(r),s>0&&await new Promise((e=>setTimeout(e,s)))}const n=await Promise.allSettled(t);if(n.every((e=>"rejected"===e.status)))throw n[0].reason;return{id:tD([...n.map((e=>"fulfilled"===e.status?e.value:vS)),n_(a.id,{size:32}),gS])}}throw cS(n,{...t,account:u,chain:t.chain})}}async function CS(e,t){const{atomic:n=!1,chainId:r,receipts:a,version:i="2.0.0",...s}=await async function(t){if(t.endsWith(gS.slice(2))){const n=ZA(oD(t,-64,-32)),r=oD(t,0,-64).slice(2).match(/.{1,64}/g),a=await Promise.all(r.map((t=>vS.slice(2)!==t?e.request({method:"eth_getTransactionReceipt",params:[`0x${t}`]},{dedupe:!0}):void 0))),i=a.some((e=>null===e))?100:a.every((e=>"0x1"===e?.status))?200:a.every((e=>"0x0"===e?.status))?500:600;return{atomic:!1,chainId:XA(n),receipts:a.filter(Boolean),status:i,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[t]})}(t.id),[o,c]=(()=>{const e=s.status;return e>=100&&e<200?["pending",e]:e>=200&&e<300?["success",e]:e>=300&&e<700?["failure",e]:"CONFIRMED"===e?["success",200]:"PENDING"===e?["pending",100]:[void 0,e]})();return{...s,atomic:n,chainId:r?XA(r):void 0,receipts:a?.map((e=>({...e,blockNumber:JA(e.blockNumber),gasUsed:JA(e.gasUsed),status:fS[e.status]})))??[],statusCode:c,status:o,version:i}}async function xS(e,t){const{id:n,pollingInterval:r=e.pollingInterval,status:a=(({statusCode:e})=>200===e||e>=300),retryCount:i=4,retryDelay:s=(({count:e})=>200*~~(1<<e)),timeout:o=6e4,throwOnFailure:c=!1}=t,l=LD(["waitForCallsStatus",e.uid,n]),{promise:u,resolve:d,reject:p}=function(){let e=()=>{},t=()=>{};return{promise:new Promise(((n,r)=>{e=n,t=r})),resolve:e,reject:t}}();let h;const m=rS(l,{resolve:d,reject:p},(t=>{const o=function(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let a=!0;const i=()=>a=!1;return(async()=>{let s;t&&(s=await e({unpoll:i}));const o=await(n?.(s))??r;await aS(o);const c=async()=>{a&&(await e({unpoll:i}),await aS(r),c())};c()})(),i}((async()=>{const r=e=>{clearTimeout(h),o(),e(),m()};try{const o=await mS((async()=>{const t=await CS(e,{id:n});if(c&&"failure"===t.status)throw new hS(t);return t}),{retryCount:i,delay:s});if(!a(o))return;r((()=>t.resolve(o)))}catch(e){r((()=>t.reject(e)))}}),{interval:r,emitOnBegin:!0});return o}));return h=o?setTimeout((()=>{m(),clearTimeout(h),p(new ES({id:n}))}),o):void 0,await u}class ES extends EA{constructor({id:e}){super(`Timed out while waiting for call bundle with id "${e}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const kS=256;let TS,PS=kS;function AS(e=11){if(!TS||PS+e>2*kS){TS="",PS=0;for(let e=0;e<kS;e++)TS+=(256+256*Math.random()|0).toString(16).substring(1)}return TS.substring(PS,PS+++e)}function _S(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:a}=e;if(t<=0)throw new YF({chainId:t});if(a&&!eD(a))throw new Z_({address:a});if(r&&r>sF)throw new zO({maxFeePerGas:r});if(n&&r&&n>r)throw new XO({maxFeePerGas:r,maxPriorityFeePerGas:n})}function DS(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 JD({storageKey:a[e]});if(!eD(r,{strict:!1}))throw new Z_({address:r});t.push([r,a])}return t}function OS(e,t){const n=HF(e);return"eip1559"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:i,value:s,maxFeePerGas:o,maxPriorityFeePerGas:c,accessList:l,data:u}=e;_S(e);const d=DS(l),p=[n_(n),a?n_(a):"0x",c?n_(c):"0x",o?n_(o):"0x",r?n_(r):"0x",i??"0x",s?n_(s):"0x",u??"0x",d,...FS(e,t)];return nD(["0x02",NO(p)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:r,data:a,nonce:i,to:s,value:o,accessList:c,gasPrice:l}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i}=e;if(t<=0)throw new YF({chainId:t});if(i&&!eD(i))throw new Z_({address:i});if(n||a)throw new EA("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>sF)throw new zO({maxFeePerGas:r})}(e);const u=DS(c),d=[n_(n),i?n_(i):"0x",l?n_(l):"0x",r?n_(r):"0x",s??"0x",o?n_(o):"0x",a??"0x",u,...FS(e,t)];return nD(["0x01",NO(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:r,nonce:a,to:i,value:s,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 jF;for(const e of t){const t=vA(e),n=XA(rD(e,0,1));if(32!==t)throw new GF({hash:e,size:t});if(n!==BF)throw new zF({hash:e,version:n})}}_S(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=>t_(e))),n=e.kzg,r=CF({blobs:t,kzg:n});if(void 0===p&&(p=IF({commitments:r})),void 0===h){h=$F({blobs:t,commitments:r,proofs:xF({blobs:t,commitments:r,kzg:n})})}}const m=DS(u),f=[n_(n),a?n_(a):"0x",l?n_(l):"0x",c?n_(c):"0x",r?n_(r):"0x",i??"0x",s?n_(s):"0x",d??"0x",m,o?n_(o):"0x",p??[],...FS(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 nD(["0x03",NO(h?[f,y,b,g]:f)])}(e,t):"eip7702"===n?function(e,t){const{authorizationList:n,chainId:r,gas:a,nonce:i,to:s,value:o,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{authorizationList:t}=e;if(t)for(const e of t){const{chainId:t}=e,n=e.address;if(!eD(n))throw new Z_({address:n});if(t<0)throw new YF({chainId:t})}_S(e)}(e);const p=DS(u),h=function(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const{chainId:e,nonce:r,...a}=n,i=n.address;t.push([e?QA(e):"0x",i,r?QA(r):"0x",...FS({},a)])}return t}(n);return nD(["0x04",NO([n_(r),i?n_(i):"0x",l?n_(l):"0x",c?n_(c):"0x",a?n_(a):"0x",s??"0x",o?n_(o):"0x",d??"0x",p,h,...FS(e,t)])])}(e,t):function(e,t){const{chainId:n=0,gas:r,data:a,nonce:i,to:s,value:o,gasPrice:c}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:a,to:i}=e;if(i&&!eD(i))throw new Z_({address:i});if(void 0!==t&&t<=0)throw new YF({chainId:t});if(n||a)throw new EA("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>sF)throw new zO({maxFeePerGas:r})}(e);let l=[i?n_(i):"0x",c?n_(c):"0x",r?n_(r):"0x",s??"0x",o?n_(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 ZD({v:t.v});return e})(),r=ZA(t.r),a=ZA(t.s);l=[...l,n_(e),"0x00"===r?"0x":r,"0x00"===a?"0x":a]}else n>0&&(l=[...l,n_(n),"0x","0x"]);return NO(l)}(e,t)}function FS(e,t){const n=t??e,{v:r,yParity:a}=n;if(void 0===n.r)return[];if(void 0===n.s)return[];if(void 0===r&&void 0===a)return[];const i=ZA(n.r),s=ZA(n.s);return["number"==typeof a?a?n_(1):"0x":0n===r?"0x":1n===r?n_(1):27n===r?"0x":n_(1),"0x00"===i?"0x":i,"0x00"===s?"0x":s]}const SS=new K_(8192);function IS(e,t={}){return async(n,r={})=>{const{dedupe:a=!1,methods:i,retryDelay:s=150,retryCount:o=3,uid:c}={...t,...r},{method:l}=n;if(i?.exclude?.includes(l))throw new fO(new Error("method not supported"),{method:l});if(i?.include&&!i.include.includes(l))throw new fO(new Error("method not supported"),{method:l});return function(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(SS.get(n))return SS.get(n);const r=e().finally((()=>SS.delete(n)));return SS.set(n,r),r}((()=>mS((async()=>{try{return await e(n)}catch(e){const t=e;switch(t.code){case sO.code:throw new sO(t);case oO.code:throw new oO(t);case cO.code:throw new cO(t,{method:n.method});case lO.code:throw new lO(t);case uO.code:throw new uO(t);case dO.code:throw new dO(t);case pO.code:throw new pO(t);case hO.code:throw new hO(t);case mO.code:throw new mO(t);case fO.code:throw new fO(t,{method:n.method});case yO.code:throw new yO(t);case bO.code:throw new bO(t);case gO.code:throw new gO(t);case vO.code:throw new vO(t);case wO.code:throw new wO(t);case CO.code:throw new CO(t);case xO.code:throw new xO(t);case EO.code:throw new EO(t);case kO.code:throw new kO(t);case TO.code:throw new TO(t);case PO.code:throw new PO(t);case AO.code:throw new AO(t);case _O.code:throw new _O(t);case DO.code:throw new DO(t);case OO.code:throw new OO(t);case 5e3:throw new gO(t);default:if(e instanceof EA)throw e;throw new FO(t)}}}),{delay:({count:e,error:t})=>{if(t&&t instanceof nO){const e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e,10)}return~~(1<<e)*s},retryCount:o,shouldRetry:({error:e})=>function(e){if("code"in e&&"number"==typeof e.code)return-1===e.code||(e.code===yO.code||e.code===uO.code);if(e instanceof nO&&e.status)return 403===e.status||(408===e.status||(413===e.status||(429===e.status||(500===e.status||(502===e.status||(503===e.status||504===e.status))))));return!0}(e)})),{enabled:a,id:a?a_(`${c}.${LD(n)}`):void 0})}}function MS(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}class NS extends EA{constructor({domain:e}){super(`Invalid domain "${LD(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class US extends EA{constructor({primaryType:e,types:t}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(t))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class LS extends EA{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function BS({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},("number"==typeof e?.chainId||"bigint"==typeof e?.chainId)&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function RS(e){if("address"===e||"bool"===e||"string"===e||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new LS({type:e})}function jS(e,t){const{abi:n,args:r,bytecode:a,...i}=t,s=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 TA({docsPath:QF});if(!("inputs"in a))throw new PA({docsPath:QF});if(!a.inputs||0===a.inputs.length)throw new PA({docsPath:QF});return nD([r,uD(a.inputs,n)])}({abi:n,args:r,bytecode:a});return dS(e,{...i,...i.authorizationList?{to:null}:{},data:s})}async function GS(e,t={}){const{account:n=e.account,chainId:r}=t,a=n?gD(n):void 0,i=r?[a?.address,[n_(r)]]:[a?.address],s=await e.request({method:"wallet_getCapabilities",params:i}),o={};for(const[e,t]of Object.entries(s)){o[Number(e)]={};for(let[n,r]of Object.entries(t))"addSubAccount"===n&&(n="unstable_addSubAccount"),o[Number(e)][n]=r}return"number"==typeof r?o[r]:o}async function zS(e,t){const{account:n=e.account,chainId:r,nonce:a}=t;if(!n)throw new iS({docsPath:"/docs/eip7702/prepareAuthorization"});const i=gD(n),s=(()=>{if(t.executor)return"self"===t.executor?t.executor:gD(t.executor)})(),o={address:t.contractAddress??t.address,chainId:r,nonce:a};return void 0===o.chainId&&(o.chainId=e.chain?.id??await fA(e,qF,"getChainId")({})),void 0===o.nonce&&(o.nonce=await fA(e,wF,"getTransactionCount")({address:i.address,blockTag:"pending"}),("self"===s||s?.address&&function(e,t){if(!eD(e,{strict:!1}))throw new Z_({address:e});if(!eD(t,{strict:!1}))throw new Z_({address:t});return e.toLowerCase()===t.toLowerCase()}(s.address,i.address))&&(o.nonce+=1)),o}async function $S(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map((e=>function(e,t){if(!eD(e,{strict:!1}))throw new Z_({address:e});return X_(e,t)}(e)))}async function HS(e,t){const{id:n}=t;await e.request({method:"wallet_showCallsStatus",params:[n]})}async function qS(e,t){const{account:n=e.account,domain:r,message:a,primaryType:i}=t;if(!n)throw new iS({docsPath:"/docs/actions/wallet/signTypedData"});const s=gD(n),o={EIP712Domain:BS({domain:r}),...t.types};if(function(e){const{domain:t,message:n,primaryType:r,types:a}=e,i=(e,t)=>{for(const n of e){const{name:e,type:r}=n,s=t[e],o=r.match(lD);if(o&&("number"==typeof s||"bigint"==typeof s)){const[e,t,n]=o;n_(s,{signed:"int"===t,size:Number.parseInt(n,10)/8})}if("address"===r&&"string"==typeof s&&!eD(s))throw new Z_({address:s});const c=r.match(cD);if(c){const[e,t]=c;if(t&&vA(s)!==Number.parseInt(t,10))throw new NA({expectedSize:Number.parseInt(t,10),givenSize:vA(s)})}const l=a[r];l&&(RS(r),i(l,s))}};if(a.EIP712Domain&&t){if("object"!=typeof t)throw new NS({domain:t});i(a.EIP712Domain,t)}if("EIP712Domain"!==r){if(!a[r])throw new US({primaryType:r,types:a});i(a[r],n)}}({domain:r,message:a,primaryType:i,types:o}),s.signTypedData)return s.signTypedData({domain:r,message:a,primaryType:i,types:o});const c=function(e){const{domain:t,message:n,primaryType:r,types:a}=e,i=(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},s=a.EIP712Domain&&t?i(a.EIP712Domain,t):{},o=(()=>{if("EIP712Domain"!==r)return i(a[r],n)})();return LD({domain:s,message:o,primaryType:r,types:a})}({domain:r,message:a,primaryType:i,types:o});return e.request({method:"eth_signTypedData_v4",params:[s.address,c]},{retryCount:0})}function VS(e){return{addChain:t=>async function(e,{chain:t}){const{id:n,name:r,nativeCurrency:a,rpcUrls:i,blockExplorers:s}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:n_(n),chainName:r,nativeCurrency:a,rpcUrls:i.default.http,blockExplorerUrls:s?Object.values(s).map((({url:e})=>e)):void 0}]},{dedupe:!0,retryCount:0})}(e,t),deployContract:t=>jS(e,t),getAddresses:()=>async function(e){return"local"===e.account?.type?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map((e=>X_(e)))}(e),getCallsStatus:t=>CS(e,t),getCapabilities:t=>GS(e,t),getChainId:()=>qF(e),getPermissions:()=>async function(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}(e),prepareAuthorization:t=>zS(e,t),prepareTransactionRequest:t=>ZF(e,t),requestAddresses:()=>$S(e),requestPermissions:t=>async function(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}(e,t),sendCalls:t=>wS(e,t),sendRawTransaction:t=>lS(e,t),sendTransaction:t=>dS(e,t),showCallsStatus:t=>HS(e,t),signAuthorization:t=>async function(e,t){const{account:n=e.account}=t;if(!n)throw new iS({docsPath:"/docs/eip7702/signAuthorization"});const r=gD(n);if(!r.signAuthorization)throw new sS({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:r.type});const a=await zS(e,t);return r.signAuthorization(a)}(e,t),signMessage:t=>async function(e,{account:t=e.account,message:n}){if(!t)throw new iS({docsPath:"/docs/actions/wallet/signMessage"});const r=gD(t);if(r.signMessage)return r.signMessage({message:n});const a="string"==typeof n?a_(n):n.raw instanceof Uint8Array?QA(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 iS({docsPath:"/docs/actions/wallet/signTransaction"});const i=gD(n);oF({account:i,...t});const s=await fA(e,qF,"getChainId")({});null!==r&&oS({currentChainId:s,chain:r});const o=r?.formatters||e.chain?.formatters,c=o?.transactionRequest?.format||rF;return i.signTransaction?i.signTransaction({...a,chainId:s},{serializer:e.chain?.serializers?.transaction}):await e.request({method:"eth_signTransaction",params:[{...c(a),chainId:n_(s),from:i.address}]},{retryCount:0})}(e,t),signTypedData:t=>qS(e,t),switchChain:t=>async function(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:n_(t)}]},{retryCount:0})}(e,t),waitForCallsStatus:t=>xS(e,t),watchAsset:t=>async function(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}(e,t),writeContract:t=>pS(e,t)}}function WS(e){const{key:t="wallet",name:n="Wallet Client",transport:r}=e,a=function(e){const{batch:t,chain:n,ccipRead:r,key:a="base",name:i="Base Client",type:s="base"}=e,o=e.experimental_blockTag??("number"==typeof n?.experimental_preconfirmationTime?"pending":void 0),c=n?.blockTime??12e3,l=Math.min(Math.max(Math.floor(c/2),500),4e3),u=e.pollingInterval??l,d=e.cacheTime??u,p=e.account?gD(e.account):void 0,{config:h,request:m,value:f}=e.transport({chain:n,pollingInterval:u}),y={account:p,batch:t,cacheTime:d,ccipRead:r,chain:n,key:a,name:i,pollingInterval:u,request:m,transport:{...h,...f},type:s,uid:AS(),...o?{experimental_blockTag:o}:{}};return Object.assign(y,{extend:function e(t){return n=>{const r=n(t);for(const e in y)delete r[e];const a={...t,...r};return Object.assign(a,{extend:e(a)})}}(y)})}({...e,key:t,name:n,transport:r,type:"walletClient"});return a.extend(VS)}function ZS(e,t={}){const{key:n="custom",methods:r,name:a="Custom Provider",retryDelay:i}=t;return({retryCount:s})=>function({key:e,methods:t,name:n,request:r,retryCount:a=3,retryDelay:i=150,timeout:s,type:o},c){return{config:{key:e,methods:t,name:n,request:r,retryCount:a,retryDelay:i,timeout:s,type:o},request:IS(r,{methods:t,retryCount:a,retryDelay:i,uid:AS()}),value:c}}({key:n,methods:r,name:a,request:e.request.bind(e),retryCount:t.retryCount??s,retryDelay:i,type:"custom"})}const KS=e=>{if(null!=e)return n.hexlify(e)};class JS extends i.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 m(this,void 0,void 0,(function*(){if(!this.smartAccountClient)throw new tb;return Promise.resolve(a.getAddress(this.smartAccountClient.account.address))}))}signMessage(e){return m(this,void 0,void 0,(function*(){if(!this.smartAccountClient)throw new tb;return this.smartAccountClient.account.signMessageWith6492({message:"string"!=typeof e||gA(e)?{raw:gA(e)?s_(e):e}:e})}))}_signTypedData(e,t,n){return m(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}signTransaction(e){return m(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}sendTransaction(e){return m(this,void 0,void 0,(function*(){if(!this.smartAccountClient)throw new tb;const t=yield r.resolveProperties(e),n=yield this.smartAccountClient.sendUserOperation({uo:{target:t.to,data:KS(t.data),value:BigInt(parseInt(t.value,16))}});return{hash:yield this.smartAccountClient.waitForUserOperationTransaction({hash:n.hash})}}))}connect(e){return new JS(null!=e?e:this.provider,this._address,this._index,this.smartAccountClient,this.signer)}connectUnchecked(){return new JS(this.provider,this._address,this._index,this.smartAccountClient,this.signer)}}const XS=[exports.ChainId.MAINNET,exports.ChainId.OPTIMISM,exports.ChainId.ARBITRUM_ONE,exports.ChainId.POLYGON,exports.ChainId.BASE];let YS={};const QS="alchemy-iframe-container";function eI(){if(!document.getElementById(QS)){const e=document.createElement("iframe");e.setAttribute("id",QS),e.style.display="none",document.body.appendChild(e)}}function tI(e,t){const n=e,r=YS[n];if(r)return r;const a=t[e];if(!a)throw new Error(`ChainId ${e} is not support`);eI();try{const e=new dA({client:{connection:{apiKey:a},iframeConfig:{iframeContainerId:QS}}});return YS[n]=e,e}catch(e){const t=document.getElementById(QS);if(t){t.remove(),eI();const e=new dA({client:{connection:{apiKey:a},iframeConfig:{iframeContainerId:QS}}});return YS[n]=e,e}throw e}}var nI;!function(e){e.Request="request",e.Response="response"}(nI||(nI={})),exports.ErrorType=void 0,(exports.ErrorType||(exports.ErrorType={})).SendTransactionError="SendTransactionError";class rI{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 aI{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 iI 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 iI?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof iI&&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 sI(this,e)}}function sI(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e?sI(e.cause,t):t?null:e}function oI(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 cI=oI({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}}}),lI=oI({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 uI extends iI{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 dI(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 pI(e,{size:t}){if(dI(e)>t)throw new uI({givenSize:dI(e),maxSize:t})}function hI(e,t={}){const{signed:n}=t;t.size&&pI(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 mI(e,t={}){return Number(hI(e,t))}function fI(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 yI={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559"};function bI(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?mI(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?mI(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?yI[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 gI=fI("transaction",bI);function vI(e){const t=e.transactions?.map((e=>"string"==typeof e?e:bI(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 wI=fI("block",vI);const CI={"0x0":"reverted","0x1":"success"};function xI(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?mI(e.transactionIndex):null,status:e.status?CI[e.status]:null,type:e.type?yI[e.type]||e.type:null}}const EI=fI("transactionReceipt",xI),kI={block:wI({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=bI(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?hI(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:gI({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?hI(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:EI({format:e=>({l1GasPrice:e.l1GasPrice?hI(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?hI(e.l1GasUsed):null,l1Fee:e.l1Fee?hI(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},TI=oI({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:kI}),PI=oI({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:kI}),AI=oI({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}}}),_I=oI({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}),DI=oI({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}),OI=oI({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}),FI=oI({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:kI}),SI=oI({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:kI}),II=oI({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}}}),MI=oI({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}),NI=oI({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}),UI={optimism:FI,optimismGoerli:SI,polygon:II,polygonMumbai:MI,arbitrum:cI,arbitrumGoerli:lI,linea:DI,lineaTestnet:OI,base:TI,baseGoerli:PI,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:AI.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:_I.nativeCurrency},scrollSepolia:NI};class LI 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 BI{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 rI({walletWindow:this.contextWindow,appInfo:t}),this.cyberAccount=null,Object.entries(UI).forEach((([e,n])=>{this[e]=new aI({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(UI).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 LI({name:exports.ErrorType.SendTransactionError,details:e.event.data.error,shortMessage:"Transaction failed"})):t(new LI({details:e.event.data.error})):n(e.event.data?.data))}sendTransaction(e){return this.messenger.sendMessage({name:"action",data:{type:nI.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:nI.Request,method:"getAuthToken"}}),new Promise(((e,t)=>{this.messenger.onMessage((n=>{this.resolveActionResponse(n,t,e)}))}))}}class RI{appId;name;cyberWallet;messenger;icon;constructor({appId:e,name:t,icon:n}){this.appId=e,this.name=t,this.icon=n,this.cyberWallet=new BI({contextWindow:window.parent,appInfo:{name:t,icon:n,appId:e}}),this.messenger=new rI({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 jI(e){try{return a.getAddress(e)}catch(e){return!1}}const GI=0,zI=2,$I={};const HI="DODO-WALLET-CACHED-LAST-CONNECTED";class qI{constructor({cacheKey:e,rpcUrl:t}){this._rpcUrl="",this.cacheKey=Object.assign({lastConnectedType:HI},e),this._rpcUrl=null!=t?t:""}setCacheType(e){localStorage.setItem(this.cacheKey.lastConnectedType,e),localStorage.setItem(this.cacheKey.autoConnectType,e)}removeAutoConnectCache(){localStorage.removeItem(this.cacheKey.autoConnectType)}setRpcUrl(e){this._rpcUrl=e}getAutoCacheType(){return localStorage.getItem(this.cacheKey.autoConnectType)}getLastConnectType(){return localStorage.getItem(this.cacheKey.lastConnectedType)}getConnectedWallet(){var e;return m(this,void 0,void 0,(function*(){if(O.getState().connectLoading){let e,t;yield Promise.race([new Promise((e=>{t=O.subscribe((t=>{!1===t.connectLoading&&e(!0)}))})),new Promise((t=>{e=setTimeout((()=>{t(!1)}),4e3)}))]),clearTimeout(e),t&&t()}return null===(e=O.getState().connected)||void 0===e?void 0:e.wallet}))}connectWalletProcess(e,t){return m(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&&O.getState().chainIdChanged(r),(null===(n=t.events)||void 0===n?void 0:n.connect)&&t.events.connect({chainId:e})},accountsChanged:e=>{var n;O.getState().accountsChanged(e),e.length||O.getState().disconnect(),(null===(n=t.events)||void 0===n?void 0:n.accountsChanged)&&t.events.accountsChanged(e)},chainChanged:e=>m(this,void 0,void 0,(function*(){var n,r;yield null===(n=O.getState().provider)||void 0===n?void 0:n.detectNetwork();const a=parseInt(e,16);a&&O.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;O.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 m(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 i=Object.assign({},e);O.getState().startConnecting(i.type);const{type:s,connector:o,supportMobile:c,supportExtension:l}=i;let u;if(!1===l&&c&&!_()){const{openSingleWalletConnectModal:n,closeSingleWalletConnectModal:r}=t,{connector:s,disconnect:o}=DM;if(i.disconnect=o,n)try{u=yield this.connectWalletProcess(s,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,i,s;(null===(i=null===(a=null==t?void 0:t.walletConnectParams)||void 0===a?void 0:a.qrModalOptions)||void 0===i?void 0:i.openCallback)&&(null===(s=null==t?void 0:t.walletConnectParams)||void 0===s||s.qrModalOptions.openCallback(r)),n({uri:r,wallet:e})}})})}))}finally{r&&r()}else u=yield this.connectWalletProcess(s,t)}else{if(!o)throw new Error(`${e.showName} is not valid.`);try{u=yield this.connectWalletProcess(o,t)}catch(e){throw O.getState().connectFailed(),console.error(e),e}}return u?(this.setCacheType(s),this._wallet=i,yield O.getState().connectSuccess(u,i,!!n)):O.getState().connectFailed(),u}))}disconnectWallet(){var e;return m(this,void 0,void 0,(function*(){this.getAutoCacheType()&&((null===(e=this._wallet)||void 0===e?void 0:e.disconnect)&&(yield this._wallet.disconnect()),this._wallet=void 0,this.removeAutoConnectCache(),O.getState().disconnect(this._rpcUrl))}))}}const VI=/(?:^[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,WI="io.metamask",ZI="io.metamask.mobile",KI={"com.coinbase.wallet":exports.WalletType.WalletLink,"com.bitget.web3":exports.WalletType.Bitkeep,"com.okex.wallet":exports.WalletType.OKX,[WI]: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,"so.onekey.app.wallet":exports.WalletType.OneKey,"com.bybit":exports.WalletType.Bybit,"io.zerion.wallet":exports.WalletType.Zerion,"https://www.safepal.com/download":exports.WalletType.SafePal,"com.risechain.wallet":exports.WalletType.Rise};function JI(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=>N(Object.assign(Object.assign({},e),{provider:n})),injected:()=>!0,disabled:()=>!1,connector:(e,t)=>S(n,t),isEip6963:!0}}const XI={autoConnectType:"DODO-WALLET-CACHED-PROVIDER"};let YI,QI,eM;const tM=[exports.ChainId.OPTIMISM,exports.ChainId.POLYGON,exports.ChainId.ARBITRUM_ONE,exports.ChainId.LINEA,exports.ChainId.BASE,exports.ChainId.SCROLL_ALPHA_TESTNET];const nM=80001,rM=2025,aM=9527,iM=534354,sM=421613,oM=42161,cM=43113,lM=43114,uM=2206132,dM=210425,pM=[1,5,137,nM,56,97,rM,aM,iM,sM,oM,cM,lM,322,321,65,66,uM];const hM={type:exports.WalletType.WalletLink,showName:"Coinbase Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47054%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47054%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8%2020C8%2026.6267%2013.3733%2032%2020%2032C26.6267%2032%2032%2026.6267%2032%2020C32%2013.3733%2026.6267%208%2020%208C13.3733%208%208%2013.3733%208%2020ZM16.9333%2016.1333C16.49%2016.1333%2016.1333%2016.49%2016.1333%2016.9333V23.0667C16.1333%2023.51%2016.49%2023.8667%2016.9333%2023.8667H23.0667C23.51%2023.8667%2023.8667%2023.51%2023.8667%2023.0667V16.9333C23.8667%2016.49%2023.51%2016.1333%2023.0667%2016.1333H16.9333Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47054%22%20x1%3D%2220%22%20y1%3D%220%22%20x2%3D%2220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23345FF8%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%231D43DC%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47054%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,getPackage:Z,connector:oe,mobileAndroidDeepLink:"https://go.cb-w.com/dapp?cburl=$formattedAPPUrl",mobileIOSDeepLink:"cbwallet://dapp?url=$formattedAPPUrl",isContractWallet:()=>{const e=O.getState().provider.provider;return!(!e||(null==e?void 0:e.isWalletLink)||(null==e?void 0:e.isToshi))},disabled:()=>!!_(),injected:()=>{var e,t;return _()&&((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)=>S(void 0,t),switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:null!==(t=e.provider)&&void 0!==t?t:O.getState().provider}))},getSupportEip5792ChainIds:()=>{const e=O.getState().provider.provider;return!e||(null==e?void 0:e.isWalletLink)||(null==e?void 0:e.isToshi)?[]:[exports.ChainId.BASE,84532]}},mM={type:exports.WalletType.ImToken,showName:"imToken",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47053%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47053%29%22%2F%3E%3Cpath%20d%3D%22M32.5485%2012.3424C33.3788%2023.5873%2026.1506%2028.9022%2019.6707%2029.469C13.6462%2029.9958%207.97553%2026.2941%207.47806%2020.6066C7.06768%2015.9078%209.97179%2013.9073%2012.2535%2013.7079C14.6002%2013.5022%2016.5724%2015.1206%2016.7435%2017.0801C16.9082%2018.964%2015.7327%2019.8215%2014.9152%2019.8929C14.2686%2019.9496%2013.4552%2019.5571%2013.3818%2018.7143C13.3188%2017.99%2013.5938%2017.8914%2013.5266%2017.1221C13.407%2015.7524%2012.2126%2015.5929%2011.5587%2015.6495C10.7673%2015.7189%209.33155%2016.6424%209.53303%2018.943C9.73561%2021.2636%2011.9606%2023.0972%2014.8774%2022.8421C18.025%2022.5671%2020.2164%2020.1164%2020.3812%2016.6792C20.3797%2016.4971%2020.418%2016.3169%2020.4935%2016.1512L20.4945%2016.1471C20.5284%2016.075%2020.5681%2016.0059%2020.6131%2015.9403C20.6803%2015.8396%2020.7664%2015.7283%2020.8776%2015.6065C20.8787%2015.6034%2020.8787%2015.6034%2020.8808%2015.6034C20.9616%2015.5121%2021.0592%2015.4134%2021.1694%2015.3074C22.5443%2014.0102%2027.4961%2010.9507%2032.1791%2011.9195C32.2781%2011.9407%2032.3676%2011.9933%2032.4342%2012.0696C32.5008%2012.1458%2032.5408%2012.2415%2032.5485%2012.3424Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47053%22%20x1%3D%2238.8816%22%20y1%3D%221.1184%22%20x2%3D%22-1.04289e-05%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2311C4D1%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%230062AD%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47053%22%3E%3Crect%20width%3D%2240%22%20height%3D%2239.922%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://token.im/",supportMobile:!0,supportExtension:!1,switchChain:N,mobileDeepLink:"imtokenv2://navigate/DappView?url=$formattedAPPUrl",injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isImToken}},fM={type:exports.WalletType.Math,showName:"Math Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22black%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47067%29%22%3E%3Cpath%20d%3D%22M20%2036C28.8366%2036%2036%2028.8366%2036%2020C36%2011.1634%2028.8366%204%2020%204C11.1634%204%204%2011.1634%204%2020C4%2028.8366%2011.1634%2036%2020%2036Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M10.3333%2024.6543C10.7288%2024.6543%2011.0494%2024.9748%2011.0494%2025.3703C11.0494%2025.7658%2010.7288%2026.0864%2010.3333%2026.0864C9.93784%2026.0864%209.61726%2025.7658%209.61726%2025.3703C9.61726%2024.9748%209.93784%2024.6543%2010.3333%2024.6543ZM20%2024.6543C20.3954%2024.6543%2020.716%2024.9748%2020.716%2025.3703C20.716%2025.7658%2020.3954%2026.0864%2020%2026.0864C19.6045%2026.0864%2019.2839%2025.7658%2019.2839%2025.3703C19.2839%2024.9748%2019.6045%2024.6543%2020%2024.6543ZM29.6666%2024.6543C30.0621%2024.6543%2030.3827%2024.9748%2030.3827%2025.3703C30.3827%2025.7658%2030.0621%2026.0864%2029.6666%2026.0864C29.2712%2026.0864%2028.9506%2025.7658%2028.9506%2025.3703C28.9506%2024.9748%2029.2712%2024.6543%2029.6666%2024.6543ZM12.4814%2021.79C13.0746%2021.79%2013.5555%2022.2709%2013.5555%2022.8641C13.5555%2023.4573%2013.0746%2023.9382%2012.4814%2023.9382C11.8882%2023.9382%2011.4074%2023.4573%2011.4074%2022.8641C11.4074%2022.2709%2011.8882%2021.79%2012.4814%2021.79ZM17.4938%2021.79C18.087%2021.79%2018.5679%2022.2709%2018.5679%2022.8641C18.5679%2023.4573%2018.087%2023.9382%2017.4938%2023.9382C16.9006%2023.9382%2016.4197%2023.4573%2016.4197%2022.8641C16.4197%2022.2709%2016.9006%2021.79%2017.4938%2021.79ZM22.5062%2021.79C23.0994%2021.79%2023.5802%2022.2709%2023.5802%2022.8641C23.5802%2023.4573%2023.0994%2023.9382%2022.5062%2023.9382C21.913%2023.9382%2021.4321%2023.4573%2021.4321%2022.8641C21.4321%2022.2709%2021.913%2021.79%2022.5062%2021.79ZM27.5185%2021.79C28.1117%2021.79%2028.5926%2022.2709%2028.5926%2022.8641C28.5926%2023.4573%2028.1117%2023.9382%2027.5185%2023.9382C26.9253%2023.9382%2026.4444%2023.4573%2026.4444%2022.8641C26.4444%2022.2709%2026.9253%2021.79%2027.5185%2021.79ZM7.82713%2022.1481C8.22259%2022.1481%208.54317%2022.4687%208.54317%2022.8641C8.54317%2023.2596%208.22259%2023.5802%207.82713%2023.5802C7.43167%2023.5802%207.11108%2023.2596%207.11108%2022.8641C7.11108%2022.4687%207.43167%2022.1481%207.82713%2022.1481ZM32.1728%2022.1481C32.5683%2022.1481%2032.8889%2022.4687%2032.8889%2022.8641C32.8889%2023.2596%2032.5683%2023.5802%2032.1728%2023.5802C31.7774%2023.5802%2031.4568%2023.2596%2031.4568%2022.8641C31.4568%2022.4687%2031.7774%2022.1481%2032.1728%2022.1481ZM14.9876%2018.9259C15.7786%2018.9259%2016.4197%2019.567%2016.4197%2020.358C16.4197%2021.1489%2015.7786%2021.79%2014.9876%2021.79C14.1967%2021.79%2013.5555%2021.1489%2013.5555%2020.358C13.5555%2019.567%2014.1967%2018.9259%2014.9876%2018.9259ZM25.0123%2018.9259C25.8033%2018.9259%2026.4444%2019.567%2026.4444%2020.358C26.4444%2021.1489%2025.8033%2021.79%2025.0123%2021.79C24.2214%2021.79%2023.5802%2021.1489%2023.5802%2020.358C23.5802%2019.567%2024.2214%2018.9259%2025.0123%2018.9259ZM10.3333%2019.2839C10.9265%2019.2839%2011.4074%2019.7648%2011.4074%2020.358C11.4074%2020.9512%2010.9265%2021.432%2010.3333%2021.432C9.74011%2021.432%209.25922%2020.9512%209.25922%2020.358C9.25922%2019.7648%209.74011%2019.2839%2010.3333%2019.2839ZM20%2019.2839C20.5932%2019.2839%2021.0741%2019.7648%2021.0741%2020.358C21.0741%2020.9512%2020.5932%2021.432%2020%2021.432C19.4068%2021.432%2018.9259%2020.9512%2018.9259%2020.358C18.9259%2019.7648%2019.4068%2019.2839%2020%2019.2839ZM29.6666%2019.2839C30.2598%2019.2839%2030.7407%2019.7648%2030.7407%2020.358C30.7407%2020.9512%2030.2598%2021.432%2029.6666%2021.432C29.0734%2021.432%2028.5926%2020.9512%2028.5926%2020.358C28.5926%2019.7648%2029.0734%2019.2839%2029.6666%2019.2839ZM12.4814%2016.4197C13.2724%2016.4197%2013.9136%2017.0608%2013.9136%2017.8518C13.9136%2018.6427%2013.2724%2019.2839%2012.4814%2019.2839C11.6905%2019.2839%2011.0494%2018.6427%2011.0494%2017.8518C11.0494%2017.0608%2011.6905%2016.4197%2012.4814%2016.4197ZM17.4938%2016.4197C18.2847%2016.4197%2018.9259%2017.0608%2018.9259%2017.8518C18.9259%2018.6427%2018.2847%2019.2839%2017.4938%2019.2839C16.7029%2019.2839%2016.0617%2018.6427%2016.0617%2017.8518C16.0617%2017.0608%2016.7029%2016.4197%2017.4938%2016.4197ZM22.5062%2016.4197C23.2971%2016.4197%2023.9382%2017.0608%2023.9382%2017.8518C23.9382%2018.6427%2023.2971%2019.2839%2022.5062%2019.2839C21.7152%2019.2839%2021.0741%2018.6427%2021.0741%2017.8518C21.0741%2017.0608%2021.7152%2016.4197%2022.5062%2016.4197ZM27.5185%2016.4197C28.3094%2016.4197%2028.9506%2017.0608%2028.9506%2017.8518C28.9506%2018.6427%2028.3094%2019.2839%2027.5185%2019.2839C26.7276%2019.2839%2026.0864%2018.6427%2026.0864%2017.8518C26.0864%2017.0608%2026.7276%2016.4197%2027.5185%2016.4197ZM14.9876%2013.9135C15.7786%2013.9135%2016.4197%2014.5547%2016.4197%2015.3456C16.4197%2016.1365%2015.7786%2016.7777%2014.9876%2016.7777C14.1967%2016.7777%2013.5555%2016.1365%2013.5555%2015.3456C13.5555%2014.5547%2014.1967%2013.9135%2014.9876%2013.9135ZM25.0123%2013.9135C25.8033%2013.9135%2026.4444%2014.5547%2026.4444%2015.3456C26.4444%2016.1365%2025.8033%2016.7777%2025.0123%2016.7777C24.2214%2016.7777%2023.5802%2016.1365%2023.5802%2015.3456C23.5802%2014.5547%2024.2214%2013.9135%2025.0123%2013.9135Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47067%22%3E%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22white%22%20transform%3D%22translate%284%204%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://mathwallet.org",supportMobile:!0,supportExtension:!0,connector:S,switchChain:N,injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isMathWallet}},yM={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)=>S(window.gamestop,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.gamestop}))},bM={type:exports.WalletType.Brave,showName:"Brave",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47062%29%22%3E%3Cmask%20id%3D%22mask0_6996_47062%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%227%22%20y%3D%227%22%20width%3D%2226%22%20height%3D%2226%22%3E%3Cpath%20d%3D%22M33%207H7V33H33V7Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_6996_47062%29%22%3E%3Cpath%20d%3D%22M31.1202%2016.2236L30.3185%2014.0461L30.876%2012.7961C30.9111%2012.7173%2030.9214%2012.6297%2030.9058%2012.5448C30.8902%2012.4599%2030.8493%2012.3818%2030.7886%2012.3205L29.2725%2010.7881C28.947%2010.4579%2028.5345%2010.2269%2028.0829%2010.122C27.6313%2010.0172%2027.1591%2010.0428%2026.7215%2010.1959L26.2969%2010.3435L23.981%207.83436L20.0524%207.8125H20.0268L16.0728%207.84347L13.7586%2010.3726L13.3468%2010.2269C12.9064%2010.072%2012.4308%2010.0459%2011.9761%2010.1518C11.5213%2010.2576%2011.1062%2010.491%2010.7794%2010.8245L9.23603%2012.3861C9.18759%2012.4349%209.15506%2012.4973%209.1427%2012.5649C9.13034%2012.6326%209.13874%2012.7024%209.16679%2012.7651L9.74806%2014.0625L8.94995%2016.2382L9.46563%2018.2006L11.818%2027.1438C12.089%2028.174%2012.7125%2029.0767%2013.5801%2029.6948C13.5801%2029.6948%2016.4354%2031.7083%2019.2525%2033.5378C19.4752%2033.7157%2019.7518%2033.8125%2020.0369%2033.8125C20.3219%2033.8125%2020.5985%2033.7157%2020.8213%2033.5378C23.9864%2031.4641%2026.49%2029.6875%2026.49%2029.6875C27.357%2029.069%2027.9798%2028.1664%2028.2503%2027.1365L30.5899%2018.1897L31.1202%2016.2236Z%22%20fill%3D%22url%28%23paint0_linear_6996_47062%29%22%2F%3E%3Cpath%20d%3D%22M20.6827%2023.9297C20.5327%2023.8625%2020.378%2023.8065%2020.2199%2023.762H19.9411C19.7829%2023.8065%2019.6282%2023.8625%2019.4783%2023.9297L18.7767%2024.2212C18.5544%2024.3141%2018.1973%2024.4799%2017.9841%2024.5856L16.694%2025.2579C16.6473%2025.2731%2016.6062%2025.3019%2016.5759%2025.3406C16.5457%2025.3794%2016.5278%2025.4263%2016.5245%2025.4753C16.5212%2025.5243%2016.5325%2025.5732%2016.5572%2025.6156C16.5819%2025.6581%2016.6187%2025.6921%2016.663%2025.7135L17.7836%2026.5043C17.9804%2026.6428%2018.2902%2026.887%2018.4724%2027.051L18.7876%2027.3225C18.9699%2027.4792%2019.2668%2027.7398%2019.4473%2027.9001L19.7461%2028.1643C19.8384%2028.2413%2019.9548%2028.2834%2020.075%2028.2834C20.1952%2028.2834%2020.3116%2028.2413%2020.4039%2028.1643L20.7173%2027.891L21.3769%2027.3152L21.694%2027.0382C21.8762%2026.8797%2022.1841%2026.6355%2022.3809%2026.4916L23.5016%2025.6899C23.5459%2025.6686%2023.5828%2025.6344%2023.6074%2025.5918C23.6319%2025.5492%2023.6431%2025.5001%2023.6394%2025.4512C23.6357%2025.4021%2023.6171%2025.3554%2023.5864%2025.317C23.5556%2025.2786%2023.514%2025.2505%2023.467%2025.2361L22.1787%2024.5819C21.9637%2024.4727%2021.6065%2024.3086%2021.3824%2024.2175L20.6827%2023.9297Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M28.6273%2016.7103L28.6637%2016.5937C28.6659%2016.4377%2028.6561%2016.2818%2028.6345%2016.1273C28.526%2015.8513%2028.3867%2015.5884%2028.2191%2015.3437L27.4902%2014.2741C27.3554%2014.0737%2027.1258%2013.7566%2026.9709%2013.569L25.9942%2012.3463C25.9051%2012.2271%2025.8084%2012.1139%2025.7045%2012.0074H25.6845C25.6845%2012.0074%2025.4877%2012.042%2025.2508%2012.0875L23.7584%2012.3754L23.1043%2012.5012C22.8871%2012.5114%2022.67%2012.4798%2022.4647%2012.4082L21.2858%2012.0274C21.0561%2011.9527%2020.6771%2011.8452%2020.4421%2011.7942C20.1944%2011.7678%2019.9446%2011.7678%2019.6968%2011.7942C19.4618%2011.8488%2019.0827%2011.9545%2018.8531%2012.0292L17.6742%2012.4119C17.469%2012.4835%2017.2519%2012.515%2017.0347%2012.5048L16.3805%2012.3809L14.8863%2012.0948C14.6494%2012.0493%2014.4545%2012.0128%2014.4526%2012.0146H14.4326C14.3287%2012.1212%2014.232%2012.2344%2014.1429%2012.3536L13.168%2013.5762C13.0186%2013.7584%2012.7835%2014.0828%2012.6487%2014.2814L11.9198%2015.351C11.794%2015.5355%2011.679%2015.7271%2011.5755%2015.925C11.513%2016.1456%2011.4799%2016.3736%2011.4771%2016.6028L11.5135%2016.7194C11.531%2016.7943%2011.5536%2016.868%2011.5809%2016.9399C11.7322%2017.1222%2011.9909%2017.4246%2012.1567%2017.6014L14.7077%2020.3128C14.7924%2020.4116%2014.8491%2020.5314%2014.8719%2020.6596C14.8946%2020.7877%2014.8826%2020.9197%2014.8371%2021.0416L14.4198%2022.0311C14.325%2022.2932%2014.3179%2022.5791%2014.3998%2022.8456L14.4836%2023.0751C14.6206%2023.4481%2014.8553%2023.7772%2015.1633%2024.0281L15.5641%2024.3543C15.6683%2024.4294%2015.7898%2024.4769%2015.9173%2024.4921C16.0448%2024.5075%2016.1741%2024.4901%2016.293%2024.4418L17.718%2023.7621C17.9795%2023.6312%2018.2243%2023.469%2018.4468%2023.2792L19.5875%2022.2497C19.633%2022.2087%2019.6697%2022.159%2019.6955%2022.1035C19.7214%2022.0481%2019.7358%2021.9879%2019.7381%2021.9267C19.7403%2021.8656%2019.7302%2021.8045%2019.7084%2021.7473C19.6866%2021.6901%2019.6535%2021.6379%2019.6112%2021.5937L17.0365%2019.859C16.939%2019.7899%2016.8696%2019.688%2016.8408%2019.572C16.812%2019.4559%2016.8259%2019.3335%2016.8797%2019.2267L17.8783%2017.3499C17.9351%2017.235%2017.9686%2017.1101%2017.9771%2016.9822C17.9855%2016.8543%2017.9687%2016.726%2017.9275%2016.6046C17.8035%2016.3731%2017.6033%2016.1916%2017.3608%2016.0908L14.2303%2014.9082C14.0044%2014.8226%2014.0171%2014.726%2014.2558%2014.7114L16.0944%2014.5292C16.3827%2014.5109%2016.6721%2014.5367%2016.9526%2014.6058L18.5525%2015.0522C18.6661%2015.0864%2018.7634%2015.1607%2018.8264%2015.2612C18.8894%2015.3617%2018.9138%2015.4817%2018.8951%2015.5988L18.2664%2019.0318C18.2244%2019.2219%2018.2139%2019.4177%2018.2355%2019.6112C18.261%2019.6933%2018.476%2019.7934%2018.711%2019.8518L19.6859%2020.0595C19.969%2020.1115%2020.2592%2020.1115%2020.5423%2020.0595L21.4188%2019.8609C21.6538%2019.808%2021.867%2019.6968%2021.8943%2019.6149C21.9154%2019.4212%2021.9042%2019.2254%2021.8616%2019.0355L21.2293%2015.6025C21.2105%2015.4853%2021.235%2015.3654%2021.2979%2015.2648C21.3609%2015.1643%2021.4582%2015.0901%2021.5718%2015.0558L23.1716%2014.6076C23.4522%2014.5385%2023.7416%2014.5127%2024.0299%2014.531L25.8685%2014.7023C26.109%2014.7242%2026.12%2014.8135%2025.8958%2014.8991L22.7672%2016.0854C22.5247%2016.1862%2022.3245%2016.3677%2022.2005%2016.5992C22.1175%2016.8443%2022.1352%2017.1124%2022.2497%2017.3445L23.2501%2019.2213C23.3039%2019.328%2023.3177%2019.4505%2023.289%2019.5665C23.2603%2019.6825%2023.1908%2019.7844%2023.0933%2019.8536L20.5205%2021.5919C20.478%2021.6361%2020.4451%2021.6884%2020.4232%2021.7456C20.4014%2021.8028%2020.3914%2021.8638%2020.3935%2021.925C20.3957%2021.9861%2020.4102%2022.0462%2020.4361%2022.1017C20.462%2022.1572%2020.4987%2022.2069%2020.5441%2022.2479L21.6866%2023.2774C21.9093%2023.4666%2022.154%2023.6281%2022.4155%2023.7584L23.8404%2024.4363C23.9595%2024.4844%2024.0889%2024.5015%2024.2164%2024.4858C24.3438%2024.4702%2024.4653%2024.4224%2024.5693%2024.347L24.9702%2024.019C25.2785%2023.7676%2025.5133%2023.4378%2025.6499%2023.0642L25.7336%2022.8346C25.8155%2022.5681%2025.8085%2022.2823%2025.7136%2022.0201L25.2945%2021.0307C25.249%2020.9087%2025.237%2020.7768%2025.2598%2020.6486C25.2825%2020.5205%2025.3392%2020.4007%2025.4239%2020.3018L27.9749%2017.5868C28.1407%2017.4046%2028.3976%2017.113%2028.5489%2016.9254C28.5797%2016.8555%2028.6059%2016.7837%2028.6273%2016.7103Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47062%22%20x1%3D%228.95724%22%20y1%3D%2220.8136%22%20x2%3D%2231.1129%22%20y2%3D%2220.8136%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23F1562B%22%2F%3E%3Cstop%20offset%3D%220.3%22%20stop-color%3D%22%23F1542B%22%2F%3E%3Cstop%20offset%3D%220.41%22%20stop-color%3D%22%23F04D2A%22%2F%3E%3Cstop%20offset%3D%220.49%22%20stop-color%3D%22%23EF4229%22%2F%3E%3Cstop%20offset%3D%220.5%22%20stop-color%3D%22%23EF4029%22%2F%3E%3Cstop%20offset%3D%220.56%22%20stop-color%3D%22%23E83E28%22%2F%3E%3Cstop%20offset%3D%220.67%22%20stop-color%3D%22%23E13C26%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23DF3C26%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47062%22%3E%3Crect%20width%3D%2226%22%20height%3D%2226%22%20fill%3D%22white%22%20transform%3D%22translate%287%207%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!1,supportExtension:!0,switchChain:N,link:"https://wallet-docs.brave.com/",injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isBraveWallet}},gM={type:exports.WalletType.FoxWallet,showName:"FoxWallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47068%29%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M17.5234%2021.6769C17.5775%2021.6943%2017.6339%2021.7073%2017.6902%2021.7138C17.6902%2021.7138%2017.4541%2021.8026%2016.9666%2021.6358C16.9666%2021.6358%2016.6004%2021.4863%2016.3274%2021.5123C16.0089%2021.5404%2015.79%2021.9543%2015.79%2021.9543C15.8529%2021.9196%2015.92%2021.8936%2015.9894%2021.8763C16.206%2021.8329%2016.1324%2021.8698%2016.1324%2021.8698C16.1324%2021.8698%2015.7164%2022.0453%2015.6882%2022.1991C15.6817%2022.2381%2015.7987%2022.1276%2016.1064%2022.1384C16.4855%2022.1493%2016.8149%2022.3703%2016.9492%2022.4071C17.2265%2022.4808%2017.623%2022.4981%2017.9892%2022.2121C17.9892%2022.2121%2018.325%2022.0019%2018.429%2021.6119C18.455%2021.5036%2018.4724%2021.3931%2018.4767%2021.2826C18.4789%2021.1851%2018.4681%2021.0876%2018.4464%2020.9901C18.4442%2020.9879%2018.247%2021.4451%2017.5234%2021.6769Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M24.6821%2025.956C25.4166%2025.0351%2025.8152%2023.8933%2025.8152%2022.7146C25.8152%2021.5381%2025.4144%2020.3941%2024.6821%2019.4733L29.3859%2018.9555C29.3859%2018.9555%2029.8756%2020.2966%2030.0034%2021.0138C30.0207%2021.1048%2030.0489%2021.2911%2030.0489%2021.2911C30.0489%2021.2911%2029.3187%2023.0635%2028.1986%2024.0363C26.6949%2025.345%2024.6821%2025.956%2024.6821%2025.956ZM13.5433%2025.891L11.7406%2026.2246C11.1686%2024.7751%2010.9584%2023.2086%2011.1318%2021.6616C11.3029%2020.1125%2011.8533%2018.6305%2012.7286%2017.3435C12.7676%2017.2871%2012.8456%2017.1766%2012.8456%2017.1766L14.8368%2022.7861L13.5433%2025.891Z%22%20fill%3D%22url%28%23paint0_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M20.0674%2014.386C20.0739%2014.3774%2020.0782%2014.3752%2020.0847%2014.3665C20.1324%2014.3145%2021.2525%2013.112%2019.9179%2011.0732C18.932%209.57169%2016.4252%209.61286%2015.4004%208.83069C15.4762%209.43303%2016.0655%209.97686%2016.0027%2010.8002C15.9767%2011.0732%2015.9269%2011.3419%2015.851%2011.604C15.7297%2012.0742%2015.617%2012.5227%2015.786%2013.4002C15.9182%2014.0849%2016.2302%2014.5832%2016.7134%2014.8844C17.268%2015.2267%2018.035%2015.3025%2018.8215%2015.0902C19.3459%2014.9472%2019.8139%2014.6829%2020.0674%2014.386Z%22%20fill%3D%22url%28%23paint1_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.7379%2013.5064C22.0261%2013.0103%2022.0803%2012.4318%2021.9026%2011.7904C21.6556%2010.8934%2021.1876%2010.3041%2020.8084%209.83177C20.6893%209.68227%2020.5788%209.5436%2020.4878%209.41143C20.1281%208.88277%2019.9721%208.24143%2020.0501%207.60876C19.5929%207.9381%2018.7133%208.55777%2018.1521%209.2186C18.9646%209.6086%2019.5994%2010.0333%2020.0999%2010.7981C20.9558%2012.1024%2020.9406%2013.1554%2020.7781%2013.8098C20.7326%2013.9896%2021.0771%2014.1499%2021.0143%2014.2886C21.3068%2014.0806%2021.5516%2013.8141%2021.7379%2013.5064Z%22%20fill%3D%22url%28%23paint2_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M27.9668%2018.9231C27.0113%2018.8321%2025.0764%2018.5959%2025.0764%2018.5959C20.7236%2018.3533%2018.2536%2019.6598%2016.3903%2021.3693C14.9516%2022.7993%2013.6689%2026.5043%2013.6689%2026.5043L12.1111%2026.4198C12.1111%2026.4198%2012.6072%2024.9421%2013.1814%2023.8653C13.8401%2022.6324%2013.9874%2022.7321%2013.8379%2022.5284C13.1424%2021.5729%2012.8152%2020.8211%2012.5357%2019.2134C12.5357%2019.2134%2012.8629%2019.4713%2013.1099%2019.3131C13.1099%2019.3131%2012.5487%2018.3381%2012.4621%2017.2851C12.3082%2015.4196%2013.1814%2012.8716%2013.2031%2012.8131C13.1944%2012.8391%2013.1489%2013.0579%2013.6602%2013.3851C13.6971%2013.2312%2013.7361%2013.0796%2013.7772%2012.9322C13.9571%2012.0526%2014.4402%2010.1307%2015.4044%208.82855C15.4044%208.82855%2015.9439%2010.7114%2017.2981%2011.5651C19.9349%2013.2291%2021.5859%2013.2377%2021.5859%2013.2377C25.3104%2013.6537%2026.9008%2015.4824%2026.9008%2015.4824C29.5744%2018.3663%2032.0033%2018.3403%2032.0033%2018.3403C31.1301%2019.1744%2027.9668%2018.9231%2027.9668%2018.9231Z%22%20fill%3D%22url%28%23paint3_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M32.049%2018.3402C32.049%2018.3402%2031.6698%2020.4375%2029.683%2020.6823C29.683%2020.6823%2022.4767%2020.6368%2021.9502%2027.1823L21.8288%2029.0218L13.1838%2026.502C13.1838%2026.502%2013.9985%2023.7222%2015.7817%2021.4905C15.7817%2021.4905%2018.8085%2017.2157%2027.4318%2018.3423C27.4318%2018.3423%2028.4393%2018.546%2029.852%2018.6782C31.0437%2018.7887%2032.049%2018.3402%2032.049%2018.3402Z%22%20fill%3D%22url%28%23paint4_linear_6996_47068%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M27.1458%2017.3415C27.1458%2017.3415%2025.2738%2016.3687%2022.9446%2016.4597C22.9446%2016.4597%2024.2121%2015.4695%2025.9238%2015.7122L27.1458%2017.3415Z%22%20fill%3D%22%23722B00%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.4115%2026.2854C22.4115%2026.2854%2023.0204%2026.7057%2023.9867%2026.4826C23.9867%2026.4826%2022.4245%2027.3882%2019.1312%2026.1467C19.1312%2026.1467%2015.736%2024.6279%2013.3462%2024.9746C11.81%2025.1977%2010.4537%2026.4176%209.63032%2027.3449C8.63799%2028.4672%208.76149%2027.9429%2011.2553%2027.6331C11.8555%2027.5594%2011.5088%2027.7284%2011.5088%2027.7284C11.5088%2027.7284%208.17866%2029.1259%207.95332%2030.3674C7.89699%2030.6772%208.83082%2029.8019%2011.2943%2029.8799C14.319%2029.9752%2016.9494%2031.7302%2018.0305%2032.0206C20.2449%2032.6121%2023.4212%2032.7486%2026.3354%2030.4627C26.3354%2030.4627%2029.0242%2028.7749%2029.8562%2025.6571C30.0729%2024.7926%2030.2007%2023.9064%2030.2375%2023.0159C30.2809%2021.8546%2029.9277%2020.6326%2029.9277%2020.6326C29.9277%2020.6326%2027.9647%2024.9897%2022.4115%2026.2854Z%22%20fill%3D%22url%28%23paint5_linear_6996_47068%29%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47068%22%20x1%3D%2220.3513%22%20y1%3D%2216.8741%22%20x2%3D%2220.7275%22%20y2%3D%2226.2095%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23DADB48%22%2F%3E%3Cstop%20offset%3D%220.6562%22%20stop-color%3D%22%23637621%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47068%22%20x1%3D%2220.5689%22%20y1%3D%2212.0214%22%20x2%3D%2215.9952%22%20y2%3D%2212.0214%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23EC6F01%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F4B23D%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47068%22%20x1%3D%2220.1979%22%20y1%3D%2212.7904%22%20x2%3D%2219.9276%22%20y2%3D%228.37438%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23F4B33E%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FB6F1B%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_6996_47068%22%20x1%3D%2212.0063%22%20y1%3D%2216.933%22%20x2%3D%2228.093%22%20y2%3D%2223.2866%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FB6D1A%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F3B23E%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint4_linear_6996_47068%22%20x1%3D%2215.6112%22%20y1%3D%2226.2219%22%20x2%3D%2230.8869%22%20y2%3D%2219.5079%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23F3B63F%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FB701C%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_6996_47068%22%20x1%3D%2214.036%22%20y1%3D%2231.164%22%20x2%3D%2227.2614%22%20y2%3D%2222.9179%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23EC6F00%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23F4B33E%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47068%22%3E%3Crect%20width%3D%2226%22%20height%3D%2226%22%20fill%3D%22white%22%20transform%3D%22translate%287%207%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!1,switchChain:N,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}},vM={type:exports.WalletType.BinanceChain,showName:"Binance Web3 Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_7345_82351%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%234D4D4D%22%2F%3E%3Cpath%20d%3D%22M20%2038.6666C30.3093%2038.6666%2038.6667%2030.3092%2038.6667%2019.9999C38.6667%209.6906%2030.3093%201.33325%2020%201.33325C9.69069%201.33325%201.33334%209.6906%201.33334%2019.9999C1.33334%2030.3092%209.69069%2038.6666%2020%2038.6666Z%22%20fill%3D%22%234D4D4D%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14.8214%2017.8718L20%2012.6932L25.1787%2017.8772L28.192%2014.8638L20%206.6665L11.808%2014.8585L14.8214%2017.8718ZM6.66669%2019.9998L9.68002%2016.9865L12.6934%2019.9998L9.68002%2023.0132L6.66669%2019.9998ZM14.8214%2022.1278L20%2027.3065L25.1787%2022.1225L28.1974%2025.1358L20%2033.3332L11.808%2025.1412L11.8027%2025.1358L14.8214%2022.1278ZM27.3067%2019.9998L30.32%2016.9865L33.3334%2019.9998L30.32%2023.0132L27.3067%2019.9998Z%22%20fill%3D%22%23F3BA2F%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M23.36%2019.9998L20%2016.6292L17.5147%2019.1198L17.2267%2019.4078L16.6347%2019.9998L16.6293%2020.0052L16.6347%2020.0105L19.9947%2023.3705L23.36%2020.0052V19.9998Z%22%20fill%3D%22%23F3BA2F%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_7345_82351%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportChains:[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,supportExtension:!0,disabled:()=>!1,injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isBinance},connector:(e,t)=>pe(e,t),switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:null!==(t=e.provider)&&void 0!==t?t:O.getState().provider}))},isInstalled:()=>{var e;return!!((null===(e=window.ethereum)||void 0===e?void 0:e.isBinance)||window.BinanceChain||na())}},wM={type:exports.WalletType.kuCoinWallet,showName:"Halo Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%2308C082%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M26.9013%2013.0737C26.6763%2012.5218%2026.4011%2011.9917%2026.0791%2011.4901H26.0785C25.4995%2010.5874%2025.7628%209.38621%2026.6656%208.80718C27.5683%208.22873%2028.7695%208.49151%2029.3485%209.39426C33.0136%2015.1116%2031.8584%2022.5371%2026.9261%2026.9002C27.4703%2026.6796%2027.9931%2026.4094%2028.4878%2026.0929C28.7937%2025.8905%2029.1605%2025.7732%2029.555%2025.7709C30.6273%2025.7709%2031.4985%2026.638%2031.5002%2027.7098C31.5013%2028.4113%2031.1322%2029.0254%2030.5767%2029.3681C24.863%2033.009%2017.4553%2031.8498%2013.099%2026.9255C13.3237%2027.4779%2013.5989%2028.0084%2013.9212%2028.5102C14.5002%2029.4118%2014.2369%2030.6147%2013.3341%2031.192C12.4314%2031.7716%2011.2302%2031.5094%2010.6512%2030.6055C6.98616%2024.8888%208.14133%2017.4633%2013.0737%2013.099C12.5218%2013.324%2011.9918%2013.5993%2011.4902%2013.9212C10.5875%2014.5002%209.38621%2014.2369%208.80718%2013.3341C8.22873%2012.4314%208.49151%2011.2302%209.39426%2010.6512C15.1116%206.98616%2022.5371%208.14133%2026.9013%2013.0737ZM15.096%2023.1437C13.3606%2020.4372%2014.1465%2016.8366%2016.8509%2015.0988V15.0983L16.8567%2015.0949C19.5655%2013.3584%2023.1685%2014.1461%2024.9055%2016.8544V16.8555C26.642%2019.5644%2025.8537%2023.1679%2023.1449%2024.9044C20.4361%2026.6397%2016.8325%2025.8531%2015.096%2023.1437ZM17.7681%2020.5844C17.4455%2020.2618%2017.4455%2019.738%2017.7681%2019.4154L19.416%2017.7675C19.4928%2017.6907%2019.5839%2017.6297%2019.6843%2017.5881C19.7846%2017.5465%2019.8922%2017.5251%2020.0008%2017.5251C20.1094%2017.5251%2020.2169%2017.5465%2020.3173%2017.5881C20.4176%2017.6297%2020.5088%2017.6907%2020.5856%2017.7675L22.2335%2019.4154C22.3103%2019.4922%2022.3713%2019.5833%2022.4128%2019.6836C22.4544%2019.7838%2022.4758%2019.8914%2022.4758%2019.9999C22.4758%2020.1085%2022.4544%2020.216%2022.4128%2020.3163C22.3713%2020.4166%2022.3103%2020.5077%2022.2335%2020.5844L20.5856%2022.2329C20.4304%2022.3878%2020.2201%2022.4749%2020.0008%2022.4749C19.7815%2022.4749%2019.5712%2022.3878%2019.416%2022.2329L17.7681%2020.5844Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://halo.social/",disabled:()=>{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 S(null!==(n=window.haloEthereum)&&void 0!==n?n:window.kucoin,t)},switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:e.provider||(null!==(t=window.haloEthereum)&&void 0!==t?t:window.kucoin)}))},isInstalled:()=>{var e;return!!(null!==(e=window.haloEthereum)&&void 0!==e?e:window.kucoin)}},CM={type:exports.WalletType.Coin98,showName:"Coin98",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47072%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip1_6996_47072%29%22%3E%3Cpath%20d%3D%22M32.6961%200H7.30486C3.25283%200%200%203.252%200%207.304V32.696C0%2036.748%203.25283%2040%207.30486%2040H32.6951C36.6903%2040%2040%2036.748%2040%2032.696V7.304C40%203.252%2036.7481%200%2032.6961%200ZM26.5341%209.986C29.5013%209.986%2031.8979%2012.382%2031.8979%2015.35C31.8979%2016.262%2031.6691%2017.118%2031.2695%2017.917C30.5851%2017.404%2029.8439%2016.947%2029.0446%2016.662C29.2725%2016.262%2029.3874%2015.806%2029.3874%2015.35C29.3874%2013.809%2028.1316%2012.554%2026.5911%2012.554C25.0496%2012.554%2023.7948%2013.809%2023.7948%2015.35C23.7948%2015.806%2023.9087%2016.262%2024.1375%2016.662C23.3382%2016.947%2022.539%2017.347%2021.9116%2017.917C21.4551%2017.118%2021.2832%2016.262%2021.2832%2015.349C21.1704%2012.382%2023.567%209.986%2026.5341%209.986ZM13.4659%2030.014C10.4998%2030.014%208.10309%2027.618%208.10309%2024.651H10.6706C10.6706%2026.191%2011.9264%2027.447%2013.4669%2027.447C15.0074%2027.447%2016.2631%2026.191%2016.2631%2024.651H18.8306C18.8306%2027.618%2016.433%2030.014%2013.4659%2030.014ZM13.4659%2022.482C10.0432%2022.482%207.24694%2019.686%207.24694%2016.262C7.24694%2012.839%2010.0432%209.986%2013.4669%209.986C16.8905%209.986%2019.7437%2012.782%2019.7437%2016.262C19.6868%2019.686%2016.8895%2022.482%2013.4659%2022.482ZM26.5341%2030.014C23.1105%2030.014%2020.2572%2027.218%2020.2572%2023.794C20.2572%2020.314%2023.0535%2017.518%2026.5341%2017.518C29.9578%2017.518%2032.754%2020.314%2032.754%2023.795C32.754%2027.218%2029.9578%2030.014%2026.5341%2030.014ZM30.2425%2023.738C30.2425%2025.792%2028.5881%2027.389%2026.5341%2027.389C24.4801%2027.389%2022.8247%2025.735%2022.8247%2023.738C22.8247%2021.683%2024.4801%2020.028%2026.5341%2020.028C28.5881%2020.086%2030.2425%2021.74%2030.2425%2023.738ZM17.1182%2016.262C17.1182%2018.317%2015.4639%2019.972%2013.4099%2019.972C11.3549%2019.972%209.70054%2018.317%209.70054%2016.262C9.70054%2014.208%2011.3549%2012.553%2013.4099%2012.553C15.5209%2012.553%2017.1182%2014.207%2017.1182%2016.262Z%22%20fill%3D%22%23D9B432%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47072%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3CclipPath%20id%3D%22clip1_6996_47072%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://coin98.com/wallet",disabled:()=>{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 S(null===(n=window.coin98)||void 0===n?void 0:n.provider,t)},switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.coin98)||void 0===t?void 0:t.provider)}))},isInstalled:()=>{var e;return!!(null===(e=window.coin98)||void 0===e?void 0:e.provider)}},xM={type:exports.WalletType.frontier,showName:"Frontier",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47060%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%23CC703C%22%2F%3E%3Cpath%20d%3D%22M28.8973%209L28.7753%209.3228L28.3759%2010.3548L28.1105%2011.02C26.0949%2016.0081%2024.5274%2018.3752%2022.8605%2018.3752C22.4393%2018.3863%2022.0204%2018.3096%2021.6304%2018.1501C21.2405%2017.9904%2020.8881%2017.7513%2020.5957%2017.4481L20.383%2017.2552C19.8536%2016.7667%2019.6309%2016.6462%2019.121%2016.6462C18.8557%2016.6462%2018.3803%2016.9846%2017.7797%2017.7798C16.9752%2018.9192%2016.291%2020.1392%2015.7384%2021.4198L15.6706%2021.57H22.8206L21.9302%2023.4209H15.2543V31H13.2908V9H28.8973ZM26.1151%2010.8474H15.2543V18.1783C16.5556%2015.9215%2017.7927%2014.7886%2019.1231%2014.7886C19.5705%2014.7743%2020.016%2014.8531%2020.4314%2015.0199C20.8468%2015.1867%2021.223%2015.4379%2021.5361%2015.7577L21.7555%2015.9567C22.2497%2016.4128%2022.44%2016.5177%2022.8624%2016.5177C23.327%2016.5184%2024.5626%2014.5558%2026.1151%2010.8474Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47060%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://www.frontier.xyz/download",injected:()=>{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 S(null===(n=window.frontier)||void 0===n?void 0:n.ethereum,t)},switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.frontier)||void 0===t?void 0:t.ethereum)}))},isInstalled:()=>{var e;return!!(null===(e=window.frontier)||void 0===e?void 0:e.ethereum)}},EM={type:exports.WalletType.LedgerUSB,showName:"Ledger",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47064%29%22%3E%3Cpath%20d%3D%22M22.8376%2029.1957V30.5203H31.9293V24.546H30.6045V29.1957H22.8376ZM22.8376%209.47949V10.8042H30.6045V15.454H31.9293V9.47949H22.8376ZM18.4295%2015.454H17.1049V24.5457H23.0794V23.3509H18.4295V15.454ZM8%2024.546V30.5206H17.0917V29.1957H9.32468V24.546H8ZM8%209.47949V15.454H9.32468V10.8042H17.0917V9.47949H8Z%22%20fill%3D%22black%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47064%22%3E%3Crect%20width%3D%2224%22%20height%3D%2221.0411%22%20fill%3D%22white%22%20transform%3D%22translate%288%209.47949%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportChains:[exports.ChainId.MAINNET,exports.ChainId.BSC,exports.ChainId.POLYGON],disabled:()=>!E(),getPackage:H,connector:e=>m(void 0,void 0,void 0,(function*(){return E()&&e?(yield H()).default(e):void 0})),needReadProvider:!0},kM={type:exports.WalletType.openBlock,showName:"OpenBlock",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M24.8394%2011.3075C28.3377%2011.3075%2031.1736%2014.1434%2031.1736%2017.6417V17.7911L28.9613%2020.0015L31.1736%2022.2099V22.3614C31.1736%2025.8597%2028.3377%2028.6957%2024.8394%2028.6957H8.81738L13.9384%2024.9696H22.4796C25.2233%2024.9696%2027.4476%2022.7453%2027.4476%2020.0015C27.4476%2017.2578%2025.2233%2015.0335%2022.4796%2015.0335H13.9384L8.81738%2011.3075H24.8394ZM15.1309%2017.89C13.9648%2017.89%2013.0195%2018.8354%2013.0195%2020.0015C13.0195%2021.1676%2013.9648%2022.1129%2015.1309%2022.1129H22.4869C23.653%2022.1129%2024.5983%2021.1676%2024.5983%2020.0015C24.5983%2018.8354%2023.653%2017.89%2022.4869%2017.89H15.1309Z%22%20fill%3D%22%234A3DE6%22%2F%3E%3C%2Fsvg%3E",supportChains:[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)=>S(window.openblock,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.openblock})),isInstalled:()=>!!window.openblock},TM={type:exports.WalletType.OneKey,showName:"OneKey",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47075%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%2344D62C%22%2F%3E%3Cpath%20d%3D%22M21.8071%208.48083H16.2432L15.2671%2011.4322H18.3573V17.6495H21.8071V8.48083Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M26.3455%2025.1739C26.3455%2028.6782%2023.5044%2031.5191%2020%2031.5191C16.4955%2031.5191%2013.6548%2028.6782%2013.6548%2025.1739C13.6548%2021.6694%2016.4955%2018.8286%2020%2018.8286C23.5044%2018.8286%2026.3455%2021.6694%2026.3455%2025.1739ZM23.4648%2025.1739C23.4648%2027.0875%2021.9137%2028.6386%2020%2028.6386C18.0867%2028.6386%2016.5355%2027.0875%2016.5355%2025.1739C16.5355%2023.2605%2018.0867%2021.7091%2020%2021.7091C21.9137%2021.7091%2023.4648%2023.2605%2023.4648%2025.1739Z%22%20fill%3D%22black%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47075%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://onekey.so",supportMobile:!0,injected:()=>{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 S(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 N(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)}))},isInstalled:()=>{var e,t;return!!(null!==(t=null===(e=window.$onekey)||void 0===e?void 0:e.ethereum)&&void 0!==t?t:window.onekey)}},PM={type:exports.WalletType.Bitkeep,showName:"Bitget Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_9886_837%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M40%200H0V40H40V0Z%22%20fill%3D%22%23001F29%22%2F%3E%3Cpath%20d%3D%22M17.1833%207.4768C15.7517%207.47608%2014.3225%207.47534%2012.8859%207.47754C12.0172%207.47754%2011.6914%208.56812%2012.3375%209.21405L22.1169%2018.9936C22.4221%2019.2727%2022.6125%2019.5762%2022.6194%2019.9761C22.6125%2020.376%2022.4221%2020.6794%2022.1169%2020.9586L12.3375%2030.738C11.6914%2031.3841%2012.0172%2032.4746%2012.8859%2032.4746C14.3225%2032.4768%2015.7517%2032.4761%2017.1833%2032.4753C17.9%2032.475%2018.6175%2032.4746%2019.3367%2032.4746C20.2776%2032.4746%2020.8374%2031.9719%2021.34%2031.4692L30.1598%2022.6494C30.8637%2021.9455%2031.4936%2021.0109%2031.485%2019.9761C31.4936%2018.9412%2030.8637%2018.0066%2030.1598%2017.3027L21.34%208.48288C20.8374%207.98022%2020.2776%207.47754%2019.3367%207.47754C18.6175%207.47754%2017.9%207.47717%2017.1833%207.4768Z%22%20fill%3D%22%2300F0FF%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_9886_837%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://bitkeep.com/download?type=2",mobileDeepLink:"https://bkcode.vip?action=dapp&url=$APP_URL",supportMobile:!0,injected:()=>{var e;return _()&&((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 S(null===(n=window.bitkeep)||void 0===n?void 0:n.ethereum,t)},connectorInjected:(e,t)=>{var n;return S(null===(n=window.bitkeep)||void 0===n?void 0:n.ethereum,t)},switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.bitkeep)||void 0===t?void 0:t.ethereum)}))},isInstalled:()=>{var e;return!(!(null===(e=window.bitkeep)||void 0===e?void 0:e.ethereum)&&!window.isBitKeep)}},AM={type:exports.WalletType.Nabox,showName:"Nabox",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.625%2014.3018V26.4113L12.1312%2028.4326V19.7701L15.6249%2021.788V30.4448L19.1322%2032.4661V20.3554L8.625%2014.3018Z%22%20fill%3D%22%232AC98B%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M16.5894%2013.1937L20.1024%2011.1348L24.4673%2013.689L20.9565%2015.7388L16.5894%2013.1937ZM20.107%207L9.5166%2013.196L20.9372%2019.8919V33L24.4013%2030.9822V17.7213L27.9018%2015.6716V28.921L31.4171%2026.8519V13.6173L20.107%207Z%22%20fill%3D%22%232AC98B%22%2F%3E%3C%2Fsvg%3E",link:"https://nabox.io/",supportMobile:!0,disabled:()=>!window.NaboxWallet,injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isNabox},connector:(e,t)=>S(window.NaboxWallet,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.NaboxWallet})),isInstalled:()=>!!window.NaboxWallet},_M={type:exports.WalletType.OKX,showName:"OKX Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M16.2222%2010H10.4444C10.199%2010%2010%2010.199%2010%2010.4444V16.2222C10%2016.4677%2010.199%2016.6667%2010.4444%2016.6667H16.2222C16.4677%2016.6667%2016.6667%2016.4677%2016.6667%2016.2222V10.4444C16.6667%2010.199%2016.4677%2010%2016.2222%2010ZM22.8918%2016.6667H17.114C16.8685%2016.6667%2016.6695%2016.8657%2016.6695%2017.1111V22.8889C16.6695%2023.1343%2016.8685%2023.3333%2017.114%2023.3333H22.8918C23.1372%2023.3333%2023.3362%2023.1343%2023.3362%2022.8889V17.1111C23.3362%2016.8657%2023.1372%2016.6667%2022.8918%2016.6667ZM23.7778%2010H29.5556C29.801%2010%2030%2010.199%2030%2010.4444V16.2222C30%2016.4677%2029.801%2016.6667%2029.5556%2016.6667H23.7778C23.5323%2016.6667%2023.3333%2016.4677%2023.3333%2016.2222V10.4444C23.3333%2010.199%2023.5323%2010%2023.7778%2010ZM16.2222%2023.3333H10.4444C10.199%2023.3333%2010%2023.5323%2010%2023.7778V29.5556C10%2029.801%2010.199%2030%2010.4444%2030H16.2222C16.4677%2030%2016.6667%2029.801%2016.6667%2029.5556V23.7778C16.6667%2023.5323%2016.4677%2023.3333%2016.2222%2023.3333ZM23.7778%2023.3333H29.5556C29.801%2023.3333%2030%2023.5323%2030%2023.7778V29.5556C30%2029.801%2029.801%2030%2029.5556%2030H23.7778C23.5323%2030%2023.3333%2029.801%2023.3333%2029.5556V23.7778C23.3333%2023.5323%2023.5323%2023.3333%2023.7778%2023.3333Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://www.okx.com/",mobileDeepLink:"okx://wallet/dapp/details?dappUrl=$APP_URL",injected:()=>_()&&!!window.okxwallet,disabled:()=>!window.okxwallet,connector:(e,t)=>S(window.okxwallet,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.okxwallet})),isInstalled:()=>!!window.okxwallet},DM={type:exports.WalletType.WalletConnect,showName:"WalletConnect",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_radial_6996_47051%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M27.2897%2015.446C23.2637%2011.518%2016.7363%2011.518%2012.7103%2015.446L12.1785%2015.9649C11.9772%2016.1613%2011.9772%2016.4797%2012.1785%2016.6761L13.836%2018.2933C13.9366%2018.3915%2014.0998%2018.3915%2014.2005%2018.2933L14.9145%2017.5966C17.7232%2014.8563%2022.2769%2014.8563%2025.0855%2017.5966L25.7523%2018.2471C25.8529%2018.3453%2026.0161%2018.3453%2026.1168%2018.2471L27.7743%2016.63C27.9756%2016.4336%2027.9756%2016.1151%2027.7743%2015.9187L27.2897%2015.446ZM32.1928%2020.2297L30.7176%2018.7904C30.5163%2018.594%2030.1899%2018.594%2029.9886%2018.7904L25.2677%2023.3965C25.2174%2023.4456%2025.1358%2023.4456%2025.0854%2023.3965L20.3644%2018.7903L20.3644%2018.7903C20.1631%2018.5939%2019.8367%2018.5939%2019.6354%2018.7903L14.9146%2023.3965C14.8643%2023.4456%2014.7827%2023.4456%2014.7324%2023.3965L10.0114%2018.7903C9.81008%2018.5939%209.48371%2018.5939%209.28241%2018.7903L7.80722%2020.2296C7.60593%2020.426%207.60593%2020.7444%207.80722%2020.9408L14.4591%2027.4308C14.6604%2027.6272%2014.9868%2027.6272%2015.1881%2027.4308L19.9089%2022.8248C19.9592%2022.7757%2020.0408%2022.7757%2020.0912%2022.8248L24.8121%2027.4308C25.0134%2027.6272%2025.3398%2027.6272%2025.5411%2027.4308L32.1928%2020.9409C32.3941%2020.7445%2032.3941%2020.4261%2032.1928%2020.2297Z%22%20fill%3D%22white%22%2F%3E%3Cdefs%3E%3CradialGradient%20id%3D%22paint0_radial_6996_47051%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%280%2020%29%20scale%2840%29%22%3E%3Cstop%20stop-color%3D%22%235D9DF6%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23006FFF%22%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,getPackage:K,connector:(e,t)=>ce(e,t),disconnect:()=>m(void 0,void 0,void 0,(function*(){return(yield K()).disconnect()})),needReadProvider:!0},OM={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:W,connector:(e,t)=>se(e,t)},FM={type:exports.WalletType.Gnosis,showName:"Gnosis",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47074%29%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47074%29%22%3E%3Cmask%20id%3D%22mask0_6996_47074%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%224%22%20y%3D%224%22%20width%3D%2232%22%20height%3D%2232%22%3E%3Cpath%20d%3D%22M36%204H4V36H36V4Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_6996_47074%29%22%3E%3Cmask%20id%3D%22mask1_6996_47074%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%224%22%20y%3D%224%22%20width%3D%2232%22%20height%3D%2232%22%3E%3Cpath%20d%3D%22M20%2036C28.8366%2036%2036%2028.8366%2036%2020C36%2011.1634%2028.8366%204%2020%204C11.1634%204%204%2011.1634%204%2020C4%2028.8366%2011.1634%2036%2020%2036Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask1_6996_47074%29%22%3E%3Cpath%20d%3D%22M36.0641%201.39203H2.46411V38.288H36.0641V1.39203Z%22%20fill%3D%22url%28%23paint1_linear_6996_47074%29%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M28.9623%2019.994H26.7763C26.1235%2019.994%2025.5946%2020.5233%2025.5946%2021.1757V24.3482C25.5946%2025.001%2025.0653%2025.53%2024.4128%2025.53H15.7162C15.0634%2025.53%2014.5344%2026.0593%2014.5344%2026.7117V28.8977C14.5344%2029.5505%2015.0637%2030.0794%2015.7162%2030.0794H24.9162C25.569%2030.0794%2026.0909%2029.5501%2026.0909%2028.8977V27.1441C26.0909%2026.4913%2026.6202%2026.0279%2027.2727%2026.0279H28.9623C29.6151%2026.0279%2030.144%2025.4986%2030.144%2024.8461V21.1617C30.144%2020.5089%2029.6147%2019.994%2028.9623%2019.994Z%22%20fill%3D%22%23121312%22%2F%3E%3Cpath%20d%3D%22M14.5338%2015.6515C14.5338%2014.9987%2015.0631%2014.4698%2015.7156%2014.4698H24.4068C25.0596%2014.4698%2025.5885%2013.9405%2025.5885%2013.288V11.1021C25.5885%2010.4493%2025.0593%209.92035%2024.4068%209.92035H15.2119C14.5591%209.92035%2014.0301%2010.4496%2014.0301%2011.1021V12.7863C14.0301%2013.4391%2013.5009%2013.968%2012.8484%2013.968H11.1661C10.5133%2013.968%209.98438%2014.4973%209.98438%2015.1498V18.8381C9.98438%2019.4909%2010.5156%2019.9933%2011.1684%2019.9933H13.3543C14.0071%2019.9933%2014.5361%2019.464%2014.5361%2018.8115L14.5338%2015.6515Z%22%20fill%3D%22%23121312%22%2F%3E%3Cpath%20d%3D%22M19.0351%2017.6964H21.135C21.8191%2017.6964%2022.3746%2018.2519%2022.3746%2018.936V21.0359C22.3746%2021.72%2021.8191%2022.2755%2021.135%2022.2755H19.0351C18.351%2022.2755%2017.7954%2021.72%2017.7954%2021.0359V18.936C17.7954%2018.2519%2018.351%2017.6964%2019.0351%2017.6964Z%22%20fill%3D%22%23121312%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47074%22%20x1%3D%221.25943%22%20y1%3D%2234.5582%22%20x2%3D%2242.4153%22%20y2%3D%22-3.99282%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2312FF80%22%2F%3E%3Cstop%20offset%3D%220.13%22%20stop-color%3D%22%2315FD85%22%2F%3E%3Cstop%20offset%3D%220.29%22%20stop-color%3D%22%231FF896%22%2F%3E%3Cstop%20offset%3D%220.49%22%20stop-color%3D%22%2330F1B2%22%2F%3E%3Cstop%20offset%3D%220.69%22%20stop-color%3D%22%2348E7D9%22%2F%3E%3Cstop%20offset%3D%220.87%22%20stop-color%3D%22%235FDDFF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47074%22%20x1%3D%223.52203%22%20y1%3D%2233.2685%22%20x2%3D%2241.0897%22%20y2%3D%221.22211%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2312FF80%22%2F%3E%3Cstop%20offset%3D%220.13%22%20stop-color%3D%22%2315FD85%22%2F%3E%3Cstop%20offset%3D%220.29%22%20stop-color%3D%22%231FF896%22%2F%3E%3Cstop%20offset%3D%220.49%22%20stop-color%3D%22%2330F1B2%22%2F%3E%3Cstop%20offset%3D%220.69%22%20stop-color%3D%22%2348E7D9%22%2F%3E%3Cstop%20offset%3D%220.87%22%20stop-color%3D%22%235FDDFF%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47074%22%3E%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22white%22%20transform%3D%22translate%284%204%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportChains:[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:()=>m(void 0,void 0,void 0,(function*(){return!(yield(yield q()).getIsSafe())})),getPackage:q,connector:(e,t)=>m(void 0,void 0,void 0,(function*(){return(yield q()).default(t)}))},SM={type:exports.WalletType.uAuth,showName:"Unstoppable",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M33%209.00916V17.8605L7%2028.3194L33%209.00916Z%22%20fill%3D%22%2300C9FF%22%2F%3E%3Cpath%20d%3D%22M28.1258%208.625V23.8942C28.1258%2026.028%2027.2697%2028.0745%2025.7459%2029.5833C24.222%2031.0922%2022.1553%2031.9398%2020.0003%2031.9398C17.8453%2031.9398%2015.7785%2031.0922%2014.2547%2029.5833C12.7308%2028.0745%2011.8748%2026.028%2011.8748%2023.8942V17.4602L16.7492%2014.804V23.8942C16.7036%2024.2909%2016.7431%2024.6928%2016.8652%2025.0732C16.9874%2025.4538%2017.1892%2025.8045%2017.4577%2026.1024C17.7263%2026.4003%2018.0553%2026.6387%2018.4234%2026.8018C18.7914%2026.9651%2019.1901%2027.0495%2019.5934%2027.0495C19.9966%2027.0495%2020.3953%2026.9651%2020.7634%2026.8018C21.1314%2026.6387%2021.4605%2026.4003%2021.729%2026.1024C21.9975%2025.8045%2022.1995%2025.4538%2022.3215%2025.0732C22.4436%2024.6928%2022.4832%2024.2909%2022.4375%2023.8942V11.7064L28.1258%208.625Z%22%20fill%3D%22%230D67FE%22%2F%3E%3C%2Fsvg%3E",getPackage:V,connector:(e,t)=>m(void 0,void 0,void 0,(function*(){var n;return(yield V()).default(Object.assign(Object.assign({},e),{uAuthParams:Object.assign(Object.assign({walletConnect:()=>DM.connector?DM.connector(e,t):Promise.resolve(void 0)},e.uAuthParams),{clientID:null===(n=e.uAuthParams)||void 0===n?void 0:n.clientID})}),t)})),disconnect:()=>m(void 0,void 0,void 0,(function*(){const{disconnectWallet:e}=yield V();yield e()}))},IM={type:exports.WalletType.Blocto,showName:"Blocto",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M20.7145%2014.1513C18.4586%2014.1513%2016.2568%2015.0211%2014.6108%2016.5641C12.8053%2018.2569%2011.6628%2020.7569%2011.0078%2023.1086C10.5789%2024.6468%2010.364%2026.2429%2010.364%2027.8406C10.364%2028.3234%2010.3838%2028.8023%2010.4219%2029.2757C10.4687%2029.8513%2011.0292%2030.2502%2011.5874%2030.0995C12.0743%2029.9687%2012.5865%2029.8981%2013.1146%2029.8981C14.1992%2029.8981%2015.2157%2030.1931%2016.0871%2030.7084C16.1085%2030.7211%2016.1291%2030.7339%2016.1505%2030.7457C17.5667%2031.5901%2019.2373%2032.054%2021.0189%2031.9945C25.6661%2031.8407%2029.4625%2028.0594%2029.6337%2023.413C29.8208%2018.3298%2025.7564%2014.1505%2020.7152%2014.1505L20.7145%2014.1513ZM20.7145%2027.154C18.4619%2027.154%2016.6358%2025.3279%2016.6358%2023.0761C16.6358%2020.8243%2018.4619%2018.9975%2020.7145%2018.9975C22.967%2018.9975%2024.7931%2020.8235%2024.7931%2023.0761C24.7931%2025.3287%2022.967%2027.154%2020.7145%2027.154Z%22%20fill%3D%22%2314AAFF%22%2F%3E%3Cpath%20d%3D%22M17.0453%2011.3412C17.0453%2012.5171%2016.4293%2013.6081%2015.4175%2014.2075C14.7824%2014.5842%2014.1869%2015.029%2013.6478%2015.5356C12.4513%2016.6568%2011.5585%2018.0325%2010.8972%2019.3963C10.7664%2019.6642%2010.3628%2019.5691%2010.3628%2019.2709V11.3412C10.3628%209.49618%2011.859%208%2013.7041%208C15.5491%208%2017.0453%209.49618%2017.0453%2011.3412Z%22%20fill%3D%22%230077FF%22%2F%3E%3C%2Fsvg%3E",supportChains:[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:J,connector:ie,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 N(Object.assign(Object.assign({},e),{provider:null!==(t=e.provider)&&void 0!==t?t:O.getState().provider}))},needReadProvider:!0},MM={type:exports.WalletType.Rainbow,showName:"Rainbow",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22url%28%23paint0_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2014.133H10.933C19.181%2014.133%2025.867%2020.819%2025.867%2029.067V30.667H29.067C29.4914%2030.667%2029.8983%2030.4984%2030.1984%2030.1984C30.4984%2029.8983%2030.667%2029.4913%2030.667%2029.067C30.667%2018.168%2021.832%209.33398%2010.933%209.33398C10.5087%209.33398%2010.1017%209.50256%209.80164%209.80261C9.50158%2010.1027%209.33301%2010.5096%209.33301%2010.934V14.133Z%22%20fill%3D%22url%28%23paint1_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M26.3999%2029.067H30.6669C30.6669%2029.4914%2030.4983%2029.8983%2030.1983%2030.1984C29.8982%2030.4984%2029.4912%2030.667%2029.0669%2030.667H26.3999V29.067Z%22%20fill%3D%22url%28%23paint2_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M10.934%209.33301V13.6H9.33398V10.934C9.33398%2010.5097%209.50256%2010.1027%209.80261%209.80264C10.1027%209.50258%2010.5096%209.33301%2010.934%209.33301Z%22%20fill%3D%22url%28%23paint3_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2013.6H10.933C19.476%2013.6%2026.4%2020.525%2026.4%2029.067V30.667H21.6V29.067C21.6%2023.176%2016.824%2018.4%2010.933%2018.4H9.33301V13.6Z%22%20fill%3D%22url%28%23paint4_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M22.1331%2029.067H26.4001V30.667H22.1331V29.067Z%22%20fill%3D%22url%28%23paint5_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2017.867V13.6H10.933V17.867H9.33301Z%22%20fill%3D%22url%28%23paint6_linear_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M9.33301%2020.5329C9.33301%2020.7431%209.37439%2020.9511%209.4548%2021.1452C9.53521%2021.3394%209.65306%2021.5157%209.80164%2021.6643C9.95021%2021.8129%2010.1266%2021.9307%2010.3207%2022.0112C10.5148%2022.0916%2010.7229%2022.1329%2010.933%2022.1329C11.8436%2022.1328%2012.7454%2022.3121%2013.5867%2022.6605C14.428%2023.0089%2015.1925%2023.5197%2015.8364%2024.1636C16.4803%2024.8075%2016.991%2025.5719%2017.3395%2026.4133C17.6879%2027.2546%2017.8671%2028.1563%2017.867%2029.0669C17.867%2029.2771%2017.9084%2029.4851%2017.9888%2029.6792C18.0692%2029.8734%2018.1871%2030.0497%2018.3356%2030.1983C18.4842%2030.3469%2018.6606%2030.4647%2018.8547%2030.5452C19.0488%2030.6256%2019.2569%2030.6669%2019.467%2030.6669H22.134V29.0669C22.134%2022.8809%2017.119%2017.8669%2010.934%2017.8669H9.33401L9.33301%2020.5329Z%22%20fill%3D%22url%28%23paint7_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M17.8669%2029.067H22.1329V30.667H19.4669C19.0426%2030.667%2018.6356%2030.4984%2018.3356%2030.1984C18.0355%2029.8983%2017.8669%2029.4914%2017.8669%2029.067Z%22%20fill%3D%22url%28%23paint8_radial_6996_47058%29%22%2F%3E%3Cpath%20d%3D%22M10.934%2022.1329C10.5096%2022.1329%2010.1027%2021.9644%209.80261%2021.6643C9.50256%2021.3643%209.33398%2020.9573%209.33398%2020.5329V17.8669H10.934V22.1329Z%22%20fill%3D%22url%28%23paint9_radial_6996_47058%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47058%22%20x1%3D%2220%22%20y1%3D%220%22%20x2%3D%2220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23174299%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23001E59%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22paint1_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.933%2029.067%29%20rotate%28-90%29%20scale%2819.7333%29%22%3E%3Cstop%20offset%3D%220.77%22%20stop-color%3D%22%23FF4000%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47058%22%20x1%3D%2226.1329%22%20y1%3D%2229.867%22%20x2%3D%2230.6669%22%20y2%3D%2229.867%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FF4000%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_6996_47058%22%20x1%3D%2210.133%22%20y1%3D%229.33301%22%20x2%3D%2210.133%22%20y2%3D%2213.867%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238754C9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF4000%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22paint4_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.933%2029.067%29%20rotate%28-90%29%20scale%2815.4667%29%22%3E%3Cstop%20offset%3D%220.724%22%20stop-color%3D%22%23FFF700%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%22paint5_linear_6996_47058%22%20x1%3D%2222.1331%22%20y1%3D%2229.867%22%20x2%3D%2226.4001%22%20y2%3D%2229.867%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint6_linear_6996_47058%22%20x1%3D%2210.133%22%20y1%3D%2217.867%22%20x2%3D%2210.133%22%20y2%3D%2213.6%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22paint7_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.933%2029.0669%29%20rotate%28-90%29%20scale%2811.2%29%22%3E%3Cstop%20offset%3D%220.595%22%20stop-color%3D%22%2300AAFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22paint8_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2817.5999%2029.867%29%20scale%284.53333%2012.0889%29%22%3E%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22paint9_radial_6996_47058%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2810.133%2022.3999%29%20rotate%28-90%29%20scale%284.53333%2085.9653%29%22%3E%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://rainbow.me",getPackage:X,connector:(e,t)=>le(e,t),needReadProvider:!0},NM={type:exports.WalletType.trust,showName:"TrustWallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47056%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.223%208.63789C19.6801%208.25612%2020.3449%208.25612%2020.802%208.63789C23.9045%2011.229%2027.4422%2011.2092%2028.8199%2011.2015C28.8884%2011.2012%2028.9516%2011.2008%2029.0091%2011.2008C29.3389%2011.2008%2029.655%2011.3331%2029.8865%2011.5681C30.118%2011.8032%2030.2456%2012.1212%2030.2406%2012.4511C30.1753%2016.7785%2030.0018%2019.8711%2029.6607%2022.1401C29.3197%2024.4076%2028.7956%2025.9726%2027.9443%2027.1557C27.0866%2028.3477%2025.9847%2029.0228%2024.8252%2029.6636C24.6238%2029.7749%2024.4186%2029.8862%2024.2089%2030C23.1924%2030.5514%2022.0672%2031.1617%2020.7304%2032.1207C20.3013%2032.4285%2019.7237%2032.4285%2019.2946%2032.1207C17.959%2031.1627%2016.8353%2030.5526%2015.8204%2030.0016C15.6096%2029.8872%2015.4035%2029.7753%2015.2012%2029.6634C14.0426%2029.0224%2012.9421%2028.347%2012.0861%2027.1546C11.2367%2025.9714%2010.7143%2024.4065%2010.3746%2022.1395C10.0347%2019.8708%209.86207%2016.7784%209.79677%2012.4511C9.79179%2012.1212%209.91934%2011.8032%2010.1508%2011.5681C10.3823%2011.3331%2010.6984%2011.2008%2011.0283%2011.2008C11.0852%2011.2008%2011.1477%2011.2012%2011.2156%2011.2015C12.5821%2011.2092%2016.1202%2011.2292%2019.223%208.63789ZM12.2823%2013.6542C12.3602%2017.2983%2012.5276%2019.8846%2012.8108%2021.7745C13.1253%2023.8737%2013.567%2024.9934%2014.0872%2025.7181C14.6008%2026.4335%2015.2757%2026.8894%2016.3937%2027.5079C16.5753%2027.6084%2016.7672%2027.7124%2016.9688%2027.8217C17.8188%2028.2826%2018.843%2028.838%2020.0125%2029.6214C21.1837%2028.837%2022.2094%2028.2812%2023.0609%2027.8199C23.2616%2027.7112%2023.4527%2027.6076%2023.6337%2027.5076C24.7531%2026.8889%2025.4297%2026.4328%2025.9447%2025.717C26.4662%2024.9923%2026.9091%2023.8727%2027.2247%2021.7738C27.5088%2019.8843%2027.677%2017.2982%2027.755%2013.6544C25.9743%2013.5889%2022.9109%2013.2048%2020.0125%2011.1384C17.1177%2013.2023%2014.0588%2013.5879%2012.2823%2013.6542Z%22%20fill%3D%22%233375BB%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47056%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://trustwallet.com/",supportMobile:!0,supportExtension:!0,mobileDeepLink:"https://link.trustwallet.com/open_url?url=$APP_URL",injected:()=>{var e;return(null===(e=window.ethereum)||void 0===e?void 0:e.isTrust)&&!window.safepalProvider},disabled:()=>{var e;return!((null===(e=window.ethereum)||void 0===e?void 0:e.isTrust)||window.trustWallet)},connector:(e,t)=>S(window.trustWallet,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.trustWallet})),isInstalled:()=>!!window.trustWallet},UM={type:exports.WalletType.tokenPocket,showName:"TokenPocket",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47055%29%22%3E%3Cpath%20d%3D%22M40%2013.75C40%206.15609%2033.8439%200%2026.25%200H13.75C6.15609%200%200%206.15609%200%2013.75V26.25C0%2033.8439%206.15609%2040%2013.75%2040H26.25C33.8439%2040%2040%2033.8439%2040%2026.25V13.75Z%22%20fill%3D%22%232980FE%22%2F%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%232980FE%22%2F%3E%3Cpath%20d%3D%22M15.8904%2017.1345H15.8955C15.8904%2017.1038%2015.8904%2017.068%2015.8904%2017.0373V17.1345Z%22%20fill%3D%22%2329AEFF%22%2F%3E%3Cpath%20d%3D%22M26.0782%2018.1068H20.4395V28.2842C20.4395%2028.7652%2020.8283%2029.1541%2021.3093%2029.1541H25.2084C25.6894%2029.1541%2026.0782%2028.7652%2026.0782%2028.2842V18.1068Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M17.7173%2010.8203H17.528H7.43238C6.95137%2010.8203%206.5625%2011.2092%206.5625%2011.6902V15.2208C6.5625%2015.7018%206.95137%2016.0907%207.43238%2016.0907H9.80148H10.743V17.1345V28.3098C10.743%2028.7908%2011.1319%2029.1797%2011.6129%2029.1797H15.3175C15.7985%2029.1797%2016.1873%2028.7908%2016.1873%2028.3098V17.1345V17.0373V16.0907H17.1289H17.5126H17.702C19.1552%2016.0907%2020.3371%2014.9087%2020.3371%2013.4555C20.3525%2012.0023%2019.1705%2010.8203%2017.7173%2010.8203Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M26.0835%2018.1068V25.209C26.2779%2025.255%2026.4775%2025.2909%2026.6822%2025.3216C26.9687%2025.3625%2027.2655%2025.3881%2027.5623%2025.3932C27.5776%2025.3932%2027.593%2025.3932%2027.6135%2025.3932V19.7441C26.7589%2019.6878%2026.0835%2018.9766%2026.0835%2018.1068Z%22%20fill%3D%22url%28%23paint0_linear_6996_47055%29%22%2F%3E%3Cpath%20d%3D%22M27.7259%2010.8203C23.704%2010.8203%2020.4395%2014.0849%2020.4395%2018.1068C20.4395%2021.5658%2022.8495%2024.4619%2026.0834%2025.209V18.1068C26.0834%2017.2011%2026.8202%2016.4642%2027.7259%2016.4642C28.6316%2016.4642%2029.3684%2017.2011%2029.3684%2018.1068C29.3684%2018.8692%2028.8516%2019.5088%2028.1455%2019.693C28.0124%2019.7288%2027.8691%2019.7493%2027.7259%2019.7493V25.3932C27.8691%2025.3932%2028.0073%2025.3881%2028.1455%2025.383C31.9729%2025.1629%2035.0123%2021.9905%2035.0123%2018.1068C35.0174%2014.0849%2031.7529%2010.8203%2027.7259%2010.8203Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M27.7258%2025.3932V19.7493C27.6849%2019.7493%2027.6491%2019.7493%2027.6082%2019.7441V25.3932C27.6491%2025.3932%2027.69%2025.3932%2027.7258%2025.3932Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47055%22%20x1%3D%2227.7284%22%20y1%3D%2221.751%22%20x2%3D%2226.0842%22%20y2%3D%2221.751%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22white%22%2F%3E%3Cstop%20offset%3D%220.9667%22%20stop-color%3D%22white%22%20stop-opacity%3D%220.3233%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22white%22%20stop-opacity%3D%220.3%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47055%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://www.tokenpocket.pro/",supportMobile:!0,supportExtension:!0,mobileDeepLink:`tpdapp://open?params=${encodeURI('{\n "url": "$APP_URL"\n }')}`,injected:()=>{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 S(null===(n=window.tokenpocket)||void 0===n?void 0:n.ethereum,t)},switchChain:e=>{var t;return N(Object.assign(Object.assign({},e),{provider:e.provider||(null===(t=window.tokenpocket)||void 0===t?void 0:t.ethereum)}))},isInstalled:()=>{var e;return!!(null===(e=window.tokenpocket)||void 0===e?void 0:e.ethereum)}},LM={type:exports.WalletType.Cyber,showName:"CyberWallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_10558_4010%29%22%3E%3Cpath%20d%3D%22M40%2012C40%205.37258%2034.6274%200%2028%200H12C5.37258%200%200%205.37258%200%2012V28C0%2034.6274%205.37258%2040%2012%2040H28C34.6274%2040%2040%2034.6274%2040%2028V12Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M24.5625%2020.8286L31.3525%2027.4911C31.4334%2027.5695%2031.498%2027.663%2031.5426%2027.7664C31.5872%2027.8698%2031.611%2027.981%2031.6125%2028.0936C31.6136%2028.2063%2031.5921%2028.318%2031.5491%2028.4221C31.5062%2028.5263%2031.4427%2028.6207%2031.3625%2028.6999L30.8625%2029.1874C30.782%2029.2719%2030.6855%2029.3397%2030.5787%2029.3867C30.4718%2029.4337%2030.3567%2029.4591%2030.24%2029.4613C30.1232%2029.4635%2030.0072%2029.4425%2029.8987%2029.3996C29.7901%2029.3566%2029.6911%2029.2926%2029.6075%2029.2111L21.315%2021.0749C21.1719%2020.9346%2021.0581%2020.7674%2020.98%2020.5829C20.9019%2020.3984%2020.8611%2020.2002%2020.86%2019.9999C20.8596%2019.7991%2020.8997%2019.6003%2020.9779%2019.4154C21.0561%2019.2305%2021.1707%2019.0632%2021.315%2018.9236L29.6075%2010.7874C29.7718%2010.6258%2029.9934%2010.5359%2030.2238%2010.5374C30.4534%2010.5377%2030.674%2010.6274%2030.8388%2010.7874L31.3525%2011.2999C31.4328%2011.3787%2031.4967%2011.4726%2031.5404%2011.5762C31.5842%2011.6799%2031.607%2011.7911%2031.6075%2011.9036C31.6076%2012.0162%2031.5851%2012.1277%2031.5413%2012.2314C31.4975%2012.3351%2031.4333%2012.429%2031.3525%2012.5074L24.5613%2019.1724C24.4518%2019.2807%2024.3648%2019.4097%2024.3055%2019.5518C24.2462%2019.694%2024.2157%2019.8465%2024.2157%2020.0005C24.2157%2020.1545%2024.2462%2020.307%2024.3055%2020.4492C24.3648%2020.5913%2024.453%2020.7203%2024.5625%2020.8286ZM15.4375%2019.1786L8.64875%2012.5149C8.56681%2012.4364%208.50137%2012.3424%208.45629%2012.2382C8.41121%2012.1341%208.3874%2012.0221%208.38625%2011.9086C8.38545%2011.7952%208.40763%2011.6828%208.45146%2011.5782C8.49528%2011.4735%208.55985%2011.3789%208.64125%2011.2999L9.1375%2010.8124C9.27986%2010.6686%209.46491%2010.5748%209.665%2010.5449C9.79687%2010.5282%209.9308%2010.5414%2010.0569%2010.5833C10.183%2010.6253%2010.2981%2010.695%2010.3938%2010.7874L18.6838%2018.9249C18.8267%2019.0652%2018.9406%2019.2324%2019.0187%2019.4169C19.0967%2019.6014%2019.1376%2019.7995%2019.1388%2019.9999C19.1388%2020.2004%2019.0986%2020.3989%2019.0204%2020.5836C18.9422%2020.7682%2018.8278%2020.9353%2018.6838%2021.0749L10.3938%2029.2124C10.2292%2029.3736%2010.0078%2029.4634%209.7775%2029.4624C9.5474%2029.4623%209.32636%2029.3726%209.16125%2029.2124L8.64875%2028.7074C8.56825%2028.6284%208.50417%2028.5343%208.46019%2028.4305C8.41621%2028.3266%208.39321%2028.2151%208.3925%2028.1024C8.39294%2027.9898%208.41595%2027.8785%208.46018%2027.775C8.50441%2027.6715%208.56896%2027.578%208.65%2027.4999L15.4375%2020.8374C15.5472%2020.729%2015.6343%2020.6%2015.6937%2020.4577C15.7531%2020.3154%2015.7837%2020.1628%2015.7837%2020.0086C15.7837%2019.8544%2015.7531%2019.7018%2015.6937%2019.5595C15.6343%2019.4173%2015.5472%2019.287%2015.4375%2019.1786Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_10558_4010%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",link:"https://wallet.cyber.co",disabled:()=>m(void 0,void 0,void 0,(function*(){return!(yield(yield Y()).getIsCyber())})),getPackage:Y,connector:(e,t)=>ue(e,t),supportChains:tM,switchChain:e=>m(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},BM={type:exports.WalletType.uniPass,showName:"UniPass",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47070%29%22%3E%3Cpath%20d%3D%22M19.1103%2030.3416C21.2844%2027.5455%2024.9114%2026.3075%2028.3414%2027.1909L28.4555%2027.2206L28.377%2027.3096C28.1373%2027.5845%2027.8839%2027.8473%2027.6179%2028.0969L27.5912%2028.1221H27.5541C24.6835%2027.588%2021.7545%2028.6977%2019.9584%2030.9999L19.9124%2031.0607L19.8695%2031.1171H19.8339C19.4682%2031.1111%2019.1031%2031.0879%2018.7397%2031.0473L18.6225%2031.034L18.6877%2030.9347C18.8138%2030.7301%2018.9621%2030.5299%2019.1103%2030.3416ZM26.2775%2028.9271L26.3932%2028.9286H26.6141L26.4347%2029.0561C24.9424%2030.1187%2023.2108%2030.796%2021.3936%2031.0281L21.1757%2031.0548L21.3343%2030.9065C22.6619%2029.629%2024.4351%2028.919%2026.2775%2028.9271ZM23.6902%2025.1537C23.7631%2025.1382%2023.8385%2025.138%2023.9114%2025.1533C23.9844%2025.1686%2024.0533%2025.1991%2024.1138%2025.2427C24.1743%2025.2862%2024.225%2025.342%2024.2626%2025.4064C24.3002%2025.4707%2024.324%2025.5422%2024.3322%2025.6163V25.6015C24.3481%2025.7335%2024.314%2025.8667%2024.2366%2025.9748C24.1592%2026.0829%2024.0442%2026.1581%2023.9141%2026.1857C21.7298%2026.657%2019.7818%2027.884%2018.4135%2029.6507C18.1308%2030.0157%2017.8741%2030.4002%2017.6455%2030.8013L17.6188%2030.8487L17.5668%2030.8368C17.2555%2030.7671%2016.9382%2030.6841%2016.6417%2030.5877L16.5542%2030.5596L16.5957%2030.4824C16.8781%2029.9623%2017.2029%2029.4664%2017.5668%2028.9998C18.9537%2027.2083%2020.8811%2025.9116%2023.0631%2025.302C23.2715%2025.2499%2023.4806%2025.2005%2023.6903%2025.1537H23.6902ZM22.6331%2023.3108C25.2019%2022.6404%2027.9174%2022.8056%2030.386%2023.7823L30.4513%2023.809L30.4275%2023.8757C30.3184%2024.1678%2030.1972%2024.4551%2030.0643%2024.7371L30.0361%2024.7994L29.9723%2024.7742C25.3004%2022.9233%2019.9676%2024.3722%2016.8745%2028.3326C16.4247%2028.9104%2016.0315%2029.53%2015.7002%2030.183L15.669%2030.2438L15.6068%2030.2156C15.3221%2030.094%2015.0389%2029.9591%2014.7646%2029.8108L14.7023%2029.7767L14.7335%2029.7144C15.098%2028.9937%2015.5315%2028.31%2016.0278%2027.6728C17.6867%2025.5284%2020.0096%2023.9944%2022.6331%2023.3108ZM14.2157%2027.0326C14.2948%2027.0246%2014.3747%2027.0343%2014.4496%2027.0609C14.5245%2027.0875%2014.5926%2027.1304%2014.649%2027.1865V27.1895C14.7362%2027.2776%2014.7905%2027.393%2014.8026%2027.5164C14.8148%2027.6398%2014.7841%2027.7636%2014.7157%2027.867C14.4288%2028.304%2014.1679%2028.7575%2013.9343%2029.2252L13.8987%2029.2993L13.8291%2029.2533C13.5671%2029.0774%2013.3124%2028.8909%2013.0655%2028.6943L13.0195%2028.6573L13.0462%2028.6039C13.2801%2028.1453%2013.539%2027.6998%2013.8216%2027.2695C13.8657%2027.2034%2013.9239%2027.1478%2013.9921%2027.1068C14.0602%2027.0659%2014.1366%2027.0405%2014.2157%2027.0326ZM16.2251%2021.8444L16.2621%2021.8578C16.6571%2022.0062%2017.0717%2022.0961%2017.4927%2022.1247L17.7122%2022.1395L17.5268%2022.2581C16.0995%2023.1717%2014.8397%2024.3237%2013.8024%2025.6638C13.2502%2026.3739%2012.7629%2027.1321%2012.3464%2027.9293L12.3019%2028.0153L12.2322%2027.9471C12.0024%2027.7202%2011.7726%2027.4771%2011.5576%2027.2265L11.525%2027.188L11.5487%2027.145C12.6881%2025.0639%2014.2745%2023.2613%2016.1939%2021.8667L16.225%2021.8444H16.2251ZM14.9678%2025.7513C18.9166%2021.2068%2025.3094%2019.6599%2030.899%2021.8964L30.9539%2021.923L30.9435%2021.9809C30.9286%2022.0639%2030.9138%2022.1454%2030.8975%2022.227C30.851%2022.4549%2030.7976%2022.6814%2030.7374%2022.9061L30.7151%2022.9861L30.6395%2022.9535C29.063%2022.2963%2027.3717%2021.9591%2025.6637%2021.9616C25.1145%2021.9617%2024.5659%2021.9959%2024.0209%2022.0639C20.8225%2022.4547%2017.8843%2024.0224%2015.7787%2026.4615C15.7307%2026.5175%2015.6716%2026.563%2015.6052%2026.5951C15.5387%2026.6273%2015.4664%2026.6454%2015.3926%2026.6483C15.3189%2026.6512%2015.2453%2026.6389%2015.1766%2026.6121C15.1078%2026.5853%2015.0453%2026.5446%2014.9929%2026.4926L14.9814%2026.4809C14.8882%2026.3831%2014.8351%2026.2538%2014.8326%2026.1188C14.8301%2025.9837%2014.8783%2025.8525%2014.9678%2025.7513ZM25.5732%2024.9135C26.9255%2024.8631%2028.2749%2025.0725%2029.5483%2025.5304L29.6313%2025.56L29.5868%2025.6356C29.4242%2025.9115%2029.2496%2026.1801%2029.0635%2026.4407L29.0308%2026.4867L28.9804%2026.4689C28.0083%2026.1458%2026.9905%2025.9816%2025.9662%2025.9826H25.6207C25.4851%2025.988%2025.3525%2025.9419%2025.2494%2025.8537C25.1463%2025.7654%2025.0803%2025.6414%2025.0647%2025.5066L25.0631%2025.4883C25.0577%2025.4168%2025.0668%2025.345%2025.0897%2025.2771C25.1126%2025.2092%2025.1489%2025.1466%2025.1965%2025.0929C25.2441%2025.0393%2025.302%2024.9958%2025.3667%2024.965C25.4314%2024.9342%2025.5016%2024.9167%2025.5732%2024.9135ZM14.4696%2020.5901L14.5141%2020.6465C14.7186%2020.879%2014.9467%2021.0896%2015.1946%2021.2751L15.2717%2021.3315L15.1961%2021.3893V21.3789C13.4756%2022.7183%2012.0327%2024.3802%2010.9482%2026.2717L10.8904%2026.371L10.8252%2026.2761C10.6265%2025.993%2010.4397%2025.6905%2010.2707%2025.3865L10.2499%2025.3495L10.2721%2025.3124C10.6206%2024.7446%2010.9997%2024.1962%2011.4079%2023.6696C12.285%2022.5398%2013.2951%2021.5198%2014.4162%2020.6316L14.4696%2020.5901ZM11.1411%2021.0951C11.2142%2021.0929%2011.287%2021.1056%2011.3551%2021.1325C11.4231%2021.1593%2011.485%2021.1998%2011.5369%2021.2513H11.5339C11.6314%2021.3491%2011.6876%2021.4805%2011.6909%2021.6185C11.6942%2021.7564%2011.6444%2021.8904%2011.5517%2021.9927C11.2592%2022.316%2010.9793%2022.6503%2010.7125%2022.995C10.4034%2023.394%2010.1101%2023.8051%209.83327%2024.2271L9.75765%2024.3428L9.70578%2024.2152C9.55906%2023.8563%209.43089%2023.4901%209.32175%2023.1181L9.31135%2023.084L9.33215%2023.0558C9.51007%2022.8052%209.68943%2022.5621%209.86591%2022.3352C10.1509%2021.9723%2010.4476%2021.6187%2010.7555%2021.2751C10.8042%2021.2204%2010.8635%2021.1763%2010.9298%2021.1454C10.9961%2021.1144%2011.068%2021.0973%2011.1411%2021.0951ZM13.4435%2016.2904V17.5773L13.4139%2017.5981C11.8107%2018.7382%2010.3831%2020.1069%209.17647%2021.6606L9.02818%2021.8474L9.00149%2021.6798C8.93393%2021.2379%208.89332%2020.7923%208.8799%2020.3454V20.3173L8.90364%2020.2936C10.1865%2018.7815%2011.6771%2017.4586%2013.3309%2016.3645L13.4435%2016.2904ZM23.5124%2018.9992C26.0674%2018.6791%2028.6619%2018.9849%2031.0725%2019.8903L31.1199%2019.9081V20C31.1199%2020.3084%2031.1066%2020.6272%2031.0799%2020.9459L31.071%2021.0438L30.9806%2021.0068C29.2411%2020.3068%2027.3831%2019.9484%2025.508%2019.9511C24.0908%2019.9496%2022.6806%2020.1493%2021.3195%2020.5442L21.1074%2020.6049L21.2424%2020.43C21.4996%2020.0941%2021.7064%2019.7225%2021.8562%2019.3269L21.8711%2019.2913L21.9081%2019.2824C22.4377%2019.1609%2022.9732%2019.0664%2023.5124%2018.9992ZM13.5429%2018.719L13.5696%2018.8257C13.6452%2019.1366%2013.7556%2019.438%2013.8987%2019.7242L13.921%2019.7776L13.875%2019.8132C13.5021%2020.106%2013.141%2020.4137%2012.7927%2020.7354C12.6908%2020.8283%2012.5572%2020.8787%2012.4194%2020.8762C12.2815%2020.8737%2012.1498%2020.8186%2012.0513%2020.7221L12.0386%2020.7089C11.9903%2020.657%2011.9526%2020.5961%2011.928%2020.5296C11.9033%2020.463%2011.892%2020.3923%2011.8949%2020.3214C11.8977%2020.2505%2011.9146%2020.1809%2011.9445%2020.1166C11.9744%2020.0522%2012.0167%2019.9945%2012.0691%2019.9466C12.5122%2019.538%2012.9743%2019.1506%2013.4539%2018.7857L13.5429%2018.719ZM30.0212%2017.6978C30.0875%2017.6534%2030.163%2017.6243%2030.242%2017.6127C30.321%2017.601%2030.4016%2017.6072%2030.4779%2017.6307C30.6781%2017.6915%2030.8753%2017.7553%2031.071%2017.8234L31.1169%2017.8412V18.9814L31.0191%2018.9458C30.7366%2018.8421%2030.4513%2018.7462%2030.1636%2018.6582C30.0455%2018.622%2029.9434%2018.5462%2029.8746%2018.4436C29.8057%2018.341%2029.7743%2018.2178%2029.7855%2018.0948L29.7874%2018.0776C29.7969%2018.0012%2029.8226%2017.9278%2029.863%2017.8623C29.9033%2017.7968%2029.9573%2017.7407%2030.0212%2017.6978ZM12.9543%2014.1613L12.9943%2014.2147C13.1908%2014.4784%2013.327%2014.7821%2013.3932%2015.1043L13.4035%2015.1487L13.3605%2015.1754C11.7602%2016.1656%2010.2962%2017.3609%209.00594%2018.7308L8.8799%2018.8628V17.3283L8.90214%2017.309C10.1135%2016.1251%2011.4538%2015.0807%2012.8979%2014.1954L12.9543%2014.1613ZM23.1357%2017.0036C24.9708%2016.7694%2026.8313%2016.827%2028.6483%2017.174C28.7791%2017.1996%2028.8956%2017.273%2028.9752%2017.38C29.0547%2017.4869%2029.0914%2017.6197%2029.0783%2017.7523V17.7567C29.0713%2017.831%2029.0489%2017.903%2029.0126%2017.9682C28.9762%2018.0333%2028.9266%2018.0902%2028.8671%2018.1351C28.8075%2018.18%2028.7392%2018.212%2028.6666%2018.2291C28.5939%2018.2462%2028.5185%2018.2479%2028.4452%2018.2342C27.4259%2018.0378%2026.3903%2017.9385%2025.3523%2017.9376C24.6585%2017.9385%2023.9652%2017.9821%2023.2766%2018.0681C22.9207%2018.1132%2022.5661%2018.1691%2022.2136%2018.2357L22.1201%2018.2549V18.1585C22.1364%2018.031%2022.1364%2017.9065%2022.1364%2017.7878V17.1622L22.1972%2017.1518C22.5082%2017.0912%2022.8212%2017.0418%2023.1357%2017.0036ZM22.7607%2015.0064C25.5529%2014.6496%2028.3894%2014.9108%2031.0695%2015.7715L31.1199%2015.7878V16.916L31.0235%2016.8835C29.1473%2016.247%2027.1794%2015.9229%2025.1982%2015.9241C24.4273%2015.9255%2023.6573%2015.975%2022.8926%2016.0724C22.6895%2016.0976%2022.476%2016.1287%2022.2209%2016.1703L22.1364%2016.1836V15.0954L22.1987%2015.0865C22.3857%2015.0573%2022.573%2015.0306%2022.7607%2015.0064ZM11.1617%2013.2969L11.1997%2013.2971C11.4779%2013.3014%2011.753%2013.3566%2012.0113%2013.4599L12.1433%2013.5133L12.0232%2013.5889C10.9552%2014.2711%209.94466%2015.0392%209.00149%2015.8856L8.8799%2015.9939V15.5787C8.87813%2015.0663%209.05067%2014.5685%209.36918%2014.1672C9.58201%2013.8952%209.85413%2013.6755%2010.1648%2013.5247C10.4754%2013.3738%2010.8164%2013.2959%2011.1617%2013.2969ZM22.384%2013.0107C25.0873%2012.6701%2027.831%2012.8569%2030.4631%2013.5608C30.6455%2013.6097%2030.8427%2013.6661%2031.068%2013.7343L31.1185%2013.7491V14.867L31.0235%2014.8374C29.088%2014.2274%2027.0704%2013.9174%2025.041%2013.9181C24.1983%2013.9187%2023.3565%2013.9717%2022.5205%2014.0768L22.2966%2014.1064L22.1394%2014.1286V13.3695C22.1394%2013.2865%2022.1483%2013.2005%2022.1483%2013.1027V13.0433L22.2788%2013.0255L22.384%2013.0107ZM25.4947%2010.846C27.2618%2010.8946%2029.0173%2011.1488%2030.7255%2011.6037L30.7596%2011.6126L30.7745%2011.6452C30.9159%2011.9847%2031.0155%2012.3402%2031.071%2012.7038L31.0843%2012.8269L30.9761%2012.7957C30.8101%2012.7468%2030.6436%2012.6998%2030.4764%2012.6549C28.8409%2012.2181%2027.1601%2011.9733%2025.468%2011.9254C25.3939%2011.9235%2025.321%2011.9064%2025.2538%2011.875C25.1867%2011.8435%2025.1268%2011.7986%2025.0779%2011.7429C25.029%2011.6871%2024.9922%2011.6219%2024.9698%2011.5512C24.9473%2011.4806%2024.9398%2011.4061%2024.9476%2011.3324L24.9492%2011.3173C24.9654%2011.1851%2025.0302%2011.0636%2025.1311%2010.9765C25.2319%2010.8894%2025.3615%2010.8429%2025.4947%2010.846ZM23.6325%2010.8712C23.7095%2010.8671%2023.7866%2010.8796%2023.8584%2010.9078C23.9302%2010.9361%2023.9951%2010.9795%2024.0487%2011.035C24.1023%2011.0906%2024.1433%2011.157%2024.1689%2011.2298C24.1946%2011.3026%2024.2043%2011.38%2024.1974%2011.4569H24.2033C24.1913%2011.5852%2024.1334%2011.7049%2024.0402%2011.794C23.9471%2011.883%2023.8249%2011.9355%2023.6962%2011.9417C23.2811%2011.9654%2022.8644%2011.9996%2022.4493%2012.0455L22.3366%2012.0574L22.3722%2011.9506C22.4857%2011.6001%2022.641%2011.2646%2022.8348%2010.9513L22.8541%2010.9216H22.8911C23.1417%2010.9009%2023.3878%2010.8831%2023.6325%2010.8712ZM26.6408%208.88001C27.2697%208.87952%2027.8917%209.01127%2028.4664%209.2667C29.0411%209.52213%2029.5557%209.89554%2029.9768%2010.3627L30.125%2010.5317L29.9026%2010.4813C28.1999%2010.0953%2026.4593%209.90035%2024.7133%209.9001C24.4687%209.9001%2024.2196%209.90455%2023.972%209.91489H23.7437L23.926%209.78145C24.6405%209.24232%2025.5007%208.93078%2026.3947%208.8874C26.4806%208.88001%2026.5607%208.88001%2026.6408%208.88001Z%22%20fill%3D%22url%28%23paint0_linear_6996_47070%29%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47070%22%20x1%3D%228.87986%22%20y1%3D%229.16911%22%20x2%3D%222232.59%22%20y2%3D%222232.59%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23398BFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238864FF%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_6996_47070%22%3E%3Crect%20width%3D%2222.24%22%20height%3D%2222.24%22%20fill%3D%22white%22%20transform%3D%22translate%288.87988%208.88%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://unipass.id",supportChains:pM,getPackage:Q,connector:(e,t)=>de(e,t),disconnect:()=>m(void 0,void 0,void 0,(function*(){const{disconnectWallet:e}=yield Q();yield e()})),notSupported:{sign:!0},contract:{signTypedData:({typedData:e})=>m(void 0,void 0,void 0,(function*(){const{signTypedData:t}=yield Q();return t(e)}))},switchChain:e=>m(void 0,void 0,void 0,(function*(){const{switchChain:t}=yield Q();return yield t(e),{result:!0}})),isContractWallet:()=>!0,needReadProvider:!0},RM={type:exports.WalletType.Gate,showName:"Gate Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47059%29%22%3E%3Cpath%20d%3D%22M20%2026.6C18.2496%2026.6%2016.5709%2025.9047%2015.3331%2024.6669C14.0954%2023.4291%2013.4%2021.7504%2013.4%2020C13.4%2018.2496%2014.0954%2016.5709%2015.3331%2015.3331C16.5709%2014.0954%2018.2496%2013.4%2020%2013.4V8C17.6266%208%2015.3065%208.70379%2013.3332%2010.0224C11.3598%2011.3409%209.8217%2013.2151%208.91345%2015.4078C8.0052%2017.6005%207.76756%2020.0133%208.23058%2022.3411C8.69361%2024.6688%209.83649%2026.8071%2011.5147%2028.4853C13.1929%2030.1635%2015.3311%2031.3064%2017.6589%2031.7695C19.9867%2032.2324%2022.3995%2031.9948%2024.5922%2031.0866C26.785%2030.1783%2028.659%2028.6402%2029.9776%2026.6668C31.2962%2024.6934%2032%2022.3734%2032%2020H26.6C26.6%2021.7504%2025.9047%2023.4291%2024.6669%2024.6669C23.4291%2025.9047%2021.7504%2026.6%2020%2026.6Z%22%20fill%3D%22%232354E6%22%2F%3E%3Cpath%20d%3D%22M26.6%2013.4H20V19.9999H26.6V13.4Z%22%20fill%3D%22%2317E6A1%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47059%22%3E%3Crect%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22white%22%20transform%3D%22translate%288%208%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!1,link:"https://chromewebstore.google.com/detail/gate-wallet/cpmkedoipcpimgecpmgpldfpohjplkpp",disabled:()=>!window.gatewallet,connector:(e,t)=>S(window.gatewallet,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.gatewallet})),isInstalled:()=>!!window.gatewallet},jM={type:exports.WalletType.Rabby,showName:"Rabby Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M31.6568%2021.4761C32.5816%2019.4024%2028.008%2013.609%2023.6391%2011.1949C20.8846%209.32499%2018.0155%209.58224%2017.4336%2010.403C16.1588%2012.2055%2021.6581%2013.7315%2025.3349%2015.513C24.5448%2015.8577%2023.8001%2016.4755%2023.3618%2017.2665C21.9906%2015.765%2018.9815%2014.4717%2015.45%2015.513C13.07%2016.2156%2011.0925%2017.8702%2010.3286%2020.3701C10.1002%2020.2695%209.85027%2020.2276%209.60151%2020.2479C9.35274%2020.2683%209.11299%2020.3504%208.90395%2020.4868C8.69492%2020.6232%208.52321%2020.8096%208.40438%2021.0291C8.28554%2021.2486%208.22334%2021.4943%208.22339%2021.7439C8.22339%2022.5751%208.89364%2023.2471%209.72051%2023.2471C9.87451%2023.2471%2010.354%2023.1447%2010.354%2023.1447L18.0155%2023.1999C14.9513%2028.0771%2012.5293%2028.7902%2012.5293%2029.6355C12.5293%2030.4799%2014.8463%2030.2506%2015.7169%2029.9365C19.881%2028.428%2024.3531%2023.7292%2025.1214%2022.3765C28.3449%2022.7799%2031.0539%2022.8289%2031.6568%2021.4761Z%22%20fill%3D%22url%28%23paint0_linear_6996_47069%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M25.3358%2015.513C25.5064%2015.4456%2025.4793%2015.1936%2025.432%2014.995C25.3244%2014.5391%2023.4685%2012.6999%2021.7247%2011.8756C19.3499%2010.753%2017.6008%2010.8116%2017.3418%2011.3287C17.8257%2012.3236%2020.0692%2013.2581%2022.4115%2014.2337C23.4108%2014.6502%2024.4284%2015.0737%2025.3358%2015.513Z%22%20fill%3D%22url%28%23paint1_linear_6996_47069%29%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.3205%2025.5282C21.8402%2025.3445%2021.2977%2025.1747%2020.6808%2025.0207C21.3388%2023.8404%2021.477%2022.0921%2020.8558%2020.987C19.9834%2019.4356%2018.8897%2018.6096%2016.346%2018.6096C14.9478%2018.6096%2011.1818%2019.0821%2011.1144%2022.2365C11.1074%2022.5681%2011.1144%2022.8709%2011.138%2023.15L18.0155%2023.1999C17.088%2024.676%2016.22%2025.7706%2015.4605%2026.6027C16.3723%2026.8372%2017.1257%2027.0341%2017.8169%2027.2152C18.4732%2027.3867%2019.0734%2027.5442%2019.7025%2027.7052C20.6176%2027.0321%2021.4918%2026.3051%2022.3205%2025.5282Z%22%20fill%3D%22url%28%23paint2_linear_6996_47069%29%22%2F%3E%3Cpath%20d%3D%22M10.2367%2022.8263C10.5167%2025.222%2011.8747%2026.16%2014.6484%2026.4383C17.4222%2026.7165%2019.0121%2026.5301%2021.1304%2026.7235C22.8997%2026.8845%2024.4791%2027.7893%2025.0644%2027.4769C25.5921%2027.196%2025.2972%2026.1793%2024.5919%2025.5274C23.6767%2024.6821%2022.4106%2024.0941%2020.1837%2023.8859C20.6273%2022.6661%2020.5031%2020.9564%2019.8136%2020.0271C18.8161%2018.6814%2016.9768%2018.0733%2014.6484%2018.3384C12.2159%2018.6166%209.88406%2019.8189%2010.2367%2022.8263Z%22%20fill%3D%22url%28%23paint3_linear_6996_47069%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47069%22%20x1%3D%2215.1726%22%20y1%3D%2219.6395%22%20x2%3D%2231.4651%22%20y2%3D%2224.2446%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238697FF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23ABB7FF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47069%22%20x1%3D%2228.7159%22%20y1%3D%2219.3289%22%20x2%3D%2216.9262%22%20y2%3D%227.54961%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238697FF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235156D8%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47069%22%20x1%3D%2222.6478%22%20y1%3D%2225.9395%22%20x2%3D%2211.3419%22%20y2%3D%2219.461%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23465EED%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238697FF%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint3_linear_6996_47069%22%20x1%3D%2216.1447%22%20y1%3D%2219.517%22%20x2%3D%2223.8062%22%20y2%3D%2229.219%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%238898FF%22%2F%3E%3Cstop%20offset%3D%220.984%22%20stop-color%3D%22%236277F1%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!1,link:"https://rabby.io",disabled:()=>!window.rabby,connector:(e,t)=>S(window.rabby,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.rabby})),isInstalled:()=>!!window.rabby},GM={type:exports.WalletType.SocialLogin,showName:"Social Login",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22%2341454F%22%2F%3E%3Cpath%20d%3D%22M7.33317%2016.6666C7.01234%2016.6666%206.73768%2016.5524%206.50921%2016.3239C6.28074%2016.0955%206.1665%2015.8208%206.1665%2015.5V8.49998C6.1665%208.17915%206.28074%207.90449%206.50921%207.67602C6.73768%207.44755%207.01234%207.33331%207.33317%207.33331H16.6665C16.9873%207.33331%2017.262%207.44755%2017.4905%207.67602C17.7189%207.90449%2017.8332%208.17915%2017.8332%208.49998V15.5C17.8332%2015.8208%2017.7189%2016.0955%2017.4905%2016.3239C17.262%2016.5524%2016.9873%2016.6666%2016.6665%2016.6666H7.33317ZM11.9998%2012.5833L16.6665%209.66665V8.49998L11.9998%2011.4166L7.33317%208.49998V9.66665L11.9998%2012.5833Z%22%20fill%3D%22white%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_6996_47057%29%22%3E%3Cpath%20d%3D%22M35%2012C35%208.1332%2031.8668%205%2028%205C24.1332%205%2021%208.1332%2021%2012C21%2015.2816%2023.2596%2018.0368%2026.3088%2018.7928V14.1392H24.864V12H26.3088V11.0788C26.3088%208.696%2027.3868%207.5928%2029.7248%207.5928C30.1672%207.5928%2030.9344%207.6796%2031.2452%207.7664V9.704C31.08%209.6872%2030.7944%209.6788%2030.436%209.6788C29.288%209.6788%2028.8456%2010.1128%2028.8456%2011.244V12H31.1332L30.7412%2014.1392H28.8484V18.9496C32.3148%2018.5296%2035%2015.5784%2035%2012Z%22%20fill%3D%22%230866FF%22%2F%3E%3Cpath%20d%3D%22M30.741%2014.1392L31.133%2012H28.8454V11.244C28.8454%2010.1128%2029.2878%209.67877%2030.4358%209.67877C30.7914%209.67877%2031.0798%209.68717%2031.245%209.70397V7.76637C30.9314%207.67957%2030.167%207.59277%2029.7246%207.59277C27.3866%207.59277%2026.3086%208.69597%2026.3086%2011.0788V12H24.8638V14.1392H26.3086V18.7928C26.849%2018.9272%2027.4174%2019%2027.9998%2019C28.2882%2019%2028.571%2018.9832%2028.8482%2018.9496V14.1392H30.741Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cg%20clip-path%3D%22url%28%23clip1_6996_47057%29%22%3E%3Cpath%20d%3D%22M18.16%2028.1458C18.16%2027.6908%2018.1192%2027.2533%2018.0433%2026.8333H12V29.3183H15.4533C15.3017%2030.1175%2014.8467%2030.7941%2014.1642%2031.2491V32.865H16.2467C17.46%2031.745%2018.16%2030.1%2018.16%2028.1458Z%22%20fill%3D%22%234285F4%22%2F%3E%3Cpath%20d%3D%22M11.9998%2034.4166C13.7323%2034.4166%2015.1848%2033.845%2016.2465%2032.865L14.164%2031.2491C13.5923%2031.6341%2012.8632%2031.8675%2011.9998%2031.8675C10.3315%2031.8675%208.91398%2030.7416%208.40648%2029.225H6.27148V30.8816C7.32732%2032.9758%209.49148%2034.4166%2011.9998%2034.4166Z%22%20fill%3D%22%2334A853%22%2F%3E%3Cpath%20d%3D%22M8.40683%2029.2191C8.2785%2028.8341%208.20266%2028.4258%208.20266%2028C8.20266%2027.5741%208.2785%2027.1658%208.40683%2026.7808V25.1241H6.27183C5.83433%2025.9875%205.5835%2026.9616%205.5835%2028C5.5835%2029.0383%205.83433%2030.0125%206.27183%2030.8758L7.93433%2029.5808L8.40683%2029.2191Z%22%20fill%3D%22%23FBBC05%22%2F%3E%3Cpath%20d%3D%22M11.9998%2024.1383C12.9448%2024.1383%2013.7848%2024.465%2014.4557%2025.095L16.2932%2023.2575C15.179%2022.2191%2013.7323%2021.5833%2011.9998%2021.5833C9.49148%2021.5833%207.32732%2023.0241%206.27148%2025.1241L8.40648%2026.7808C8.91398%2025.2641%2010.3315%2024.1383%2011.9998%2024.1383Z%22%20fill%3D%22%23EA4335%22%2F%3E%3C%2Fg%3E%3Cmask%20id%3D%22mask0_6996_47057%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2221%22%20y%3D%2223%22%20width%3D%2214%22%20height%3D%2211%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2023.1875H35V33.1875H21V23.1875Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_6996_47057%29%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M30.4337%2030.0246C30.0063%2030.0701%2029.6594%2029.903%2029.393%2029.5916C29.0418%2029.1808%2028.9574%2028.7127%2029.1402%2028.214C29.3069%2027.7594%2029.6334%2027.4588%2030.1419%2027.3691C30.7188%2027.2672%2031.3177%2027.6378%2031.5221%2028.2202C31.5767%2028.3755%2031.6009%2028.5366%2031.6071%2028.657C31.6027%2029.3858%2031.1069%2029.953%2030.4337%2030.0246M26.4813%2029.7218C25.9785%2030.1611%2025.2701%2030.1317%2024.7948%2029.6635C24.2491%2029.126%2024.2598%2028.2133%2024.8177%2027.6913C25.4058%2027.1412%2026.3517%2027.2859%2026.7543%2027.9895C26.879%2028.2076%2026.9426%2028.4426%2026.9414%2028.7393C26.9325%2029.0949%2026.794%2029.4486%2026.4813%2029.7218M34.9499%2029.4469C34.7791%2027.5043%2034.0783%2025.7445%2032.9424%2024.136C32.8905%2024.0626%2032.834%2023.9963%2032.7464%2023.9592C31.9026%2023.602%2031.0266%2023.3471%2030.1181%2023.1926C29.9989%2023.1723%2029.9355%2023.2133%2029.8877%2023.3095C29.817%2023.4514%2029.7358%2023.5887%2029.6689%2023.732C29.6179%2023.8414%2029.5394%2023.8715%2029.4213%2023.8558C28.4643%2023.7284%2027.5068%2023.726%2026.5498%2023.855C26.4382%2023.8701%2026.3642%2023.842%2026.3176%2023.7379C26.2651%2023.6203%2026.1929%2023.5106%2026.1429%2023.3921C26.0697%2023.2191%2025.9594%2023.1662%2025.7605%2023.2054C24.9295%2023.3688%2024.1234%2023.6042%2023.3407%2023.9169C23.1873%2023.9782%2023.0786%2024.0698%2022.9882%2024.2024C21.8942%2025.8055%2021.2034%2027.5449%2021.0378%2029.4632C20.9846%2030.0796%2020.9897%2030.6961%2021.0396%2031.3123C21.0489%2031.4278%2021.0656%2031.5383%2021.1823%2031.6175C22.1825%2032.2966%2023.2662%2032.8136%2024.4332%2033.1726C24.5437%2033.2065%2024.6147%2033.1837%2024.6808%2033.093C24.8865%2032.811%2025.0771%2032.5207%2025.2499%2032.219C25.3126%2032.1094%2025.2889%2032.0536%2025.1685%2032.0088C24.8908%2031.9053%2024.6174%2031.791%2024.3601%2031.6458C24.2977%2031.6106%2024.1728%2031.5951%2024.2103%2031.5032C24.251%2031.4033%2024.3511%2031.3249%2024.4798%2031.3286C24.5314%2031.33%2024.5828%2031.3608%2024.6331%2031.3809C26.7182%2032.21%2028.8228%2032.2754%2030.9476%2031.528C31.1073%2031.4718%2031.2621%2031.4029%2031.421%2031.3446C31.5272%2031.3056%2031.7282%2031.3859%2031.7557%2031.4856C31.7893%2031.6076%2031.6646%2031.6202%2031.5934%2031.6577C31.3429%2031.7896%2031.0857%2031.9099%2030.8169%2032.004C30.6906%2032.0482%2030.6571%2032.109%2030.7283%2032.2266C30.8989%2032.5089%2031.0738%2032.7881%2031.2685%2033.0563C31.352%2033.1714%2031.4437%2033.1948%2031.58%2033.1525C32.7222%2032.7981%2033.7861%2032.2945%2034.7713%2031.6371C34.8755%2031.5675%2034.9317%2031.4845%2034.9387%2031.365C34.9586%2031.0281%2034.9804%2030.6913%2035%2030.3779C34.983%2030.0513%2034.9764%2029.7483%2034.9499%2029.4469%22%20fill%3D%22%235A6AEF%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_6996_47057%22%3E%3Crect%20width%3D%2214%22%20height%3D%2214%22%20fill%3D%22white%22%20transform%3D%22translate%2821%205%29%22%2F%3E%3C%2FclipPath%3E%3CclipPath%20id%3D%22clip1_6996_47057%22%3E%3Crect%20width%3D%2214%22%20height%3D%2214%22%20fill%3D%22white%22%20transform%3D%22translate%285%2021%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,getPackage:ne,connector:me,switchChain:e=>m(void 0,void 0,void 0,(function*(){return(yield ne()).switchChain(e)})),disconnect:()=>m(void 0,void 0,void 0,(function*(){return(yield ne()).disconnect()}))},zM={type:exports.WalletType.Alchemy,showName:"Alchemy",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M27.9663%2022.8488L20.3716%209.93638C20.3349%209.87262%2020.2815%209.81951%2020.2172%209.7824C20.1528%209.74529%2020.0796%209.72551%2020.005%209.72505C19.9304%209.72458%2019.857%209.74344%2019.7921%209.77974C19.7273%209.81603%2019.6734%209.86847%2019.6358%209.93176L17.3613%2013.8009C17.2867%2013.9275%2017.2476%2014.0712%2017.2476%2014.2174C17.2476%2014.3637%2017.2867%2014.5073%2017.3613%2014.634L22.3134%2023.0577C22.388%2023.1844%2022.4953%2023.2896%2022.6245%2023.3628C22.7536%2023.436%2022.9002%2023.4744%2023.0493%2023.4742H27.5983C27.6728%2023.474%2027.7459%2023.4546%2027.8103%2023.418C27.8748%2023.3813%2027.9283%2023.3287%2027.9655%2023.2654C28.0028%2023.2021%2028.0224%2023.1303%2028.0225%2023.0571C28.0227%2022.9841%2028.0032%2022.9123%2027.9663%2022.8488Z%22%20fill%3D%22url%28%23paint0_linear_6996_47071%29%22%2F%3E%3Cpath%20d%3D%22M8.05856%2029.5973L15.6532%2016.6849C15.6905%2016.6216%2015.7441%2016.5691%2015.8085%2016.5326C15.873%2016.4961%2015.9461%2016.4769%2016.0205%2016.4769C16.095%2016.4769%2016.1681%2016.4961%2016.2326%2016.5326C16.297%2016.5691%2016.3506%2016.6216%2016.3878%2016.6849L18.6636%2020.5505C18.738%2020.6774%2018.7773%2020.8212%2018.7773%2020.9676C18.7773%2021.1141%2018.738%2021.258%2018.6636%2021.3848L13.7113%2029.8085C13.6371%2029.9352%2013.53%2030.0405%2013.401%2030.1137C13.272%2030.1868%2013.1256%2030.2252%2012.9767%2030.225H8.42648C8.35152%2030.2254%208.27781%2030.2063%208.21283%2030.1696C8.14784%2030.1329%208.09392%2030.08%208.05654%2030.0162C8.01916%2029.9524%207.99965%2029.88%208%2029.8065C8.00036%2029.7329%208.02056%2029.6607%208.05856%2029.5973Z%22%20fill%3D%22url%28%23paint1_linear_6996_47071%29%22%2F%3E%3Cpath%20d%3D%22M16.3868%2030.2222H31.5761C31.6506%2030.2221%2031.7238%2030.2028%2031.7883%2030.1662C31.8526%2030.1295%2031.9062%2030.0769%2031.9434%2030.0135C31.9805%2029.9501%2032%2029.8782%2032%2029.8051C32%2029.7319%2031.9803%2029.6601%2031.9429%2029.5968L29.6706%2025.7288C29.5961%2025.6021%2029.4888%2025.4968%2029.3597%2025.4236C29.2305%2025.3506%2029.0839%2025.3121%2028.9348%2025.3123H19.0304C18.8813%2025.3121%2018.7347%2025.3506%2018.6056%2025.4236C18.4764%2025.4968%2018.3691%2025.6021%2018.2946%2025.7288L16.02%2029.5968C15.9827%2029.6601%2015.963%2029.7319%2015.9629%2029.8051C15.9627%2029.8782%2015.9822%2029.9501%2016.0194%2030.0135C16.0566%2030.0769%2016.1101%2030.1295%2016.1746%2030.1662C16.2391%2030.2028%2016.3123%2030.2221%2016.3868%2030.2222Z%22%20fill%3D%22url%28%23paint2_linear_6996_47071%29%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22paint0_linear_6996_47071%22%20x1%3D%2220.0001%22%20y1%3D%2211.2488%22%20x2%3D%2217.8821%22%20y2%3D%2230.2265%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2305D5FF%22%2F%3E%3Cstop%20offset%3D%220.723958%22%20stop-color%3D%22%23363FF9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235533FF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_6996_47071%22%20x1%3D%2220%22%20y1%3D%2211.2488%22%20x2%3D%2217.882%22%20y2%3D%2230.2265%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2305D5FF%22%2F%3E%3Cstop%20offset%3D%220.723958%22%20stop-color%3D%22%23363FF9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235533FF%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint2_linear_6996_47071%22%20x1%3D%2220%22%20y1%3D%2211.2488%22%20x2%3D%2217.882%22%20y2%3D%2230.2264%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%2305D5FF%22%2F%3E%3Cstop%20offset%3D%220.723958%22%20stop-color%3D%22%23363FF9%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%235533FF%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,getPackage:re,connector:fe,supportChains:XS,isContractWallet:()=>!0,contract:{signTypedData:({typedData:e})=>m(void 0,void 0,void 0,(function*(){const{signTypedData:t}=yield re();return t(e)}))},disconnect:()=>m(void 0,void 0,void 0,(function*(){return(yield re()).disconnect()}))},$M={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.OKCHAIN,exports.ChainId.LINEA,exports.ChainId.BASE,exports.ChainId.MANTA,exports.ChainId.BTR,exports.ChainId.SCROLL],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)=>S(window.bybitWallet,t),switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.bybitWallet})),isInstalled:()=>!!window.bybitWallet},HM={type:exports.WalletType.Zerion,showName:"Zerion",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_10156_10455%29%22%3E%3Cg%20clip-path%3D%22url%28%23clip1_10156_10455%29%22%3E%3Cmask%20id%3D%22mask0_10156_10455%22%20style%3D%22mask-type%3Aluminance%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%3E%3Cpath%20d%3D%22M40%200H0V40H40V0Z%22%20fill%3D%22white%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_10156_10455%29%22%3E%3Cpath%20d%3D%22M40%2012C40%205.37258%2034.6274%200%2028%200H12C5.37258%200%200%205.37258%200%2012V28C0%2034.6274%205.37258%2040%2012%2040H28C34.6274%2040%2040%2034.6274%2040%2028V12Z%22%20fill%3D%22%232461ED%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.878%2019.4668C18.9564%2017.3476%2014.1848%2014.5995%2010.5936%2012.3596C9.53404%2011.5962%2010.0718%209.97607%2011.3524%209.97607H29.1216C30.1128%209.97607%2030.776%2011.0812%2030.2791%2011.9175C29.0851%2013.9797%2027.3419%2016.5979%2025.886%2018.6738C25.1044%2019.7881%2023.8305%2019.9795%2022.878%2019.4668ZM17.1585%2020.1549C20.9502%2022.1761%2026.2642%2025.25%2030.0398%2027.5743C31.2089%2028.2943%2030.7417%2030.0216%2029.3792%2030.0216C27.1494%2030.0216%2023.526%2030.0223%2019.9214%2030.0227C16.3541%2030.0234%2012.8052%2030.0238%2010.6437%2030.0238C9.55454%2030.0238%208.99626%2028.8936%209.45883%2028.1052C11.022%2025.4413%2012.7789%2022.7527%2014.2395%2020.7451C14.8889%2019.8496%2016.2106%2019.6491%2017.1585%2020.1549Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_10156_10455%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3CclipPath%20id%3D%22clip1_10156_10455%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,link:"https://zerion.io/",switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.bybitWallet}))},qM={type:exports.WalletType.Holdstation,showName:"Holdstation",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_10677_681%29%22%3E%3Cpath%20d%3D%22M40%2012C40%205.37258%2034.6274%200%2028%200H12C5.37258%200%200%205.37258%200%2012V28C0%2034.6274%205.37258%2040%2012%2040H28C34.6274%2040%2040%2034.6274%2040%2028V12Z%22%20fill%3D%22black%22%2F%3E%3Cpath%20d%3D%22M12.9622%2014.4597L12.7066%2016.0422H11.5435L11.7994%2014.4597H10.3906L9.65332%2019.0214H11.0621L11.32%2017.4253H12.4831L12.2249%2019.0214H13.6337L14.371%2014.4597H12.9622Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M15.3385%2019.3443H14.1372L14.1375%2019.3411H12.729L12.7284%2019.3443H11.4724L11.2534%2020.7274H12.5049L11.9917%2023.9027H13.4002L13.9133%2020.7274H15.1198L15.3385%2019.3443Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M23.5343%2023.9027H22.1255L22.8629%2019.3411H24.2716L23.5343%2023.9027Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M22.6403%2019.3443H21.4386L21.4392%2019.3411H20.0304L20.0298%2019.3443H18.7739L18.5552%2020.7274H19.8063L19.2931%2023.9027H20.7019L21.2151%2020.7274H22.4216L22.6403%2019.3443Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M20.4111%2017.6427L20.9256%2014.4597H19.5171L18.7798%2019.0214H20.0505H22.0225L22.2454%2017.6427H20.4111Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M18.521%2015.0573C17.7365%2014.1495%2016.2291%2014.1662%2015.1549%2015.0946C14.0804%2016.0233%2013.8457%2017.512%2014.6302%2018.4199C15.4147%2019.3277%2016.9218%2019.311%2017.9963%2018.3823C19.0708%2017.4539%2019.3055%2015.9651%2018.521%2015.0573ZM17.1562%2017.4102C16.7172%2017.7898%2016.1013%2017.7965%2015.7805%2017.4256C15.4597%2017.0547%2015.5557%2016.4462%2015.995%2016.0666C16.434%2015.687%2017.0499%2015.6803%2017.3707%2016.0512C17.6912%2016.4224%2017.5952%2017.031%2017.1562%2017.4102Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M28.4541%2019.9406C27.6696%2019.0327%2026.1625%2019.0494%2025.088%2019.9781C24.0135%2020.9069%2023.7788%2022.3956%2024.5633%2023.3034C25.3478%2024.2113%2026.8549%2024.1946%2027.9294%2023.2659C29.0036%2022.3372%2029.2386%2020.8484%2028.4541%2019.9406ZM27.0889%2022.2935C26.6501%2022.6731%2026.0341%2022.6798%2025.7133%2022.3089C25.3925%2021.938%2025.4885%2021.3295%2025.9278%2020.9499C26.3667%2020.5703%2026.9827%2020.5636%2027.3035%2020.9345C27.6243%2021.3057%2027.5283%2021.9139%2027.0889%2022.2935Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M25.0412%2014.4597H24.3497H22.9408L22.2036%2019.0214H23.4583H24.3494C25.3663%2019.0214%2026.7402%2018.0262%2026.92%2016.7384C27.1002%2015.4501%2026.2865%2014.4597%2025.0412%2014.4597ZM25.5042%2016.8258C25.3468%2017.4507%2024.7865%2017.6244%2024.5347%2017.6244H23.8384L24.1271%2015.838H24.7762C25.2254%2015.8383%2025.6615%2016.2009%2025.5042%2016.8258Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M11.1909%2019.8248L10.969%2021.4551C10.969%2021.4551%2010.7757%2021.1083%2010.6543%2021.0049C10.5329%2020.9015%2010.1733%2020.6587%209.81361%2020.67C9.45395%2020.6812%209.38875%2020.7891%209.64277%2020.915C9.89679%2021.0409%2010.5127%2021.1892%2010.8027%2021.6388C11.0927%2022.0884%2011.1039%2023.3675%209.84508%2023.835C8.58625%2024.3026%207.84284%2023.5354%207.70508%2023.3614L7.95684%2021.7625C7.95684%2021.7625%208.2205%2022.2406%208.59814%2022.4384C8.97579%2022.6363%209.44624%2022.5913%209.56633%2022.5255C9.68612%2022.4596%209.0869%2022.3036%208.73622%2022.091C8.38554%2021.8781%207.90289%2021.538%208.17264%2020.4365C8.44271%2019.3347%2010.3653%2018.7997%2011.1909%2019.8248Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M32.0831%2019.3411L31.7707%2021.2749L30.8258%2019.3411H29.4174L28.6802%2023.9027H30.0886L30.4081%2021.9268L31.3458%2023.9027H31.3647H32.7545L33.4919%2019.3411H32.0831Z%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M13.6436%2024.4619C6.45288%2024.6777%206.50587%2025.4869%206.50587%2025.4869C7.2419%2025.4619%209.36616%2025.5023%2012.2907%2025.5428C15.658%2025.5893%2020.087%2025.6362%2024.6815%2025.5826C33.2862%2025.4824%2032.7671%2024.6446%2032.7671%2024.6446C29.002%2024.5694%2018.9034%2024.3809%2018.9034%2024.3809C17.5071%2020.9282%2018.185%2019.3418%2018.185%2019.3418C15.1622%2019.3418%2013.6436%2024.4619%2013.6436%2024.4619Z%22%20fill%3D%22url%28%23paint0_radial_10677_681%29%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CradialGradient%20id%3D%22paint0_radial_10677_681%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate%2832.9384%2024.7522%29%20rotate%28-178.206%29%20scale%2824.9363%2080.5053%29%22%3E%3Cstop%20stop-color%3D%22%23FFBC95%22%2F%3E%3Cstop%20offset%3D%220.4679%22%20stop-color%3D%22%23FF7A78%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23664EFF%22%2F%3E%3C%2FradialGradient%3E%3CclipPath%20id%3D%22clip0_10677_681%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!1,link:"https://holdstation.com/",disabled:()=>{var e;return!(null===(e=window.ethereum)||void 0===e?void 0:e.isHoldstation)},injected:()=>{var e;return null===(e=window.ethereum)||void 0===e?void 0:e.isHoldstation},switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.ethereum}))},VM={type:exports.WalletType.SafePal,showName:"SafePal",logo:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22none%22%20viewBox%3D%220%200%2040%2040%22%3E%3Cg%20clip-path%3D%22url%28%23a%29%22%3E%3Cpath%20fill%3D%22%234a21ef%22%20d%3D%22M30.37%200H9.63A9.63%209.63%200%200%200%200%209.63v20.74A9.63%209.63%200%200%200%209.63%2040h20.74A9.63%209.63%200%200%200%2040%2030.37V9.63A9.63%209.63%200%200%200%2030.37%200%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M18.627%208.77a2.58%202.58%200%200%200-1.825.755l-7.601%207.602a1.47%201.47%200%200%200-.432%201.042c0%20.378.144.755.432%201.043l4.981%204.981v-8.819c0-.658.53-1.191%201.188-1.191h10.472l5.413-5.414zm-4.444%2017.072H24.65c.658%200%201.192-.534%201.192-1.192v-8.819l4.981%204.982a1.47%201.47%200%200%201%200%202.085L23.222%2030.5a2.58%202.58%200%200%201-1.825.755H8.77z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22%23fff%22%20rx%3D%2212%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://www.safepal.com/",disabled:()=>!window.safepalProvider,injected:()=>window.safepalProvider,switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider||window.ethereum})),connector:(e,t)=>S(window.safepalProvider,t)},WM={type:exports.WalletType.Rise,showName:"Rise Wallet",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_11156_1385%29%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22%237967E5%22%2F%3E%3Cpath%20d%3D%22M23.7198%209.77002H11.8364V13.1769H23.7198C24.6573%2013.1769%2025.4174%2013.9397%2025.4174%2014.8804V16.5839H17.0335C14.1632%2016.5839%2011.8364%2018.9107%2011.8364%2021.781V30.2117H15.2317V22.2003L23.8242%2030.2113H28.8134L17.8502%2019.9909H25.4174V16.6005H28.8134V14.8804C28.8134%2012.058%2026.5323%209.77002%2023.7198%209.77002Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_11156_1385%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",supportMobile:!0,supportExtension:!0,link:"https://risechain.com/",getPackage:ae,connector:ye,switchChain:e=>N(Object.assign(Object.assign({},e),{provider:e.provider})),isContractWallet:()=>!0};var ZM=Object.freeze({__proto__:null,WalletLink:hM,ImToken:mM,Math:fM,GameStop:yM,Brave:bM,FoxWallet:gM,BSC:vM,KuCoin:wM,Coin98:CM,Frontier:xM,Ledger:EM,OpenBlock:kM,OneKey:TM,Bitkeep:PM,Nabox:AM,OKXWallet:_M,WalletConnect:DM,Portis:OM,Gnosis:FM,UAuth:SM,Blocto:IM,Rainbow:MM,Trust:NM,TokenPocket:UM,Cyber:LM,UniPass:BM,Gate:RM,Rabby:jM,SocialLogin:GM,Alchemy:zM,Bybit:$M,Zerion:HM,Holdstation:qM,SafePal:VM,Rise:WM});const KM={type:exports.WalletType.injected,showName:"MetaMask",logo:"data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2212%22%20fill%3D%22white%22%2F%3E%3Cpath%20d%3D%22M29.3231%2019.9841L30.3121%2018.8232L29.8821%2018.5079L30.57%2017.8773L30.0397%2017.476L30.7277%2016.96L30.2834%2016.616L31%2013.119L29.9107%209.87988M29.9107%209.87988L22.9166%2012.474H17.0834L10.0893%209.87988L9%2013.119L9.73094%2016.616L9.27231%2016.96L9.97459%2017.476L9.4443%2017.8773L10.1322%2018.5079L9.70228%2018.8232L10.6912%2019.9841L9.18632%2024.6278L10.5765%2029.3717L15.4638%2028.0245L16.4098%2028.7984L18.3446%2030.117H21.6554L23.5902%2028.7984L24.5362%2028.0245L29.4378%2029.3717L30.8423%2024.6278L29.3231%2019.9841%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M29.9107%209.87994L21.3257%2016.2005L22.9166%2012.4741L29.9107%209.87994Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M10.0894%209.87994L18.6027%2016.2578L17.0835%2012.4741L10.0894%209.87994Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M26.8293%2024.5422L24.5361%2028.0106L29.4378%2029.3578L30.8423%2024.6138L26.8293%2024.5422Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M9.18652%2024.6138L10.5768%2029.3578L15.464%2028.0106L13.1852%2024.5422L9.18652%2024.6138Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M15.2058%2018.6657L13.8442%2020.7152L18.6885%2020.9302L18.5309%2015.7419L15.2058%2018.6657Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M24.8084%2018.6656L21.426%2015.6845L21.3257%2020.9301L26.17%2020.7151L24.8084%2018.6656Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M15.4639%2028.0107L18.402%2026.6061L15.8652%2024.6569L15.4639%2028.0107Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M21.6123%2026.6061L24.5361%2028.0107L24.1348%2024.6569L21.6123%2026.6061Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M24.5361%2028.0107L21.6123%2026.6061L21.856%2028.498L21.8273%2029.3006L24.5361%2028.0107Z%22%20fill%3D%22%23D7C1B3%22%2F%3E%3Cpath%20d%3D%22M15.4639%2028.0107L18.187%2029.3006L18.1727%2028.498L18.402%2026.6061L15.4639%2028.0107Z%22%20fill%3D%22%23D7C1B3%22%2F%3E%3Cpath%20d%3D%22M18.2298%2023.3953L15.8076%2022.693L17.5275%2021.9047L18.2298%2023.3953Z%22%20fill%3D%22%232F343B%22%2F%3E%3Cpath%20d%3D%22M21.77%2023.3953L22.4866%2021.9047L24.2065%2022.693L21.77%2023.3953Z%22%20fill%3D%22%232F343B%22%2F%3E%3Cpath%20d%3D%22M15.4639%2028.0106L15.8939%2024.5422L13.1851%2024.6138L15.4639%2028.0106Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M24.1206%2024.5422L24.5362%2028.0106L26.8294%2024.6138L24.1206%2024.5422Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M26.17%2020.7155L21.3257%2020.9305L21.77%2023.3956L22.4866%2021.9051L24.2065%2022.6934L26.17%2020.7155Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M15.8078%2022.6934L17.5276%2021.9051L18.2299%2023.3956L18.6885%2020.9305L13.8442%2020.7155L15.8078%2022.6934Z%22%20fill%3D%22%23CC6228%22%2F%3E%3Cpath%20d%3D%22M13.8442%2020.7155L15.8651%2024.6569L15.8078%2022.6934L13.8442%2020.7155Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M24.2064%2022.6934L24.1348%2024.6569L26.1699%2020.7155L24.2064%2022.6934Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M18.6886%2020.9301L18.23%2023.3953L18.8033%2026.319L18.9323%2022.478L18.6886%2020.9301Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M21.3257%2020.9301L21.082%2022.4637L21.1967%2026.319L21.77%2023.3953L21.3257%2020.9301Z%22%20fill%3D%22%23E27625%22%2F%3E%3Cpath%20d%3D%22M21.7701%2023.3953L21.1968%2026.3191L21.6124%2026.6057L24.1349%2024.6565L24.2065%2022.693L21.7701%2023.3953Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M15.8076%2022.693L15.8649%2024.6565L18.4018%2026.6057L18.8031%2026.3191L18.2298%2023.3953L15.8076%2022.693Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M21.8274%2029.3002L21.8561%2028.4975L21.6267%2028.3112H18.3733L18.1727%2028.4975L18.187%2029.3002L15.4639%2028.0103L16.4098%2028.7842L18.3446%2030.1171H21.6554L23.5903%2028.7842L24.5362%2028.0103L21.8274%2029.3002Z%22%20fill%3D%22%23C0AD9E%22%2F%3E%3Cpath%20d%3D%22M21.6126%2026.6062L21.197%2026.3195H18.8035L18.4022%2026.6062L18.1729%2028.498L18.3735%2028.3117H21.6269L21.8562%2028.498L21.6126%2026.6062Z%22%20fill%3D%22%232F343B%22%2F%3E%3Cpath%20d%3D%22M30.2833%2016.6161L30.9999%2013.119L29.9107%209.87994L21.6123%2015.9855L24.8084%2018.6656L29.3231%2019.9842L30.312%2018.8233L29.882%2018.508L30.57%2017.8917L30.0397%2017.476L30.7276%2016.9601L30.2833%2016.6161Z%22%20fill%3D%22%23763E1A%22%2F%3E%3Cpath%20d%3D%22M9%2013.119L9.73094%2016.616L9.27231%2016.96L9.96026%2017.4903L9.42997%2017.8916L10.1179%2018.5079L9.68795%2018.8232L10.6912%2019.9841L15.2059%2018.6656L18.402%2015.9854L10.0893%209.87988L9%2013.119Z%22%20fill%3D%22%23763E1A%22%2F%3E%3Cpath%20d%3D%22M29.323%2019.9842L24.8084%2018.6656L26.1699%2020.7152L24.1348%2024.6565L26.8292%2024.6135H30.8423L29.323%2019.9842Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M15.2061%2018.6656L10.6914%2019.9842L9.18652%2024.6135H13.1852L15.8654%2024.6565L13.8445%2020.7152L15.2061%2018.6656Z%22%20fill%3D%22%23F5841F%22%2F%3E%3Cpath%20d%3D%22M21.3258%2020.9301L21.6125%2015.9855L22.9167%2012.4741H17.0835L18.4021%2015.9855L18.6887%2020.9301L18.8034%2022.478V26.3191H21.1969L21.2112%2022.478L21.3258%2020.9301Z%22%20fill%3D%22%23F5841F%22%2F%3E%3C%2Fsvg%3E",supportMobile:!0,switchChain:N,disabled:()=>!1,injected:()=>window.ethereum,connector:(e,t)=>he(e,t),disconnect:()=>m(void 0,void 0,void 0,(function*(){const e=O.getState().provider;e&&function(e){m(this,void 0,void 0,(function*(){try{return I(e,{method:"wallet_revokePermissions",params:[{eth_accounts:{}}]})}catch(e){console.error(e)}}))}(e)}))},JM=Object.assign({MetamaskWallet:KM},ZM),XM=Object.values(ZM),YM=Object.values(JM),QM=Object.assign(Object.assign({},kM),{disabled:()=>!1,type:exports.WalletType.openBlockIframe,connector:$}),eN=[DM.showName,KM.showName,hM.showName];function tN(e){return m(this,void 0,void 0,(function*(){const t=[],n=[],r=_();[...YM,...null!=e?e:[]].forEach((e=>{const a=`${e.type}-${e.showName}`;let i=!1;if(i=r?!1===e.supportMobile:!1===e.supportExtension,i)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((()=>m(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()))),O.getState().setDisabledWalletKeyList(t)}))}function nN(e,t){return!e||!t||t.includes(e)}function rN({PORTIS_ID:e,chainId:t,includes:n,excludes:r,excludeNames:a,keysSort:i,mobileKeysSort:s,lastConnectedFirst:o,showAllInjected:c,afterHooks:l,extendsWalleObject:u,showNotSupport:d,eip6963WalletList:p,eip6963IgnoreIncludes:h,supportChainIds:m}={}){var f,y,b;if("undefined"==typeof window)return[];const g=_(),v=(!n||n.includes(exports.WalletType.injected))&&(!r||!r.includes(exports.WalletType.injected)),w={PORTIS_ID:e},C=null==p?void 0:p.filter((e=>![WI,ZI].includes(e.info.rdns)));let x,E=[],k=!1;const T=Object.assign({},JM);u&&Object.entries(u).forEach((([e,t])=>{T[e]=t}));const P=Object.values(T),A=P.filter((e=>e.type!==exports.WalletType.injected));if(v){if(g&&(XM.some((e=>!!(e.injected&&e.injected()&&nN(t,e.supportChains))&&(x=Object.assign({},e),!0))),!x&&(null==C?void 0:C.length))){const[e]=C,n=XM.find((t=>t.type===KI[e.info.rdns])),r=JI(e);n?nN(t,n.supportChains)&&(x=Object.assign(Object.assign(Object.assign({},n),r),{type:n.type,logo:n.logo})):x=r}x||(x=KM),x.connector=null!==(y=null!==(f=x.connectorInjected)&&void 0!==f?f:x.connector)&&void 0!==y?y:(e,t)=>S(void 0,t),x.switchChain=null!==(b=x.switchChain)&&void 0!==b?b:N,E.push(x),x.injected?k=x.injected():x.disabled&&(k=!x.disabled())}const D=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(w))return!1;if(t&&e.supportChains&&!e.supportChains.includes(t))return!1;if(t&&!g&&e.supportChainsPC&&!e.supportChainsPC.includes(t))return!1;if(m&&(e.supportChains||e.supportChainsPC)){const t=m.some((t=>{var n,r;return!!(null===(n=e.supportChains)||void 0===n?void 0:n.includes(t))||!(g||!(null===(r=e.supportChainsPC)||void 0===r?void 0:r.includes(t)))}));if(!t)return!1}return!!(!n||n.includes(e.type)||h&&e.isEip6963)};if(g)k?D(DM)&&E.push(DM):P.forEach((e=>!(!D(e)||!e.supportMobile&&!d||e.showName===(null==x?void 0:x.showName))&&(E.push(e),!0)));else{let e=[];A.forEach((t=>{if(!D(t))return!1;if(!1===t.supportExtension)if(t.injected){if(!d&&!c)return!1}else if(!d)return!1;return e.push(t),!0})),E=[...E,...e]}g&&k||!(null==C?void 0:C.length)||C.forEach((e=>{const{info:t}=e,n=KI[t.rdns],r=JI(e);let a=!1;n&&(a=E.some(((e,t)=>e.type===n&&(E.splice(t,1,Object.assign(Object.assign(Object.assign({},e),r),{type:e.type,logo:e.logo})),!0))),a||(a=XM.some((e=>e.type===n&&(D(e)&&E.push(Object.assign(Object.assign(Object.assign({},e),r),{type:e.type,logo:e.logo})),!0))))),a||E.push(r)}));const O=g&&null!=s?s:i;if(O){let e=O.map((e=>{const t=T[e];if(!t)throw new Error(`unknown key ${e}`);return t.showName}));g?k?e=[KM.showName,...e.filter((e=>e!==KM.showName))]:(e=e.filter((e=>!eN.includes(e))),e=[...eN,...e]):e.includes(KM.showName)||(e=[KM.showName,...e]),E.sort(((t,n)=>{let r=e.indexOf(t.showName),a=e.indexOf(n.showName);return-1===r&&(r=999),-1===a&&(a=999),r-a}))}if(o&&"undefined"!=typeof window&&localStorage.getItem(HI)){const e=localStorage.getItem(HI);E.sort(((t,n)=>(e===t.type?1:2)-(e===n.type?1:2)))}return l&&(E=l({isMobile:g,PORTIS_ID:e,chainId:t,includes:n,excludes:r,excludeNames:a,showAllInjected:c,hasInjectedWallet:k,walletList:E,showNotSupport:d})),E.forEach((e=>{e.getPackage&&e.getPackage()})),E}function aN(){return m(this,void 0,void 0,(function*(){if("undefined"!=typeof window&&window.top!==window){if(yield(yield Y()).getIsCyber())return LM;if(yield(yield q()).getIsSafe())return FM;if(yield z())return QM}}))}var iN=[{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"}];function sN(){return e=>({getCallsStatus:t=>CS(e,t),getCapabilities:t=>GS(e,t),sendCalls:t=>wS(e,t),showCallsStatus:t=>HS(e,t),waitForCallsStatus:t=>xS(e,t),writeContracts:t=>async function(e,t){const n=t.contracts.map((e=>{const{address:t,abi:n,functionName:r,args:a,value:i}=e;return{data:wD({abi:n,functionName:r,args:a}),to:t,value:i}}));return fA(e,wS,"sendCalls")({...t,calls:n})}(e,t)})}const oN={block:yF({format(e){const t=e.transactions?.map((e=>{if("string"==typeof e)return e;const t=hF(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?JA(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}));return{transactions:t,stateRoot:e.stateRoot}}}),transaction:mF({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?JA(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:bS({format:e=>({l1GasPrice:e.l1GasPrice?JA(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?JA(e.l1GasUsed):null,l1Fee:e.l1Fee?JA(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})};const cN={blockTime:2e3,contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:oN,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&&!eD(t))throw new Z_({address:t});if(n&&!eD(n))throw new Z_({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:a,isSystemTx:i,mint:s,to:o,value:c}=e;return nD(["0x7e",NO([t,r,o??"0x",s?QA(s):"0x",c?QA(c):"0x",a?QA(a):"0x",i?"0x1":"0x",n??"0x"])])}(e):OS(e,t)}}},lN=MS({...cN,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:{...cN.contracts,disputeGameFactory:{1:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{1:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{1:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{1:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),uN=11155111,dN=MS({...cN,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:{...cN.contracts,disputeGameFactory:{[uN]:{address:"0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"}},l2OutputOracle:{[uN]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[uN]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[uN]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:uN});var pN;function hN(){const{provider:e}=O.getState();if(!e)throw new Error("provider is undefined");return e}exports.WatchResult=void 0,(pN=exports.WatchResult||(exports.WatchResult={}))[pN.Failed=0]="Failed",pN[pN.Success=1]="Success",pN[pN.Warning=2]="Warning";const mN=e=>m(void 0,void 0,void 0,(function*(){const{value:t,from:n,to:r,data:a}=e,i={from:n,to:r,value:t,data:a};t&&!/^0x0*$/.test(t)||delete i.value;const s=hN();try{return(yield s.estimateGas(i)).add(5e4)}catch(t){s.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})),fN=e=>m(void 0,void 0,void 0,(function*(){var t,n,r,a,i;const s=hN(),o=O.getState().chainId,c=yield s.send("eth_chainId",[]);if(Number(c)!==Number(o))throw new Error("Network not matched, please refresh page and try again.");const l=null===(t=O.getState().connected)||void 0===t?void 0:t.wallet;if(null===(n=null==l?void 0:l.notSupported)||void 0===n?void 0:n.sendTransaction)throw new Error("Not supported sendTransaction.");if(null===(r=null==l?void 0:l.contract)||void 0===r?void 0:r.sendTransaction)return l.contract.sendTransaction(e);const u=null===(a=null==l?void 0:l.getSupportEip5792ChainIds)||void 0===a?void 0:a.call(l);if(null==u?void 0:u.includes(o)){let t=lN,n="https://api.developer.coinbase.com/rpc/v1/base/pE-_rU5q_IliJGUVkVI-82ZoyiCeCSFx";84532===o&&(t=dN,n="https://api.developer.coinbase.com/rpc/v1/base-sepolia/pE-_rU5q_IliJGUVkVI-82ZoyiCeCSFx");const r=WS({chain:t,transport:ZS(s.provider)}).extend(sN()),a=yield r.sendCalls({account:e.from,calls:[e],capabilities:{paymasterService:{url:n}}}),i=()=>new Promise((e=>{setTimeout((()=>m(void 0,void 0,void 0,(function*(){var t;const n=yield r.getCallsStatus({id:a.id});if("pending"===n.status){const t=yield i();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.id)}))),700)}));return{hash:yield i()}}try{const t=yield s.getSigner().sendTransaction(e);if((null===(i=O.getState().connected)||void 0===i?void 0:i.isSafe)&&O.getState().account){const e=yield q(),n=yield e.getSafeTxHash(O.getState().chainId,O.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 yN(e,t,n){if(!jI(e)||e===c.AddressZero)throw Error(`Invalid 'address' parameter '${e}'.`);const r=null!=n?n:hN(),a=O.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 bN=new Map;function gN(e){var t,n,r;return m(this,void 0,void 0,(function*(){const a=hN(),i=null===(t=O.getState().connected)||void 0===t?void 0:t.wallet,s=O.getState().account;if(null===(n=null==i?void 0:i.notSupported)||void 0===n?void 0:n.sign)throw new Error("Not supported sign.");return(null===(r=null==i?void 0:i.contract)||void 0===r?void 0:r.sign)?i.contract.sign(e):a.send("eth_sign",[s,e])}))}exports.ALCHEMY_EVENT_TYPES=yT,exports.ALCHEMY_MINED_TRANSACTIONS_EVENT_TYPE=fT,exports.ALCHEMY_PENDING_TRANSACTIONS_EVENT_TYPE=mT,exports.BN=Kw,exports.BaseError=La,exports.BigNumber=nC,exports.Core=class{constructor(e){this.isOpenBlockIframe=!1,this.isSafeIframe=!1;const{providerConfig:t,walletListConfig:n,cacheKey:r}=e;this.providerConfig=t,YI=t,"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&&VI.test(e.uuid)&&O.setState((n=>{const r=[...n.eip6963WalletList];return r.some((t=>t.info.rdns===e.rdns))?{}:{eip6963WalletList:[...r,t.detail]}}))}catch(t){console.error(t,e)}})),window.dispatchEvent(new Event("eip6963:requestProvider"))),this.walletListConfig=n,this.setDisabledState(),this.connectController=new qI({cacheKey:Object.assign(Object.assign({},XI),r),rpcUrl:t.rpcUrl})}setDisabledState(){var e,t;return tN((null===(e=this.walletListConfig)||void 0===e?void 0:e.extendsWalleObject)?Object.values(null===(t=this.walletListConfig)||void 0===t?void 0:t.extendsWalleObject):void 0)}setWalletListConfig(e){this.walletListConfig=Object.assign(Object.assign({},this.walletListConfig),e)}autoConnect(e){var t;return m(this,void 0,void 0,(function*(){try{const n=e=>this.connectToWallet(e,void 0,{isAutoConnect:!0}),r=yield aN();if(r)return n(r);if(!O.getState().connected){const r=this.connectController.getAutoCacheType(),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 i=_()?a.find((e=>{var t;return null===(t=e.injected)||void 0===t?void 0:t.call(e)})):void 0;if(i)return n(i);this.providerConfig.rpcUrl&&O.getState().setRpcUrlProvider(this.providerConfig.rpcUrl,this.providerConfig.chainId)}}catch(e){console.error(e)}}))}setRpcUrl(e){this.connectController.setRpcUrl(e)}getWalletList(e,t){var n;return rN(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 m(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(O.getState().disabledWalletKeyList.includes(`${e.type}-${e.showName}`)||!e.connector&&!e.disabled&&!e.injected){let{link:t,supportExtension:n,supportMobile:r}=e;if(!1===n&&r&&!_())return!0;if(k()?t=e.mobileAndroidDeepLink||e.mobileDeepLink||e.link:A()&&(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=RE,exports.DEFAULT_NETWORK=jE,exports.DefaultJsonRpcProvider=Ia,exports.EthersEvent=class extends bT{get fromAddress(){const e=this.tag.split(":");if(e[0]===mT)return e[1]&&"*"!==e[1]?CT(e[1]):void 0}get toAddress(){const e=this.tag.split(":");if(e[0]===mT)return e[2]&&"*"!==e[2]?CT(e[2]):void 0}get hashesOnly(){const e=this.tag.split(":");if(yT.includes(e[0]))return e[3]&&"*"!==e[3]?"true"===e[3]:void 0}get includeRemoved(){const e=this.tag.split(":");if(e[0]===fT)return e[2]&&"*"!==e[2]?"true"===e[2]:void 0}get addresses(){const e=this.tag.split(":");if(e[0]===fT)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=$E,exports.EventEmitter=xn,exports.FixedNumber=bC,exports.HD_PATH_LIST=[{path:"m/44'/60'/x'/0/0",name:"Ledger Live"},{path:"m/44'/60'/0'/x",name:"Legacy"}],exports.Hash=T_,exports.HttpRequestError=_c,exports.IS_BROWSER=xk,exports.InvalidAddressError=Ti,exports.Logger=ha,exports.OpenBlockIframeWallet=QM,exports.Q=lr,exports.SUPPORTED_CHAIN_ID=pM,exports.Utf8ErrorFuncs=ga,exports.VERSION=jk,exports.X=function(){return function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t}()},exports.Z=function(e,t,n){return{id:n||lr(),jsonrpc:"2.0",method:e,params:t||[]}},exports.__awaiter=m,exports.__awaiter$1=ME,exports._fetchData=Oa,exports._toEscapedUtf8String=function(e,t){return'"'+va(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?Ca(e):Ca(55296+((e-=65536)>>10&1023))+Ca(56320+(1023&e))})).join("")+'"'},exports._toUtf8String=xa,exports._tslib=x,exports.abytes=b_,exports.aexists=g_,exports.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");y_(e.outputLen),y_(e.blockLen)},exports.allWalletList=YM,exports.allWalletObject=JM,exports.anumber=y_,exports.approve=(e,t,n)=>m(void 0,void 0,void 0,(function*(){const r=yN(e,iN).interface.encodeFunctionData("approve",[t,n]),a={from:O.getState().account,to:e,data:r,value:"0x0",gasLimit:void 0},i=yield mN(a);return i&&(a.gasLimit=i),yield fN(a)})),exports.browserPonyfill=pP,exports.call=au,exports.clean=w_,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)&&wC.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 i=[];for(;n.length;){if(n.length<=3){i.unshift(n);break}{const e=n.length-3;i.unshift(n.substring(e)),n=n.substring(0,e)}}return r+i.join(",")+a},exports.commonjsGlobal=be,exports.concat=os,exports.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];b_(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const a=e[t];n.set(a,r),r+=a.length}return n},exports.connect=function({appName:e,appLogoUrl:t,appId:n}){return m(this,void 0,void 0,(function*(){return QI&&eM||(QI||(QI=new RI({name:e,icon:t,appId:n})),void 0===eM&&(eM=yield Promise.race([QI.start(),new Promise((e=>setTimeout(e,300)))]))),{app:QI,cyberAccount:eM}}))},exports.connectOpenBlockIframe=$,exports.convertTransactionType=function(e,t,n){return m(this,void 0,void 0,(function*(){const r=t;if(!n)return r;r.type=GI;const a=yield function(e){return m(this,void 0,void 0,(function*(){if(void 0!==$I[e])return $I[e];const t=O.getState().provider;if(!t)return!1;const n=void 0!==(yield t.getBlock("latest")).baseFeePerGas;return $I[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=zI)}return r}))},exports.convertWeb3Provider=F,exports.createProvider=function(e){var t,n,r;return m(this,void 0,void 0,(function*(){const{rpcUrl:i,JsonRpcProvider:s=Ia}=e,o=null!==(t=e.chainId)&&void 0!==t?t:1,c=rw(o),l=null!==(r=null===(n=e.alchemyParams)||void 0===n?void 0:n.apiKeyObject)&&void 0!==r?r:{},u=tI(o,l),d=l[o];if(!d)throw new Error(`ChainId ${o} is not support`);const p=yield eP({apiKey:d,chain:c,signer:u});const h=new class extends s{constructor(e,t){super(e,t),this.smartAccountClient=p}getSigner(){const e=p.account.address;return new JS(h,e,0,p,u)}disconnect(){return u.disconnect()}listAccounts(){return m(this,void 0,void 0,(function*(){return[p.account.address]}))}getAddress(){const e=p.account.address;return Promise.resolve(a.getAddress(e))}}(i,o);return h}))},exports.decode=ra,exports.decode$1=e=>Hn((e=>In(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))))(e)),exports.decodeErrorResult=rc,exports.deepCopy=ck,exports.eB=function(e){var t=ea(),n=ta(!0,e);if(t){var r=document.createElement("a");r.href=n,document.body.appendChild(r),r.click(),document.body.removeChild(r)}},exports.eD=ea,exports.eI={CLOSE_MODAL:{code:100001,message:"[binance-w3w] User closed modal"},REJECT_SESSION:{code:100002,message:"[binance-w3w] User rejected connection"},PROVIDER_NOT_READY:{code:100003,message:"[binance-w3w] Provider is not ready"},CONNECTING:{code:100004,message:"[binance-w3w] Already processing session request. Please wait"},CONNECTED:{code:100005,message:"[binance-w3w] Already connected"}},exports.eM=na,exports.eN=function(){if(Xr){var e=function(){var e=Yr("name","og:site_name","og:title","twitter:title");return e||(e=document.title),e}(),t=Yr("description","og:description","twitter:description","keywords"),n=location.origin,r=function(){for(var e=document.getElementsByTagName("link"),t=[],n=0;n<e.length;n++){var r=e[n],a=r.getAttribute("rel");if(a&&a.toLowerCase().indexOf("icon")>-1){var i=r.getAttribute("href");if(i)if(-1===i.toLowerCase().indexOf("https:")&&-1===i.toLowerCase().indexOf("http:")&&0!==i.indexOf("//")){var s=location.protocol+"//"+location.host;if(0===i.indexOf("/"))s+=i;else{var o=location.pathname.split("/");o.pop(),s+=o.join("/")+"/"+i}t.push(s)}else if(0===i.indexOf("//")){var c=location.protocol+i;t.push(c)}else t.push(i)}}return t}();return{description:t,url:n,icons:r,name:e}}},exports.eP=Qr,exports.eR=Jr,exports.eT={REJECT_ERR:{code:200001,message:"[binance-w3w] User rejected the operation"},METHOD_NOT_SUPPORT:{code:200002,message:"[binance-w3w] Does not support calling method"},MISSING_RESPONSE:{code:200003,message:"[binance-w3w] Missing JSON RPC response"},INVALID_PARAM:{code:200004,message:"[binance-w3w] Invalid request param"}},exports.eU=function(){return!!navigator.userAgent.match(/Android/i)},exports.eg=function e(){var t=this;Wn(this,e),cr(this,"events",new xn),cr(this,"on",(function(e,n){return t.events.on(e,n)})),cr(this,"once",(function(e,n){return t.events.once(e,n)})),cr(this,"off",(function(e,n){return t.events.off(e,n)})),cr(this,"removeListener",(function(e,n){return t.events.removeListener(e,n)})),cr(this,"removeAllListeners",(function(){return t.events.removeAllListeners()}))},exports.eh=function(e){try{window.localStorage.removeItem(e)}catch(e){}},exports.ei=Kr,exports.ej={INTERNAL_ERR:{code:300001,message:"[binance-w3w] Internal error"}},exports.ek=ta,exports.el=function(e,t){var n=fr(vr(t));if(!n)throw new Error("Missing key: required for decryption");if(!function(e,t){var n=hr(e.data),r=hr(e.iv),a=mr(hr(e.hmac),!1),i=mr(Wr(t,br(n,r)),!1);return pr(a)===pr(i)}(e,n))return null;var r,a=hr(e.data),i=function(e,t,n){var r=new $r(t,e).decrypt(n),a=new Uint8Array(r);return qr.unpad(a)}(hr(e.iv),n,a),s=gr(i);try{r=JSON.parse(s)}catch(e){return null}return r},exports.encode=aa,exports.encodeAbiParameters=To,exports.ep=function(e){var t=null;try{var n=window.localStorage.getItem(e);n&&(t=JSON.parse(n))}catch(e){t=null}return t},exports.eu=function(e,t,n){var r=fr(vr(t)),a=fr(vr(n||Kr(128))),i=mr(a,!1),s=function(e){return fr(Buffer.from(e,dr))}(JSON.stringify(e)),o=function(e,t,n){var r=new $r(t,e),a=qr.pad(n),i=r.encrypt(a);return new Uint8Array(i)}(a,r,s);return{data:mr(o,!1),hmac:mr(Wr(r,br(o,a)),!1),iv:i}},exports.ev=function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}},exports.eventemitter3=Cn,exports.fetchJson=Fa,exports.formatEther=function(e){return xC(e,18)},exports.formatUnits=xC,exports.fromHex=lk,exports.getAlchemyConnector=fe,exports.getAlchemyEventTag=function(e){if(!gT(e))throw new Error("Event tag requires AlchemyEventType");if(e.method===exports.AlchemySubscription.PENDING_TRANSACTIONS)return function(e){const t=vT(e.fromAddress),n=vT(e.toAddress),r=wT(e.hashesOnly);return mT+":"+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=>vT(e.to)+","+vT(e.from))).join("|")}(e.addresses),n=wT(e.includeRemoved),r=wT(e.hashesOnly);return fT+":"+t+":"+n+":"+r}(e);throw new Error(`Unrecognized AlchemyFilterEvent: ${e}`)},exports.getAlchemyHttpUrl=GE,exports.getAlchemyPackage=re,exports.getAlchemySigner=tI,exports.getAlchemyWsUrl=function(e,t){return`wss://${e}.g.alchemy.com/v2/${t}`},exports.getAugmentedNamespace=ve,exports.getBinanceConnector=pe,exports.getBinancePackage=ee,exports.getBloctoConnector=ie,exports.getBloctoPackage=J,exports.getChainNameByChainId=e=>{switch(Number(e)){case 1:case 5:return"eth";case 137:case nM:return"polygon";case 56:case 97:return"bsc";case rM:case aM:return"rangers";case iM:return"scroll";case sM:case oM:return"arbitrum";case cM:case lM:return"avalanche";case 322:case 321:return"kcc";case 65:case 66:return"okc";case uM:case dM:return"platon";default:return"polygon"}},exports.getContract=yN,exports.getCyberAccount=()=>eM,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=ue,exports.getCyberPackage=Y,exports.getDefaultExportFromCjs=ge,exports.getENVByChainId=e=>{switch(Number(e)){case 1:case 137:case 56:case rM:case oM:case lM:case 321:case dM:case 66:return"prod";default:return"test"}},exports.getEstimateGas=mN,exports.getGasPrice=()=>m(void 0,void 0,void 0,(function*(){const e=hN();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=q,exports.getIsAndroid=k,exports.getIsCyber=function(){var e,t,n,r;return m(this,void 0,void 0,(function*(){const a=YI;if(eM)return!0;try{return QI||((null===(e=null==a?void 0:a.cyberParams)||void 0===e?void 0:e.appId)||console.warn("cyberParams.appId is required"),QI=new RI({name:null!==(t=null==a?void 0:a.appName)&&void 0!==t?t:"DODO",icon:null!==(n=null==a?void 0:a.appLogoUrl)&&void 0!==n?n:"https://app.dodoex.io/DODO.svg",appId:null===(r=null==a?void 0:a.cyberParams)||void 0===r?void 0:r.appId})),eM=yield Promise.race([QI.start(),new Promise((e=>setTimeout(e,400)))]),!!eM}catch(e){return!1}}))},exports.getIsIOS=A,exports.getIsMobile=_,exports.getIsOpenBlockIframe=z,exports.getIsolatedEnvironmentWallet=aN,exports.getLedgerUSBPackage=H,exports.getMetamaskConnector=he,exports.getMetamaskPackage=te,exports.getOwnerProvider=function(){if(!window.ethereum)throw new Error("Method not implemented.");return new e.Web3Provider(window.ethereum)},exports.getPortisConnector=se,exports.getPortisPackage=W,exports.getProviderByChain=function(t,n){return m(this,void 0,void 0,(function*(){if(!t||t===O.getState().chainId&&O.getState().provider)return O.getState().provider;if(bN.has(t))return bN.get(t);const r=new e.JsonRpcProvider(n,t);return bN.set(t,r),r}))},exports.getRainbowConnectPackage=X,exports.getRainbowConnector=le,exports.getRiseConnector=ye,exports.getRisePackage=ae,exports.getSocialLoginConnector=me,exports.getSocialLoginPackage=ne,exports.getUAuthPackage=V,exports.getUniPassConnector=de,exports.getUniPassPackage=Q,exports.getUrl=Ua,exports.getWalletConnectConnector=ce,exports.getWalletConnectPackage=K,exports.getWalletDisabledState=tN,exports.getWalletLinkConnector=oe,exports.getWalletLinkPackage=Z,exports.getWalletList=rN,exports.getWindow=D,exports.hash=we,exports.inherits_browser=ke,exports.injectedConnect=S,exports.isAddress=ss,exports.isAddress$1=jI,exports.isAlchemyEvent=gT,exports.isHex=$a,exports.isLargeIOS=P,exports.isSmallIOS=T,exports.isSupportWebHid=E,exports.keccak256=Vw,exports.logWarn=function(e,...t){Rk.warn(e,t)},exports.m=hP,exports.minimalisticAssert=xe,exports.noop=function(){},exports.parseEther=function(e){return EC(e,18)},exports.parseUnits=EC,exports.personalSign=function(e,t){var n,r,a;return m(this,void 0,void 0,(function*(){const i=hN(),s=null===(n=O.getState().connected)||void 0===n?void 0:n.wallet;if(null===(r=null==s?void 0:s.notSupported)||void 0===r?void 0:r.personalSign)throw new Error("Not supported personalSign.");return(null===(a=null==s?void 0:s.contract)||void 0===a?void 0:a.personalSign)?s.contract.personalSign(e,t):i.getSigner().signMessage(e)}))},exports.poll=function(e,t){return t||(t={}),null==(t=r.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,i=!1;const s=()=>!i&&(i=!0,a&&clearTimeout(a),!0);t.timeout&&(a=setTimeout((()=>{s()&&r(new Error("timeout"))}),t.timeout));const o=t.retryLimit;let c=0;!function a(){return e().then((function(e){if(void 0!==e)s()&&n(e);else if(t.oncePoll)t.oncePoll.once("poll",a);else if(t.onceBlock)t.onceBlock.once("block",a);else if(!i){if(c++,c>o)return void(s()&&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){s()&&r(e)}))}()}))},exports.randomBytes=function(e=32){if(f_&&"function"==typeof f_.getRandomValues)return f_.getRandomValues(new Uint8Array(e));if(f_&&"function"==typeof f_.randomBytes)return Uint8Array.from(f_.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")},exports.registerNetworkWithMetamask=N,exports.require$$1=Zw,exports.sendTransaction=fN,exports.sha256=OF,exports.sha3=Hw,exports.sign=gN,exports.signTransaction=function(e){return m(this,void 0,void 0,(function*(){const t=yield r.resolveProperties(e);delete t.from;const n=Vw(l.serialize(t)),a=yield gN(n);return l.serialize(t,a)}))},exports.signTypedData=function({account:e,typedData:t}){var n,r,a;return m(this,void 0,void 0,(function*(){const i=hN(),s=null===(n=O.getState().connected)||void 0===n?void 0:n.wallet;if(null===(r=null==s?void 0:s.notSupported)||void 0===r?void 0:r.signTypedData)throw new Error("Not supported sign.");if(null===(a=null==s?void 0:s.contract)||void 0===a?void 0:a.signTypedData)return s.contract.signTypedData({account:e,typedData:t});try{if(i){const n=yield i.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=XM,exports.standaloneListObject=ZM,exports.stringify=ac,exports.supportChains=tM,exports.toBytes=k_,exports.toHex=uk,exports.toUtf8Bytes=wa,exports.toUtf8CodePoints=function(e,t=exports.UnicodeNormalizationForm.current){return va(wa(e,t))},exports.toUtf8String=Ea,exports.useWalletStore=O,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 i;return m(this,void 0,void 0,(function*(){const s=hN();for(;!t.killSwitch;){try{if(null===(i=O.getState().connected)||void 0===i?void 0:i.isSafe){const t=yield q(),n=yield t.getSafeTxStatus(O.getState().chainId,e,O.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,i]=yield Promise.all([a?a(e):s.getTransactionReceipt(e),s.getTransactionCount(null!=r?r:"")]);let o;if(console.log("[TX Watch] Web3",t,"/Current Nonce ",i,"/TX Nonce",n),t&&(o=t.status?exports.WatchResult.Success:exports.WatchResult.Failed),void 0===o&&void 0!==n&&i>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}))},exports.xB=function(e){return hr(e).buffer},exports.xK=function(e){var t="0x0";return"number"==typeof e&&(t="0x".concat(e.toString(16))),"string"==typeof e&&(t=e.startsWith("0x")?e:"0x0"),t},exports.xM=function(e,t){return mr(new Uint8Array(e),!t)},exports.xg=function(){return("undefined"==typeof process?"undefined":nr(process))<"u"&&nr(process.versions)<"u"&&nr(process.versions.node)<"u"},exports.xl=["eth_requestAccounts","eth_accounts","eth_chainId","eth_signTransaction","eth_sendTransaction","eth_sign","personal_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_watchAsset"];