Files
to_session/web_process/MetaMask 12.16.1/common-2.js
Administrator a0720d80dc fefdwef
2025-11-12 12:54:37 +08:00

1 line
708 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

LavaPack.loadBundle([[1972,{"./asset.cjs":1961,"./caip.cjs":1963,"@metamask/keyring-utils":2064,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TransactionsPageStruct=r.TransactionStruct=r.TransactionEventStruct=r.TransactionType=r.TransactionStatus=r.FeeType=void 0;const n=e("@metamask/keyring-utils"),s=e("@metamask/superstruct"),a=e("./asset.cjs"),i=e("./caip.cjs"),o=(0,n.object)({address:(0,s.string)(),asset:(0,s.nullable)(a.AssetStruct)});var c;!function(e){e.Base="base",e.Priority="priority"}(c||(r.FeeType=c={}));const u=(0,n.object)({type:(0,s.enums)([`${c.Base}`,`${c.Priority}`]),asset:a.AssetStruct});var l,d;!function(e){e.Submitted="submitted",e.Unconfirmed="unconfirmed",e.Confirmed="confirmed",e.Failed="failed"}(l||(r.TransactionStatus=l={})),function(e){e.Send="send",e.Receive="receive",e.Swap="swap",e.BridgeSend="bridge:send",e.BridgeReceive="bridge:receive",e.Unknown="unknown"}(d||(r.TransactionType=d={})),r.TransactionEventStruct=(0,n.object)({status:(0,s.enums)([`${l.Submitted}`,`${l.Unconfirmed}`,`${l.Confirmed}`,`${l.Failed}`]),timestamp:(0,s.nullable)((0,s.number)())}),r.TransactionStruct=(0,n.object)({id:(0,s.string)(),chain:i.CaipChainIdStruct,account:n.UuidStruct,status:(0,s.enums)([`${l.Submitted}`,`${l.Unconfirmed}`,`${l.Confirmed}`,`${l.Failed}`]),timestamp:(0,s.nullable)((0,s.number)()),type:(0,s.enums)([`${d.Send}`,`${d.Receive}`,`${d.Swap}`,`${d.BridgeSend}`,`${d.BridgeReceive}`,`${d.Unknown}`]),from:(0,s.array)(o),to:(0,s.array)(o),fees:(0,s.array)(u),events:(0,s.array)(r.TransactionEventStruct)}),r.TransactionsPageStruct=(0,n.object)({data:(0,s.array)(r.TransactionStruct),next:(0,s.nullable)((0,s.string)())})}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/api/transaction.cjs"}],[1973,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.BtcScope=void 0,function(e){e.Mainnet="bip122:000000000019d6689c085ae165831e93",e.Testnet="bip122:000000000933ea01ad0ee984209779ba",e.Testnet4="bip122:00000000da84f2bafbbc53dee25a72ae",e.Signet="bip122:00000008819873e925422c1ff0f99f7c",e.Regtest="bip122:regtest"}(n||(r.BtcScope=n={}))}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/btc/constants.cjs"}],[1974,{"./constants.cjs":1973,"./types.cjs":1975},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./constants.cjs"),r),s(e("./types.cjs"),r)}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/btc/index.cjs"}],[1975,{"../api/index.cjs":1967,"@metamask/keyring-utils":2064,"@metamask/superstruct":2872,bech32:3977},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.BtcP2wpkhAccountStruct=r.BtcMethod=r.BtcP2wpkhAddressStruct=void 0;const n=e("@metamask/keyring-utils"),s=e("@metamask/superstruct"),a=e("bech32"),i=e("../api/index.cjs");var o;r.BtcP2wpkhAddressStruct=(0,s.refine)((0,s.string)(),"BtcP2wpkhAddressStruct",(e=>{try{a.bech32.decode(e)}catch(e){return new Error(`Could not decode P2WPKH address: ${e.message}`)}return!0})),function(e){e.SendBitcoin="sendBitcoin"}(o||(r.BtcMethod=o={})),r.BtcP2wpkhAccountStruct=(0,n.object)({...i.KeyringAccountStruct.schema,address:r.BtcP2wpkhAddressStruct,type:(0,s.literal)(`${i.BtcAccountType.P2wpkh}`),scopes:(0,s.size)((0,s.array)(i.CaipChainIdStruct),1),methods:(0,s.array)((0,s.enums)([`${o.SendBitcoin}`]))})}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/btc/types.cjs"}],[1976,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.EthScope=void 0,function(e){e.Eoa="eip155:0",e.Mainnet="eip155:1",e.Testnet="eip155:11155111"}(n||(r.EthScope=n={}))}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/eth/constants.cjs"}],[1977,{"./types.cjs":1978},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./types.cjs"),r)}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/eth/erc4337/index.cjs"}],[1978,{"../types.cjs":1980,"@metamask/keyring-utils":2064},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.EthUserOperationPatchStruct=r.EthBaseUserOperationStruct=r.EthBaseTransactionStruct=r.EthUserOperationStruct=void 0;const n=e("@metamask/keyring-utils"),s=e("../types.cjs");r.EthUserOperationStruct=(0,n.object)({sender:s.EthAddressStruct,nonce:s.EthUint256Struct,initCode:s.EthBytesStruct,callData:s.EthBytesStruct,callGasLimit:s.EthUint256Struct,verificationGasLimit:s.EthUint256Struct,preVerificationGas:s.EthUint256Struct,maxFeePerGas:s.EthUint256Struct,maxPriorityFeePerGas:s.EthUint256Struct,paymasterAndData:s.EthBytesStruct,signature:s.EthBytesStruct}),r.EthBaseTransactionStruct=(0,n.object)({to:s.EthAddressStruct,value:s.EthUint256Struct,data:s.EthBytesStruct}),r.EthBaseUserOperationStruct=(0,n.object)({nonce:s.EthUint256Struct,initCode:s.EthBytesStruct,callData:s.EthBytesStruct,gasLimits:(0,n.exactOptional)((0,n.object)({callGasLimit:s.EthUint256Struct,verificationGasLimit:s.EthUint256Struct,preVerificationGas:s.EthUint256Struct})),dummyPaymasterAndData:s.EthBytesStruct,dummySignature:s.EthBytesStruct,bundlerUrl:n.UrlStruct}),r.EthUserOperationPatchStruct=(0,n.object)({paymasterAndData:s.EthBytesStruct,callGasLimit:(0,n.exactOptional)(s.EthUint256Struct),verificationGasLimit:(0,n.exactOptional)(s.EthUint256Struct),preVerificationGas:(0,n.exactOptional)(s.EthUint256Struct)})}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/eth/erc4337/types.cjs"}],[1979,{"./constants.cjs":1976,"./erc4337/index.cjs":1977,"./types.cjs":1980,"./utils.cjs":1981},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./constants.cjs"),r),s(e("./erc4337/index.cjs"),r),s(e("./types.cjs"),r),s(e("./utils.cjs"),r)}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/eth/index.cjs"}],[1980,{"../api/index.cjs":1967,"./index.cjs":1979,"@metamask/keyring-utils":2064,"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.EthErc4337AccountStruct=r.EthEoaAccountStruct=r.EthMethod=r.EthUint256Struct=r.EthAddressStruct=r.EthBytesStruct=void 0;const n=e("@metamask/keyring-utils"),s=e("@metamask/superstruct"),a=e("@metamask/utils"),i=e("./index.cjs"),o=e("../api/index.cjs");var c;r.EthBytesStruct=(0,a.definePattern)("EthBytes",/^0x[0-9a-f]*$/iu),r.EthAddressStruct=(0,a.definePattern)("EthAddress",/^0x[0-9a-f]{40}$/iu),r.EthUint256Struct=(0,a.definePattern)("EthUint256",/^0x([1-9a-f][0-9a-f]*|0)$/iu),function(e){e.PersonalSign="personal_sign",e.Sign="eth_sign",e.SignTransaction="eth_signTransaction",e.SignTypedDataV1="eth_signTypedData_v1",e.SignTypedDataV3="eth_signTypedData_v3",e.SignTypedDataV4="eth_signTypedData_v4",e.PrepareUserOperation="eth_prepareUserOperation",e.PatchUserOperation="eth_patchUserOperation",e.SignUserOperation="eth_signUserOperation"}(c||(r.EthMethod=c={})),r.EthEoaAccountStruct=(0,n.object)({...o.KeyringAccountStruct.schema,address:r.EthAddressStruct,type:(0,s.literal)(`${o.EthAccountType.Eoa}`),scopes:(0,s.nonempty)((0,s.array)((0,s.literal)(i.EthScope.Eoa))),methods:(0,s.array)((0,s.enums)([`${c.PersonalSign}`,`${c.Sign}`,`${c.SignTransaction}`,`${c.SignTypedDataV1}`,`${c.SignTypedDataV3}`,`${c.SignTypedDataV4}`]))}),r.EthErc4337AccountStruct=(0,n.object)({...o.KeyringAccountStruct.schema,address:r.EthAddressStruct,type:(0,s.literal)(`${o.EthAccountType.Erc4337}`),scopes:(0,s.nonempty)((0,s.array)(o.CaipChainIdStruct)),methods:(0,s.array)((0,s.enums)([`${c.PersonalSign}`,`${c.Sign}`,`${c.SignTypedDataV1}`,`${c.SignTypedDataV3}`,`${c.SignTypedDataV4}`,`${c.PrepareUserOperation}`,`${c.PatchUserOperation}`,`${c.SignUserOperation}`]))})}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/eth/types.cjs"}],[1981,{"../api/index.cjs":1967},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isEvmAccountType=function(e){return e===n.EthAccountType.Eoa||e===n.EthAccountType.Erc4337};const n=e("../api/index.cjs")}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/eth/utils.cjs"}],[1982,{"./api/index.cjs":1967,"@metamask/keyring-utils":2064,"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.AccountAssetListUpdatedEventStruct=r.AccountTransactionsUpdatedEventStruct=r.AccountBalancesUpdatedEventStruct=r.RequestRejectedEventStruct=r.RequestApprovedEventStruct=r.AccountDeletedEventStruct=r.AccountUpdatedEventStruct=r.AccountCreatedEventStruct=r.KeyringEvent=void 0;const n=e("@metamask/keyring-utils"),s=e("@metamask/superstruct"),a=e("@metamask/utils"),i=e("./api/index.cjs");var o;!function(e){e.AccountCreated="notify:accountCreated",e.AccountUpdated="notify:accountUpdated",e.AccountDeleted="notify:accountDeleted",e.RequestApproved="notify:requestApproved",e.RequestRejected="notify:requestRejected",e.AccountBalancesUpdated="notify:accountBalancesUpdated",e.AccountAssetListUpdated="notify:accountAssetListUpdated",e.AccountTransactionsUpdated="notify:accountTransactionsUpdated"}(o||(r.KeyringEvent=o={})),r.AccountCreatedEventStruct=(0,n.object)({method:(0,s.literal)(`${o.AccountCreated}`),params:(0,n.object)({account:i.KeyringAccountStruct,accountNameSuggestion:(0,n.exactOptional)((0,s.string)()),displayConfirmation:(0,n.exactOptional)((0,s.boolean)()),displayAccountNameSuggestion:(0,n.exactOptional)((0,s.boolean)()),...i.MetaMaskOptionsStruct.schema})}),r.AccountUpdatedEventStruct=(0,n.object)({method:(0,s.literal)(`${o.AccountUpdated}`),params:(0,n.object)({account:i.KeyringAccountStruct})}),r.AccountDeletedEventStruct=(0,n.object)({method:(0,s.literal)(`${o.AccountDeleted}`),params:(0,n.object)({id:n.UuidStruct})}),r.RequestApprovedEventStruct=(0,n.object)({method:(0,s.literal)(`${o.RequestApproved}`),params:(0,n.object)({id:n.UuidStruct,result:a.JsonStruct})}),r.RequestRejectedEventStruct=(0,n.object)({method:(0,s.literal)(`${o.RequestRejected}`),params:(0,n.object)({id:n.UuidStruct})}),r.AccountBalancesUpdatedEventStruct=(0,n.object)({method:(0,s.literal)(`${o.AccountBalancesUpdated}`),params:(0,n.object)({balances:(0,s.record)(n.AccountIdStruct,(0,s.record)(a.CaipAssetTypeStruct,i.FungibleAssetAmountStruct))})}),r.AccountTransactionsUpdatedEventStruct=(0,n.object)({method:(0,s.literal)(`${o.AccountTransactionsUpdated}`),params:(0,n.object)({transactions:(0,s.record)(n.AccountIdStruct,(0,s.array)(i.TransactionStruct))})}),r.AccountAssetListUpdatedEventStruct=(0,n.object)({method:(0,s.literal)(`${o.AccountAssetListUpdated}`),params:(0,n.object)({assets:(0,s.record)(n.AccountIdStruct,(0,n.object)({added:(0,s.array)(a.CaipAssetTypeOrIdStruct),removed:(0,s.array)(a.CaipAssetTypeOrIdStruct)}))})})}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/events.cjs"}],[1983,{"./api/index.cjs":1967,"./btc/index.cjs":1974,"./eth/index.cjs":1979,"./events.cjs":1982,"./rpc.cjs":1984,"./sol/index.cjs":1986},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./api/index.cjs"),r),s(e("./btc/index.cjs"),r),s(e("./sol/index.cjs"),r),s(e("./eth/index.cjs"),r),s(e("./rpc.cjs"),r),s(e("./events.cjs"),r)}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/index.cjs"}],[1984,{"./api/index.cjs":1967,"@metamask/keyring-utils":2064,"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.RejectRequestResponseStruct=r.RejectRequestRequestStruct=r.ApproveRequestResponseStruct=r.ApproveRequestRequestStruct=r.SubmitRequestResponseStruct=r.SubmitRequestRequestStruct=r.GetRequestResponseStruct=r.GetRequestRequestStruct=r.ListRequestsResponseStruct=r.ListRequestsRequestStruct=r.ExportAccountResponseStruct=r.ExportAccountRequestStruct=r.DeleteAccountResponseStruct=r.DeleteAccountRequestStruct=r.UpdateAccountResponseStruct=r.UpdateAccountRequestStruct=r.FilterAccountChainsResponseStruct=r.FilterAccountChainsStruct=r.ResolveAccountAddressResponseStruct=r.ResolveAccountAddressRequestStruct=r.GetAccountBalancesResponseStruct=r.GetAccountBalancesRequestStruct=r.ListAccountAssetsResponseStruct=r.ListAccountAssetsRequestStruct=r.ListAccountTransactionsResponseStruct=r.ListAccountTransactionsRequestStruct=r.DiscoverAccountsResponseStruct=r.DiscoverAccountsRequestStruct=r.CreateAccountResponseStruct=r.CreateAccountRequestStruct=r.GetAccountResponseStruct=r.GetAccountRequestStruct=r.ListAccountsResponseStruct=r.ListAccountsRequestStruct=r.KeyringRpcMethod=void 0,r.isKeyringRpcMethod=function(e){return Object.values(o).includes(e)};const n=e("@metamask/keyring-utils"),s=e("@metamask/superstruct"),a=e("@metamask/utils"),i=e("./api/index.cjs");var o;!function(e){e.ListAccounts="keyring_listAccounts",e.GetAccount="keyring_getAccount",e.CreateAccount="keyring_createAccount",e.DiscoverAccounts="keyring_discoverAccounts",e.ListAccountAssets="keyring_listAccountAssets",e.ListAccountTransactions="keyring_listAccountTransactions",e.GetAccountBalances="keyring_getAccountBalances",e.ResolveAccountAddress="keyring_resolveAccountAddress",e.FilterAccountChains="keyring_filterAccountChains",e.UpdateAccount="keyring_updateAccount",e.DeleteAccount="keyring_deleteAccount",e.ExportAccount="keyring_exportAccount",e.ListRequests="keyring_listRequests",e.GetRequest="keyring_getRequest",e.SubmitRequest="keyring_submitRequest",e.ApproveRequest="keyring_approveRequest",e.RejectRequest="keyring_rejectRequest"}(o||(r.KeyringRpcMethod=o={}));const c={jsonrpc:(0,s.literal)("2.0"),id:(0,s.union)([(0,s.string)(),(0,s.number)(),(0,s.literal)(null)])};r.ListAccountsRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_listAccounts")}),r.ListAccountsResponseStruct=(0,s.array)(i.KeyringAccountStruct),r.GetAccountRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_getAccount"),params:(0,n.object)({id:n.UuidStruct})}),r.GetAccountResponseStruct=i.KeyringAccountStruct,r.CreateAccountRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_createAccount"),params:(0,n.object)({options:(0,s.record)((0,s.string)(),a.JsonStruct)})}),r.CreateAccountResponseStruct=i.KeyringAccountStruct,r.DiscoverAccountsRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_discoverAccounts"),params:(0,n.object)({scopes:(0,s.array)(i.CaipChainIdStruct),entropySource:(0,s.string)(),groupIndex:(0,s.number)()})}),r.DiscoverAccountsResponseStruct=(0,s.array)(i.DiscoveredAccountStruct),r.ListAccountTransactionsRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_listAccountTransactions"),params:(0,n.object)({id:n.UuidStruct,pagination:i.PaginationStruct})}),r.ListAccountTransactionsResponseStruct=i.TransactionsPageStruct,r.ListAccountAssetsRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_listAccountAssets"),params:(0,n.object)({id:n.UuidStruct})}),r.ListAccountAssetsResponseStruct=(0,s.array)(i.CaipAssetTypeOrIdStruct),r.GetAccountBalancesRequestStruct=(0,n.object)({...c,method:(0,s.literal)(`${o.GetAccountBalances}`),params:(0,n.object)({id:n.UuidStruct,assets:(0,s.array)(i.CaipAssetTypeStruct)})}),r.GetAccountBalancesResponseStruct=(0,s.record)(i.CaipAssetTypeStruct,i.BalanceStruct),r.ResolveAccountAddressRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_resolveAccountAddress"),params:(0,n.object)({scope:i.CaipChainIdStruct,request:n.JsonRpcRequestStruct})}),r.ResolveAccountAddressResponseStruct=(0,s.nullable)((0,n.object)({address:i.CaipAccountIdStruct})),r.FilterAccountChainsStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_filterAccountChains"),params:(0,n.object)({id:n.UuidStruct,chains:(0,s.array)((0,s.string)())})}),r.FilterAccountChainsResponseStruct=(0,s.array)((0,s.string)()),r.UpdateAccountRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_updateAccount"),params:(0,n.object)({account:i.KeyringAccountStruct})}),r.UpdateAccountResponseStruct=(0,s.literal)(null),r.DeleteAccountRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_deleteAccount"),params:(0,n.object)({id:n.UuidStruct})}),r.DeleteAccountResponseStruct=(0,s.literal)(null),r.ExportAccountRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_exportAccount"),params:(0,n.object)({id:n.UuidStruct})}),r.ExportAccountResponseStruct=i.KeyringAccountDataStruct,r.ListRequestsRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_listRequests")}),r.ListRequestsResponseStruct=(0,s.array)(i.KeyringRequestStruct),r.GetRequestRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_getRequest"),params:(0,n.object)({id:n.UuidStruct})}),r.GetRequestResponseStruct=i.KeyringRequestStruct,r.SubmitRequestRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_submitRequest"),params:i.KeyringRequestStruct}),r.SubmitRequestResponseStruct=i.KeyringResponseStruct,r.ApproveRequestRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_approveRequest"),params:(0,n.object)({id:n.UuidStruct,data:(0,s.record)((0,s.string)(),a.JsonStruct)})}),r.ApproveRequestResponseStruct=(0,s.literal)(null),r.RejectRequestRequestStruct=(0,n.object)({...c,method:(0,s.literal)("keyring_rejectRequest"),params:(0,n.object)({id:n.UuidStruct})}),r.RejectRequestResponseStruct=(0,s.literal)(null)}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/rpc.cjs"}],[1985,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.SolScope=void 0,function(e){e.Devnet="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",e.Mainnet="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",e.Testnet="solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"}(n||(r.SolScope=n={}))}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/sol/constants.cjs"}],[1986,{"./constants.cjs":1985,"./types.cjs":1987},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./constants.cjs"),r),s(e("./types.cjs"),r)}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/sol/index.cjs"}],[1987,{"../api/index.cjs":1967,"@metamask/keyring-utils":2064,"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.SolDataAccountStruct=r.SolMethod=r.SolAddressStruct=void 0;const n=e("@metamask/keyring-utils"),s=e("@metamask/superstruct"),a=e("@metamask/utils"),i=e("../api/index.cjs");var o;r.SolAddressStruct=(0,a.definePattern)("SolAddress",/^[1-9A-HJ-NP-Za-km-z]{32,44}$/iu),function(e){e.SendAndConfirmTransaction="sendAndConfirmTransaction",e.SignAndSendTransaction="signAndSendTransaction",e.SignTransaction="signTransaction",e.SignMessage="signMessage",e.SignIn="signIn"}(o||(r.SolMethod=o={})),r.SolDataAccountStruct=(0,n.object)({...i.KeyringAccountStruct.schema,address:r.SolAddressStruct,type:(0,s.literal)(`${i.SolAccountType.DataAccount}`),scopes:(0,s.nonempty)((0,s.array)(i.CaipChainIdStruct)),methods:(0,s.array)((0,s.enums)(Object.values(o)))})}}},{package:"@metamask/keyring-api",file:"node_modules/@metamask/keyring-api/dist/sol/types.cjs"}],[1988,{"./constants.cjs":1989,"@ethereumjs/util":457,"@metamask/base-controller":1383,"@metamask/browser-passworder":1448,"@metamask/eth-hd-keyring":1510,"@metamask/eth-sig-util":2012,"@metamask/eth-simple-keyring":1743,"@metamask/utils":2950,"async-mutex":3913,"ethereumjs-wallet":4338,ulid:5623},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i,o,c,u,l,d,m,p,h,f,g,y,b,k,w,S,_,v,E,T,A,j,C,I,P,x,R,O,M,N,B,$,D,U,L,H,V,K,F,q=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),J=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),z=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&q(t,e,r);return J(t,e),t},G=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},W=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},X=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.KeyringController=r.getDefaultKeyringState=r.keyringBuilderFactory=r.SignTypedDataVersion=r.AccountImportStrategy=r.isCustodyKeyring=r.KeyringTypes=void 0;const Z=e("@ethereumjs/util"),Y=e("@metamask/base-controller"),Q=z(e("@metamask/browser-passworder")),ee=e("@metamask/eth-hd-keyring"),te=e("@metamask/eth-sig-util"),re=X(e("@metamask/eth-simple-keyring")),ne=e("@metamask/utils"),se=e("async-mutex"),ae=z(e("ethereumjs-wallet")),ie=e("ulid"),oe=e("./constants.cjs"),ce="KeyringController";var ue;!function(e){e.simple="Simple Key Pair",e.hd="HD Key Tree",e.qr="QR Hardware Wallet Device",e.trezor="Trezor Hardware",e.oneKey="OneKey Hardware",e.ledger="Ledger Hardware",e.lattice="Lattice Hardware",e.snap="Snap Keyring"}(ue||(r.KeyringTypes=ue={}));var le,de;function me(e){const t=()=>new e;return t.type=e.type,t}r.isCustodyKeyring=e=>e.startsWith("Custody"),function(e){e.privateKey="privateKey",e.json="json"}(le||(r.AccountImportStrategy=le={})),function(e){e.V1="V1",e.V3="V3",e.V4="V4"}(de||(r.SignTypedDataVersion=de={})),r.keyringBuilderFactory=me;const pe=[me(re.default),me(ee.HdKeyring)];function he(e){if(!((0,ne.hasProperty)(e,"mnemonic")&&e.mnemonic instanceof Uint8Array))throw new Error("Can't get mnemonic bytes from keyring")}function fe(e){if(!("importKey"in e&&"function"==typeof e.importKey&&"decryptWithKey"in e&&"function"==typeof e.decryptWithKey&&"encryptWithKey"in e&&"function"==typeof e.encryptWithKey))throw new Error(oe.KeyringControllerError.UnsupportedEncryptionKeyExport)}function ge(e){if("string"!=typeof e)throw new Error(oe.KeyringControllerError.WrongPasswordType);if(!e||!e.length)throw new Error(oe.KeyringControllerError.InvalidEmptyPassword)}async function ye(e){const t=await e.getAccounts();return{type:e.type,accounts:t.map(be)}}function be(e){return function(e){return(0,ne.isStrictHexString)(e.toLowerCase())&&(0,ne.isValidHexAddress)(e)}(e)?(0,te.normalize)(e):e}r.getDefaultKeyringState=()=>({isUnlocked:!1,keyrings:[],keyringsMetadata:[]});class ke extends Y.BaseController{constructor(e){const{encryptor:t=Q,keyringBuilders:f,messenger:g,state:y}=e;super({name:ce,metadata:{vault:{persist:!0,anonymous:!1},isUnlocked:{persist:!1,anonymous:!0},keyrings:{persist:!1,anonymous:!1},keyringsMetadata:{persist:!0,anonymous:!1},encryptionKey:{persist:!1,anonymous:!1},encryptionSalt:{persist:!1,anonymous:!1}},messenger:g,state:{...(0,r.getDefaultKeyringState)(),...y}}),n.add(this),s.set(this,new se.Mutex),a.set(this,new se.Mutex),i.set(this,void 0),o.set(this,void 0),c.set(this,void 0),u.set(this,void 0),l.set(this,void 0),d.set(this,void 0),m.set(this,void 0),p.set(this,void 0),G(this,i,f?f.concat(pe):pe,"f"),G(this,o,t,"f"),G(this,u,[],"f"),G(this,d,y?.keyringsMetadata?.slice()??[],"f"),G(this,l,[],"f"),G(this,c,Boolean(e.cacheEncryptionKey),"f"),W(this,c,"f")&&fe(t),W(this,n,"m",h).call(this)}async addNewAccount(e){return W(this,n,"m",U).call(this),W(this,n,"m",L).call(this,(async()=>{const t=this.getKeyringsByType("HD Key Tree")[0];if(!t)throw new Error("No HD keyring found");const r=await t.getAccounts();if(e&&r.length!==e){if(e>r.length)throw new Error("Account out of sequence");const t=r[e];if(!t)throw new Error(`Can't find account at index ${e}`);return t}const[s]=await t.addAccounts(1);return await W(this,n,"m",v).call(this),s}))}async addNewAccountForKeyring(e,t){return W(this,n,"m",U).call(this),W(this,n,"m",L).call(this,(async()=>{const r=await W(this,n,"m",I).call(this);if(t&&r.length!==t){if(t>r.length)throw new Error("Account out of sequence");const e=r[t];return(0,ne.assertIsStrictHexString)(e),e}await e.addAccounts(1);const s=(await W(this,n,"m",I).call(this)).find((e=>!r.includes(e)));return(0,ne.assertIsStrictHexString)(s),s}))}async createNewVaultAndRestore(e,t){return W(this,n,"m",L).call(this,(async()=>{ge(e),await W(this,n,"m",_).call(this,e,{type:ue.hd,opts:{mnemonic:t,numberOfAccounts:1}})}))}async createNewVaultAndKeychain(e){return W(this,n,"m",L).call(this,(async()=>{(await W(this,n,"m",I).call(this)).length||await W(this,n,"m",_).call(this,e,{type:ue.hd})}))}async addNewKeyring(e,t){return W(this,n,"m",U).call(this),e===ue.qr?W(this,n,"m",y).call(this,await this.getOrAddQRKeyring()):W(this,n,"m",y).call(this,await W(this,n,"m",L).call(this,(async()=>W(this,n,"m",x).call(this,e,t))))}async verifyPassword(e){if(!this.state.vault)throw new Error(oe.KeyringControllerError.VaultError);await W(this,o,"f").decrypt(e,this.state.vault)}isUnlocked(){return this.state.isUnlocked}async exportSeedPhrase(e,t){W(this,n,"m",U).call(this),await this.verifyPassword(e);const r=W(this,n,"m",g).call(this,t);if(!r)throw new Error("Keyring not found");return he(r),r.mnemonic}async exportAccount(e,t){await this.verifyPassword(e);const r=await this.getKeyringForAccount(t);if(!r.exportAccount)throw new Error(oe.KeyringControllerError.UnsupportedExportAccount);return await r.exportAccount(be(t))}async getAccounts(){return W(this,n,"m",U).call(this),this.state.keyrings.reduce(((e,t)=>e.concat(t.accounts)),[])}async getEncryptionPublicKey(e,t){W(this,n,"m",U).call(this);const r=(0,te.normalize)(e),s=await this.getKeyringForAccount(e);if(!s.getEncryptionPublicKey)throw new Error(oe.KeyringControllerError.UnsupportedGetEncryptionPublicKey);return await s.getEncryptionPublicKey(r,t)}async decryptMessage(e){W(this,n,"m",U).call(this);const t=(0,te.normalize)(e.from),r=await this.getKeyringForAccount(t);if(!r.decryptMessage)throw new Error(oe.KeyringControllerError.UnsupportedDecryptMessage);return r.decryptMessage(t,e.data)}async getKeyringForAccount(e){W(this,n,"m",U).call(this);const t=be(e),r=await Promise.all(W(this,u,"f").map((async e=>Promise.all([e,e.getAccounts()])))),s=r.filter((e=>e[1].map(be).includes(t)));if(s.length&&s[0]?.length)return s[0][0];let a="";throw r.length?s.length||(a="There are keyrings, but none match the address"):a="There are no keyrings",new Error(`${oe.KeyringControllerError.NoKeyring}. Error info: ${a}`)}getKeyringsByType(e){return W(this,n,"m",U).call(this),W(this,u,"f").filter((t=>t.type===e))}async persistAllKeyrings(){return W(this,n,"m",U).call(this),W(this,n,"m",L).call(this,(async()=>!0))}async importAccountWithStrategy(e,t){return W(this,n,"m",U).call(this),W(this,n,"m",L).call(this,(async()=>{let r;switch(e){case le.privateKey:const[n]=t;if(!n)throw new Error("Cannot import an empty key.");const s=(0,ne.add0x)(n);let a;try{a=(0,ne.hexToBytes)(s)}catch{throw new Error("Cannot import invalid private key.")}if(!(0,Z.isValidPrivate)(a)||66!==(0,Z.getBinarySize)(s))throw new Error("Cannot import invalid private key.");r=(0,ne.remove0x)(s);break;case le.json:let i;const[o,c]=t;try{i=ae.thirdparty.fromEtherWallet(o,c)}catch(e){i=i||await ae.default.fromV3(o,c,!0)}r=(0,ne.bytesToHex)(i.getPrivateKey());break;default:throw new Error(`Unexpected import strategy: '${String(e)}'`)}const s=await W(this,n,"m",x).call(this,ue.simple,[r]);return(await s.getAccounts())[0]}))}async removeAccount(e){W(this,n,"m",U).call(this),await W(this,n,"m",L).call(this,(async()=>{const t=await this.getKeyringForAccount(e),r=0===this.state.keyrings.findIndex((t=>t.accounts.includes(e))),s=1===(await t.getAccounts()).length;if(r&&s)throw new Error(oe.KeyringControllerError.LastAccountInPrimaryKeyring);if(!t.removeAccount)throw new Error(oe.KeyringControllerError.UnsupportedRemoveAccount);t.removeAccount(e),s&&await W(this,n,"m",B).call(this)})),this.messagingSystem.publish(`${ce}:accountRemoved`,e)}async setLocked(){return W(this,n,"m",U).call(this),W(this,n,"m",H).call(this,(async()=>{W(this,n,"m",S).call(this),G(this,m,undefined,"f"),await W(this,n,"m",O).call(this),this.update((e=>{e.isUnlocked=!1,e.keyrings=[],delete e.encryptionKey,delete e.encryptionSalt})),this.messagingSystem.publish(`${ce}:lock`)}))}async signMessage(e){if(W(this,n,"m",U).call(this),!e.data)throw new Error("Can't sign an empty message");const t=(0,te.normalize)(e.from),r=await this.getKeyringForAccount(t);if(!r.signMessage)throw new Error(oe.KeyringControllerError.UnsupportedSignMessage);return await r.signMessage(t,e.data)}async signEip7702Authorization(e){const t=(0,te.normalize)(e.from),r=await this.getKeyringForAccount(t);if(!r.signEip7702Authorization)throw new Error(oe.KeyringControllerError.UnsupportedSignEip7702Authorization);const{chainId:n,nonce:s}=e,a=(0,te.normalize)(e.contractAddress);if(a===undefined)throw new Error(oe.KeyringControllerError.MissingEip7702AuthorizationContractAddress);return await r.signEip7702Authorization(t,[n,a,s])}async signPersonalMessage(e){W(this,n,"m",U).call(this);const t=(0,te.normalize)(e.from),r=await this.getKeyringForAccount(t);if(!r.signPersonalMessage)throw new Error(oe.KeyringControllerError.UnsupportedSignPersonalMessage);const s=be(e.data);return await r.signPersonalMessage(t,s)}async signTypedMessage(e,t){W(this,n,"m",U).call(this);try{if(![de.V1,de.V3,de.V4].includes(t))throw new Error(`Unexpected signTypedMessage version: '${t}'`);const r=(0,te.normalize)(e.from),n=await this.getKeyringForAccount(r);if(!n.signTypedData)throw new Error(oe.KeyringControllerError.UnsupportedSignTypedMessage);return await n.signTypedData(r,t!==de.V1&&"string"==typeof e.data?JSON.parse(e.data):e.data,{version:t})}catch(e){throw new Error(`Keyring Controller signTypedMessage: ${e}`)}}async signTransaction(e,t,r){W(this,n,"m",U).call(this);const s=(0,te.normalize)(t),a=await this.getKeyringForAccount(s);if(!a.signTransaction)throw new Error(oe.KeyringControllerError.UnsupportedSignTransaction);return await a.signTransaction(s,e,r)}async prepareUserOperation(e,t,r){W(this,n,"m",U).call(this);const s=(0,te.normalize)(e),a=await this.getKeyringForAccount(s);if(!a.prepareUserOperation)throw new Error(oe.KeyringControllerError.UnsupportedPrepareUserOperation);return await a.prepareUserOperation(s,t,r)}async patchUserOperation(e,t,r){W(this,n,"m",U).call(this);const s=(0,te.normalize)(e),a=await this.getKeyringForAccount(s);if(!a.patchUserOperation)throw new Error(oe.KeyringControllerError.UnsupportedPatchUserOperation);return await a.patchUserOperation(s,t,r)}async signUserOperation(e,t,r){W(this,n,"m",U).call(this);const s=(0,te.normalize)(e),a=await this.getKeyringForAccount(s);if(!a.signUserOperation)throw new Error(oe.KeyringControllerError.UnsupportedSignUserOperation);return await a.signUserOperation(s,t,r)}changePassword(e){return W(this,n,"m",U).call(this),W(this,n,"m",L).call(this,(async()=>{ge(e),G(this,m,e,"f"),W(this,c,"f")&&this.update((e=>{delete e.encryptionKey,delete e.encryptionSalt}))}))}async submitEncryptionKey(e,t){return W(this,n,"m",H).call(this,(async()=>{G(this,u,await W(this,n,"m",j).call(this,undefined,e,t),"f"),W(this,n,"m",D).call(this)}))}async submitPassword(e){return W(this,n,"m",H).call(this,(async()=>{G(this,u,await W(this,n,"m",j).call(this,e),"f"),W(this,n,"m",D).call(this)}))}async verifySeedPhrase(e){return W(this,n,"m",U).call(this),W(this,n,"m",K).call(this,(async()=>W(this,n,"m",v).call(this,e)))}async withKeyring(e,t,r={createIfMissing:!1}){return W(this,n,"m",U).call(this),W(this,n,"m",L).call(this,(async()=>{let s;if("address"in e?s=await this.getKeyringForAccount(e.address):"type"in e?(s=this.getKeyringsByType(e.type)[e.index||0],!s&&r.createIfMissing&&(s=await W(this,n,"m",x).call(this,e.type,r.createWithData))):"id"in e&&(s=W(this,n,"m",f).call(this,e.id)),!s)throw new Error(oe.KeyringControllerError.KeyringNotFound);const a=await t({keyring:s,metadata:W(this,n,"m",y).call(this,s)});if(Object.is(a,s))throw new Error(oe.KeyringControllerError.UnsafeDirectKeyringAccess);return a}))}getQRKeyring(){return W(this,n,"m",U).call(this),this.getKeyringsByType(ue.qr)[0]}async getOrAddQRKeyring(){return W(this,n,"m",U).call(this),this.getQRKeyring()||await W(this,n,"m",L).call(this,(async()=>W(this,n,"m",k).call(this)))}async restoreQRKeyring(e){return W(this,n,"m",U).call(this),W(this,n,"m",L).call(this,(async()=>{(this.getQRKeyring()||await W(this,n,"m",k).call(this)).deserialize(e)}))}async resetQRKeyringState(){W(this,n,"m",U).call(this),(await this.getOrAddQRKeyring()).resetStore()}async getQRKeyringState(){return W(this,n,"m",U).call(this),(await this.getOrAddQRKeyring()).getMemStore()}async submitQRCryptoHDKey(e){W(this,n,"m",U).call(this),(await this.getOrAddQRKeyring()).submitCryptoHDKey(e)}async submitQRCryptoAccount(e){W(this,n,"m",U).call(this),(await this.getOrAddQRKeyring()).submitCryptoAccount(e)}async submitQRSignature(e,t){W(this,n,"m",U).call(this),(await this.getOrAddQRKeyring()).submitSignature(e,t)}async cancelQRSignRequest(){W(this,n,"m",U).call(this),(await this.getOrAddQRKeyring()).cancelSignRequest()}async cancelQRSynchronization(){W(this,n,"m",U).call(this),(await this.getOrAddQRKeyring()).cancelSync()}async connectQRHardware(e){return W(this,n,"m",U).call(this),W(this,n,"m",L).call(this,(async()=>{try{const t=this.getQRKeyring()||await W(this,n,"m",k).call(this);let r;switch(e){case-1:r=await t.getPreviousPage();break;case 1:r=await t.getNextPage();break;default:r=await t.getFirstPage()}return r.map((e=>({...e,balance:"0x0"})))}catch(e){throw new Error(`Unspecified error when connect QR Hardware, ${e}`)}}))}async unlockQRHardwareWalletAccount(e){return W(this,n,"m",U).call(this),W(this,n,"m",L).call(this,(async()=>{const t=this.getQRKeyring()||await W(this,n,"m",k).call(this);t.setAccountToUnlock(e),await t.addAccounts(1)}))}async getAccountKeyringType(e){W(this,n,"m",U).call(this);return(await this.getKeyringForAccount(e)).type}async forgetQRDevice(){return W(this,n,"m",U).call(this),W(this,n,"m",L).call(this,(async()=>{const e=this.getQRKeyring();if(!e)return{removedAccounts:[],remainingAccounts:[]};const t=await W(this,n,"m",I).call(this);e.forgetDevice();const r=await W(this,n,"m",I).call(this);return{removedAccounts:t.filter((e=>!r.includes(e))),remainingAccounts:r}}))}}async function we(e,t){const r=await e.acquire();try{return await t({releaseLock:r})}finally{r()}}function Se(){return{id:(0,ie.ulid)(),name:""}}r.KeyringController=ke,s=new WeakMap,a=new WeakMap,i=new WeakMap,o=new WeakMap,c=new WeakMap,u=new WeakMap,l=new WeakMap,d=new WeakMap,m=new WeakMap,p=new WeakMap,n=new WeakSet,h=function(){this.messagingSystem.registerActionHandler(`${ce}:signMessage`,this.signMessage.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:signEip7702Authorization`,this.signEip7702Authorization.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:signPersonalMessage`,this.signPersonalMessage.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:signTypedMessage`,this.signTypedMessage.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:decryptMessage`,this.decryptMessage.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:getEncryptionPublicKey`,this.getEncryptionPublicKey.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:getAccounts`,this.getAccounts.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:getKeyringsByType`,this.getKeyringsByType.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:getKeyringForAccount`,this.getKeyringForAccount.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:persistAllKeyrings`,this.persistAllKeyrings.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:prepareUserOperation`,this.prepareUserOperation.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:patchUserOperation`,this.patchUserOperation.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:signUserOperation`,this.signUserOperation.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:addNewAccount`,this.addNewAccount.bind(this)),this.messagingSystem.registerActionHandler(`${ce}:withKeyring`,this.withKeyring.bind(this))},f=function(e){const t=this.state.keyringsMetadata.findIndex((t=>t.id===e));return W(this,u,"f")[t]},g=function(e){return e?W(this,n,"m",f).call(this,e):W(this,u,"f")[0]},y=function(e){const t=W(this,u,"f").findIndex((t=>t===e));return(0,ne.assert)(-1!==t,oe.KeyringControllerError.KeyringNotFound),W(this,d,"f")[t]},b=function(e){return W(this,i,"f").find((t=>t.type===e))},k=async function(){return W(this,n,"m",V).call(this),await W(this,n,"m",x).call(this,ue.qr)},w=function(e){G(this,p,(e=>{this.messagingSystem.publish(`${ce}:qrKeyringStateChange`,e)}),"f"),e.getMemStore().subscribe(W(this,p,"f"))},S=function(){this.getKeyringsByType(ue.qr).forEach((e=>{W(this,p,"f")&&e.getMemStore().unsubscribe(W(this,p,"f"))}))},_=async function(e,t){if(W(this,n,"m",V).call(this),"string"!=typeof e)throw new TypeError(oe.KeyringControllerError.WrongPasswordType);this.update((e=>{delete e.encryptionKey,delete e.encryptionSalt})),G(this,m,e,"f"),await W(this,n,"m",O).call(this),G(this,d,[],"f"),await W(this,n,"m",P).call(this,t.type,t.opts),W(this,n,"m",D).call(this)},v=async function(e){W(this,n,"m",V).call(this);const t=W(this,n,"m",g).call(this,e);if(!t)throw new Error(oe.KeyringControllerError.KeyringNotFound);if(t.type!==ue.hd)throw new Error(oe.KeyringControllerError.UnsupportedVerifySeedPhrase);he(t);const r=t.mnemonic,s=await t.getAccounts();if(0===s.length)throw new Error("Cannot verify an empty keyring.");const a=W(this,n,"m",b).call(this,ue.hd)();await a.deserialize({mnemonic:r,numberOfAccounts:s.length});const i=await a.getAccounts();if(i.length!==s.length)throw new Error("Seed phrase imported incorrect number of accounts.");return i.forEach(((e,t)=>{if(e.toLowerCase()!==s[t].toLowerCase())throw new Error("Seed phrase imported different accounts.")})),r},E=async function(){return Promise.all(W(this,u,"f").map(ye))},T=async function({includeUnsupported:e}={includeUnsupported:!0}){const t=await Promise.all(W(this,u,"f").map((async e=>{const[t,r]=await Promise.all([e.type,e.serialize()]);return{type:t,data:r}})));return e&&t.push(...W(this,l,"f")),t},A=async function(e){await W(this,n,"m",O).call(this);for(const t of e)await W(this,n,"m",M).call(this,t)},j=async function(e,t,r){return W(this,n,"m",F).call(this,(async({releaseLock:s})=>{const a=this.state.vault;if(!a)throw new Error(oe.KeyringControllerError.VaultError);let i;const l={};if(W(this,c,"f"))if(fe(W(this,o,"f")),e){const t=await W(this,o,"f").decryptWithDetail(e,a);i=t.vault,G(this,m,e,"f"),l.encryptionKey=t.exportedKeyString,l.encryptionSalt=t.salt}else{const e=JSON.parse(a);if(r!==e.salt)throw new Error(oe.KeyringControllerError.ExpiredCredentials);if("string"!=typeof t)throw new TypeError(oe.KeyringControllerError.WrongPasswordType);const n=await W(this,o,"f").importKey(t);i=await W(this,o,"f").decryptWithKey(n,e),l.encryptionKey=t,l.encryptionSalt=r}else{if("string"!=typeof e)throw new TypeError(oe.KeyringControllerError.WrongPasswordType);i=await W(this,o,"f").decrypt(e,a),G(this,m,e,"f")}if("object"!=typeof(p=i)||!Array.isArray(p)||!p.every((e=>e.type&&(0,ne.isValidJson)(e.data))))throw new Error(oe.KeyringControllerError.VaultDataError);var p;if(await W(this,n,"m",A).call(this,i),W(this,u,"f").length!==W(this,d,"f").length)throw new Error(oe.KeyringControllerError.KeyringMetadataLengthMismatch);const h=await W(this,n,"m",E).call(this);return this.update((e=>{e.keyrings=h,(l.encryptionKey||l.encryptionSalt)&&(e.encryptionKey=l.encryptionKey,e.encryptionSalt=l.encryptionSalt)})),!W(this,m,"f")||W(this,c,"f")&&t||!W(this,o,"f").isVaultUpdated||W(this,o,"f").isVaultUpdated(a)||(s(),await W(this,n,"m",C).call(this)),W(this,u,"f")}))},C=function(){return W(this,n,"m",F).call(this,(async()=>{const{encryptionKey:e,encryptionSalt:t,vault:r}=this.state,s=e&&r&&W(this,o,"f").isVaultUpdated?.(r);if(!W(this,m,"f")&&!e)throw new Error(oe.KeyringControllerError.MissingCredentials);const a=await W(this,n,"m",T).call(this);if(!a.some((e=>e.type===ue.hd)))throw new Error(oe.KeyringControllerError.NoHdKeyring);const i={};if(W(this,c,"f")){if(fe(W(this,o,"f")),s){const r=await W(this,o,"f").importKey(e),n=await W(this,o,"f").encryptWithKey(r,a);n.salt=t,i.vault=JSON.stringify(n)}else if(W(this,m,"f")){const{vault:e,exportedKeyString:t}=await W(this,o,"f").encryptWithDetail(W(this,m,"f"),a);i.vault=e,i.encryptionKey=t}}else ge(W(this,m,"f")),i.vault=await W(this,o,"f").encrypt(W(this,m,"f"),a);if(!i.vault)throw new Error(oe.KeyringControllerError.MissingVaultData);const u=await W(this,n,"m",E).call(this);if(u.length!==W(this,d,"f").length)throw new Error(oe.KeyringControllerError.KeyringMetadataLengthMismatch);return this.update((e=>{e.vault=i.vault,e.keyrings=u,e.keyringsMetadata=W(this,d,"f").slice(),i.encryptionKey&&(e.encryptionKey=i.encryptionKey,e.encryptionSalt=JSON.parse(i.vault).salt)})),!0}))},I=async function(){const e=W(this,u,"f");return(await Promise.all(e.map((async e=>e.getAccounts())))).reduce(((e,t)=>e.concat(t)),[]).map(be)},P=async function(e,t){W(this,n,"m",V).call(this);const r=await W(this,n,"m",x).call(this,e,t),[s]=await r.getAccounts();if(!s)throw new Error(oe.KeyringControllerError.NoFirstAccount);return s},x=async function(e,t){const r=await W(this,n,"m",R).call(this,e,t);if(W(this,u,"f").length!==W(this,d,"f").length)throw new Error("Keyring metadata missing");return W(this,u,"f").push(r),W(this,d,"f").push(Se()),r},R=async function(e,t){W(this,n,"m",V).call(this);const r=W(this,n,"m",b).call(this,e);if(!r)throw new Error(`${oe.KeyringControllerError.NoKeyringBuilder}. Keyring type: ${e}`);const s=r();if(t&&await s.deserialize(t),s.init&&await s.init(),!(e!==ue.hd||(0,ne.isObject)(t)&&t.mnemonic)){if(!s.generateRandomMnemonic)throw new Error(oe.KeyringControllerError.UnsupportedGenerateRandomMnemonic);await s.generateRandomMnemonic(),await s.addAccounts(1)}return await W(this,n,"m",$).call(this,e,await s.getAccounts()),e===ue.qr&&W(this,n,"m",w).call(this,s),s},O=async function(){W(this,n,"m",V).call(this);for(const e of W(this,u,"f"))await W(this,n,"m",N).call(this,e);G(this,u,[],"f"),G(this,l,[],"f")},M=async function(e){W(this,n,"m",V).call(this);try{const{type:t,data:r}=e,s=await W(this,n,"m",R).call(this,t,r);return W(this,d,"f").length<=W(this,u,"f").length&&(console.log(`Adding missing metadata for '${t}' keyring`),W(this,d,"f").push(Se())),W(this,u,"f").push(s),s}catch(t){return console.error(t),W(this,l,"f").push(e),undefined}},N=async function(e){await(e.destroy?.())},B=async function(){W(this,n,"m",V).call(this);const e=[],t=[];await Promise.all(W(this,u,"f").map((async(r,s)=>{(await r.getAccounts()).length>0?(e.push(r),t.push(W(this,d,"f")[s])):await W(this,n,"m",N).call(this,r)}))),G(this,u,e,"f"),G(this,d,t,"f")},$=async function(e,t){const r=await W(this,n,"m",I).call(this);if(e===ue.simple){if(Boolean(r.find((e=>t[0]&&(e===t[0]||e===(0,ne.remove0x)(t[0]))))))throw new Error(oe.KeyringControllerError.DuplicatedAccount);return t}return t},D=function(){W(this,n,"m",V).call(this),this.update((e=>{e.isUnlocked=!0,W(this,d,"f").length>e.keyringsMetadata.length&&(e.keyringsMetadata=W(this,d,"f").slice())})),this.messagingSystem.publish(`${ce}:unlock`)},U=function(){if(!this.state.isUnlocked)throw new Error(oe.KeyringControllerError.ControllerLocked)},L=async function(e){return W(this,n,"m",H).call(this,(async({releaseLock:t})=>{const r=await e({releaseLock:t});return await W(this,n,"m",C).call(this),r}))},H=async function(e){return W(this,n,"m",K).call(this,(async({releaseLock:t})=>{const r=await W(this,n,"m",T).call(this),s=W(this,m,"f"),a=W(this,d,"f").slice();try{return await e({releaseLock:t})}catch(e){throw G(this,d,a,"f"),G(this,m,s,"f"),await W(this,n,"m",A).call(this,r),e}}))},V=function(){if(!W(this,s,"f").isLocked())throw new Error(oe.KeyringControllerError.ControllerLockRequired)},K=async function(e){return we(W(this,s,"f"),e)},F=async function(e){return W(this,n,"m",V).call(this),we(W(this,a,"f"),e)},r.default=ke}}},{package:"@metamask/keyring-controller",file:"node_modules/@metamask/keyring-controller/dist/KeyringController.cjs"}],[1989,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.KeyringControllerError=void 0,function(e){e.NoKeyring="KeyringController - No keyring found",e.KeyringNotFound="KeyringController - Keyring not found.",e.UnsafeDirectKeyringAccess="KeyringController - Returning keyring instances is unsafe",e.WrongPasswordType="KeyringController - Password must be of type string.",e.InvalidEmptyPassword="KeyringController - Password cannot be empty.",e.NoFirstAccount="KeyringController - First Account not found.",e.DuplicatedAccount="KeyringController - The account you are trying to import is a duplicate",e.VaultError="KeyringController - Cannot unlock without a previous vault.",e.VaultDataError="KeyringController - The decrypted vault has an unexpected shape.",e.UnsupportedEncryptionKeyExport="KeyringController - The encryptor does not support encryption key export.",e.UnsupportedGenerateRandomMnemonic="KeyringController - The current keyring does not support the method generateRandomMnemonic.",e.UnsupportedExportAccount="`KeyringController - The keyring for the current address does not support the method exportAccount",e.UnsupportedRemoveAccount="`KeyringController - The keyring for the current address does not support the method removeAccount",e.UnsupportedSignTransaction="KeyringController - The keyring for the current address does not support the method signTransaction.",e.UnsupportedSignMessage="KeyringController - The keyring for the current address does not support the method signMessage.",e.UnsupportedSignPersonalMessage="KeyringController - The keyring for the current address does not support the method signPersonalMessage.",e.UnsupportedSignEip7702Authorization="KeyringController - The keyring for the current address does not support the method signEip7702Authorization.",e.UnsupportedGetEncryptionPublicKey="KeyringController - The keyring for the current address does not support the method getEncryptionPublicKey.",e.UnsupportedDecryptMessage="KeyringController - The keyring for the current address does not support the method decryptMessage.",e.UnsupportedSignTypedMessage="KeyringController - The keyring for the current address does not support the method signTypedMessage.",e.UnsupportedGetAppKeyAddress="KeyringController - The keyring for the current address does not support the method getAppKeyAddress.",e.UnsupportedExportAppKeyForAddress="KeyringController - The keyring for the current address does not support the method exportAppKeyForAddress.",e.UnsupportedPrepareUserOperation="KeyringController - The keyring for the current address does not support the method prepareUserOperation.",e.UnsupportedPatchUserOperation="KeyringController - The keyring for the current address does not support the method patchUserOperation.",e.UnsupportedSignUserOperation="KeyringController - The keyring for the current address does not support the method signUserOperation.",e.UnsupportedVerifySeedPhrase="KeyringController - The keyring does not support the method verifySeedPhrase.",e.MissingEip7702AuthorizationContractAddress="KeyringController - The EIP-7702 Authorization is invalid. No contract address provided.",e.NoAccountOnKeychain="KeyringController - The keychain doesn't have accounts.",e.ControllerLocked="KeyringController - The operation cannot be completed while the controller is locked.",e.MissingCredentials="KeyringController - Cannot persist vault without password and encryption key",e.MissingVaultData="KeyringController - Cannot persist vault without vault information",e.ExpiredCredentials="KeyringController - Encryption key and salt provided are expired",e.NoKeyringBuilder="KeyringController - No keyringBuilder found for keyring",e.DataType="KeyringController - Incorrect data type provided",e.NoHdKeyring="KeyringController - No HD Keyring found",e.ControllerLockRequired="KeyringController - attempt to update vault during a non mutually exclusive operation",e.KeyringMetadataLengthMismatch="KeyringController - keyring metadata length mismatch",e.LastAccountInPrimaryKeyring="KeyringController - Last account in primary keyring cannot be removed"}(n||(r.KeyringControllerError=n={}))}}},{package:"@metamask/keyring-controller",file:"node_modules/@metamask/keyring-controller/dist/constants.cjs"}],[1990,{"./KeyringController.cjs":1988},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./KeyringController.cjs"),r)}}},{package:"@metamask/keyring-controller",file:"node_modules/@metamask/keyring-controller/dist/index.cjs"}],[1991,{"./errors":1992,"./packer":1995,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.decodeSingle=r.decode=r.encodePacked=r.encodeSingle=r.encode=void 0;const n=e("@metamask/utils"),s=e("./errors"),a=e("./packer");r.encode=(e,t,r,n)=>{try{return(0,a.pack)({types:e,values:t,packed:r,tight:n})}catch(e){if(e instanceof s.ParserError)throw new s.ParserError(`Unable to encode value: ${e.message}`,e);throw new s.ParserError(`An unexpected error occurred: ${(0,s.getErrorMessage)(e)}`,e)}};r.encodeSingle=(e,t)=>(0,r.encode)([e],[t]);r.encodePacked=(e,t,n)=>(0,r.encode)(e,t,!0,n);r.decode=(e,t)=>{const r=(0,n.createBytes)(t);try{return(0,a.unpack)(e,r)}catch(e){if(e instanceof s.ParserError)throw new s.ParserError(`Unable to decode value: ${e.message}`,e);throw new s.ParserError(`An unexpected error occurred: ${(0,s.getErrorMessage)(e)}`,e)}};r.decodeSingle=(e,t)=>{const a=(0,r.decode)([e],t);return(0,n.assert)(1===a.length,new s.ParserError("Decoded value array has unexpected length.")),a[0]}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/abi.js"}],[1992,{"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ParserError=r.getErrorStack=r.getErrorMessage=void 0;const n=e("@metamask/utils");r.getErrorMessage=e=>"string"==typeof e?e:e instanceof Error||(0,n.isObject)(e)&&(0,n.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:"Unknown error.";r.getErrorStack=e=>e instanceof Error?e.stack:undefined;class s extends Error{constructor(e,t){super(e),this.name="ParserError";const n=(0,r.getErrorStack)(t);n&&(this.stack=n)}}r.ParserError=s}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/errors.js"}],[1993,{"./abi":1991,"./errors":1992,"./types":2008},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./abi"),r),s(e("./errors"),r),s(e("./types"),r)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/index.js"}],[1994,{"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.iterate=void 0;const n=e("@metamask/utils");r.iterate=function*(e,t=32){for(let r=0;r<e.length;r+=t){const s=e=>{(0,n.assert)(e>=0,"Cannot skip a negative number of bytes."),(0,n.assert)(e%t==0,"Length must be a multiple of the size."),r+=e},a=e.subarray(r);yield{skip:s,value:a}}return{skip:()=>undefined,value:new Uint8Array}}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/iterator.js"}],[1995,{"./errors":1992,"./iterator":1994,"./parsers":2002,"./utils":2010,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.unpack=r.pack=r.isDynamicParser=r.getParser=void 0;const n=e("@metamask/utils"),s=e("./errors"),a=e("./iterator"),i=e("./parsers"),o=e("./utils");r.getParser=e=>{const t={address:i.address,array:i.array,bool:i.bool,bytes:i.bytes,fixedBytes:i.fixedBytes,function:i.fn,number:i.number,string:i.string,tuple:i.tuple},r=t[e];if(r)return r;const n=Object.values(t).find((t=>t.isType(e)));if(n)return n;throw new s.ParserError(`The type "${e}" is not supported.`)};r.isDynamicParser=(e,t)=>{const{isDynamic:r}=e;return"function"==typeof r?r(t):r};r.pack=({types:e,values:t,packed:a=!1,tight:i=!1,arrayPacked:c=!1,byteArray:u=new Uint8Array})=>{(0,n.assert)(e.length===t.length,new s.ParserError(`The number of types (${e.length}) does not match the number of values (${t.length}).`));const{staticBuffer:l,dynamicBuffer:d,pointers:m}=e.reduce((({staticBuffer:e,dynamicBuffer:s,pointers:o},u,l)=>{const d=(0,r.getParser)(u),m=t[l];if(a||c||!(0,r.isDynamicParser)(d,u))return{staticBuffer:d.encode({buffer:e,value:m,type:u,packed:a,tight:i}),dynamicBuffer:s,pointers:o};return{staticBuffer:(0,n.concatBytes)([e,new Uint8Array(32)]),dynamicBuffer:d.encode({buffer:s,value:m,type:u,packed:a,tight:i}),pointers:[...o,{position:e.length,pointer:s.length}]}}),{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,n.assert)(!a&&!c||0===d.length,new s.ParserError("Invalid pack state."));const p=l.length,h=m.reduce(((e,{pointer:t,position:r})=>{const s=(0,o.padStart)((0,n.numberToBytes)(p+t));return(0,o.set)(e,s,r)}),l);return(0,n.concatBytes)([u,h,d])};r.unpack=(e,t)=>{const i=(0,a.iterate)(t);return e.map((e=>{const{value:{value:a,skip:o},done:c}=i.next();(0,n.assert)(!c,new s.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${e}".`));const u=(0,r.getParser)(e);if((0,r.isDynamicParser)(u,e)){const r=(0,n.bytesToNumber)(a.subarray(0,32)),s=t.subarray(r);return u.decode({type:e,value:s,skip:o})}return u.decode({type:e,value:a,skip:o})}))}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/packer.js"}],[1996,{"../errors":1992,"../utils":2010,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.address=r.getAddress=void 0;const n=e("@metamask/utils"),s=e("../errors"),a=e("../utils");r.getAddress=e=>{const t=(0,n.createBytes)(e);return(0,n.assert)(t.length<=20,new s.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${t.length} bytes.`)),(0,a.padStart)(t,20)},r.address={isDynamic:!1,isType:e=>"address"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:s}){const i=(0,r.getAddress)(t);if(s)return(0,n.concatBytes)([e,i]);const o=(0,a.padStart)(i);return(0,n.concatBytes)([e,o])},decode:({value:e})=>(0,n.add0x)((0,n.bytesToHex)(e.slice(12,32)))}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/parsers/address.js"}],[1997,{"../errors":1992,"../packer":1995,"../utils":2010,"./fixed-bytes":2e3,"./tuple":2006,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.array=r.getTupleType=r.getArrayType=r.isArrayType=void 0;const n=e("@metamask/utils"),s=e("../errors"),a=e("../packer"),i=e("../utils"),o=e("./fixed-bytes"),c=e("./tuple"),u=/^(?<type>.*)\[(?<length>\d*?)\]$/u;r.isArrayType=e=>u.test(e);r.getArrayType=e=>{const t=e.match(u);return(0,n.assert)(t?.groups?.type,new s.ParserError(`Invalid array type. Expected an array type, but received "${e}".`)),[t.groups.type,t.groups.length?parseInt(t.groups.length,10):undefined]};r.getTupleType=(e,t)=>`(${new Array(t).fill(e).join(",")})`,r.array={isDynamic(e){const[t,n]=(0,r.getArrayType)(e);return n===undefined||(0,a.isDynamicParser)((0,a.getParser)(t),t)},isType:e=>(0,r.isArrayType)(e),getByteLength(e){(0,n.assert)((0,r.isArrayType)(e),new s.ParserError(`Expected an array type, but received "${e}".`));const[t,i]=(0,r.getArrayType)(e);return(0,a.isDynamicParser)(this,e)||i===undefined?32:c.tuple.getByteLength((0,r.getTupleType)(t,i))},encode({type:e,buffer:t,value:u,packed:l,tight:d}){const[m,p]=(0,r.getArrayType)(e);if((0,n.assert)(!l||!(0,r.isArrayType)(m),new s.ParserError("Cannot pack nested arrays.")),l&&(0,a.isDynamicParser)((0,a.getParser)(m),m))return(0,a.pack)({types:new Array(u.length).fill(m),values:u,byteArray:t,packed:l,arrayPacked:!0,tight:d});if(p)return(0,n.assert)(p===u.length,new s.ParserError(`Array length does not match type length. Expected a length of ${p}, but received ${u.length}.`)),c.tuple.encode({type:(0,r.getTupleType)(m,p),buffer:t,value:u,packed:o.fixedBytes.isType(m)&&d,tight:d});if(l)return(0,a.pack)({types:new Array(u.length).fill(m),values:u,byteArray:t,packed:o.fixedBytes.isType(m)&&d,arrayPacked:!0,tight:d});const h=(0,i.padStart)((0,n.numberToBytes)(u.length));return(0,a.pack)({types:new Array(u.length).fill(m),values:u,byteArray:(0,n.concatBytes)([t,h]),packed:l,tight:d})},decode({type:e,value:t,...i}){const[o,u]=(0,r.getArrayType)(e);if(u){const e=c.tuple.decode({type:(0,r.getTupleType)(o,u),value:t,...i});return(0,n.assert)(e.length===u,new s.ParserError(`Array length does not match type length. Expected a length of ${u}, but received ${e.length}.`)),e}const l=(0,n.bytesToNumber)(t.subarray(0,32));return(0,a.unpack)(new Array(l).fill(o),t.subarray(32))}}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/parsers/array.js"}],[1998,{"../errors":1992,"./number":2003,"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.bool=r.getBooleanValue=void 0;const n=e("@metamask/superstruct"),s=e("@metamask/utils"),a=e("../errors"),i=e("./number"),o=(0,n.coerce)((0,n.boolean)(),(0,n.union)([(0,n.literal)("true"),(0,n.literal)("false")]),(e=>"true"===e));r.getBooleanValue=e=>{try{return(0,n.create)(e,o)?BigInt(1):BigInt(0)}catch{throw new a.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${e}".`)}},r.bool={isDynamic:!1,isType:e=>"bool"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:n,tight:a}){const o=(0,r.getBooleanValue)(t);return n?(0,s.concatBytes)([e,(0,s.bigIntToBytes)(o)]):i.number.encode({type:"uint256",buffer:e,value:o,packed:n,tight:a})},decode:e=>i.number.decode({...e,type:"uint256"})===BigInt(1)}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/parsers/bool.js"}],[1999,{"../utils":2010,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.bytes=void 0;const n=e("@metamask/utils"),s=e("../utils");r.bytes={isDynamic:!0,isType:e=>"bytes"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:r}){const a=(0,n.createBytes)(t);if(r)return(0,n.concatBytes)([e,a]);const i=32*Math.ceil(a.byteLength/32);return(0,n.concatBytes)([e,(0,s.padStart)((0,n.numberToBytes)(a.byteLength)),(0,s.padEnd)(a,i)])},decode({value:e}){const t=e.subarray(0,32),r=(0,n.bytesToNumber)(t);return e.slice(32,32+r)}}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/parsers/bytes.js"}],[2,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=[{code:"am",name:"አማርኛ"},{code:"ar",name:"العربية"},{code:"bg",name:"български"},{code:"bn",name:"বাংলা"},{code:"ca",name:"Català"},{code:"cs",name:"Čeština"},{code:"da",name:"Dansk"},{code:"de",name:"Deutsch"},{code:"el",name:"ελληνικά"},{code:"en",name:"English"},{code:"es",name:"Español"},{code:"es_419",name:"Español (Latin America)"},{code:"et",name:"Estonian"},{code:"fa",name:"فارسی"},{code:"fi",name:"Suomi"},{code:"fil",name:"Filipino"},{code:"fr",name:"Français"},{code:"gu",name:"ગુજરાત"},{code:"he",name:"עברית"},{code:"hi",name:"मानक हिन्दी"},{code:"hn",name:"हिन्दी"},{code:"hr",name:"Hrvatski"},{code:"ht",name:"Kreyòl ayisyen"},{code:"hu",name:"Magyar"},{code:"id",name:"Bahasa Indonesia"},{code:"it",name:"Italiano"},{code:"ja",name:"日本語"},{code:"kn",name:"ಕನ್ನಡ"},{code:"ko",name:"한국어"},{code:"lt",name:"Lietuviškai"},{code:"lv",name:"Latvian"},{code:"ml",name:"മലയാളം"},{code:"mr",name:"मराठी"},{code:"ms",name:"Malay"},{code:"nl",name:"Nederlands"},{code:"no",name:"Norwegian"},{code:"ph",name:"Pilipino"},{code:"pl",name:"Polskie"},{code:"pt",name:"Português"},{code:"pt_BR",name:"Português (Brazillian)"},{code:"pt_PT",name:"Português (European)"},{code:"ro",name:"Limba română"},{code:"ru",name:"Русский"},{code:"sk",name:"Slovenčina"},{code:"sl",name:"Slovenščina"},{code:"sr",name:"српски"},{code:"sv",name:"Svenska"},{code:"sw",name:"Swahili"},{code:"ta",name:"தமிழ்"},{code:"te",name:"తెలుగు"},{code:"th",name:"ไทย"},{code:"tl",name:"Wikang Tagalog"},{code:"tr",name:"Türkçe"},{code:"uk",name:"Українська мова"},{code:"vi",name:"Tiếng Việt"},{code:"zh_CN",name:"中文(简体)"},{code:"zh_TW",name:"中文(繁體)"}]}}},{package:"$root$",file:"app/_locales/index.json"}],[2e3,{"../errors":1992,"../utils":2010,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.fixedBytes=r.getByteLength=void 0;const n=e("@metamask/utils"),s=e("../errors"),a=e("../utils"),i=/^bytes([0-9]{1,2})$/u;r.getByteLength=e=>{const t=e.match(i)?.[1];(0,n.assert)(t,`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`);const r=Number(t);return(0,n.assert)(r>0&&r<=32,new s.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`)),r},r.fixedBytes={isDynamic:!1,isType:e=>i.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:i,packed:o}){const c=(0,r.getByteLength)(e),u=(0,n.createBytes)(i);return(0,n.assert)(u.length<=c,new s.ParserError(`Expected a value of length ${c}, but received a value of length ${u.length}.`)),o?(0,n.concatBytes)([t,(0,a.padEnd)(u,c)]):(0,n.concatBytes)([t,(0,a.padEnd)(u)])},decode({type:e,value:t}){const n=(0,r.getByteLength)(e);return t.slice(0,n)}}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/parsers/fixed-bytes.js"}],[2001,{"../errors":1992,"./fixed-bytes":2e3,"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.fn=r.getFunction=void 0;const n=e("@metamask/superstruct"),s=e("@metamask/utils"),a=e("../errors"),i=e("./fixed-bytes"),o=(0,n.coerce)((0,n.object)({address:s.StrictHexStruct,selector:s.StrictHexStruct}),(0,n.union)([s.StrictHexStruct,(0,n.instance)(Uint8Array)]),(e=>{const t=(0,s.createBytes)(e);return(0,s.assert)(24===t.length,new a.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${t.length} bytes.`)),{address:(0,s.bytesToHex)(t.subarray(0,20)),selector:(0,s.bytesToHex)(t.subarray(20,24))}}));r.getFunction=e=>{const t=(0,n.create)(e,o);return(0,s.concatBytes)([(0,s.hexToBytes)(t.address),(0,s.hexToBytes)(t.selector)])},r.fn={isDynamic:!1,isType:e=>"function"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:n,tight:s}){const a=(0,r.getFunction)(t);return i.fixedBytes.encode({type:"bytes24",buffer:e,value:a,packed:n,tight:s})},decode:({value:e})=>({address:(0,s.bytesToHex)(e.slice(0,20)),selector:(0,s.bytesToHex)(e.slice(20,24))})}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/parsers/function.js"}],[2002,{"./address":1996,"./array":1997,"./bool":1998,"./bytes":1999,"./fixed-bytes":2e3,"./function":2001,"./number":2003,"./parser":2004,"./string":2005,"./tuple":2006},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./address"),r),s(e("./array"),r),s(e("./bool"),r),s(e("./bytes"),r),s(e("./fixed-bytes"),r),s(e("./function"),r),s(e("./number"),r),s(e("./parser"),r),s(e("./string"),r),s(e("./tuple"),r)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/parsers/index.js"}],[2003,{"../errors":1992,"../utils":2010,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.number=r.getBigInt=r.assertNumberLength=r.getLength=r.isSigned=void 0;const n=e("@metamask/utils"),s=e("../errors"),a=e("../utils"),i=/^u?int(?<length>[0-9]*)?$/u;r.isSigned=e=>!e.startsWith("u");r.getLength=e=>{if("int"===e||"uint"===e)return 256;const t=e.match(i);(0,n.assert)(t?.groups?.length,new s.ParserError(`Invalid number type. Expected a number type, but received "${e}".`));const r=parseInt(t.groups.length,10);return(0,n.assert)(r>=8&&r<=256,new s.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${e}".`)),(0,n.assert)(r%8==0,new s.ParserError(`Invalid number length. Expected a multiple of 8, but received "${e}".`)),r};r.assertNumberLength=(e,t)=>{const a=(0,r.getLength)(t),i=BigInt(2)**BigInt(a-((0,r.isSigned)(t)?1:0))-BigInt(1);(0,r.isSigned)(t)?(0,n.assert)(e>=-(i+BigInt(1))&&e<=i,new s.ParserError(`Number "${e}" is out of range for type "${t}".`)):(0,n.assert)(e<=i,new s.ParserError(`Number "${e}" is out of range for type "${t}".`))};r.getBigInt=e=>{try{return(0,n.createBigInt)(e)}catch{throw new s.ParserError(`Invalid number. Expected a valid number value, but received "${e}".`)}},r.number={isDynamic:!1,isType:e=>i.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:s,packed:i}){const o=(0,r.getBigInt)(s);if((0,r.assertNumberLength)(o,e),(0,r.isSigned)(e)){if(i){const s=(0,r.getLength)(e)/8;return(0,n.concatBytes)([t,(0,n.signedBigIntToBytes)(o,s)])}return(0,n.concatBytes)([t,(0,a.padStart)((0,n.signedBigIntToBytes)(o,32))])}if(i){const s=(0,r.getLength)(e)/8;return(0,n.concatBytes)([t,(0,a.padStart)((0,n.bigIntToBytes)(o),s)])}return(0,n.concatBytes)([t,(0,a.padStart)((0,n.bigIntToBytes)(o))])},decode({type:e,value:t}){const s=t.subarray(0,32);if((0,r.isSigned)(e)){const t=(0,n.bytesToSignedBigInt)(s);return(0,r.assertNumberLength)(t,e),t}const a=(0,n.bytesToBigInt)(s);return(0,r.assertNumberLength)(a,e),a}}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/parsers/number.js"}],[2004,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/parsers/parser.js"}],[2005,{"./bytes":1999,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.string=void 0;const n=e("@metamask/utils"),s=e("./bytes");r.string={isDynamic:!0,isType:e=>"string"===e,getByteLength:()=>32,encode:({buffer:e,value:t,packed:r,tight:a})=>s.bytes.encode({type:"bytes",buffer:e,value:(0,n.stringToBytes)(t),packed:r,tight:a}),decode:e=>(0,n.bytesToString)(s.bytes.decode(e))}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/parsers/string.js"}],[2006,{"../errors":1992,"../packer":1995,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.tuple=r.getTupleElements=void 0;const n=e("@metamask/utils"),s=e("../errors"),a=e("../packer"),i=/^\((.+)\)$/u;r.getTupleElements=e=>{(0,n.assert)(e.startsWith("(")&&e.endsWith(")"),new s.ParserError(`Invalid tuple type. Expected tuple type, but received "${e}".`));const t=[];let r="",a=0;for(let n=1;n<e.length-1;n++){const s=e[n];","===s&&0===a?(t.push(r.trim()),r=""):(r+=s,"("===s?a+=1:")"===s&&(a-=1))}return r.trim()&&t.push(r.trim()),t},r.tuple={isDynamic:e=>(0,r.getTupleElements)(e).some((e=>{const t=(0,a.getParser)(e);return(0,a.isDynamicParser)(t,e)})),isType:e=>(e=>i.test(e))(e),getByteLength(e){if((0,a.isDynamicParser)(this,e))return 32;return(0,r.getTupleElements)(e).reduce(((e,t)=>e+(0,a.getParser)(t).getByteLength(t)),0)},encode({type:e,buffer:t,value:n,packed:s,tight:i}){const o=(0,r.getTupleElements)(e);return(0,a.pack)({types:o,values:n,byteArray:t,packed:s,tight:i})},decode({type:e,value:t,skip:n}){const s=(0,r.getTupleElements)(e);return n(this.getByteLength(e)-32),(0,a.unpack)(s,t)}}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/parsers/tuple.js"}],[2007,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/types/abi.js"}],[2008,{"./abi":2007},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./abi"),r)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/types/index.js"}],[2009,{"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.padEnd=r.padStart=r.set=void 0;const n=e("@metamask/utils");r.set=(e,t,r)=>(0,n.concatBytes)([e.subarray(0,r),t,e.subarray(r+t.length)]);r.padStart=(e,t=32)=>{const r=new Uint8Array(Math.max(t-e.length,0)).fill(0);return(0,n.concatBytes)([r,e])};r.padEnd=(e,t=32)=>{const r=new Uint8Array(Math.max(t-e.length,0)).fill(0);return(0,n.concatBytes)([e,r])}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/utils/buffer.js"}],[2010,{"./buffer":2009},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./buffer"),r)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/abi-utils/dist/utils/index.js"}],[2011,{"./utils":2016,"@scure/base":3027,buffer:4074,tweetnacl:5616},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.getEncryptionPublicKey=r.decryptSafely=r.decrypt=r.encryptSafely=r.encrypt=void 0;const i=e("@scure/base"),o=a(e("tweetnacl")),c=e("./utils");function u({publicKey:e,data:t,version:r}){if((0,c.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,c.isNullish)(t))throw new Error("Missing data parameter");if((0,c.isNullish)(r))throw new Error("Missing version parameter");if("x25519-xsalsa20-poly1305"===r){if("string"!=typeof t)throw new Error("Message data must be given as a string");const r=o.box.keyPair();let n;try{n=i.base64.decode(e)}catch(e){throw new Error("Bad public key")}const s=i.utf8.decode(t),a=o.randomBytes(o.box.nonceLength),c=o.box(s,a,n,r.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:i.base64.encode(a),ephemPublicKey:i.base64.encode(r.publicKey),ciphertext:i.base64.encode(c)}}throw new Error("Encryption type/version not supported")}function l({encryptedData:e,privateKey:r}){if((0,c.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,c.isNullish)(r))throw new Error("Missing privateKey parameter");if("x25519-xsalsa20-poly1305"===e.version){const n=t.from(r,"hex"),s=o.box.keyPair.fromSecretKey(n).secretKey,a=i.base64.decode(e.nonce),c=i.base64.decode(e.ciphertext),u=i.base64.decode(e.ephemPublicKey),l=o.box.open(c,a,u,s);try{if(!l)throw new Error;const e=i.utf8.encode(l);if(!e)throw new Error;return e}catch(e){if(e&&"string"==typeof e.message&&e.message.length)throw new Error(`Decryption failed: ${e.message}`);throw new Error("Decryption failed.")}}throw new Error("Encryption type/version not supported.")}r.encrypt=u,r.encryptSafely=function({publicKey:e,data:r,version:n}){if((0,c.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,c.isNullish)(r))throw new Error("Missing data parameter");if((0,c.isNullish)(n))throw new Error("Missing version parameter");if("object"==typeof r&&r&&"toJSON"in r)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const s={data:r,padding:""},a=t.byteLength(JSON.stringify(s),"utf-8")%2048;let i=0;return a>0&&(i=2048-a-16),s.padding="0".repeat(i),u({publicKey:e,data:JSON.stringify(s),version:n})},r.decrypt=l,r.decryptSafely=function({encryptedData:e,privateKey:t}){if((0,c.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,c.isNullish)(t))throw new Error("Missing privateKey parameter");return JSON.parse(l({encryptedData:e,privateKey:t})).data},r.getEncryptionPublicKey=function(e){const r=t.from(e,"hex"),n=o.box.keyPair.fromSecretKey(r).publicKey;return i.base64.encode(n)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/dist/encryption.js"}],[2012,{"./encryption":2011,"./personal-sign":2013,"./sign-eip7702-authorization":2014,"./sign-typed-data":2015,"./utils":2016},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.normalize=r.concatSig=void 0,s(e("./personal-sign"),r),s(e("./sign-typed-data"),r),s(e("./encryption"),r),s(e("./sign-eip7702-authorization"),r);var a=e("./utils");Object.defineProperty(r,"concatSig",{enumerable:!0,get:function(){return a.concatSig}}),Object.defineProperty(r,"normalize",{enumerable:!0,get:function(){return a.normalize}})}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/dist/index.js"}],[2013,{"./utils":2016,"@ethereumjs/util":2024},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.extractPublicKey=r.recoverPersonalSignature=r.personalSign=void 0;const n=e("@ethereumjs/util"),s=e("./utils");function a(e,t){const r=(0,n.hashPersonalMessage)((0,s.legacyToBuffer)(e));return(0,s.recoverPublicKey)(r,t)}r.personalSign=function({privateKey:e,data:t}){if((0,s.isNullish)(t))throw new Error("Missing data parameter");if((0,s.isNullish)(e))throw new Error("Missing privateKey parameter");const r=(0,s.legacyToBuffer)(t),a=(0,n.hashPersonalMessage)(r),i=(0,n.ecsign)(a,e);return(0,s.concatSig)((0,n.toBuffer)(i.v),i.r,i.s)},r.recoverPersonalSignature=function({data:e,signature:t}){if((0,s.isNullish)(e))throw new Error("Missing data parameter");if((0,s.isNullish)(t))throw new Error("Missing signature parameter");const r=a(e,t),i=(0,n.publicToAddress)(r);return(0,n.bufferToHex)(i)},r.extractPublicKey=function({data:e,signature:t}){if((0,s.isNullish)(e))throw new Error("Missing data parameter");if((0,s.isNullish)(t))throw new Error("Missing signature parameter");return`0x${a(e,t).toString("hex")}`}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/dist/personal-sign.js"}],[2014,{"./utils":2016,"@ethereumjs/rlp":429,"@ethereumjs/util":2024,"@metamask/utils":2950,buffer:4074,"ethereum-cryptography/keccak":4300},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.hashEIP7702Authorization=r.recoverEIP7702Authorization=r.signEIP7702Authorization=void 0;const n=e("@ethereumjs/rlp"),s=e("@ethereumjs/util"),a=e("@metamask/utils"),i=e("ethereum-cryptography/keccak"),o=e("./utils");function c(e){u(e);const r=(0,n.encode)(e),s=t.concat([t.from("05","hex"),r]);return t.from((0,i.keccak256)(s))}function u(e){if((0,o.isNullish)(e))throw new Error("Missing authorization parameter");const[t,r,n]=e;if((0,o.isNullish)(t))throw new Error("Missing chainId parameter");if((0,o.isNullish)(r))throw new Error("Missing contractAddress parameter");if((0,o.isNullish)(n))throw new Error("Missing nonce parameter")}r.signEIP7702Authorization=function({privateKey:e,authorization:t}){if(u(t),(0,o.isNullish)(e))throw new Error("Missing privateKey parameter");const r=c(t),{r:n,s:a,v:i}=(0,s.ecsign)(r,e),l=(0,s.toBuffer)(i);return(0,o.concatSig)(l,n,a)},r.recoverEIP7702Authorization=function({signature:e,authorization:t}){if(u(t),(0,o.isNullish)(e))throw new Error("Missing signature parameter");const r=c(t),n=(0,o.recoverPublicKey)(r,e),i=(0,s.publicToAddress)(n);return(0,a.bytesToHex)(i)},r.hashEIP7702Authorization=c}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/dist/sign-eip7702-authorization.js"}],[2015,{"./utils":2016,"@ethereumjs/util":2024,"@metamask/abi-utils":1993,"@metamask/abi-utils/dist/parsers":2002,"@metamask/abi-utils/dist/utils":2010,"@metamask/utils":2950,"ethereum-cryptography/keccak":4300},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.recoverTypedSignature=r.signTypedData=r.typedSignatureHash=r.TypedDataUtils=r.TYPED_MESSAGE_SCHEMA=r.SignTypedDataVersion=void 0;const n=e("@ethereumjs/util"),s=e("@metamask/abi-utils"),a=e("@metamask/abi-utils/dist/parsers"),i=e("@metamask/abi-utils/dist/utils"),o=e("@metamask/utils"),c=e("ethereum-cryptography/keccak"),u=e("./utils");var l;function d(e,t){if(!Object.keys(l).includes(e))throw new Error(`Invalid version: '${e}'`);if(t&&!t.includes(e))throw new Error(`SignTypedDataVersion not allowed: '${e}'. Allowed versions are: ${t.join(", ")}`)}function m(e,t){(0,o.assert)(null!==t,`Unable to encode value: Invalid number. Expected a valid number value, but received "${t}".`);const r=BigInt(t),n=(0,a.getLength)(e),s=BigInt(2)**BigInt(n)-BigInt(1);return(0,o.assert)(r>=-s&&r<=s,`Unable to encode value: Number "${t}" is out of range for type "${e}".`),r}function p(e){let t=BigInt(0);for(let r=0;r<e.length;r++){const n=BigInt(e.charCodeAt(r)-48);t*=BigInt(10),t+=n>=49?n-BigInt(49)+BigInt(10):n>=17?n-BigInt(17)+BigInt(10):n}return(0,i.padStart)((0,o.bigIntToBytes)(t),20)}function h(e,t,r,a,u){if(d(u,[l.V3,l.V4]),e[r]!==undefined)return["bytes32",u===l.V4&&null==a?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,n.arrToBufArr)((0,c.keccak256)(f(r,a,e,u)))];if("function"===r)throw new Error('Unsupported or invalid type: "function"');if(a===undefined)throw new Error(`missing value for field ${t} of type ${r}`);if("address"===r){if("number"==typeof a)return["address",(0,i.padStart)((0,o.numberToBytes)(a),20)];if((0,o.isStrictHexString)(a))return["address",(0,o.add0x)(a)];if("string"==typeof a)return["address",p(a).subarray(0,20)]}if("bool"===r)return["bool",Boolean(a)];if("bytes"===r)return"number"==typeof a?a=(0,o.numberToBytes)(a):(0,o.isStrictHexString)(a)||"0x"===a?a=(0,o.hexToBytes)(a):"string"==typeof a&&(a=(0,o.stringToBytes)(a)),["bytes32",(0,n.arrToBufArr)((0,c.keccak256)(a))];if(r.startsWith("bytes")&&"bytes"!==r&&!r.includes("["))return"number"==typeof a?a<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,o.bigIntToBytes)(BigInt(a))]:(0,o.isStrictHexString)(a)?["bytes32",(0,o.hexToBytes)(a)]:["bytes32",a];if(r.startsWith("int")&&!r.includes("[")){const e=m(r,a);return e>=BigInt(0)?["uint256",e]:["int256",e]}if("string"===r)return a="number"==typeof a?(0,o.numberToBytes)(a):(0,o.stringToBytes)(null!=a?a:""),["bytes32",(0,n.arrToBufArr)((0,c.keccak256)(a))];if(r.endsWith("]")){if(u===l.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const i=r.slice(0,r.lastIndexOf("[")),o=a.map((r=>h(e,t,i,r,u)));return["bytes32",(0,n.arrToBufArr)((0,c.keccak256)((0,s.encode)(o.map((([e])=>e)),o.map((([,e])=>e)))))]}return[r,a]}function f(e,t,r,a){d(a,[l.V3,l.V4]);const i=["bytes32"],o=[k(e,r)];for(const n of r[e]){if(a===l.V3&&t[n.name]===undefined)continue;const[e,s]=h(r,n.name,n.type,t[n.name],a);i.push(e),o.push(s)}return(0,n.arrToBufArr)((0,s.encode)(i,o))}function g(e,t){let r="";const n=y(e,t);n.delete(e);const s=[e,...Array.from(n).sort()];for(const e of s){if(!t[e])throw new Error(`No type definition specified: ${e}`);r+=`${e}(${t[e].map((({name:e,type:t})=>`${t} ${e}`)).join(",")})`}return r}function y(e,t,r=new Set){if("string"!=typeof e)throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(e)}`);const n=e.match(/^\w*/u);if([e]=n,r.has(e)||t[e]===undefined)return r;r.add(e);for(const n of t[e])y(n.type,t,r);return r}function b(e,t,r,s){d(s,[l.V3,l.V4]);const a=f(e,t,r,s),i=(0,c.keccak256)(a);return(0,n.arrToBufArr)(i)}function k(e,t){const r=(0,o.stringToBytes)(g(e,t));return(0,n.arrToBufArr)((0,c.keccak256)(r))}function w(e){const t={};for(const n in r.TYPED_MESSAGE_SCHEMA.properties)e[n]&&(t[n]=e[n]);return"types"in t&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t}function S(e,t){d(t,[l.V3,l.V4]);const r=w(e),{domain:n}=r;return b("EIP712Domain",n,{EIP712Domain:r.types.EIP712Domain},t)}function _(e,t){if((0,a.isArrayType)(e)&&Array.isArray(t)){const[r]=(0,a.getArrayType)(e);return t.map((e=>_(r,e)))}if("address"===e){if((0,o.isStrictHexString)(t))return(0,i.padStart)((0,o.hexToBytes)(t).subarray(0,20),20);if(t instanceof Uint8Array)return(0,i.padStart)(t.subarray(0,20),20)}if("bool"===e)return Boolean(t);if(e.startsWith("bytes")&&"bytes"!==e){const r=(0,a.getByteLength)(e);if("number"==typeof t)return t<0?new Uint8Array:(0,o.numberToBytes)(t).subarray(0,r);if((0,o.isStrictHexString)(t))return(0,o.hexToBytes)(t).subarray(0,r);if(t instanceof Uint8Array)return t.subarray(0,r)}if(e.startsWith("uint")&&"number"==typeof t)return Math.abs(t);if(e.startsWith("int")&&"number"==typeof t){const r=(0,a.getLength)(e);return BigInt.asIntN(r,BigInt(t))}return t}function v(e,t){return t.map((t=>{if("string"==typeof t||"number"==typeof t||"bigint"==typeof t){const r=m(e,t);if(r>=BigInt(0))return(0,i.padStart)((0,o.bigIntToBytes)(r),32);const n=(0,a.getLength)(e),s=BigInt.asIntN(n,r);return(0,o.signedBigIntToBytes)(s,32)}return t}))}function E(e){const t=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!("length"in e)||!e.length)throw t;const r=e.map((({name:e,type:t,value:r})=>{if("address[]"===t)return{name:e,type:"bytes32[]",value:(n=r,n.map((e=>"number"==typeof e?(0,i.padStart)((0,o.numberToBytes)(e),32):(0,o.isStrictHexString)(e)?(0,i.padStart)((0,o.hexToBytes)(e).subarray(0,32),32):e instanceof Uint8Array?(0,i.padStart)(e.subarray(0,32),32):e)))};var n;if(t.startsWith("int")&&(0,a.isArrayType)(t)){const[n,s]=(0,a.getArrayType)(t);return{name:e,type:`bytes32[${null!=s?s:""}]`,value:v(n,r)}}return{name:e,type:t,value:_(t,r)}})),l=r.map((e=>"bytes"!==e.type?e.value:(0,u.legacyToBuffer)(e.value))),d=r.map((e=>{if("function"===e.type)throw new Error('Unsupported or invalid type: "function"');return e.type})),m=e.map((e=>{if(!e.name)throw t;return`${e.type} ${e.name}`}));return(0,n.arrToBufArr)((0,c.keccak256)((0,s.encodePacked)(["bytes32","bytes32"],[(0,c.keccak256)((0,s.encodePacked)(["string[]"],[m],!0)),(0,c.keccak256)((0,s.encodePacked)(d,l,!0))])))}!function(e){e.V1="V1",e.V3="V3",e.V4="V4"}(l=r.SignTypedDataVersion||(r.SignTypedDataVersion={})),r.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},r.TypedDataUtils={encodeData:f,encodeType:g,findTypeDependencies:y,hashStruct:b,hashType:k,sanitizeData:w,eip712Hash:function(e,t){d(t,[l.V3,l.V4]);const r=w(e),s=[(0,o.hexToBytes)("1901")];return s.push(S(e,t)),"EIP712Domain"!==r.primaryType&&s.push(b(r.primaryType,r.message,r.types,t)),(0,n.arrToBufArr)((0,c.keccak256)((0,o.concatBytes)(s)))},eip712DomainHash:S},r.typedSignatureHash=function(e){const t=E(e);return(0,o.bytesToHex)(t)},r.signTypedData=function({privateKey:e,data:t,version:s}){if(d(s),(0,u.isNullish)(t))throw new Error("Missing data parameter");if((0,u.isNullish)(e))throw new Error("Missing private key parameter");const a=s===l.V1?E(t):r.TypedDataUtils.eip712Hash(t,s),i=(0,n.ecsign)(a,e);return(0,u.concatSig)((0,n.arrToBufArr)((0,o.bigIntToBytes)(i.v)),i.r,i.s)},r.recoverTypedSignature=function({data:e,signature:t,version:s}){if(d(s),(0,u.isNullish)(e))throw new Error("Missing data parameter");if((0,u.isNullish)(t))throw new Error("Missing signature parameter");const a=s===l.V1?E(e):r.TypedDataUtils.eip712Hash(e,s),i=(0,u.recoverPublicKey)(a,t),c=(0,n.publicToAddress)(i);return(0,o.bytesToHex)(c)}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/dist/sign-typed-data.js"}],[2016,{"@ethereumjs/util":2024,"@metamask/utils":2950,buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.normalize=r.recoverPublicKey=r.concatSig=r.legacyToBuffer=r.isNullish=r.padWithZeroes=void 0;const n=e("@ethereumjs/util"),s=e("@metamask/utils");function a(e,t){if(""!==e&&!/^[a-f0-9]+$/iu.test(e))throw new Error(`Expected an unprefixed hex string. Received: ${e}`);if(t<0)throw new Error(`Expected a non-negative integer target length. Received: ${t}`);return String.prototype.padStart.call(e,t,"0")}function i(e){return null===e||e===undefined}r.padWithZeroes=a,r.isNullish=i,r.legacyToBuffer=function(e){return"string"!=typeof e||(0,n.isHexString)(e)?(0,n.toBuffer)(e):t.from(e)},r.concatSig=function(e,t,r){const i=(0,n.fromSigned)(t),o=(0,n.fromSigned)(r),c=(0,n.bufferToInt)(e),u=a((0,n.toUnsigned)(i).toString("hex"),64),l=a((0,n.toUnsigned)(o).toString("hex"),64),d=(0,s.remove0x)((0,s.numberToHex)(c));return(0,s.add0x)(u.concat(l,d))},r.recoverPublicKey=function(e,t){const r=(0,n.fromRpcSig)(t);return(0,n.ecrecover)(e,r.v,r.r,r.s)},r.normalize=function(e){if(i(e))return undefined;if("number"==typeof e){if(e<0)return"0x";const t=(0,s.numberToBytes)(e);e=(0,s.bytesToHex)(t)}if("string"!=typeof e){let t="eth-sig-util.normalize() requires hex string or integer input.";throw t+=` received ${typeof e}: ${e}`,new Error(t)}return(0,s.add0x)(e.toLowerCase())}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/dist/utils.js"}],[2017,{"./bytes":2020,"./constants":2021,"./helpers":2023,"./internal":2025,"@ethereumjs/rlp":429,buffer:4074,"ethereum-cryptography/keccak":4300,"ethereum-cryptography/secp256k1":4317,"ethereum-cryptography/utils":4319},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.accountBodyToRLP=r.accountBodyToSlim=r.accountBodyFromSlim=r.isZeroAddress=r.zeroAddress=r.importPublic=r.privateToAddress=r.privateToPublic=r.publicToAddress=r.pubToAddress=r.isValidPublic=r.isValidPrivate=r.generateAddress2=r.generateAddress=r.isValidChecksumAddress=r.toChecksumAddress=r.isValidAddress=r.Account=void 0;const n=e("@ethereumjs/rlp"),s=e("ethereum-cryptography/keccak"),a=e("ethereum-cryptography/secp256k1"),i=e("ethereum-cryptography/utils"),o=e("./bytes"),c=e("./constants"),u=e("./helpers"),l=e("./internal"),d=BigInt(0);class m{constructor(e=d,t=d,r=c.KECCAK256_RLP,n=c.KECCAK256_NULL){this.nonce=e,this.balance=t,this.storageRoot=r,this.codeHash=n,this._validate()}static fromAccountData(e){const{nonce:t,balance:r,storageRoot:n,codeHash:s}=e;return new m(t!==undefined?(0,o.bufferToBigInt)((0,o.toBuffer)(t)):undefined,r!==undefined?(0,o.bufferToBigInt)((0,o.toBuffer)(r)):undefined,n!==undefined?(0,o.toBuffer)(n):undefined,s!==undefined?(0,o.toBuffer)(s):undefined)}static fromRlpSerializedAccount(e){const t=(0,o.arrToBufArr)(n.RLP.decode(Uint8Array.from(e)));if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)}static fromValuesArray(e){const[t,r,n,s]=e;return new m((0,o.bufferToBigInt)(t),(0,o.bufferToBigInt)(r),n,s)}_validate(){if(this.nonce<d)throw new Error("nonce must be greater than zero");if(this.balance<d)throw new Error("balance must be greater than zero");if(32!==this.storageRoot.length)throw new Error("storageRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")}raw(){return[(0,o.bigIntToUnpaddedBuffer)(this.nonce),(0,o.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return t.from(n.RLP.encode((0,o.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(c.KECCAK256_NULL)}isEmpty(){return this.balance===d&&this.nonce===d&&this.codeHash.equals(c.KECCAK256_NULL)}}r.Account=m;r.isValidAddress=function(e){try{(0,u.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};r.toChecksumAddress=function(e,r){(0,u.assertIsHexString)(e);const n=(0,l.stripHexPrefix)(e).toLowerCase();let a="";if(r!==undefined){a=(0,o.bufferToBigInt)((0,o.toBuffer)(r)).toString()+"0x"}const c=t.from(a+n,"utf8"),d=(0,i.bytesToHex)((0,s.keccak256)(c));let m="0x";for(let e=0;e<n.length;e++)parseInt(d[e],16)>=8?m+=n[e].toUpperCase():m+=n[e];return m};r.isValidChecksumAddress=function(e,t){return(0,r.isValidAddress)(e)&&(0,r.toChecksumAddress)(e,t)===e};r.generateAddress=function(e,r){return(0,u.assertIsBuffer)(e),(0,u.assertIsBuffer)(r),(0,o.bufferToBigInt)(r)===BigInt(0)?t.from((0,s.keccak256)(n.RLP.encode((0,o.bufArrToArr)([e,null])))).slice(-20):t.from((0,s.keccak256)(n.RLP.encode((0,o.bufArrToArr)([e,r])))).slice(-20)};r.generateAddress2=function(e,r,n){if((0,u.assertIsBuffer)(e),(0,u.assertIsBuffer)(r),(0,u.assertIsBuffer)(n),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==r.length)throw new Error("Expected salt to be of length 32");const a=(0,s.keccak256)(t.concat([t.from("ff","hex"),e,r,(0,s.keccak256)(n)]));return(0,o.toBuffer)(a).slice(-20)};r.isValidPrivate=function(e){return a.secp256k1.utils.isValidPrivateKey(e)};r.isValidPublic=function(e,r=!1){if((0,u.assertIsBuffer)(e),64===e.length)try{return a.secp256k1.ProjectivePoint.fromHex(t.concat([t.from([4]),e])),!0}catch(e){return!1}if(!r)return!1;try{return a.secp256k1.ProjectivePoint.fromHex(e),!0}catch(e){return!1}};r.pubToAddress=function(e,r=!1){if((0,u.assertIsBuffer)(e),r&&64!==e.length&&(e=t.from(a.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),64!==e.length)throw new Error("Expected pubKey to be of length 64");return t.from((0,s.keccak256)(e)).slice(-20)},r.publicToAddress=r.pubToAddress;r.privateToPublic=function(e){return(0,u.assertIsBuffer)(e),t.from(a.secp256k1.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1))};r.privateToAddress=function(e){return(0,r.publicToAddress)((0,r.privateToPublic)(e))};r.importPublic=function(e){return(0,u.assertIsBuffer)(e),64!==e.length&&(e=t.from(a.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),e};r.zeroAddress=function(){const e=(0,o.zeros)(20);return(0,o.bufferToHex)(e)};function p(e){const[t,r,n,s]=e;return[t,r,0===(0,o.arrToBufArr)(n).length?c.KECCAK256_RLP:n,0===(0,o.arrToBufArr)(s).length?c.KECCAK256_NULL:s]}r.isZeroAddress=function(e){try{(0,u.assertIsString)(e)}catch(e){return!1}return(0,r.zeroAddress)()===e},r.accountBodyFromSlim=p;const h=new Uint8Array(0);r.accountBodyToSlim=function(e){const[t,r,n,s]=e;return[t,r,(0,o.arrToBufArr)(n).equals(c.KECCAK256_RLP)?h:n,(0,o.arrToBufArr)(s).equals(c.KECCAK256_NULL)?h:s]},r.accountBodyToRLP=function(e,t=!0){const r=t?p(e):e;return(0,o.arrToBufArr)(n.RLP.encode(r))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/account.js"}],[2018,{"./account":2017,"./bytes":2020,buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.Address=void 0;const n=e("./account"),s=e("./bytes");class a{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.buf=e}static zero(){return new a((0,s.zeros)(20))}static fromString(e){if(!(0,n.isValidAddress)(e))throw new Error("Invalid address");return new a((0,s.toBuffer)(e))}static fromPublicKey(e){if(!t.isBuffer(e))throw new Error("Public key should be Buffer");const r=(0,n.pubToAddress)(e);return new a(r)}static fromPrivateKey(e){if(!t.isBuffer(e))throw new Error("Private key should be Buffer");const r=(0,n.privateToAddress)(e);return new a(r)}static generate(e,t){if("bigint"!=typeof t)throw new Error("Expected nonce to be a bigint");return new a((0,n.generateAddress)(e.buf,(0,s.bigIntToBuffer)(t)))}static generate2(e,r,s){if(!t.isBuffer(r))throw new Error("Expected salt to be a Buffer");if(!t.isBuffer(s))throw new Error("Expected initCode to be a Buffer");return new a((0,n.generateAddress2)(e.buf,r,s))}equals(e){return this.buf.equals(e.buf)}isZero(){return this.equals(a.zero())}isPrecompileOrSystemAddress(){const e=(0,s.bufferToBigInt)(this.buf),t=BigInt(0),r=BigInt("0xffff");return e>=t&&e<=r}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return t.from(this.buf)}}r.Address=a}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/address.js"}],[2019,{events:4399},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.AsyncEventEmitter=void 0;const n=e("events");class s extends n.EventEmitter{emit(e,...t){let[r,n]=t;const s=this;let a=s._events[e]??[];return n===undefined&&"function"==typeof r&&(n=r,r=undefined),"newListener"!==e&&"removeListener"!==e||(r={event:r,fn:n},n=undefined),a=Array.isArray(a)?a:[a],async function(e,t,r){let n;for await(const s of t)try{s.length<2?s.call(e,r):await new Promise(((t,n)=>{s.call(e,r,(e=>{e?n(e):t()}))}))}catch(e){n=e}if(n)throw n}(s,a.slice(),r).then(n).catch(n),s.listenerCount(e)>0}once(e,t){const r=this;let n;if("function"!=typeof t)throw new TypeError("listener must be a function");return n=t.length>=2?function(s,a){r.removeListener(e,n),t(s,a)}:function(s){r.removeListener(e,n),t(s,n)},r.on(e,n),r}first(e,t){let r=this._events[e]??[];if("function"!=typeof t)throw new TypeError("listener must be a function");return Array.isArray(r)||(this._events[e]=r=[r]),r.unshift(t),this}before(e,t,r){return this.beforeOrAfter(e,t,r)}after(e,t,r){return this.beforeOrAfter(e,t,r,"after")}beforeOrAfter(e,t,r,n){let s,a,i=this._events[e]??[];const o="after"===n?1:0;if("function"!=typeof r)throw new TypeError("listener must be a function");if("function"!=typeof t)throw new TypeError("target must be a function");for(Array.isArray(i)||(this._events[e]=i=[i]),a=i.length,s=i.length;s--;)if(i[s]===t){a=s+o;break}return i.splice(a,0,r),this}on(e,t){return super.on(e,t)}addListener(e,t){return super.addListener(e,t)}prependListener(e,t){return super.prependListener(e,t)}prependOnceListener(e,t){return super.prependOnceListener(e,t)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,t){return super.removeListener(e,t)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}r.AsyncEventEmitter=s}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/asyncEventEmitter.js"}],[2020,{"./helpers":2023,"./internal":2025,buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.intToUnpaddedBuffer=r.bigIntToUnpaddedBuffer=r.bigIntToHex=r.bufArrToArr=r.arrToBufArr=r.validateNoLeadingZeroes=r.baToJSON=r.toUtf8=r.short=r.addHexPrefix=r.toUnsigned=r.fromSigned=r.bufferToInt=r.bigIntToBuffer=r.bufferToBigInt=r.bufferToHex=r.toBuffer=r.unpadHexString=r.unpadArray=r.unpadBuffer=r.setLengthRight=r.setLengthLeft=r.zeros=r.intToBuffer=r.intToHex=void 0;const n=e("./helpers"),s=e("./internal");r.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`};r.intToBuffer=function(e){const n=(0,r.intToHex)(e);return t.from((0,s.padToEven)(n.slice(2)),"hex")};r.zeros=function(e){return t.allocUnsafe(e).fill(0)};const a=function(e,t,n){const s=(0,r.zeros)(t);return n?e.length<t?(e.copy(s),s):e.slice(0,t):e.length<t?(e.copy(s,t-e.length),s):e.slice(-t)};r.setLengthLeft=function(e,t){return(0,n.assertIsBuffer)(e),a(e,t,!1)};r.setLengthRight=function(e,t){return(0,n.assertIsBuffer)(e),a(e,t,!0)};const i=function(e){let t=e[0];for(;e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};r.unpadBuffer=function(e){return(0,n.assertIsBuffer)(e),i(e)};r.unpadArray=function(e){return(0,n.assertIsArray)(e),i(e)};r.unpadHexString=function(e){return(0,n.assertIsHexString)(e),e=(0,s.stripHexPrefix)(e),"0x"+i(e)};r.toBuffer=function(e){if(null===e||e===undefined)return t.allocUnsafe(0);if(t.isBuffer(e))return t.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return t.from(e);if("string"==typeof e){if(!(0,s.isHexString)(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return t.from((0,s.padToEven)((0,s.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,r.intToBuffer)(e);if("bigint"==typeof e){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${e}`);let r=e.toString(16);return r.length%2&&(r="0"+r),t.from(r,"hex")}if(e.toArray)return t.from(e.toArray());if(e.toBuffer)return t.from(e.toBuffer());throw new Error("invalid type")};function o(e){const t=(0,r.bufferToHex)(e);return"0x"===t?BigInt(0):BigInt(t)}function c(e){return(0,r.toBuffer)("0x"+e.toString(16))}r.bufferToHex=function(e){return"0x"+(e=(0,r.toBuffer)(e)).toString("hex")},r.bufferToBigInt=o,r.bigIntToBuffer=c;r.bufferToInt=function(e){const t=Number(o(e));if(!Number.isSafeInteger(t))throw new Error("Number exceeds 53 bits");return t};r.fromSigned=function(e){return BigInt.asIntN(256,o(e))};r.toUnsigned=function(e){return c(BigInt.asUintN(256,e))};r.addHexPrefix=function(e){return"string"!=typeof e||(0,s.isHexPrefixed)(e)?e:"0x"+e},r.short=function(e,r=50){const n=t.isBuffer(e)?e.toString("hex"):e;return n.length<=r?n:n.slice(0,r)+"…"};r.toUtf8=function(e){if((e=(0,s.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return t.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};r.baToJSON=function(e){if(t.isBuffer(e))return`0x${e.toString("hex")}`;if(e instanceof Array){const t=[];for(let n=0;n<e.length;n++)t.push((0,r.baToJSON)(e[n]));return t}};r.validateNoLeadingZeroes=function(e){for(const[t,r]of Object.entries(e))if(r!==undefined&&r.length>0&&0===r[0])throw new Error(`${t} cannot have leading zeroes, received: ${r.toString("hex")}`)},r.arrToBufArr=function e(r){return Array.isArray(r)?r.map((t=>e(t))):t.from(r)},r.bufArrToArr=function e(t){return Array.isArray(t)?t.map((t=>e(t))):Uint8Array.from(t??[])};r.bigIntToHex=e=>"0x"+e.toString(16),r.bigIntToUnpaddedBuffer=function(e){return(0,r.unpadBuffer)(c(e))},r.intToUnpaddedBuffer=function(e){return(0,r.unpadBuffer)((0,r.intToBuffer)(e))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/bytes.js"}],[2021,{buffer:4074,"ethereum-cryptography/secp256k1":4317},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MAX_WITHDRAWALS_PER_PAYLOAD=r.RLP_EMPTY_STRING=r.KECCAK256_RLP=r.KECCAK256_RLP_S=r.KECCAK256_RLP_ARRAY=r.KECCAK256_RLP_ARRAY_S=r.KECCAK256_NULL=r.KECCAK256_NULL_S=r.TWO_POW256=r.SECP256K1_ORDER_DIV_2=r.SECP256K1_ORDER=r.MAX_INTEGER_BIGINT=r.MAX_INTEGER=r.MAX_UINT64=void 0;const n=e("buffer"),s=e("ethereum-cryptography/secp256k1");r.MAX_UINT64=BigInt("0xffffffffffffffff"),r.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),r.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),r.SECP256K1_ORDER=s.secp256k1.CURVE.n,r.SECP256K1_ORDER_DIV_2=s.secp256k1.CURVE.n/BigInt(2),r.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),r.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",r.KECCAK256_NULL=n.Buffer.from(r.KECCAK256_NULL_S,"hex"),r.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",r.KECCAK256_RLP_ARRAY=n.Buffer.from(r.KECCAK256_RLP_ARRAY_S,"hex"),r.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",r.KECCAK256_RLP=n.Buffer.from(r.KECCAK256_RLP_S,"hex"),r.RLP_EMPTY_STRING=n.Buffer.from([128]),r.MAX_WITHDRAWALS_PER_PAYLOAD=16}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/constants.js"}],[2022,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.compactBytesToNibbles=r.bytesToNibbles=r.nibblesToCompactBytes=r.nibblesToBytes=r.hasTerminator=void 0;r.hasTerminator=e=>e.length>0&&16===e[e.length-1];r.nibblesToBytes=(e,t)=>{for(let r=0,n=0;n<e.length;r+=1,n+=2)t[r]=e[n]<<4|e[n+1]};r.nibblesToCompactBytes=e=>{let t=0;(0,r.hasTerminator)(e)&&(t=1,e=e.subarray(0,e.length-1));const n=new Uint8Array(e.length/2+1);return n[0]=t<<5,1&~e.length||(n[0]|=16,n[0]|=e[0],e=e.subarray(1)),(0,r.nibblesToBytes)(e,n.subarray(1)),n};r.bytesToNibbles=e=>{const t=2*e.length+1,r=new Uint8Array(t);for(let t=0;t<e.length;t++){const n=e[t];r[2*t]=n/16,r[2*t+1]=n%16}return r[t-1]=16,r};r.compactBytesToNibbles=e=>{if(0===e.length)return e;let t=(0,r.bytesToNibbles)(e);t[0]<2&&(t=t.subarray(0,t.length-1));const n=2-(1&t[0]);return t.subarray(n)}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/encoding.js"}],[2023,{"../../../../../../../../../is-buffer/index.js":4657,"./internal":2025},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.assertIsString=r.assertIsArray=r.assertIsBuffer=r.assertIsHexString=void 0;const n=e("./internal");r.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)}};r.assertIsBuffer=function(e){if(!t.isBuffer(e)){throw new Error(`This method only supports Buffer but input was: ${e}`)}};r.assertIsArray=function(e){if(!Array.isArray(e)){throw new Error(`This method only supports number arrays but input was: ${e}`)}};r.assertIsString=function(e){if("string"!=typeof e){throw new Error(`This method only supports strings but input was: ${e}`)}}}).call(this)}).call(this,{isBuffer:e("../../../../../../../../../is-buffer/index.js")})}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/helpers.js"}],[2024,{"./account":2017,"./address":2018,"./asyncEventEmitter":2019,"./bytes":2020,"./constants":2021,"./encoding":2022,"./internal":2025,"./lock":2026,"./provider":2027,"./signature":2028,"./types":2029,"./units":2030,"./withdrawal":2031},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.toAscii=r.stripHexPrefix=r.padToEven=r.isHexString=r.isHexPrefixed=r.getKeys=r.getBinarySize=r.fromUtf8=r.fromAscii=r.arrayContainsArray=void 0,s(e("./constants"),r),s(e("./units"),r),s(e("./account"),r),s(e("./address"),r),s(e("./withdrawal"),r),s(e("./signature"),r),s(e("./bytes"),r),s(e("./types"),r),s(e("./encoding"),r),s(e("./asyncEventEmitter"),r);var a=e("./internal");Object.defineProperty(r,"arrayContainsArray",{enumerable:!0,get:function(){return a.arrayContainsArray}}),Object.defineProperty(r,"fromAscii",{enumerable:!0,get:function(){return a.fromAscii}}),Object.defineProperty(r,"fromUtf8",{enumerable:!0,get:function(){return a.fromUtf8}}),Object.defineProperty(r,"getBinarySize",{enumerable:!0,get:function(){return a.getBinarySize}}),Object.defineProperty(r,"getKeys",{enumerable:!0,get:function(){return a.getKeys}}),Object.defineProperty(r,"isHexPrefixed",{enumerable:!0,get:function(){return a.isHexPrefixed}}),Object.defineProperty(r,"isHexString",{enumerable:!0,get:function(){return a.isHexString}}),Object.defineProperty(r,"padToEven",{enumerable:!0,get:function(){return a.padToEven}}),Object.defineProperty(r,"stripHexPrefix",{enumerable:!0,get:function(){return a.stripHexPrefix}}),Object.defineProperty(r,"toAscii",{enumerable:!0,get:function(){return a.toAscii}}),s(e("./lock"),r),s(e("./provider"),r)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/index.js"}],[2025,{buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(e){(function(){function t(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}Object.defineProperty(r,"__esModule",{value:!0}),r.isHexString=r.getKeys=r.fromAscii=r.fromUtf8=r.toAscii=r.arrayContainsArray=r.getBinarySize=r.padToEven=r.stripHexPrefix=r.isHexPrefixed=void 0,r.isHexPrefixed=t;function n(e){let t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received "+typeof t);return t.length%2&&(t=`0${t}`),t}r.stripHexPrefix=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return t(e)?e.slice(2):e},r.padToEven=n,r.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof t);return e.byteLength(t,"utf8")},r.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(!0!==Array.isArray(t))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[!0===r?"some":"every"]((t=>e.indexOf(t)>=0))},r.toAscii=function(e){let t="",r=0;const n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){const n=parseInt(e.substr(r,2),16);t+=String.fromCharCode(n)}return t},r.fromUtf8=function(t){return`0x${n(e.from(t,"utf8").toString("hex")).replace(/^0+|0+$/g,"")}`},r.fromAscii=function(e){let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r).toString(16);t+=n.length<2?`0${n}`:n}return`0x${t}`},r.getKeys=function(e,t,r){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got "+typeof e);if("string"!=typeof t)throw new Error("[getKeys] method expects input 'key' to be type 'string', got "+typeof e);const n=[];for(let s=0;s<e.length;s++){let a=e[s][t];if(!0!==r||a){if("string"!=typeof a)throw new Error("invalid abi - expected type 'string', received "+typeof a)}else a="";n.push(a)}return n},r.isHexString=function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&!(void 0!==t&&t>0&&e.length!==2+2*t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/internal.js"}],[2026,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Lock=void 0;r.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((e=>this.promiseResolverQueue.push(e)))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const e=this.promiseResolverQueue.shift();e&&e(!0)}}}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/lock.js"}],[2027,{"micro-ftch":4910},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getProvider=r.fetchFromProvider=void 0;const n=e("micro-ftch");r.fetchFromProvider=async(e,t)=>(await(0,n.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;r.getProvider=e=>{if("string"==typeof e)return e;if(e?.connection?.url!==undefined)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/provider.js"}],[2028,{"./bytes":2020,"./constants":2021,"./helpers":2023,buffer:4074,"ethereum-cryptography/keccak":4300,"ethereum-cryptography/secp256k1":4317},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.hashPersonalMessage=r.isValidSignature=r.fromRpcSig=r.toCompactSig=r.toRpcSig=r.ecrecover=r.ecsign=void 0;const n=e("ethereum-cryptography/keccak"),s=e("ethereum-cryptography/secp256k1"),a=e("./bytes"),i=e("./constants"),o=e("./helpers");function c(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===undefined?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function u(e){return e===BigInt(0)||e===BigInt(1)}r.ecsign=function(e,r,n){const a=s.secp256k1.sign(e,r),i=a.toCompactRawBytes();return{r:t.from(i.slice(0,32)),s:t.from(i.slice(32,64)),v:n===undefined?BigInt(a.recovery+27):BigInt(a.recovery+35)+BigInt(n)*BigInt(2)}};r.ecrecover=function(e,r,n,i,o){const l=t.concat([(0,a.setLengthLeft)(n,32),(0,a.setLengthLeft)(i,32)],64),d=c(r,o);if(!u(d))throw new Error("Invalid signature v value");const m=s.secp256k1.Signature.fromCompact(l).addRecoveryBit(Number(d)).recoverPublicKey(e);return t.from(m.toRawBytes(!1).slice(1))};r.toRpcSig=function(e,r,n,s){if(!u(c(e,s)))throw new Error("Invalid signature v value");return(0,a.bufferToHex)(t.concat([(0,a.setLengthLeft)(r,32),(0,a.setLengthLeft)(n,32),(0,a.toBuffer)(e)]))};r.toCompactSig=function(e,r,n,s){if(!u(c(e,s)))throw new Error("Invalid signature v value");let i=n;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(i=t.from(n),i[0]|=128),(0,a.bufferToHex)(t.concat([(0,a.setLengthLeft)(r,32),(0,a.setLengthLeft)(i,32)]))};r.fromRpcSig=function(e){const t=(0,a.toBuffer)(e);let r,n,s;if(t.length>=65)r=t.slice(0,32),n=t.slice(32,64),s=(0,a.bufferToBigInt)(t.slice(64));else{if(64!==t.length)throw new Error("Invalid signature length");r=t.slice(0,32),n=t.slice(32,64),s=BigInt((0,a.bufferToInt)(t.slice(32,33))>>7),n[0]&=127}return s<27&&(s+=BigInt(27)),{v:s,r:r,s:n}};r.isValidSignature=function(e,t,r,n=!0,s){if(32!==t.length||32!==r.length)return!1;if(!u(c(e,s)))return!1;const o=(0,a.bufferToBigInt)(t),l=(0,a.bufferToBigInt)(r);return!(o===BigInt(0)||o>=i.SECP256K1_ORDER||l===BigInt(0)||l>=i.SECP256K1_ORDER)&&!(n&&l>=i.SECP256K1_ORDER_DIV_2)};r.hashPersonalMessage=function(e){(0,o.assertIsBuffer)(e);const r=t.from(`Ethereum Signed Message:\n${e.length}`,"utf-8");return t.from((0,n.keccak256)(t.concat([r,e])))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/signature.js"}],[2029,{"./bytes":2020,"./internal":2025},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.toType=r.TypeOutput=void 0;const n=e("./bytes"),s=e("./internal");var a;!function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(a=r.TypeOutput||(r.TypeOutput={})),r.toType=function(e,t){if(null===e)return null;if(e===undefined)return undefined;if("string"==typeof e&&!(0,s.isHexString)(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const r=(0,n.toBuffer)(e);switch(t){case a.Buffer:return r;case a.BigInt:return(0,n.bufferToBigInt)(r);case a.Number:{const e=(0,n.bufferToBigInt)(r);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(e)}case a.PrefixedHexString:return(0,n.bufferToHex)(r);default:throw new Error("unknown outputType")}}}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/types.js"}],[2030,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.GWEI_TO_WEI=void 0,r.GWEI_TO_WEI=BigInt(1e9)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/units.js"}],[2031,{"./address":2018,"./bytes":2020,"./types":2029,buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.Withdrawal=void 0;const n=e("./address"),s=e("./bytes"),a=e("./types");class i{constructor(e,t,r,n){this.index=e,this.validatorIndex=t,this.address=r,this.amount=n}static fromWithdrawalData(e){const{index:t,validatorIndex:r,address:s,amount:o}=e,c=(0,a.toType)(t,a.TypeOutput.BigInt),u=(0,a.toType)(r,a.TypeOutput.BigInt),l=new n.Address((0,a.toType)(s,a.TypeOutput.Buffer)),d=(0,a.toType)(o,a.TypeOutput.BigInt);return new i(c,u,l,d)}static fromValuesArray(e){if(4!==e.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[t,r,n,s]=e;return i.fromWithdrawalData({index:t,validatorIndex:r,address:n,amount:s})}static toBufferArray(e){const{index:r,validatorIndex:s,address:i,amount:o}=e,c=(0,a.toType)(r,a.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,a.toType)(r,a.TypeOutput.Buffer),u=(0,a.toType)(s,a.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,a.toType)(s,a.TypeOutput.Buffer);let l;l=i instanceof n.Address?i.buf:(0,a.toType)(i,a.TypeOutput.Buffer);return[c,u,l,(0,a.toType)(o,a.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,a.toType)(o,a.TypeOutput.Buffer)]}raw(){return i.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,s.bigIntToHex)(this.index),validatorIndex:(0,s.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,s.bigIntToHex)(this.amount)}}}r.Withdrawal=i}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/keyring-controller>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/keyring-controller/node_modules/@metamask/eth-sig-util/node_modules/@ethereumjs/util/dist/withdrawal.js"}],[2034,{"@metamask/keyring-api":1983,"@metamask/keyring-utils":2040,"@metamask/superstruct":2872,uuid:2045},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.KeyringClient=void 0;const c=e("@metamask/keyring-api"),u=e("@metamask/keyring-utils"),l=e("@metamask/superstruct"),d=e("uuid");r.KeyringClient=class{constructor(e){n.add(this),s.set(this,void 0),i(this,s,e,"f")}async listAccounts(){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.ListAccounts}),c.ListAccountsResponseStruct)}async getAccount(e){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.GetAccount,params:{id:e}}),c.GetAccountResponseStruct)}async getAccountBalances(e,t){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.GetAccountBalances,params:{id:e,assets:t}}),c.GetAccountBalancesResponseStruct)}async createAccount(e={}){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.CreateAccount,params:{options:e}}),c.CreateAccountResponseStruct)}async listAccountTransactions(e,t){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.ListAccountTransactions,params:{id:e,pagination:t}}),c.ListAccountTransactionsResponseStruct)}async listAccountAssets(e){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.ListAccountAssets,params:{id:e}}),c.ListAccountAssetsResponseStruct)}async resolveAccountAddress(e,t){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.ResolveAccountAddress,params:{scope:e,request:t}}),c.ResolveAccountAddressResponseStruct)}async filterAccountChains(e,t){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.FilterAccountChains,params:{id:e,chains:t}}),c.FilterAccountChainsResponseStruct)}async updateAccount(e){(0,l.assert)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.UpdateAccount,params:{account:e}}),c.UpdateAccountResponseStruct)}async deleteAccount(e){(0,l.assert)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.DeleteAccount,params:{id:e}}),c.DeleteAccountResponseStruct)}async exportAccount(e){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.ExportAccount,params:{id:e}}),c.ExportAccountResponseStruct)}async listRequests(){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.ListRequests}),c.ListRequestsResponseStruct)}async getRequest(e){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.GetRequest,params:{id:e}}),c.GetRequestResponseStruct)}async submitRequest(e){return(0,u.strictMask)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.SubmitRequest,params:e}),c.SubmitRequestResponseStruct)}async approveRequest(e,t={}){(0,l.assert)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.ApproveRequest,params:{id:e,data:t}}),c.ApproveRequestResponseStruct)}async rejectRequest(e){(0,l.assert)(await o(this,n,"m",a).call(this,{method:c.KeyringRpcMethod.RejectRequest,params:{id:e}}),c.RejectRequestResponseStruct)}},s=new WeakMap,n=new WeakSet,a=async function(e){return o(this,s,"f").send({jsonrpc:"2.0",id:(0,d.v4)(),...e})}}}},{package:"@metamask/keyring-snap-client",file:"node_modules/@metamask/keyring-snap-client/dist/KeyringClient.cjs"}],[2035,{"./KeyringClient.cjs":2034},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.KeyringSnapRpcClient=r.SnapRpcSender=void 0;const o=e("./KeyringClient.cjs");class c{constructor(e,t){n.set(this,void 0),s.set(this,void 0),a(this,n,e,"f"),a(this,s,t,"f")}async send(e){return i(this,s,"f").request({method:"wallet_invokeKeyring",params:{snapId:i(this,n,"f"),request:e}})}}r.SnapRpcSender=c,n=new WeakMap,s=new WeakMap;class u extends o.KeyringClient{constructor(e,t){super(new c(e,t))}}r.KeyringSnapRpcClient=u}}},{package:"@metamask/keyring-snap-client",file:"node_modules/@metamask/keyring-snap-client/dist/KeyringSnapRpcClient.cjs"}],[2036,{"./KeyringClient.cjs":2034,"./KeyringSnapRpcClient.cjs":2035},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./KeyringClient.cjs"),r),s(e("./KeyringSnapRpcClient.cjs"),r)}}},{package:"@metamask/keyring-snap-client",file:"node_modules/@metamask/keyring-snap-client/dist/index.cjs"}],[2037,{"./index.cjs":2040,"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.JsonRpcRequestStruct=void 0;const n=e("@metamask/superstruct"),s=e("@metamask/utils"),a=e("./index.cjs");r.JsonRpcRequestStruct=(0,a.object)({jsonrpc:(0,n.literal)("2.0"),id:(0,n.union)([(0,n.string)(),(0,n.number)(),(0,n.literal)(null)]),method:(0,n.string)(),params:(0,a.exactOptional)((0,n.union)([(0,n.array)(s.JsonStruct),(0,n.record)((0,n.string)(),s.JsonStruct)]))})}}},{package:"@metamask/keyring-snap-client>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-snap-client/node_modules/@metamask/keyring-utils/dist/JsonRpcRequest.cjs"}],[2038,{"bitcoin-address-validation":3979},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isBtcMainnetAddress=function(e){return(0,n.validate)(e,n.Network.mainnet)},r.isBtcTestnetAddress=function(e){return(0,n.validate)(e,n.Network.testnet)};const n=e("bitcoin-address-validation")}}},{package:"@metamask/keyring-snap-client>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-snap-client/node_modules/@metamask/keyring-utils/dist/btc/address.cjs"}],[2039,{"./address.cjs":2038},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./address.cjs"),r)}}},{package:"@metamask/keyring-snap-client>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-snap-client/node_modules/@metamask/keyring-utils/dist/btc/index.cjs"}],[2040,{"./JsonRpcRequest.cjs":2037,"./btc/index.cjs":2039,"./scopes.cjs":2041,"./superstruct.cjs":2042,"./types.cjs":2043,"./typing.cjs":2044},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./btc/index.cjs"),r),s(e("./types.cjs"),r),s(e("./typing.cjs"),r),s(e("./scopes.cjs"),r),s(e("./superstruct.cjs"),r),s(e("./JsonRpcRequest.cjs"),r)}}},{package:"@metamask/keyring-snap-client>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-snap-client/node_modules/@metamask/keyring-utils/dist/index.cjs"}],[2041,{"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ETH_SCOPE_EOA=void 0,r.isScopeEqual=a,r.isScopeEqualToAny=function(e,t){return t.some((t=>a(e,t)))};const n=e("@metamask/utils");r.ETH_SCOPE_EOA=`${n.KnownCaipNamespace.Eip155}:0`;const s=`${n.KnownCaipNamespace.Eip155}:`;function a(e,t){const n=e===r.ETH_SCOPE_EOA,a=t===r.ETH_SCOPE_EOA;return n?t.startsWith(s):a?e.startsWith(s):e===t}}}},{package:"@metamask/keyring-snap-client>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-snap-client/node_modules/@metamask/keyring-utils/dist/scopes.cjs"}],[2042,{"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.object=function(e){return(0,n.object)(e)},r.exactOptional=function(e){return new n.Struct({...e,validator:(t,r)=>!s(r)||e.validator(t,r),refiner:(t,r)=>!s(r)||e.refiner(t,r)})},r.strictMask=function(e,t,r){return(0,n.assert)(e,t,r),e},r.selectiveUnion=function(e){return new n.Struct({type:"union",schema:null,*entries(t,r){yield*e(t).entries(t,r)},*refiner(t,r){yield*e(t).refiner(t,r)},coercer:(t,r)=>e(t).coercer(t,r),validator:(t,r)=>e(t).validator(t,r)})};const n=e("@metamask/superstruct");function s(e){return e.path[e.path.length-1]in e.branch[e.branch.length-2]}}}},{package:"@metamask/keyring-snap-client>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-snap-client/node_modules/@metamask/keyring-utils/dist/superstruct.cjs"}],[2043,{"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.StringNumberStruct=r.UrlStruct=r.AccountIdStruct=r.UuidStruct=void 0;const n=e("@metamask/superstruct"),s=e("@metamask/utils");r.UuidStruct=(0,s.definePattern)("UuidV4",/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu),r.AccountIdStruct=r.UuidStruct,r.UrlStruct=(0,n.define)("Url",(e=>{try{const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}})),r.StringNumberStruct=(0,s.definePattern)("StringNumber",/^\d+(\.\d+)?$/u)}}},{package:"@metamask/keyring-snap-client>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-snap-client/node_modules/@metamask/keyring-utils/dist/types.cjs"}],[2044,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.expectTrue=function(){}}}},{package:"@metamask/keyring-snap-client>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-snap-client/node_modules/@metamask/keyring-utils/dist/typing.cjs"}],[2045,{"./nil.js":2048,"./parse.js":2049,"./stringify.js":2053,"./v1.js":2054,"./v3.js":2055,"./v4.js":2057,"./v5.js":2058,"./validate.js":2059,"./version.js":2060},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return c.default}});var n=m(e("./v1.js")),s=m(e("./v3.js")),a=m(e("./v4.js")),i=m(e("./v5.js")),o=m(e("./nil.js")),c=m(e("./version.js")),u=m(e("./validate.js")),l=m(e("./stringify.js")),d=m(e("./parse.js"));function m(e){return e&&e.__esModule?e:{default:e}}}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/index.js"}],[2046,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e){return 14+(e+64>>>9<<4)+1}function s(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function a(e,t,r,n,a,i){return s((o=s(s(t,e),s(n,i)))<<(c=a)|o>>>32-c,r);var o,c}function i(e,t,r,n,s,i,o){return a(t&r|~t&n,e,t,s,i,o)}function o(e,t,r,n,s,i,o){return a(t&n|r&~n,e,t,s,i,o)}function c(e,t,r,n,s,i,o){return a(t^r^n,e,t,s,i,o)}function u(e,t,r,n,s,i,o){return a(r^(t|~n),e,t,s,i,o)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length,n="0123456789abcdef";for(let s=0;s<r;s+=8){const r=e[s>>5]>>>s%32&255,a=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let r=1732584193,a=-271733879,l=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const n=r,m=a,p=l,h=d;r=i(r,a,l,d,e[t],7,-680876936),d=i(d,r,a,l,e[t+1],12,-389564586),l=i(l,d,r,a,e[t+2],17,606105819),a=i(a,l,d,r,e[t+3],22,-1044525330),r=i(r,a,l,d,e[t+4],7,-176418897),d=i(d,r,a,l,e[t+5],12,1200080426),l=i(l,d,r,a,e[t+6],17,-1473231341),a=i(a,l,d,r,e[t+7],22,-45705983),r=i(r,a,l,d,e[t+8],7,1770035416),d=i(d,r,a,l,e[t+9],12,-1958414417),l=i(l,d,r,a,e[t+10],17,-42063),a=i(a,l,d,r,e[t+11],22,-1990404162),r=i(r,a,l,d,e[t+12],7,1804603682),d=i(d,r,a,l,e[t+13],12,-40341101),l=i(l,d,r,a,e[t+14],17,-1502002290),a=i(a,l,d,r,e[t+15],22,1236535329),r=o(r,a,l,d,e[t+1],5,-165796510),d=o(d,r,a,l,e[t+6],9,-1069501632),l=o(l,d,r,a,e[t+11],14,643717713),a=o(a,l,d,r,e[t],20,-373897302),r=o(r,a,l,d,e[t+5],5,-701558691),d=o(d,r,a,l,e[t+10],9,38016083),l=o(l,d,r,a,e[t+15],14,-660478335),a=o(a,l,d,r,e[t+4],20,-405537848),r=o(r,a,l,d,e[t+9],5,568446438),d=o(d,r,a,l,e[t+14],9,-1019803690),l=o(l,d,r,a,e[t+3],14,-187363961),a=o(a,l,d,r,e[t+8],20,1163531501),r=o(r,a,l,d,e[t+13],5,-1444681467),d=o(d,r,a,l,e[t+2],9,-51403784),l=o(l,d,r,a,e[t+7],14,1735328473),a=o(a,l,d,r,e[t+12],20,-1926607734),r=c(r,a,l,d,e[t+5],4,-378558),d=c(d,r,a,l,e[t+8],11,-2022574463),l=c(l,d,r,a,e[t+11],16,1839030562),a=c(a,l,d,r,e[t+14],23,-35309556),r=c(r,a,l,d,e[t+1],4,-1530992060),d=c(d,r,a,l,e[t+4],11,1272893353),l=c(l,d,r,a,e[t+7],16,-155497632),a=c(a,l,d,r,e[t+10],23,-1094730640),r=c(r,a,l,d,e[t+13],4,681279174),d=c(d,r,a,l,e[t],11,-358537222),l=c(l,d,r,a,e[t+3],16,-722521979),a=c(a,l,d,r,e[t+6],23,76029189),r=c(r,a,l,d,e[t+9],4,-640364487),d=c(d,r,a,l,e[t+12],11,-421815835),l=c(l,d,r,a,e[t+15],16,530742520),a=c(a,l,d,r,e[t+2],23,-995338651),r=u(r,a,l,d,e[t],6,-198630844),d=u(d,r,a,l,e[t+7],10,1126891415),l=u(l,d,r,a,e[t+14],15,-1416354905),a=u(a,l,d,r,e[t+5],21,-57434055),r=u(r,a,l,d,e[t+12],6,1700485571),d=u(d,r,a,l,e[t+3],10,-1894986606),l=u(l,d,r,a,e[t+10],15,-1051523),a=u(a,l,d,r,e[t+1],21,-2054922799),r=u(r,a,l,d,e[t+8],6,1873313359),d=u(d,r,a,l,e[t+15],10,-30611744),l=u(l,d,r,a,e[t+6],15,-1560198380),a=u(a,l,d,r,e[t+13],21,1309151649),r=u(r,a,l,d,e[t+4],6,-145523070),d=u(d,r,a,l,e[t+11],10,-1120210379),l=u(l,d,r,a,e[t+2],15,718787259),a=u(a,l,d,r,e[t+9],21,-343485551),r=s(r,n),a=s(a,m),l=s(l,p),d=s(d,h)}return[r,a,l,d]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))};r.default=l}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/md5-browser.js"}],[2047,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};r.default=n}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/native-browser.js"}],[2048,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default="00000000-0000-0000-0000-000000000000"}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/nil.js"}],[2049,{"./validate.js":2059},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,s=(n=e("./validate.js"))&&n.__esModule?n:{default:n};var a=function(e){if(!(0,s.default)(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};r.default=a}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/parse.js"}],[2050,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/regex.js"}],[2051,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){let n;Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(s)};const s=new Uint8Array(16)}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/rng-browser.js"}],[2052,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function s(e,t){return e<<t|e>>>32-t}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=function(e){const t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const a=e.length/4+2,i=Math.ceil(a/16),o=new Array(i);for(let t=0;t<i;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];o[t]=r}o[i-1][14]=8*(e.length-1)/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<i;++e){const a=new Uint32Array(80);for(let t=0;t<16;++t)a[t]=o[e][t];for(let e=16;e<80;++e)a[e]=s(a[e-3]^a[e-8]^a[e-14]^a[e-16],1);let i=r[0],c=r[1],u=r[2],l=r[3],d=r[4];for(let e=0;e<80;++e){const r=Math.floor(e/20),o=s(i,5)+n(r,c,u,l)+d+t[r]+a[e]>>>0;d=l,l=u,u=s(c,30)>>>0,c=i,i=o}r[0]=r[0]+i>>>0,r[1]=r[1]+c>>>0,r[2]=r[2]+u>>>0,r[3]=r[3]+l>>>0,r[4]=r[4]+d>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]};r.default=a}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/sha1-browser.js"}],[2053,{"./validate.js":2059},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.unsafeStringify=i;var n,s=(n=e("./validate.js"))&&n.__esModule?n:{default:n};const a=[];for(let e=0;e<256;++e)a.push((e+256).toString(16).slice(1));function i(e,t=0){return a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]}var o=function(e,t=0){const r=i(e,t);if(!(0,s.default)(r))throw TypeError("Stringified UUID is invalid");return r};r.default=o}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/stringify.js"}],[2054,{"./rng.js":2051,"./stringify.js":2053},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,s=(n=e("./rng.js"))&&n.__esModule?n:{default:n},a=e("./stringify.js");let i,o,c=0,u=0;var l=function(e,t,r){let n=t&&r||0;const l=t||new Array(16);let d=(e=e||{}).node||i,m=e.clockseq!==undefined?e.clockseq:o;if(null==d||null==m){const t=e.random||(e.rng||s.default)();null==d&&(d=i=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==m&&(m=o=16383&(t[6]<<8|t[7]))}let p=e.msecs!==undefined?e.msecs:Date.now(),h=e.nsecs!==undefined?e.nsecs:u+1;const f=p-c+(h-u)/1e4;if(f<0&&e.clockseq===undefined&&(m=m+1&16383),(f<0||p>c)&&e.nsecs===undefined&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=p,u=h,o=m,p+=122192928e5;const g=(1e4*(268435455&p)+h)%4294967296;l[n++]=g>>>24&255,l[n++]=g>>>16&255,l[n++]=g>>>8&255,l[n++]=255&g;const y=p/4294967296*1e4&268435455;l[n++]=y>>>8&255,l[n++]=255&y,l[n++]=y>>>24&15|16,l[n++]=y>>>16&255,l[n++]=m>>>8|128,l[n++]=255&m;for(let e=0;e<6;++e)l[n+e]=d[e];return t||(0,a.unsafeStringify)(l)};r.default=l}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/v1.js"}],[2055,{"./md5.js":2046,"./v35.js":2056},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=a(e("./v35.js")),s=a(e("./md5.js"));function a(e){return e&&e.__esModule?e:{default:e}}var i=(0,n.default)("v3",48,s.default);r.default=i}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/v3.js"}],[2056,{"./parse.js":2049,"./stringify.js":2053},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.URL=r.DNS=void 0,r.default=function(e,t,r){function n(e,n,i,o){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=(0,a.default)(n)),16!==(null===(c=n)||void 0===c?void 0:c.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+e.length);if(u.set(n),u.set(e,n.length),u=r(u),u[6]=15&u[6]|t,u[8]=63&u[8]|128,i){o=o||0;for(let e=0;e<16;++e)i[o+e]=u[e];return i}return(0,s.unsafeStringify)(u)}try{n.name=e}catch(e){}return n.DNS=i,n.URL=o,n};var n,s=e("./stringify.js"),a=(n=e("./parse.js"))&&n.__esModule?n:{default:n};const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";r.DNS=i;const o="6ba7b811-9dad-11d1-80b4-00c04fd430c8";r.URL=o}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/v35.js"}],[2057,{"./native.js":2047,"./rng.js":2051,"./stringify.js":2053},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(e("./native.js")),s=i(e("./rng.js")),a=e("./stringify.js");function i(e){return e&&e.__esModule?e:{default:e}}var o=function(e,t,r){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const i=(e=e||{}).random||(e.rng||s.default)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=i[e];return t}return(0,a.unsafeStringify)(i)};r.default=o}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/v4.js"}],[2058,{"./sha1.js":2052,"./v35.js":2056},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=a(e("./v35.js")),s=a(e("./sha1.js"));function a(e){return e&&e.__esModule?e:{default:e}}var i=(0,n.default)("v5",80,s.default);r.default=i}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/v5.js"}],[2059,{"./regex.js":2050},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,s=(n=e("./regex.js"))&&n.__esModule?n:{default:n};var a=function(e){return"string"==typeof e&&s.default.test(e)};r.default=a}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/validate.js"}],[2060,{"./validate.js":2059},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,s=(n=e("./validate.js"))&&n.__esModule?n:{default:n};var a=function(e){if(!(0,s.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};r.default=a}}},{package:"@metamask/keyring-snap-client>uuid",file:"node_modules/@metamask/keyring-snap-client/node_modules/uuid/dist/version.js"}],[2061,{"./index.cjs":2064,"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.JsonRpcRequestStruct=void 0;const n=e("@metamask/superstruct"),s=e("@metamask/utils"),a=e("./index.cjs");r.JsonRpcRequestStruct=(0,a.object)({jsonrpc:(0,n.literal)("2.0"),id:(0,n.union)([(0,n.string)(),(0,n.number)(),(0,n.literal)(null)]),method:(0,n.string)(),params:(0,a.exactOptional)((0,n.union)([(0,n.array)(s.JsonStruct),(0,n.record)((0,n.string)(),s.JsonStruct)]))})}}},{package:"@metamask/keyring-api>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-utils/dist/JsonRpcRequest.cjs"}],[2062,{"bitcoin-address-validation":3979},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isBtcMainnetAddress=function(e){return(0,n.validate)(e,n.Network.mainnet)},r.isBtcTestnetAddress=function(e){return(0,n.validate)(e,n.Network.testnet)};const n=e("bitcoin-address-validation")}}},{package:"@metamask/keyring-api>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-utils/dist/btc/address.cjs"}],[2063,{"./address.cjs":2062},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./address.cjs"),r)}}},{package:"@metamask/keyring-api>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-utils/dist/btc/index.cjs"}],[2064,{"./JsonRpcRequest.cjs":2061,"./btc/index.cjs":2063,"./scopes.cjs":2065,"./superstruct.cjs":2066,"./types.cjs":2067,"./typing.cjs":2068},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./btc/index.cjs"),r),s(e("./types.cjs"),r),s(e("./typing.cjs"),r),s(e("./scopes.cjs"),r),s(e("./superstruct.cjs"),r),s(e("./JsonRpcRequest.cjs"),r)}}},{package:"@metamask/keyring-api>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-utils/dist/index.cjs"}],[2065,{"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ETH_SCOPE_EOA=void 0,r.isScopeEqual=a,r.isScopeEqualToAny=function(e,t){return t.some((t=>a(e,t)))};const n=e("@metamask/utils");r.ETH_SCOPE_EOA=`${n.KnownCaipNamespace.Eip155}:0`;const s=`${n.KnownCaipNamespace.Eip155}:`;function a(e,t){const n=e===r.ETH_SCOPE_EOA,a=t===r.ETH_SCOPE_EOA;return n?t.startsWith(s):a?e.startsWith(s):e===t}}}},{package:"@metamask/keyring-api>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-utils/dist/scopes.cjs"}],[2066,{"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.object=function(e){return(0,n.object)(e)},r.exactOptional=function(e){return new n.Struct({...e,validator:(t,r)=>!s(r)||e.validator(t,r),refiner:(t,r)=>!s(r)||e.refiner(t,r)})},r.strictMask=function(e,t,r){return(0,n.assert)(e,t,r),e},r.selectiveUnion=function(e){return new n.Struct({type:"union",schema:null,*entries(t,r){yield*e(t).entries(t,r)},*refiner(t,r){yield*e(t).refiner(t,r)},coercer:(t,r)=>e(t).coercer(t,r),validator:(t,r)=>e(t).validator(t,r)})};const n=e("@metamask/superstruct");function s(e){return e.path[e.path.length-1]in e.branch[e.branch.length-2]}}}},{package:"@metamask/keyring-api>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-utils/dist/superstruct.cjs"}],[2067,{"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.StringNumberStruct=r.UrlStruct=r.AccountIdStruct=r.UuidStruct=void 0;const n=e("@metamask/superstruct"),s=e("@metamask/utils");r.UuidStruct=(0,s.definePattern)("UuidV4",/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu),r.AccountIdStruct=r.UuidStruct,r.UrlStruct=(0,n.define)("Url",(e=>{try{const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}})),r.StringNumberStruct=(0,s.definePattern)("StringNumber",/^\d+(\.\d+)?$/u)}}},{package:"@metamask/keyring-api>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-utils/dist/types.cjs"}],[2068,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.expectTrue=function(){}}}},{package:"@metamask/keyring-api>@metamask/keyring-utils",file:"node_modules/@metamask/keyring-utils/dist/typing.cjs"}],[2069,{"@metamask/base-controller":1383,uuid:5663},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.LoggingController=void 0;const i=e("@metamask/base-controller"),o=e("uuid"),c="LoggingController",u={logs:{persist:!0,anonymous:!1}},l={logs:{}};class d extends i.BaseController{constructor({messenger:e,state:t}){super({name:c,metadata:u,messenger:e,state:{...l,...t}}),n.add(this),this.messagingSystem.registerActionHandler(`${c}:add`,(e=>this.add(e)))}add(e){const t={id:a(this,n,"m",s).call(this),timestamp:Date.now(),log:e};this.update((e=>{e.logs[t.id]=t}))}clear(){this.update((e=>{e.logs={}}))}}r.LoggingController=d,n=new WeakSet,s=function(){let e=(0,o.v1)();for(;e in this.state.logs;)e=(0,o.v1)();return e}}}},{package:"@metamask/logging-controller",file:"node_modules/@metamask/logging-controller/dist/LoggingController.cjs"}],[2070,{"./LoggingController.cjs":2069,"./logTypes/index.cjs":2074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./LoggingController.cjs"),r),s(e("./logTypes/index.cjs"),r)}}},{package:"@metamask/logging-controller",file:"node_modules/@metamask/logging-controller/dist/index.cjs"}],[2071,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s;Object.defineProperty(r,"__esModule",{value:!0}),r.SigningStage=r.SigningMethod=void 0,function(e){e.PersonalSign="personal_sign",e.EthSignTypedData="eth_signTypedData",e.EthSignTypedDataV3="eth_signTypedData_v3",e.EthSignTypedDataV4="eth_signTypedData_v4"}(n||(r.SigningMethod=n={})),function(e){e.Proposed="proposed",e.Rejected="rejected",e.Signed="signed"}(s||(r.SigningStage=s={}))}}},{package:"@metamask/logging-controller",file:"node_modules/@metamask/logging-controller/dist/logTypes/EthSignLog.cjs"}],[2072,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/logging-controller",file:"node_modules/@metamask/logging-controller/dist/logTypes/GenericLog.cjs"}],[2073,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.LogType=void 0,function(e){e.GenericLog="GenericLog",e.EthSignLog="EthSignLog"}(n||(r.LogType=n={}))}}},{package:"@metamask/logging-controller",file:"node_modules/@metamask/logging-controller/dist/logTypes/LogType.cjs"}],[2074,{"./EthSignLog.cjs":2071,"./GenericLog.cjs":2072,"./LogType.cjs":2073},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./EthSignLog.cjs"),r),s(e("./GenericLog.cjs"),r),s(e("./LogType.cjs"),r)}}},{package:"@metamask/logging-controller",file:"node_modules/@metamask/logging-controller/dist/logTypes/index.cjs"}],[2085,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.abiERC1155=void 0,r.abiERC1155=[{inputs:[{internalType:"string",name:"uri_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}]}}},{package:"@metamask/metamask-eth-abis",file:"node_modules/@metamask/metamask-eth-abis/dist/abis/abiERC1155.js"}],[2086,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.abiERC20=void 0,r.abiERC20=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint256"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"version",outputs:[{name:"",type:"string"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"},{name:"_extraData",type:"bytes"}],name:"approveAndCall",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"remaining",type:"uint256"}],payable:!1,type:"function"},{inputs:[{name:"_initialAmount",type:"uint256"},{name:"_tokenName",type:"string"},{name:"_decimalUnits",type:"uint8"},{name:"_tokenSymbol",type:"string"}],type:"constructor"},{payable:!1,type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"_from",type:"address"},{indexed:!0,name:"_to",type:"address"},{indexed:!1,name:"_value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_owner",type:"address"},{indexed:!0,name:"_spender",type:"address"},{indexed:!1,name:"_value",type:"uint256"}],name:"Approval",type:"event"}]}}},{package:"@metamask/metamask-eth-abis",file:"node_modules/@metamask/metamask-eth-abis/dist/abis/abiERC20.js"}],[2087,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.abiERC721=void 0,r.abiERC721=[{constant:!0,inputs:[{name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{name:"_name",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_tokenId",type:"uint256"}],name:"getApproved",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_approved",type:"address"},{name:"_tokenId",type:"uint256"}],name:"approve",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"transferFrom",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{constant:!0,inputs:[{name:"_index",type:"uint256"}],name:"tokenByIndex",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_tokenId",type:"uint256"}],name:"ownerOf",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"_symbol",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_operator",type:"address"},{name:"_approved",type:"bool"}],name:"setApprovalForAll",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"},{name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{constant:!0,inputs:[{name:"_tokenId",type:"uint256"}],name:"tokenURI",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_operator",type:"address"}],name:"isApprovedForAll",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"_from",type:"address"},{indexed:!0,name:"_to",type:"address"},{indexed:!0,name:"_tokenId",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_owner",type:"address"},{indexed:!0,name:"_approved",type:"address"},{indexed:!0,name:"_tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"_owner",type:"address"},{indexed:!0,name:"_operator",type:"address"},{indexed:!1,name:"_approved",type:"bool"}],name:"ApprovalForAll",type:"event"}]}}},{package:"@metamask/metamask-eth-abis",file:"node_modules/@metamask/metamask-eth-abis/dist/abis/abiERC721.js"}],[2088,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.abiFiatTokenV2=void 0,r.abiFiatTokenV2=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"authorizer",type:"address"},{indexed:!0,internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"AuthorizationCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"authorizer",type:"address"},{indexed:!0,internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"AuthorizationUsed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_account",type:"address"}],name:"Blacklisted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newBlacklister",type:"address"}],name:"BlacklisterChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"burner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newMasterMinter",type:"address"}],name:"MasterMinterChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"minter",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"minter",type:"address"},{indexed:!1,internalType:"uint256",name:"minterAllowedAmount",type:"uint256"}],name:"MinterConfigured",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldMinter",type:"address"}],name:"MinterRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousOwner",type:"address"},{indexed:!1,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[],name:"Pause",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newAddress",type:"address"}],name:"PauserChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newRescuer",type:"address"}],name:"RescuerChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_account",type:"address"}],name:"UnBlacklisted",type:"event"},{anonymous:!1,inputs:[],name:"Unpause",type:"event"},{inputs:[],name:"CANCEL_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"RECEIVE_WITH_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TRANSFER_WITH_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"authorizationState",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",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:"blacklist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"blacklister",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"cancelAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"cancelAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"},{internalType:"uint256",name:"minterAllowedAmount",type:"uint256"}],name:"configureMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"currency",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"decrement",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"increment",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"tokenName",type:"string"},{internalType:"string",name:"tokenSymbol",type:"string"},{internalType:"string",name:"tokenCurrency",type:"string"},{internalType:"uint8",name:"tokenDecimals",type:"uint8"},{internalType:"address",name:"newMasterMinter",type:"address"},{internalType:"address",name:"newPauser",type:"address"},{internalType:"address",name:"newBlacklister",type:"address"},{internalType:"address",name:"newOwner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"newName",type:"string"}],name:"initializeV2",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"lostAndFound",type:"address"}],name:"initializeV2_1",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"accountsToBlacklist",type:"address[]"},{internalType:"string",name:"newSymbol",type:"string"}],name:"initializeV2_2",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}],name:"isBlacklisted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"isMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"masterMinter",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_to",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"}],name:"minterAllowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"pauser",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"receiveWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"receiveWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"}],name:"removeMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20",name:"tokenContract",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"rescueERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rescuer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"transferWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"transferWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}],name:"unBlacklist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newBlacklister",type:"address"}],name:"updateBlacklister",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newMasterMinter",type:"address"}],name:"updateMasterMinter",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newPauser",type:"address"}],name:"updatePauser",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newRescuer",type:"address"}],name:"updateRescuer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"}]}}},{package:"@metamask/metamask-eth-abis",file:"node_modules/@metamask/metamask-eth-abis/dist/abis/fiatTokenV2.js"}],[2089,{"./abis/abiERC1155":2085,"./abis/abiERC20":2086,"./abis/abiERC721":2087,"./abis/fiatTokenV2":2088},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.abiFiatTokenV2=r.abiERC1155=r.abiERC721=r.abiERC20=void 0;const n=e("./abis/abiERC20");Object.defineProperty(r,"abiERC20",{enumerable:!0,get:function(){return n.abiERC20}});const s=e("./abis/abiERC721");Object.defineProperty(r,"abiERC721",{enumerable:!0,get:function(){return s.abiERC721}});const a=e("./abis/abiERC1155");Object.defineProperty(r,"abiERC1155",{enumerable:!0,get:function(){return a.abiERC1155}});const i=e("./abis/fiatTokenV2");Object.defineProperty(r,"abiFiatTokenV2",{enumerable:!0,get:function(){return i.abiFiatTokenV2}})}}},{package:"@metamask/metamask-eth-abis",file:"node_modules/@metamask/metamask-eth-abis/dist/index.js"}],[2090,{"./constants.cjs":2091,"./types.cjs":2093,"./utils.cjs":2094,"@metamask/base-controller":1383,"@metamask/keyring-api":1983,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i,o,c,u=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.MultichainNetworkController=void 0;const l=e("@metamask/base-controller"),d=e("@metamask/keyring-api"),m=e("@metamask/utils"),p=e("./constants.cjs"),h=e("./types.cjs"),f=e("./utils.cjs");class g extends l.BaseController{constructor({messenger:e,state:t}){super({messenger:e,name:h.MULTICHAIN_NETWORK_CONTROLLER_NAME,metadata:p.MULTICHAIN_NETWORK_CONTROLLER_METADATA,state:{...(0,p.getDefaultMultichainNetworkControllerState)(),...t}}),n.add(this),u(this,n,"m",o).call(this),u(this,n,"m",c).call(this)}async setActiveNetwork(e){if((0,m.isCaipChainId)(e)){if(!(0,f.checkIfSupportedCaipChainId)(e))throw new Error(`Unsupported Caip chain ID: ${String(e)}`);return u(this,n,"m",a).call(this,e)}return await u(this,n,"m",s).call(this,e)}}r.MultichainNetworkController=g,n=new WeakSet,s=async function(e){const{selectedNetworkClientId:t}=this.messagingSystem.call("NetworkController:getState"),r=!this.state.isEvmSelected,n=e!==t;(r||n)&&(r&&this.update((e=>{e.isEvmSelected=!0})),n&&await this.messagingSystem.call("NetworkController:setActiveNetwork",e),(r||n)&&this.messagingSystem.publish("MultichainNetworkController:networkDidChange",e))},a=function(e){(e!==this.state.selectedMultichainNetworkChainId||this.state.isEvmSelected)&&(this.update((t=>{t.selectedMultichainNetworkChainId=e,t.isEvmSelected=!1})),this.messagingSystem.publish("MultichainNetworkController:networkDidChange",e))},i=function(e){const{type:t,address:r}=e;if((0,d.isEvmAccountType)(t)){if(this.state.isEvmSelected)return;return void this.update((e=>{e.isEvmSelected=!0}))}const n=(0,f.getChainIdForNonEvmAddress)(r);n===this.state.selectedMultichainNetworkChainId?this.update((e=>{e.isEvmSelected=!1})):this.update((e=>{e.selectedMultichainNetworkChainId=n,e.isEvmSelected=!1}))},o=function(){this.messagingSystem.subscribe("AccountsController:selectedAccountChange",(e=>u(this,n,"m",i).call(this,e)))},c=function(){this.messagingSystem.registerActionHandler("MultichainNetworkController:setActiveNetwork",this.setActiveNetwork.bind(this))}}}},{package:"@metamask/multichain-network-controller",file:"node_modules/@metamask/multichain-network-controller/dist/MultichainNetworkController.cjs"}],[2091,{"@metamask/keyring-api":1983,"@metamask/network-controller":2176},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MULTICHAIN_NETWORK_CONTROLLER_METADATA=r.getDefaultMultichainNetworkControllerState=r.NETWORKS_METADATA=r.AVAILABLE_MULTICHAIN_NETWORK_CONFIGURATIONS=r.SOL_NATIVE_ASSET=r.BTC_NATIVE_ASSET=void 0;const n=e("@metamask/keyring-api"),s=e("@metamask/network-controller");r.BTC_NATIVE_ASSET=`${n.BtcScope.Mainnet}/slip44:0`,r.SOL_NATIVE_ASSET=`${n.SolScope.Mainnet}/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`,r.AVAILABLE_MULTICHAIN_NETWORK_CONFIGURATIONS={[n.BtcScope.Mainnet]:{chainId:n.BtcScope.Mainnet,name:"Bitcoin Mainnet",nativeCurrency:r.BTC_NATIVE_ASSET,isEvm:!1},[n.SolScope.Mainnet]:{chainId:n.SolScope.Mainnet,name:"Solana Mainnet",nativeCurrency:r.SOL_NATIVE_ASSET,isEvm:!1}},r.NETWORKS_METADATA={[n.BtcScope.Mainnet]:{features:[],status:s.NetworkStatus.Available},[n.SolScope.Mainnet]:{features:[],status:s.NetworkStatus.Available}};r.getDefaultMultichainNetworkControllerState=()=>({multichainNetworkConfigurationsByChainId:r.AVAILABLE_MULTICHAIN_NETWORK_CONFIGURATIONS,selectedMultichainNetworkChainId:n.SolScope.Mainnet,isEvmSelected:!0}),r.MULTICHAIN_NETWORK_CONTROLLER_METADATA={multichainNetworkConfigurationsByChainId:{persist:!0,anonymous:!0},selectedMultichainNetworkChainId:{persist:!0,anonymous:!0},isEvmSelected:{persist:!0,anonymous:!0}}}}},{package:"@metamask/multichain-network-controller",file:"node_modules/@metamask/multichain-network-controller/dist/constants.cjs"}],[2092,{"./MultichainNetworkController.cjs":2090,"./constants.cjs":2091,"./utils.cjs":2094},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.toEvmCaipChainId=r.toMultichainNetworkConfigurationsByChainId=r.toMultichainNetworkConfiguration=r.checkIfSupportedCaipChainId=r.getDefaultMultichainNetworkControllerState=r.MultichainNetworkController=void 0;var n=e("./MultichainNetworkController.cjs");Object.defineProperty(r,"MultichainNetworkController",{enumerable:!0,get:function(){return n.MultichainNetworkController}});var s=e("./constants.cjs");Object.defineProperty(r,"getDefaultMultichainNetworkControllerState",{enumerable:!0,get:function(){return s.getDefaultMultichainNetworkControllerState}});var a=e("./utils.cjs");Object.defineProperty(r,"checkIfSupportedCaipChainId",{enumerable:!0,get:function(){return a.checkIfSupportedCaipChainId}}),Object.defineProperty(r,"toMultichainNetworkConfiguration",{enumerable:!0,get:function(){return a.toMultichainNetworkConfiguration}}),Object.defineProperty(r,"toMultichainNetworkConfigurationsByChainId",{enumerable:!0,get:function(){return a.toMultichainNetworkConfigurationsByChainId}}),Object.defineProperty(r,"toEvmCaipChainId",{enumerable:!0,get:function(){return a.toEvmCaipChainId}})}}},{package:"@metamask/multichain-network-controller",file:"node_modules/@metamask/multichain-network-controller/dist/index.cjs"}],[2093,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MULTICHAIN_NETWORK_CONTROLLER_NAME=void 0,r.MULTICHAIN_NETWORK_CONTROLLER_NAME="MultichainNetworkController"}}},{package:"@metamask/multichain-network-controller",file:"node_modules/@metamask/multichain-network-controller/dist/types.cjs"}],[2094,{"./constants.cjs":2091,"@metamask/keyring-api":1983,"@metamask/utils":2950,"@solana/addresses":2095},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.toMultichainNetworkConfigurationsByChainId=r.toMultichainNetworkConfiguration=r.toEvmCaipChainId=r.checkIfSupportedCaipChainId=r.getChainIdForNonEvmAddress=void 0;const n=e("@metamask/keyring-api"),s=e("@metamask/utils"),a=e("@solana/addresses"),i=e("./constants.cjs");r.getChainIdForNonEvmAddress=function(e){return(0,a.isAddress)(e)?n.SolScope.Mainnet:n.BtcScope.Mainnet},r.checkIfSupportedCaipChainId=function(e){return Object.keys(i.AVAILABLE_MULTICHAIN_NETWORK_CONFIGURATIONS).includes(e)};r.toEvmCaipChainId=e=>(0,s.toCaipChainId)(s.KnownCaipNamespace.Eip155,(0,s.hexToNumber)(e).toString());r.toMultichainNetworkConfiguration=e=>({chainId:(0,r.toEvmCaipChainId)(e.chainId),isEvm:!0,name:e.name,nativeCurrency:e.nativeCurrency,blockExplorerUrls:e.blockExplorerUrls,defaultBlockExplorerUrlIndex:e.defaultBlockExplorerUrlIndex||0});r.toMultichainNetworkConfigurationsByChainId=e=>Object.entries(e).reduce(((e,[,t])=>({...e,[(0,r.toEvmCaipChainId)(t.chainId)]:(0,r.toMultichainNetworkConfiguration)(t)})),{})}}},{package:"@metamask/multichain-network-controller",file:"node_modules/@metamask/multichain-network-controller/dist/utils.cjs"}],[2095,{"@solana/assertions":3243,"@solana/codecs-core":3244,"@solana/codecs-strings":3245,"@solana/errors":3246},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a=e("@solana/codecs-core"),i=e("@solana/codecs-strings"),o=e("@solana/errors"),c=e("@solana/assertions");function u(){return n||(n=i.getBase58Encoder()),n}function l(e){if(e.length<32||e.length>44)return!1;const t=u();try{return 32===t.encode(e).byteLength}catch{return!1}}function d(e){if(e.length<32||e.length>44)throw new o.SolanaError(o.SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE,{actualLength:e.length});const t=u().encode(e).byteLength;if(32!==t)throw new o.SolanaError(o.SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH,{actualLength:t})}function m(e){return d(e),e}function p(){return a.transformEncoder(a.fixEncoderSize(u(),32),(e=>m(e)))}function h(){return a.fixDecoderSize((s||(s=i.getBase58Decoder()),s),32)}function f(){return a.combineCodec(p(),h())}var g=37095705934669439343138083508754565189542113879843219016388785533085940283555n,y=57896044618658097711785492504343953926634992332820282019728792003956564819949n,b=19681161376707505956807079304988542015446066515923890162744021073123829784752n;function k(e){const t=e%y;return t>=0n?t:y+t}function w(e,t){let r=e;for(;t-- >0n;)r*=r,r%=y;return r}function S(e,t){const r=k(t*t*t),n=function(e){const t=e*e%y*e%y,r=w(t,2n)*t%y,n=w(r,1n)*e%y,s=w(n,5n)*n%y,a=w(s,10n)*s%y,i=w(a,20n)*a%y,o=w(i,40n)*i%y,c=w(o,80n)*o%y,u=w(c,80n)*o%y,l=w(u,10n)*s%y;return w(l,2n)*e%y}(e*k(r*r*t));let s=k(e*r*n);const a=k(t*s*s),i=s,o=k(s*b),c=a===e,u=a===k(-e),l=a===k(-e*b);return c&&(s=i),(u||l)&&(s=o),1n===(1n&k(s))&&(s=k(-s)),c||u?s:null}function _(e){if(32!==e.byteLength)return!1;const t=function(e){const t=e.reduce(((e,t,r)=>`${function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(31===r?-129&t:t)}${e}`),"");return BigInt(`0x${t}`)}(e);return function(e,t){const r=k(e*e),n=S(k(r-1n),k(g*r+1n));return null!==n&&(0n!==n||!(128&t))}(t,e[31])}var v=32,E=16,T=[80,114,111,103,114,97,109,68,101,114,105,118,101,100,65,100,100,114,101,115,115];async function A({programAddress:e,seeds:t}){if(c.assertDigestCapabilityIsAvailable(),t.length>E)throw new o.SolanaError(o.SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED,{actual:t.length,maxSeeds:E});let r;const n=t.reduce(((e,t,n)=>{const s="string"==typeof t?(r||(r=new TextEncoder)).encode(t):t;if(s.byteLength>v)throw new o.SolanaError(o.SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED,{actual:s.byteLength,index:n,maxSeedLength:v});return e.push(...s),e}),[]),s=f(),a=s.encode(e),i=await crypto.subtle.digest("SHA-256",new Uint8Array([...n,...a,...T])),u=new Uint8Array(i);if(_(u))throw new o.SolanaError(o.SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE);return s.decode(u)}r.address=m,r.assertIsAddress=d,r.assertIsProgramDerivedAddress=function(e){if(!(Array.isArray(e)&&2===e.length&&"string"==typeof e[0]&&"number"==typeof e[1]))throw new o.SolanaError(o.SOLANA_ERROR__ADDRESSES__MALFORMED_PDA);if(e[1]<0||e[1]>255)throw new o.SolanaError(o.SOLANA_ERROR__ADDRESSES__PDA_BUMP_SEED_OUT_OF_RANGE,{bump:e[1]});d(e[0])},r.createAddressWithSeed=async function({baseAddress:e,programAddress:t,seed:r}){const{encode:n,decode:s}=f(),a="string"==typeof r?(new TextEncoder).encode(r):r;if(a.byteLength>v)throw new o.SolanaError(o.SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED,{actual:a.byteLength,index:0,maxSeedLength:v});const i=n(t);if(i.length>=T.length&&i.slice(-T.length).every(((e,t)=>e===T[t])))throw new o.SolanaError(o.SOLANA_ERROR__ADDRESSES__PDA_ENDS_WITH_PDA_MARKER);const c=await crypto.subtle.digest("SHA-256",new Uint8Array([...n(e),...a,...i]));return s(new Uint8Array(c))},r.getAddressCodec=f,r.getAddressComparator=function(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare},r.getAddressDecoder=h,r.getAddressEncoder=p,r.getAddressFromPublicKey=async function(e){if(c.assertKeyExporterIsAvailable(),"public"!==e.type||"Ed25519"!==e.algorithm.name)throw new o.SolanaError(o.SOLANA_ERROR__ADDRESSES__INVALID_ED25519_PUBLIC_KEY);const t=await crypto.subtle.exportKey("raw",e);return h().decode(new Uint8Array(t))},r.getProgramDerivedAddress=async function({programAddress:e,seeds:t}){let r=255;for(;r>0;)try{return[await A({programAddress:e,seeds:[...t,new Uint8Array([r])]}),r]}catch(e){if(!o.isSolanaError(e,o.SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE))throw e;r--}throw new o.SolanaError(o.SOLANA_ERROR__ADDRESSES__FAILED_TO_FIND_VIABLE_PDA_BUMP_SEED)},r.isAddress=l,r.isProgramDerivedAddress=function(e){return Array.isArray(e)&&2===e.length&&"string"==typeof e[0]&&"number"==typeof e[1]&&e[1]>=0&&e[1]<=255&&l(e[0])}}}},{package:"@metamask/multichain-network-controller>@solana/addresses",file:"node_modules/@metamask/multichain-network-controller/node_modules/@solana/addresses/dist/index.browser.cjs"}],[2096,{"./constants.cjs":2097,"@metamask/base-controller":1383,"@metamask/keyring-api":1983,"@metamask/keyring-snap-client":2036,"@metamask/snaps-utils":2117,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i,o,c,u,l,d,m,p=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.MultichainTransactionsController=r.getDefaultMultichainTransactionsControllerState=void 0;const h=e("@metamask/base-controller"),f=e("@metamask/keyring-api"),g=e("@metamask/keyring-snap-client"),y=e("@metamask/snaps-utils"),b=e("@metamask/utils"),k=e("./constants.cjs");function w(){return{nonEvmTransactions:{}}}r.getDefaultMultichainTransactionsControllerState=w;const S={nonEvmTransactions:{persist:!0,anonymous:!1}};class _ extends h.BaseController{constructor({messenger:e,state:t}){super({messenger:e,name:"MultichainTransactionsController",metadata:S,state:{nonEvmTransactions:{},...t}}),n.add(this);for(const e of p(this,n,"m",a).call(this))this.updateTransactionsForAccount(e.id).catch((t=>{console.error(`Failed to fetch initial transactions for account ${e.id}:`,t)}));this.messagingSystem.subscribe("AccountsController:accountAdded",(e=>p(this,n,"m",u).call(this,e))),this.messagingSystem.subscribe("AccountsController:accountRemoved",(e=>p(this,n,"m",l).call(this,e))),this.messagingSystem.subscribe("AccountsController:accountTransactionsUpdated",(e=>p(this,n,"m",d).call(this,e)))}async updateTransactionsForAccount(e){const{isUnlocked:t}=this.messagingSystem.call("KeyringController:getState");if(t)try{const t=p(this,n,"m",a).call(this).find((t=>t.id===e));if(t?.metadata.snap){const e=await p(this,n,"m",i).call(this,t.id,t.metadata.snap.id,{limit:10}),r=p(this,n,"m",o).call(this,e.data);this.update((n=>{const s={transactions:r,next:e.next,lastUpdated:Date.now()};Object.assign(n.nonEvmTransactions,{[t.id]:s})}))}}catch(t){console.error(`Failed to fetch transactions for account ${e}:`,t)}}}r.MultichainTransactionsController=_,n=new WeakSet,s=function(){return this.messagingSystem.call("AccountsController:listMultichainAccounts")},a=function(){return p(this,n,"m",s).call(this).filter((e=>p(this,n,"m",c).call(this,e)))},i=async function(e,t,r){return await p(this,n,"m",m).call(this,t).listAccountTransactions(e,r)},o=function(e){return e.filter((e=>{const t=e.chain,{namespace:r}=(0,b.parseCaipChainId)(t);return r!==b.KnownCaipNamespace.Solana||t===k.MultichainNetwork.Solana}))},c=function(e){return!(0,f.isEvmAccountType)(e.type)&&e.metadata.snap!==undefined},u=async function(e){p(this,n,"m",c).call(this,e)&&await this.updateTransactionsForAccount(e.id)},l=async function(e){e in this.state.nonEvmTransactions&&this.update((t=>{delete t.nonEvmTransactions[e]}))},d=function(e){const t={};e?.transactions&&(Object.entries(e.transactions).forEach((([e,r])=>{const s=this.state.nonEvmTransactions[e]?.transactions??[],a=p(this,n,"m",o).call(this,r),i=new Map;s.forEach((e=>{i.set(e.id,e)})),a.forEach((e=>{i.set(e.id,e)})),t[e]=Array.from(i.values()).sort(((e,t)=>(t.timestamp??0)-(e.timestamp??0)))})),this.update((e=>{Object.entries(t).forEach((([t,r])=>{e.nonEvmTransactions[t]={...e.nonEvmTransactions[t],transactions:r,lastUpdated:Date.now()}}))})))},m=function(e){return new g.KeyringClient({send:async t=>await this.messagingSystem.call("SnapController:handleRequest",{snapId:e,origin:"metamask",handler:y.HandlerType.OnKeyringRequest,request:t})})}}}},{package:"@metamask/multichain-transactions-controller",file:"node_modules/@metamask/multichain-transactions-controller/dist/MultichainTransactionsController.cjs"}],[2097,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s;Object.defineProperty(r,"__esModule",{value:!0}),r.MultichainNativeAsset=r.MultichainNetwork=void 0,function(e){e.Bitcoin="bip122:000000000019d6689c085ae165831e93",e.BitcoinTestnet="bip122:000000000933ea01ad0ee984209779ba",e.Solana="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",e.SolanaDevnet="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",e.SolanaTestnet="solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"}(n||(r.MultichainNetwork=n={})),function(e){e.Bitcoin="bip122:000000000019d6689c085ae165831e93/slip44:0",e.BitcoinTestnet="bip122:000000000933ea01ad0ee984209779ba/slip44:0",e.Solana="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501",e.SolanaDevnet="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/slip44:501",e.SolanaTestnet="solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z/slip44:501"}(s||(r.MultichainNativeAsset=s={}))}}},{package:"@metamask/multichain-transactions-controller",file:"node_modules/@metamask/multichain-transactions-controller/dist/constants.cjs"}],[2098,{"./MultichainTransactionsController.cjs":2096,"./constants.cjs":2097},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MultichainNativeAsset=r.MultichainNetwork=r.MultichainTransactionsController=void 0;var n=e("./MultichainTransactionsController.cjs");Object.defineProperty(r,"MultichainTransactionsController",{enumerable:!0,get:function(){return n.MultichainTransactionsController}});var s=e("./constants.cjs");Object.defineProperty(r,"MultichainNetwork",{enumerable:!0,get:function(){return s.MultichainNetwork}}),Object.defineProperty(r,"MultichainNativeAsset",{enumerable:!0,get:function(){return s.MultichainNativeAsset}})}}},{package:"@metamask/multichain-transactions-controller",file:"node_modules/@metamask/multichain-transactions-controller/dist/index.cjs"}],[2099,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isEqual=void 0,r.isEqual=function(e,t){return e.length===t.length&&e.every(((e,r)=>e===t[r]))}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/array.cjs"}],[2100,{"./base64.cjs":2101,"./constants.cjs":2105,"@metamask/snaps-sdk":2746,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.validateAuxiliaryFiles=r.encodeAuxiliaryFile=void 0;const n=e("@metamask/snaps-sdk"),s=e("@metamask/utils"),a=e("./base64.cjs"),i=e("./constants.cjs");r.encodeAuxiliaryFile=async function(e,t){if(t===n.AuxiliaryFileEncoding.Base64)return e;const r=await(0,a.decodeBase64)(e);return t===n.AuxiliaryFileEncoding.Utf8?(0,s.bytesToString)(r):(0,s.bytesToHex)(r)},r.validateAuxiliaryFiles=function(e){for(const t of e)(0,s.assert)(t.size<i.MAX_FILE_SIZE,"Static files required by the Snap must be smaller than 64 MB.")}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/auxiliary-files.cjs"}],[2101,{"./bytes.cjs":2102,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.decodeBase64=r.encodeBase64=void 0;const n=e("@metamask/utils"),s=e("./bytes.cjs");r.encodeBase64=async function(e){const t=(0,s.getBytes)(e);return"FileReader"in globalThis?await new Promise(((e,r)=>{const n=Object.assign(new FileReader,{onload:()=>e(n.result.replace("data:application/octet-stream;base64,","")),onerror:()=>r(n.error)});n.readAsDataURL(new File([t],"",{type:"application/octet-stream"}))})):(0,n.bytesToBase64)(t)},r.decodeBase64=async function(e){const t=await fetch(`data:application/octet-stream;base64,${e}`);return new Uint8Array(await t.arrayBuffer())}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/base64.cjs"}],[2102,{"./virtual-file/VirtualFile.cjs":2137,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getBytes=void 0;const n=e("@metamask/utils"),s=e("./virtual-file/VirtualFile.cjs");r.getBytes=function(e){const t=e instanceof s.VirtualFile?e.value:e;return"string"==typeof t?(0,n.stringToBytes)(t):t}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/bytes.cjs"}],[2103,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.SnapCaveatType=void 0,function(e){e.PermittedDerivationPaths="permittedDerivationPaths",e.PermittedCoinTypes="permittedCoinTypes",e.SnapCronjob="snapCronjob",e.TransactionOrigin="transactionOrigin",e.SignatureOrigin="signatureOrigin",e.RpcOrigin="rpcOrigin",e.KeyringOrigin="keyringOrigin",e.SnapIds="snapIds",e.ChainIds="chainIds",e.LookupMatchers="lookupMatchers",e.MaxRequestTime="maxRequestTime",e.ProtocolSnapScopes="protocolSnapScopes"}(n||(r.SnapCaveatType=n={}))}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/caveats.cjs"}],[2104,{"./bytes.cjs":2102,"@metamask/utils":2950,"@noble/hashes/sha256":3e3},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.checksumFiles=r.checksum=void 0;const n=e("@metamask/utils"),s=e("@noble/hashes/sha256"),a=e("./bytes.cjs");async function i(e){const t=(0,a.getBytes)(e);return"crypto"in globalThis&&"object"==typeof globalThis.crypto&&crypto.subtle?.digest?new Uint8Array(await crypto.subtle.digest("SHA-256",t)):(0,s.sha256)(t)}r.checksum=i,r.checksumFiles=async function(e){const t=await Promise.all([...e].sort(((e,t)=>((0,n.assert)(e.path!==t.path,"Tried to sort files with non-unique paths."),e.path<t.path?-1:1))).map((async e=>i(e))));return i((0,n.concatBytes)(t))}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/checksum.cjs"}],[2105,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MAX_FILE_SIZE=void 0,r.MAX_FILE_SIZE=64e6}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/constants.cjs"}],[2106,{"@metamask/superstruct":2872,"@metamask/utils":2950,"cron-parser":4179},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isCronjobSpecificationArray=r.CronjobSpecificationArrayStruct=r.isCronjobSpecification=r.CronjobSpecificationStruct=r.parseCronExpression=r.CronExpressionStruct=r.CronjobRpcRequestStruct=void 0;const n=e("@metamask/superstruct"),s=e("@metamask/utils"),a=e("cron-parser");r.CronjobRpcRequestStruct=(0,n.object)({jsonrpc:(0,n.optional)(s.JsonRpcVersionStruct),id:(0,n.optional)(s.JsonRpcIdStruct),method:(0,n.string)(),params:(0,n.optional)(s.JsonRpcParamsStruct)}),r.CronExpressionStruct=(0,n.refine)((0,n.string)(),"CronExpression",(e=>{try{return(0,a.parseExpression)(e),!0}catch{return!1}})),r.parseCronExpression=function(e){const t=(0,n.create)(e,r.CronExpressionStruct);return(0,a.parseExpression)(t)},r.CronjobSpecificationStruct=(0,n.object)({expression:r.CronExpressionStruct,request:r.CronjobRpcRequestStruct}),r.isCronjobSpecification=function(e){try{return(0,n.create)(e,r.CronjobSpecificationStruct),!0}catch{return!1}},r.CronjobSpecificationArrayStruct=(0,n.array)(r.CronjobSpecificationStruct),r.isCronjobSpecificationArray=function(e){try{return(0,n.create)(e,r.CronjobSpecificationArrayStruct),!0}catch{return!1}}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/cronjob.cjs"}],[2107,{"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.currency=void 0;const n=e("@metamask/superstruct");r.currency=function(e){const t=e.toLowerCase();return(0,n.coerce)((0,n.literal)(t),(0,n.literal)(e.toUpperCase()),(e=>(0,n.create)(e.toLowerCase(),(0,n.literal)(t))))}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/currency.cjs"}],[2108,{rfdc:5288},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.deepClone=void 0;const s=n(e("rfdc"));r.deepClone=(0,s.default)({proto:!1,circles:!1})}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/deep-clone.cjs"}],[2109,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_ENDOWMENTS=void 0,r.DEFAULT_ENDOWMENTS=Object.freeze(["atob","btoa","BigInt","console","crypto","Date","Math","setTimeout","clearTimeout","SubtleCrypto","TextDecoder","TextEncoder","URL","URLSearchParams","setInterval","clearInterval","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","isSecureContext","Intl","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","DataView","ArrayBuffer","AbortController","AbortSignal"])}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/default-endowments.cjs"}],[2110,{"./array.cjs":2099,"@metamask/slip44":2624},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.getSlip44ProtocolName=r.getSnapDerivationPathName=r.SNAPS_DERIVATION_PATHS=void 0;const s=n(e("@metamask/slip44")),a=e("./array.cjs");function i(e){return"1"===String(e)?"Test Networks":s.default[e]?.name??null}r.SNAPS_DERIVATION_PATHS=[{path:["m","44'","0'"],curve:"ed25519",name:"Test BIP-32 Path (ed25519)"},{path:["m","44'","1'"],curve:"secp256k1",name:"Testnet"},{path:["m","44'","0'"],curve:"secp256k1",name:"Bitcoin Legacy"},{path:["m","49'","0'"],curve:"secp256k1",name:"Bitcoin Nested SegWit"},{path:["m","49'","1'"],curve:"secp256k1",name:"Bitcoin Testnet Nested SegWit"},{path:["m","84'","0'"],curve:"secp256k1",name:"Bitcoin Native SegWit"},{path:["m","84'","1'"],curve:"secp256k1",name:"Bitcoin Testnet Native SegWit"},{path:["m","86'","0'"],curve:"secp256k1",name:"Bitcoin Taproot"},{path:["m","86'","1'"],curve:"secp256k1",name:"Bitcoin Testnet Taproot"},{path:["m","44'","501'"],curve:"ed25519",name:"Solana"},{path:["m","44'","501'","0'","0'"],curve:"ed25519",name:"Solana"},{path:["m","44'","2'"],curve:"secp256k1",name:"Litecoin"},{path:["m","44'","3'"],curve:"secp256k1",name:"Dogecoin"},{path:["m","44'","60'"],curve:"secp256k1",name:"Ethereum"},{path:["m","44'","118'"],curve:"secp256k1",name:"Atom"},{path:["m","44'","145'"],curve:"secp256k1",name:"Bitcoin Cash"},{path:["m","44'","637'"],curve:"ed25519",name:"Aptos"},{path:["m","44'","714'"],curve:"secp256k1",name:"Binance (BNB)"},{path:["m","44'","784'"],curve:"ed25519",name:"Sui"},{path:["m","44'","931'"],curve:"secp256k1",name:"THORChain (RUNE)"},{path:["m","44'","330'"],curve:"secp256k1",name:"Terra (LUNA)"},{path:["m","44'","459'"],curve:"secp256k1",name:"Kava"},{path:["m","44'","529'"],curve:"secp256k1",name:"Secret Network"},{path:["m","44'","397'","0'"],curve:"ed25519",name:"NEAR Protocol"},{path:["m","44'","1'","0'"],curve:"ed25519",name:"Testnet"},{path:["m","44'","472'"],curve:"ed25519",name:"Arweave"},{path:["m","44'","12586'"],curve:"secp256k1",name:"Mina"},{path:["m","44'","242'"],curve:"ed25519",name:"Nimiq"},{path:["m","44'","1729'","0'","0'"],curve:"ed25519",name:"Tezos"},{path:["m","1789'","0'"],curve:"ed25519",name:"Vega"},{path:["m","1852'","1815'"],curve:"ed25519Bip32",name:"Cardano"},{path:["m","44'","508'","0'","0'","0'"],curve:"ed25519",name:"MultiversX"},{path:["m","44'","709'"],curve:"secp256k1",name:"Avail"},{path:["m","44'","626'"],curve:"ed25519",name:"Kadena"},{path:["m","44'","632'"],curve:"ed25519",name:"Massa"}],r.getSnapDerivationPathName=function(e,t){const n=r.SNAPS_DERIVATION_PATHS.find((r=>r.curve===t&&(0,a.isEqual)(r.path,e)));if(n)return n.name;if("secp256k1"===t&&"m"===e[0]&&"44'"===e[1]&&e[2].endsWith("'")){return i(e[2].slice(0,-1))??null}return null},r.getSlip44ProtocolName=i}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/derivation-paths.cjs"}],[2111,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.STATE_ENCRYPTION_MAGIC_VALUE=r.SIP_6_MAGIC_VALUE=void 0,r.SIP_6_MAGIC_VALUE="1399742832'",r.STATE_ENCRYPTION_MAGIC_VALUE="572232532'"}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/entropy.cjs"}],[2112,{"@metamask/rpc-errors":2554,"@metamask/snaps-sdk":2746,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.unwrapError=r.isWrappedSnapError=r.isSerializedSnapError=r.isSnapError=r.WrappedSnapError=r.SNAP_ERROR_WRAPPER_MESSAGE=r.SNAP_ERROR_WRAPPER_CODE=void 0;const c=e("@metamask/rpc-errors"),u=e("@metamask/snaps-sdk"),l=e("@metamask/utils");r.SNAP_ERROR_WRAPPER_CODE=-31001,r.SNAP_ERROR_WRAPPER_MESSAGE="Wrapped Snap Error";class d extends Error{constructor(e){const t=(0,u.getErrorMessage)(e);super(t),n.set(this,void 0),s.set(this,void 0),a.set(this,void 0),i(this,n,e,"f"),i(this,s,t,"f"),i(this,a,(0,u.getErrorStack)(e),"f")}get name(){return"WrappedSnapError"}get message(){return o(this,s,"f")}get stack(){return o(this,a,"f")}toJSON(){const e=m(o(this,n,"f"))?o(this,n,"f").serialize():(0,c.serializeCause)(o(this,n,"f"));return{code:r.SNAP_ERROR_WRAPPER_CODE,message:r.SNAP_ERROR_WRAPPER_MESSAGE,data:{cause:e}}}serialize(){return this.toJSON()}}function m(e){if((0,l.isObject)(e)&&"serialize"in e&&"function"==typeof e.serialize){const t=e.serialize();return(0,l.isJsonRpcError)(t)&&p(t)}return!1}function p(e){return e.code===u.SNAP_ERROR_CODE&&e.message===u.SNAP_ERROR_MESSAGE}function h(e){return(0,l.isJsonRpcError)(e)&&e.code===r.SNAP_ERROR_WRAPPER_CODE&&e.message===r.SNAP_ERROR_WRAPPER_MESSAGE}function f(e,t,r,n){const s=new c.JsonRpcError(e,t,n);return s.stack=r,s}r.WrappedSnapError=d,n=new WeakMap,s=new WeakMap,a=new WeakMap,r.isSnapError=m,r.isSerializedSnapError=p,r.isWrappedSnapError=h,r.unwrapError=function(e){if(h(e)){if((0,l.isJsonRpcError)(e.data.cause)){if(p(e.data.cause)){const{code:t,message:r,stack:n,data:s}=e.data.cause.data.cause;return[f(t,r,n,s),!0]}const{code:t,message:r,stack:n,data:s}=e.data.cause;return[f(t,r,n,s),!1]}return[f(c.errorCodes.rpc.internal,(0,u.getErrorMessage)(e.data.cause),(0,u.getErrorStack)(e.data.cause)),!1]}if((0,l.isJsonRpcError)(e)){const{code:t,message:r,stack:n,data:s}=e;return[f(t,r,n,s),!1]}return[f(c.errorCodes.rpc.internal,(0,u.getErrorMessage)(e),(0,u.getErrorStack)(e)),!1]}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/errors.cjs"}],[2113,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.SNAP_EXPORT_NAMES=r.HandlerType=void 0,function(e){e.OnRpcRequest="onRpcRequest",e.OnSignature="onSignature",e.OnTransaction="onTransaction",e.OnCronjob="onCronjob",e.OnInstall="onInstall",e.OnUpdate="onUpdate",e.OnNameLookup="onNameLookup",e.OnKeyringRequest="onKeyringRequest",e.OnHomePage="onHomePage",e.OnSettingsPage="onSettingsPage",e.OnUserInput="onUserInput",e.OnAssetsLookup="onAssetsLookup",e.OnAssetsConversion="onAssetsConversion",e.OnProtocolRequest="onProtocolRequest"}(n||(r.HandlerType=n={})),r.SNAP_EXPORT_NAMES=Object.values(n)}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/handler-types.cjs"}],[2114,{"./handler-types.cjs":2113,"@metamask/snaps-sdk":2746,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.OnNameLookupResponseStruct=r.DomainResolutionResponseStruct=r.AddressResolutionResponseStruct=r.DomainResolutionStruct=r.AddressResolutionStruct=r.OnSettingsPageResponseStruct=r.OnHomePageResponseStruct=r.OnHomePageResponseWithIdStruct=r.OnHomePageResponseWithContentStruct=r.OnSignatureResponseStruct=r.OnTransactionResponseStruct=r.OnTransactionResponseWithContentStruct=r.OnTransactionResponseWithIdStruct=r.OnTransactionSeverityResponseStruct=r.SNAP_EXPORTS=void 0;const n=e("@metamask/snaps-sdk"),s=e("@metamask/superstruct"),a=e("./handler-types.cjs");r.SNAP_EXPORTS={[a.HandlerType.OnRpcRequest]:{type:a.HandlerType.OnRpcRequest,required:!0,validator:e=>"function"==typeof e},[a.HandlerType.OnTransaction]:{type:a.HandlerType.OnTransaction,required:!0,validator:e=>"function"==typeof e},[a.HandlerType.OnCronjob]:{type:a.HandlerType.OnCronjob,required:!0,validator:e=>"function"==typeof e},[a.HandlerType.OnNameLookup]:{type:a.HandlerType.OnNameLookup,required:!0,validator:e=>"function"==typeof e},[a.HandlerType.OnInstall]:{type:a.HandlerType.OnInstall,required:!1,validator:e=>"function"==typeof e},[a.HandlerType.OnUpdate]:{type:a.HandlerType.OnUpdate,required:!1,validator:e=>"function"==typeof e},[a.HandlerType.OnKeyringRequest]:{type:a.HandlerType.OnKeyringRequest,required:!0,validator:e=>"function"==typeof e},[a.HandlerType.OnHomePage]:{type:a.HandlerType.OnHomePage,required:!0,validator:e=>"function"==typeof e},[a.HandlerType.OnSettingsPage]:{type:a.HandlerType.OnSettingsPage,required:!0,validator:e=>"function"==typeof e},[a.HandlerType.OnSignature]:{type:a.HandlerType.OnSignature,required:!0,validator:e=>"function"==typeof e},[a.HandlerType.OnUserInput]:{type:a.HandlerType.OnUserInput,required:!1,validator:e=>"function"==typeof e},[a.HandlerType.OnAssetsLookup]:{type:a.HandlerType.OnAssetsLookup,required:!0,validator:e=>"function"==typeof e},[a.HandlerType.OnAssetsConversion]:{type:a.HandlerType.OnAssetsConversion,required:!0,validator:e=>"function"==typeof e},[a.HandlerType.OnProtocolRequest]:{type:a.HandlerType.OnProtocolRequest,required:!0,validator:e=>"function"==typeof e}},r.OnTransactionSeverityResponseStruct=(0,s.object)({severity:(0,s.optional)((0,s.literal)(n.SeverityLevel.Critical))}),r.OnTransactionResponseWithIdStruct=(0,s.assign)(r.OnTransactionSeverityResponseStruct,(0,s.object)({id:(0,s.string)()})),r.OnTransactionResponseWithContentStruct=(0,s.assign)(r.OnTransactionSeverityResponseStruct,(0,s.object)({content:n.ComponentOrElementStruct})),r.OnTransactionResponseStruct=(0,s.nullable)((0,s.union)([r.OnTransactionResponseWithContentStruct,r.OnTransactionResponseWithIdStruct])),r.OnSignatureResponseStruct=r.OnTransactionResponseStruct,r.OnHomePageResponseWithContentStruct=(0,s.object)({content:n.ComponentOrElementStruct}),r.OnHomePageResponseWithIdStruct=(0,s.object)({id:(0,s.string)()}),r.OnHomePageResponseStruct=(0,s.union)([r.OnHomePageResponseWithContentStruct,r.OnHomePageResponseWithIdStruct]),r.OnSettingsPageResponseStruct=r.OnHomePageResponseStruct,r.AddressResolutionStruct=(0,s.object)({protocol:(0,s.string)(),resolvedDomain:(0,s.string)()}),r.DomainResolutionStruct=(0,s.object)({protocol:(0,s.string)(),resolvedAddress:(0,s.string)(),domainName:(0,s.string)()}),r.AddressResolutionResponseStruct=(0,s.object)({resolvedDomains:(0,s.size)((0,s.array)(r.AddressResolutionStruct),1,Infinity)}),r.DomainResolutionResponseStruct=(0,s.object)({resolvedAddresses:(0,s.size)((0,s.array)(r.DomainResolutionStruct),1,Infinity)}),r.OnNameLookupResponseStruct=(0,s.nullable)((0,s.union)([r.AddressResolutionResponseStruct,r.DomainResolutionResponseStruct]))}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/handlers.cjs"}],[2115,{"./svg.cjs":2131,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getSvgDimensions=r.assertIsSnapIcon=r.SVG_MAX_BYTE_SIZE_TEXT=r.SVG_MAX_BYTE_SIZE=void 0;const n=e("@metamask/utils"),s=e("./svg.cjs");r.SVG_MAX_BYTE_SIZE=1e5,r.SVG_MAX_BYTE_SIZE_TEXT=`${Math.floor(r.SVG_MAX_BYTE_SIZE/1e3)}kb`,r.assertIsSnapIcon=function(e){(0,n.assert)(e.path.endsWith(".svg"),'Expected snap icon to end in ".svg".');const t="string"==typeof e.value?(0,n.stringToBytes)(e.value).byteLength:e.value.byteLength;(0,n.assert)(t<=r.SVG_MAX_BYTE_SIZE,`The specified SVG icon exceeds the maximum size of ${r.SVG_MAX_BYTE_SIZE_TEXT}.`),(0,n.assert)((0,s.isSvg)(e.toString()),"Snap icon must be a valid SVG.")},r.getSvgDimensions=function(e){try{const t=(0,s.parseSvg)(e),r=t["@_height"],a=t["@_width"];if(r&&a)return{height:r,width:a};const i=t["@_viewBox"];if(i){const[e,t,r,s]=i.split(" ");if(r&&s){const e=parseInt(r,10),t=parseInt(s,10);return(0,n.assert)(Number.isInteger(e)&&e>0),(0,n.assert)(Number.isInteger(t)&&t>0),{width:e,height:t}}}}catch{throw new Error("Snap icon must be a valid SVG.")}return null}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/icon.cjs"}],[2116,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createWindow=void 0,r.createWindow=async function({uri:e,id:t,sandbox:r=!0,testId:n="snaps-iframe"}){return await new Promise(((s,a)=>{const i=document.createElement("iframe");i.setAttribute("id",t),i.setAttribute("data-testid",n),r&&i.setAttribute("sandbox","allow-scripts"),i.setAttribute("src",e),document.body.appendChild(i),i.addEventListener("load",(()=>{i.contentWindow?s(i.contentWindow):a(new Error(`iframe.contentWindow not present on load for job "${t}".`))}))}))}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/iframe.cjs"}],[2117,{"./array.cjs":2099,"./auxiliary-files.cjs":2100,"./base64.cjs":2101,"./bytes.cjs":2102,"./caveats.cjs":2103,"./checksum.cjs":2104,"./constants.cjs":2105,"./cronjob.cjs":2106,"./currency.cjs":2107,"./deep-clone.cjs":2108,"./default-endowments.cjs":2109,"./derivation-paths.cjs":2110,"./entropy.cjs":2111,"./errors.cjs":2112,"./handler-types.cjs":2113,"./handlers.cjs":2114,"./iframe.cjs":2116,"./json-rpc.cjs":2118,"./json.cjs":2119,"./localization.cjs":2120,"./logging.cjs":2121,"./manifest/index.cjs":2122,"./namespace.cjs":2124,"./path.cjs":2125,"./platform-version.cjs":2126,"./promise.cjs":2127,"./snaps.cjs":2128,"./strings.cjs":2129,"./structs.cjs":2130,"./types.cjs":2132,"./ui.cjs":2133,"./url.cjs":2134,"./validation.cjs":2135,"./versions.cjs":2136,"./virtual-file/index.cjs":2138},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./array.cjs"),r),s(e("./auxiliary-files.cjs"),r),s(e("./base64.cjs"),r),s(e("./bytes.cjs"),r),s(e("./caveats.cjs"),r),s(e("./checksum.cjs"),r),s(e("./constants.cjs"),r),s(e("./cronjob.cjs"),r),s(e("./currency.cjs"),r),s(e("./deep-clone.cjs"),r),s(e("./default-endowments.cjs"),r),s(e("./derivation-paths.cjs"),r),s(e("./entropy.cjs"),r),s(e("./errors.cjs"),r),s(e("./handlers.cjs"),r),s(e("./handler-types.cjs"),r),s(e("./iframe.cjs"),r),s(e("./json.cjs"),r),s(e("./json-rpc.cjs"),r),s(e("./localization.cjs"),r),s(e("./logging.cjs"),r),s(e("./manifest/index.cjs"),r),s(e("./namespace.cjs"),r),s(e("./path.cjs"),r),s(e("./platform-version.cjs"),r),s(e("./snaps.cjs"),r),s(e("./strings.cjs"),r),s(e("./structs.cjs"),r),s(e("./types.cjs"),r),s(e("./ui.cjs"),r),s(e("./url.cjs"),r),s(e("./validation.cjs"),r),s(e("./versions.cjs"),r),s(e("./virtual-file/index.cjs"),r),s(e("./promise.cjs"),r)}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/index.cjs"}],[2118,{"@metamask/permission-controller":2393,"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.assertIsJsonRpcSuccess=r.isOriginAllowed=r.assertIsKeyringOrigins=r.KeyringOriginsStruct=r.assertIsRpcOrigins=r.RpcOriginsStruct=void 0;const n=e("@metamask/permission-controller"),s=e("@metamask/superstruct"),a=e("@metamask/utils"),i=(0,s.array)((0,s.refine)((0,s.string)(),"Allowed origin",(e=>!(e.split("*").length-1>2)||'No more than two wildcards ("*") are allowed in an origin specifier.')));function o(e,t){if("*"===e||e===t)return!0;const r=function(e){const t=e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&").replace(/\\\*/gu,".*");return RegExp(`^${t}$`,"u")}(e);return r.test(t)}r.RpcOriginsStruct=(0,s.refine)((0,s.object)({dapps:(0,s.optional)((0,s.boolean)()),snaps:(0,s.optional)((0,s.boolean)()),allowedOrigins:(0,s.optional)(i)}),"RPC origins",(e=>!!Boolean(!0===e.snaps||!0===e.dapps||e.allowedOrigins&&e.allowedOrigins.length>0)||"Must specify at least one JSON-RPC origin.")),r.assertIsRpcOrigins=function(e,t){(0,a.assertStruct)(e,r.RpcOriginsStruct,"Invalid JSON-RPC origins",t)},r.KeyringOriginsStruct=(0,s.object)({allowedOrigins:(0,s.optional)(i)}),r.assertIsKeyringOrigins=function(e,t){(0,a.assertStruct)(e,r.KeyringOriginsStruct,"Invalid keyring origins",t)},r.isOriginAllowed=function(e,t,r){return"metamask"===r||(!!e.allowedOrigins?.some((e=>o(e,r)))||(!(t!==n.SubjectType.Website||!e.dapps)||Boolean(t===n.SubjectType.Snap&&e.snaps)))},r.assertIsJsonRpcSuccess=function(e){if(!(0,a.isJsonRpcSuccess)(e)){if((0,a.isJsonRpcFailure)(e))throw new Error(`JSON-RPC request failed: ${e.error.message}`);throw new Error("Invalid JSON-RPC response.")}}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/json-rpc.cjs"}],[2119,{"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getJsonSizeUnsafe=r.parseJson=void 0;const n=e("@metamask/utils");r.parseJson=function(e){return(0,n.getSafeJson)(JSON.parse(e))},r.getJsonSizeUnsafe=function(e){const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/json.cjs"}],[2120,{"./json.cjs":2119,"@metamask/snaps-sdk":2746,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.validateSnapManifestLocalizations=r.getLocalizedSnapManifest=r.translate=r.TRANSLATION_REGEX=r.getLocalizationFile=r.getValidatedLocalizationFiles=r.LocalizationFileStruct=r.LOCALIZABLE_FIELDS=void 0;const n=e("@metamask/snaps-sdk"),s=e("@metamask/superstruct"),a=e("./json.cjs");function i(e,t){const r=t.find((t=>t.locale===e));return r||t.find((e=>"en"===e.locale))}function o(e,t){const n=e.matchAll(r.TRANSLATION_REGEX);return Array.from(n).reduce(((r,[n,s])=>{if(!t)throw new Error(`Failed to translate "${e}": No localization file found.`);const a=t.messages[s.trim()];if(!a)throw new Error(`Failed to translate "${e}": No translation found for "${s.trim()}" in "${t.locale}" file.`);return r.replace(n,a.message)}),e)}function c(e,t,n){const s=i(t,n);return r.LOCALIZABLE_FIELDS.reduce(((e,t)=>{const r=o(e[t],s);return{...e,[t]:r}}),e)}r.LOCALIZABLE_FIELDS=["description","proposedName"],r.LocalizationFileStruct=(0,s.object)({locale:(0,s.string)(),messages:(0,s.record)((0,s.string)(),(0,s.object)({message:(0,s.string)(),description:(0,s.optional)((0,s.string)())}))}),r.getValidatedLocalizationFiles=function(e){for(const t of e)try{t.result=(0,s.create)((0,a.parseJson)(t.toString()),r.LocalizationFileStruct)}catch(e){if(e instanceof s.StructError)throw new Error(`Failed to validate localization file "${t.path}": ${e.message}.`);if(e instanceof SyntaxError)throw new Error(`Failed to parse localization file "${t.path}" as JSON.`);throw e}return e},r.getLocalizationFile=i,r.TRANSLATION_REGEX=/\{\{\s?([a-zA-Z0-9-_\s]+)\s?\}\}/gu,r.translate=o,r.getLocalizedSnapManifest=c,r.validateSnapManifestLocalizations=function(e,t){try{t.filter((e=>"en"!==e.locale)).forEach((r=>{c(e,r.locale,t)})),c(e,"en",t)}catch(e){throw new Error(`Failed to localize Snap manifest: ${(0,n.getErrorMessage)(e)}`)}}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/localization.cjs"}],[2121,{"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.logWarning=r.logError=r.logInfo=r.snapsLogger=void 0;const n=e("@metamask/utils");r.snapsLogger=(0,n.createProjectLogger)("snaps"),r.logInfo=function(e,...t){console.log(e,...t)},r.logError=function(e,...t){console.error(e,...t)},r.logWarning=function(e,...t){console.warn(e,...t)}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/logging.cjs"}],[2122,{"./validation.cjs":2123},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./validation.cjs"),r)}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/manifest/index.cjs"}],[2123,{"../array.cjs":2099,"../cronjob.cjs":2106,"../entropy.cjs":2111,"../json-rpc.cjs":2118,"../namespace.cjs":2124,"../snaps.cjs":2128,"../structs.cjs":2130,"../types.cjs":2132,"@metamask/key-tree":1957,"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createSnapManifest=r.assertIsSnapManifest=r.isSnapManifest=r.SnapManifestStruct=r.InitialConnectionsStruct=r.SnapAuxilaryFilesStruct=r.PermissionsStruct=r.EmptyObjectStruct=r.HandlerCaveatsStruct=r.ProtocolScopesStruct=r.MaxRequestTimeStruct=r.MAXIMUM_REQUEST_TIMEOUT=r.MINIMUM_REQUEST_TIMEOUT=r.LookupMatchersStruct=r.ChainIdsStruct=r.SnapIdsStruct=r.SemVerRangeStruct=r.SnapGetBip32EntropyPermissionsStruct=r.Bip32EntropyStruct=r.CurveStruct=r.bip32entropy=r.Bip32PathStruct=r.FORBIDDEN_COIN_TYPES=void 0;const n=e("@metamask/key-tree"),s=e("@metamask/superstruct"),a=e("@metamask/utils"),i=e("../array.cjs"),o=e("../cronjob.cjs"),c=e("../entropy.cjs"),u=e("../json-rpc.cjs"),l=e("../namespace.cjs"),d=e("../snaps.cjs"),m=e("../structs.cjs"),p=e("../types.cjs"),h=[c.SIP_6_MAGIC_VALUE,c.STATE_ENCRYPTION_MAGIC_VALUE];r.FORBIDDEN_COIN_TYPES=[60];const f=r.FORBIDDEN_COIN_TYPES.map((e=>["m","44'",`${e}'`]));r.Bip32PathStruct=(0,s.refine)((0,s.array)((0,s.string)()),"BIP-32 path",(e=>0===e.length?"Path must be a non-empty BIP-32 derivation path array":"m"!==e[0]?'Path must start with "m".':e.length<3?"Paths must have a length of at least three.":e.slice(1).some((e=>!(0,n.isValidBIP32PathSegment)(e)))?"Path must be a valid BIP-32 derivation path array.":h.includes(e[1])?`The purpose "${e[1]}" is not allowed for entropy derivation.`:!f.some((t=>(0,i.isEqual)(e.slice(0,t.length),t)))||`The path "${e.join("/")}" is not allowed for entropy derivation.`));r.bip32entropy=e=>(0,s.refine)(e,"BIP-32 entropy",(e=>"ed25519"!==e.curve||!e.path.slice(1).some((e=>!e.endsWith("'")))||"Ed25519 does not support unhardened paths.")),r.CurveStruct=(0,s.enums)(["ed25519","secp256k1","ed25519Bip32"]),r.Bip32EntropyStruct=(0,r.bip32entropy)((0,s.type)({path:r.Bip32PathStruct,curve:r.CurveStruct})),r.SnapGetBip32EntropyPermissionsStruct=(0,s.size)((0,s.array)(r.Bip32EntropyStruct),1,Infinity),r.SemVerRangeStruct=(0,s.refine)((0,s.string)(),"SemVer range",(e=>!!(0,a.isValidSemVerRange)(e)||"Expected a valid SemVer range.")),r.SnapIdsStruct=(0,s.refine)((0,s.record)(d.SnapIdStruct,(0,s.object)({version:(0,s.optional)(r.SemVerRangeStruct)})),"SnapIds",(e=>0!==Object.keys(e).length)),r.ChainIdsStruct=(0,s.size)((0,s.array)(l.ChainIdStruct),1,Infinity),r.LookupMatchersStruct=(0,s.union)([(0,s.object)({tlds:(0,s.size)((0,s.array)((0,s.string)()),1,Infinity)}),(0,s.object)({schemes:(0,s.size)((0,s.array)((0,s.string)()),1,Infinity)}),(0,s.object)({tlds:(0,s.size)((0,s.array)((0,s.string)()),1,Infinity),schemes:(0,s.size)((0,s.array)((0,s.string)()),1,Infinity)})]),r.MINIMUM_REQUEST_TIMEOUT=(0,a.inMilliseconds)(5,a.Duration.Second),r.MAXIMUM_REQUEST_TIMEOUT=(0,a.inMilliseconds)(3,a.Duration.Minute),r.MaxRequestTimeStruct=(0,s.size)((0,s.integer)(),r.MINIMUM_REQUEST_TIMEOUT,r.MAXIMUM_REQUEST_TIMEOUT),r.ProtocolScopesStruct=(0,s.record)(a.CaipChainIdStruct,(0,s.object)({methods:(0,s.array)((0,s.string)())})),r.HandlerCaveatsStruct=(0,s.object)({maxRequestTime:(0,s.optional)(r.MaxRequestTimeStruct)}),r.EmptyObjectStruct=(0,s.object)({}),r.PermissionsStruct=(0,s.type)({"endowment:assets":(0,s.optional)((0,m.mergeStructs)(r.HandlerCaveatsStruct,(0,s.object)({scopes:r.ChainIdsStruct}))),"endowment:cronjob":(0,s.optional)((0,m.mergeStructs)(r.HandlerCaveatsStruct,(0,s.object)({jobs:(0,s.optional)(o.CronjobSpecificationArrayStruct)}))),"endowment:ethereum-provider":(0,s.optional)(r.EmptyObjectStruct),"endowment:keyring":(0,s.optional)((0,m.mergeStructs)(r.HandlerCaveatsStruct,u.KeyringOriginsStruct)),"endowment:protocol":(0,s.optional)((0,m.mergeStructs)(r.HandlerCaveatsStruct,(0,s.object)({scopes:r.ProtocolScopesStruct}))),"endowment:lifecycle-hooks":(0,s.optional)(r.HandlerCaveatsStruct),"endowment:name-lookup":(0,s.optional)((0,m.mergeStructs)(r.HandlerCaveatsStruct,(0,s.object)({chains:(0,s.optional)(r.ChainIdsStruct),matchers:(0,s.optional)(r.LookupMatchersStruct)}))),"endowment:network-access":(0,s.optional)(r.EmptyObjectStruct),"endowment:page-home":(0,s.optional)(r.HandlerCaveatsStruct),"endowment:rpc":(0,s.optional)((0,m.mergeStructs)(r.HandlerCaveatsStruct,u.RpcOriginsStruct)),"endowment:signature-insight":(0,s.optional)((0,m.mergeStructs)(r.HandlerCaveatsStruct,(0,s.object)({allowSignatureOrigin:(0,s.optional)((0,s.boolean)())}))),"endowment:transaction-insight":(0,s.optional)((0,m.mergeStructs)(r.HandlerCaveatsStruct,(0,s.object)({allowTransactionOrigin:(0,s.optional)((0,s.boolean)())}))),"endowment:webassembly":(0,s.optional)(r.EmptyObjectStruct),snap_dialog:(0,s.optional)(r.EmptyObjectStruct),snap_manageState:(0,s.optional)(r.EmptyObjectStruct),snap_manageAccounts:(0,s.optional)(r.EmptyObjectStruct),snap_notify:(0,s.optional)(r.EmptyObjectStruct),snap_getBip32Entropy:(0,s.optional)(r.SnapGetBip32EntropyPermissionsStruct),snap_getBip32PublicKey:(0,s.optional)(r.SnapGetBip32EntropyPermissionsStruct),snap_getBip44Entropy:(0,s.optional)((0,s.size)((0,s.array)((0,s.object)({coinType:(0,s.size)((0,s.integer)(),0,2**32-1)})),1,Infinity)),snap_getEntropy:(0,s.optional)(r.EmptyObjectStruct),snap_getLocale:(0,s.optional)(r.EmptyObjectStruct),wallet_snap:(0,s.optional)(r.SnapIdsStruct)}),r.SnapAuxilaryFilesStruct=(0,s.array)((0,s.string)()),r.InitialConnectionsStruct=(0,s.record)((0,s.intersection)([(0,s.string)(),(0,p.uri)()]),(0,s.object)({})),r.SnapManifestStruct=(0,s.object)({version:a.VersionStruct,description:(0,s.size)((0,s.string)(),1,280),proposedName:(0,s.size)((0,s.string)(),1,214),repository:(0,s.optional)((0,s.type)({type:(0,s.size)((0,s.string)(),1,Infinity),url:(0,s.size)((0,s.string)(),1,Infinity)})),source:(0,s.object)({shasum:a.ChecksumStruct,location:(0,s.object)({npm:(0,s.object)({filePath:(0,s.size)((0,s.string)(),1,Infinity),iconPath:(0,s.optional)((0,s.size)((0,s.string)(),1,Infinity)),packageName:p.NameStruct,registry:(0,s.union)([(0,s.literal)("https://registry.npmjs.org"),(0,s.literal)("https://registry.npmjs.org/")])})}),files:(0,s.optional)(r.SnapAuxilaryFilesStruct),locales:(0,s.optional)(r.SnapAuxilaryFilesStruct)}),initialConnections:(0,s.optional)(r.InitialConnectionsStruct),initialPermissions:r.PermissionsStruct,manifestVersion:(0,s.literal)("0.1"),platformVersion:(0,s.optional)(a.VersionStruct),$schema:(0,s.optional)((0,s.string)())}),r.isSnapManifest=function(e){return(0,s.is)(e,r.SnapManifestStruct)},r.assertIsSnapManifest=function(e){(0,a.assertStruct)(e,r.SnapManifestStruct,`"${p.NpmSnapFileNames.Manifest}" is invalid`)},r.createSnapManifest=function(e){return(0,s.create)(e,r.SnapManifestStruct)}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/manifest/validation.cjs"}],[2124,{"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isNamespace=r.isAccountIdArray=r.isAccountId=r.isChainId=r.isNamespaceId=r.NamespaceIdStruct=r.NamespaceStruct=r.ChainStruct=r.AccountAddressStruct=r.AccountIdArrayStruct=r.AccountIdStruct=r.ChainIdStruct=r.ChainIdStringStruct=r.LimitedString=r.parseAccountId=r.parseChainId=r.ACCOUNT_ADDRESS_REGEX=r.ACCOUNT_ID_REGEX=r.CHAIN_ID_REGEX=void 0;const n=e("@metamask/superstruct");r.CHAIN_ID_REGEX=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-a-zA-Z0-9]{1,32})$/u,r.ACCOUNT_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-a-zA-Z0-9]{1,32})):(?<accountAddress>[a-zA-Z0-9]{1,64})$/u,r.ACCOUNT_ADDRESS_REGEX=/^(?<accountAddress>[a-zA-Z0-9]{1,64})$/u,r.parseChainId=function(e){const t=r.CHAIN_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}},r.parseAccountId=function(e){const t=r.ACCOUNT_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.LimitedString=(0,n.size)((0,n.string)(),1,40),r.ChainIdStringStruct=(0,n.define)("Chain ID",(0,n.string)().validator),r.ChainIdStruct=(0,n.pattern)(r.ChainIdStringStruct,r.CHAIN_ID_REGEX),r.AccountIdStruct=(0,n.pattern)((0,n.string)(),r.ACCOUNT_ID_REGEX),r.AccountIdArrayStruct=(0,n.array)(r.AccountIdStruct),r.AccountAddressStruct=(0,n.pattern)((0,n.string)(),r.ACCOUNT_ADDRESS_REGEX),r.ChainStruct=(0,n.object)({id:r.ChainIdStruct,name:r.LimitedString}),r.NamespaceStruct=(0,n.object)({chains:(0,n.array)(r.ChainStruct),methods:(0,n.optional)((0,n.array)(r.LimitedString)),events:(0,n.optional)((0,n.array)(r.LimitedString))}),r.NamespaceIdStruct=(0,n.pattern)((0,n.string)(),/^[-a-z0-9]{3,8}$/u),r.isNamespaceId=function(e){return(0,n.is)(e,r.NamespaceIdStruct)},r.isChainId=function(e){return(0,n.is)(e,r.ChainIdStruct)},r.isAccountId=function(e){return(0,n.is)(e,r.AccountIdStruct)},r.isAccountIdArray=function(e){return(0,n.is)(e,r.AccountIdArrayStruct)},r.isNamespace=function(e){return(0,n.is)(e,r.NamespaceStruct)}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/namespace.cjs"}],[2125,{"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.normalizeRelative=void 0;const n=e("@metamask/utils");r.normalizeRelative=function(e){return(0,n.assert)(!e.startsWith("/")),(0,n.assert)(-1===e.search(/:|\/\//u),`Path "${e}" potentially an URI instead of local relative`),e.startsWith("./")?e.slice(2):e}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/path.cjs"}],[2126,{"@metamask/snaps-sdk/package.json":2831},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.getPlatformVersion=void 0;const s=n(e("@metamask/snaps-sdk/package.json"));r.getPlatformVersion=function(){return s.default.version}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/platform-version.cjs"}],[2127,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/promise.cjs"}],[2128,{"./caveats.cjs":2103,"./checksum.cjs":2104,"./types.cjs":2132,"@metamask/superstruct":2872,"@metamask/utils":2950,"@scure/base":3027,"fast-json-stable-stringify":4434,"validate-npm-package-name":5679},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.verifyRequestedSnapPermissions=r.isSnapPermitted=r.isCaipChainId=r.assertIsValidSnapId=r.isSnapId=r.stripSnapPrefix=r.getSnapPrefix=r.SnapIdStruct=r.HttpSnapIdStruct=r.NpmSnapIdStruct=r.LocalSnapIdStruct=r.BaseSnapIdStruct=r.LOCALHOST_HOSTNAMES=r.validateSnapShasum=r.getSnapChecksum=r.SnapStatusEvents=r.SnapStatus=r.PROPOSED_NAME_REGEX=void 0;const s=e("@metamask/superstruct"),a=e("@metamask/utils"),i=e("@scure/base"),o=n(e("fast-json-stable-stringify")),c=n(e("validate-npm-package-name")),u=e("./caveats.cjs"),l=e("./checksum.cjs"),d=e("./types.cjs");var m,p;function h(e){const t=e.clone();return delete t.result.source.shasum,t.value=(0,o.default)(t.result),t}async function f(e){const{manifest:t,sourceCode:r,svgIcon:n,auxiliaryFiles:s,localizationFiles:a}=e,o=[h(t),r,n,...s,...a].filter((e=>e!==undefined));return i.base64.encode(await(0,l.checksumFiles)(o))}r.PROPOSED_NAME_REGEX=/^(?:[A-Za-z0-9-_]+( [A-Za-z0-9-_]+)*)|(?:(?:@[A-Za-z0-9-*~][A-Za-z0-9-*._~]*\/)?[A-Za-z0-9-~][A-Za-z0-9-._~]*)$/u,function(e){e.Installing="installing",e.Updating="updating",e.Running="running",e.Stopped="stopped",e.Crashed="crashed"}(m||(r.SnapStatus=m={})),function(e){e.Start="START",e.Stop="STOP",e.Crash="CRASH",e.Update="UPDATE"}(p||(r.SnapStatusEvents=p={})),r.getSnapChecksum=f,r.validateSnapShasum=async function(e,t="Invalid Snap manifest: manifest shasum does not match computed shasum."){if(e.manifest.result.source.shasum!==await f(e))throw new Error(t)},r.LOCALHOST_HOSTNAMES=["localhost","127.0.0.1","[::1]"],r.BaseSnapIdStruct=(0,s.pattern)((0,s.string)(),/^[\x21-\x7E]*$/u);const g=(0,d.uri)({protocol:(0,s.enums)(["http:","https:"]),hostname:(0,s.enums)(r.LOCALHOST_HOSTNAMES),hash:(0,s.empty)((0,s.string)()),search:(0,s.empty)((0,s.string)())});function y(e){const t=Object.values(d.SnapIdPrefixes).find((t=>e.startsWith(t)));if(t!==undefined)return t;throw new Error(`Invalid or no prefix found for "${e}"`)}r.LocalSnapIdStruct=(0,s.refine)(r.BaseSnapIdStruct,"local Snap Id",(e=>{if(!e.startsWith(d.SnapIdPrefixes.local))return`Expected local snap ID, got "${e}".`;const[t]=(0,s.validate)(e.slice(d.SnapIdPrefixes.local.length),g);return t??!0})),r.NpmSnapIdStruct=(0,s.intersection)([r.BaseSnapIdStruct,(0,d.uri)({protocol:(0,s.literal)(d.SnapIdPrefixes.npm),pathname:(0,s.refine)((0,s.string)(),"package name",(function*(e){const t=e.startsWith("/")?e.slice(1):e,{errors:r,validForNewPackages:n,warnings:s}=(0,c.default)(t);return n||(r===undefined?((0,a.assert)(s!==undefined),yield*s):yield*r),!0})),search:(0,s.empty)((0,s.string)()),hash:(0,s.empty)((0,s.string)())})]),r.HttpSnapIdStruct=(0,s.intersection)([r.BaseSnapIdStruct,(0,d.uri)({protocol:(0,s.enums)(["http:","https:"]),search:(0,s.empty)((0,s.string)()),hash:(0,s.empty)((0,s.string)())})]),r.SnapIdStruct=(0,s.union)([r.NpmSnapIdStruct,r.LocalSnapIdStruct]),r.getSnapPrefix=y,r.stripSnapPrefix=function(e){return e.replace(y(e),"")},r.isSnapId=function(e){return(0,s.is)(e,r.SnapIdStruct)},r.assertIsValidSnapId=function(e){(0,a.assertStruct)(e,r.SnapIdStruct,"Invalid snap ID")},r.isCaipChainId=function(e){return"string"==typeof e&&/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-a-zA-Z0-9]{1,32})$/u.test(e)},r.isSnapPermitted=function(e,t){return Boolean((e?.wallet_snap?.caveats?.find((e=>e.type===u.SnapCaveatType.SnapIds))??{}).value?.[t])},r.verifyRequestedSnapPermissions=function(e){(0,a.assert)((0,a.isObject)(e),"Requested permissions must be an object.");const{wallet_snap:t}=e;(0,a.assert)((0,a.isObject)(t),"wallet_snap is missing from the requested permissions.");const{caveats:r}=t;(0,a.assert)(Array.isArray(r)&&1===r.length,"wallet_snap must have a caveat property with a single-item array value.");const[n]=r;(0,a.assert)((0,a.isObject)(n)&&n.type===u.SnapCaveatType.SnapIds&&(0,a.isObject)(n.value),`The requested permissions do not have a valid ${u.SnapCaveatType.SnapIds} caveat.`)}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/snaps.cjs"}],[2129,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.indent=void 0,r.indent=function(e,t=2){return e.replace(/^/gmu," ".repeat(t))}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/strings.cjs"}],[2130,{"./strings.cjs":2129,"@metamask/snaps-sdk":2746,"@metamask/superstruct":2872,"@metamask/utils":2950,chalk:4094},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.mergeStructs=r.createUnion=r.validateUnion=r.getStructErrorMessage=r.getStructFailureMessage=r.getStructErrorPrefix=r.getUnionStructNames=r.getStructFromPath=r.createFromStruct=r.getError=r.arrayToGenerator=r.SnapsStructError=r.named=void 0;const n=e("@metamask/snaps-sdk"),s=e("@metamask/superstruct"),a=e("@metamask/utils"),i=e("chalk"),o=e("./strings.cjs");function c(e,t,r){return r?t(e):e}r.named=function(e,t){return new s.Struct({...t,type:e})};class u extends s.StructError{constructor(e,t,r,n,s,a=!0){super(n,s),this.name="SnapsStructError",this.message=`${t}.\n\n${g(e,[...s()],a)}${r?`\n\n${r}`:""}`}}function*l(e){for(const t of e)yield t}function d({struct:e,prefix:t,suffix:r="",error:n,colorize:s}){return new u(e,t,r,n,(()=>l(n.failures())),s)}function m(e,t){return t.reduce(((t,r)=>(0,a.isObject)(e.schema)&&e.schema[r]?e.schema[r]:t),e)}function p(e,t=!0){return Array.isArray(e.schema)?e.schema.map((({type:e})=>c(e,i.green,t))):null}function h(e,t=!0){return"never"===e.type||0===e.path.length?"":`At path: ${c(e.path.join("."),i.bold,t)}`}function f(e,t,r=!0){const n=c(JSON.stringify(t.value),i.red,r),s=h(t,r);if("union"===t.type){const a=p(m(e,t.path),r);return a?`${s}Expected the value to be one of: ${a.join(", ")}, but received: ${n}.`:`${s}${t.message}.`}if("literal"===t.type){return`${s}${t.message.replace(/the literal `(.+)`,/u,`the value to be \`${c("$1",i.green,r)}\`,`).replace(/, but received: (.+)/u,`, but received: ${c("$1",i.red,r)}`)}.`}if("never"===t.type)return`Unknown key: ${c(t.path.join("."),i.bold,r)}, received: ${n}.`;if("size"===t.refinement){return`${s}${t.message.replace(/length between `(\d+)` and `(\d+)`/u,`length between ${c("$1",i.green,r)} and ${c("$2",i.green,r)},`).replace(/length of `(\d+)`/u,`length of ${c("$1",i.red,r)}`).replace(/a array/u,"an array")}.`}return t.refinement!==undefined?`${s}${t.message}.`:`${s}Expected a value of type ${c(t.type,i.green,r)}, but received: ${n}.`}function g(e,t,r=!0){return t.map((t=>(0,o.indent)(`${f(e,t,r)}`))).join("\n")}function y(e,t,r,i=!1){(0,a.assert)(t.schema,"Expected a struct with a schema. Make sure to use `union` from `@metamask/snaps-sdk`."),(0,a.assert)(t.schema.length>0,"Expected a non-empty array of structs.");const o=t.schema.map((e=>e.schema[r])),c=(0,s.type)({[r]:(0,n.union)(o)}),[u]=(0,s.validate)(e,c,{coerce:i});if(u)throw new Error(f(c,u.failures()[0],!1));const l=e,d=t.schema.filter((e=>(0,s.is)(l[r],e.schema[r])));(0,a.assert)(d.length>0,"Expected a struct to match the value.");const m=d.map((e=>(0,s.validate)(l,e,{coerce:i}))),p=m.find((([e])=>!e));if(p)return p[1];(0,a.assert)(m[0][0],"Expected at least one error.");const h=m.reduce(((e,[t])=>((0,a.assert)(t,"Expected an error."),t.failures().length<e.failures().length?t:e)),m[0][0]);throw new Error(f(t,h.failures()[0],!1))}r.SnapsStructError=u,r.arrayToGenerator=l,r.getError=d,r.createFromStruct=function(e,t,r,n=""){try{return(0,s.create)(e,t)}catch(e){if(e instanceof s.StructError)throw d({struct:t,prefix:r,suffix:n,error:e});throw e}},r.getStructFromPath=m,r.getUnionStructNames=p,r.getStructErrorPrefix=h,r.getStructFailureMessage=f,r.getStructErrorMessage=g,r.validateUnion=y,r.createUnion=function(e,t,r){return y(e,t,r,!0)},r.mergeStructs=function(...e){const t=s.assign(...e);return new s.Struct({...t,*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/structs.cjs"}],[2131,{"@metamask/utils":2950,"fast-xml-parser":4436},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isSvg=r.parseSvg=void 0;const n=e("@metamask/utils"),s=e("fast-xml-parser");function a(e){try{const t=e.trim();(0,n.assert)(t.length>0);const r=new s.XMLParser({ignoreAttributes:!1,parseAttributeValue:!0}).parse(t,!0);return(0,n.assert)((0,n.hasProperty)(r,"svg")),(0,n.isObject)(r.svg)?r.svg:{}}catch{throw new Error("Snap icon must be a valid SVG.")}}r.parseSvg=a,r.isSvg=function(e){try{return a(e),!0}catch{return!1}}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/svg.cjs"}],[2132,{"@metamask/superstruct":2872,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.WALLET_SNAP_PERMISSION_KEY=r.isValidUrl=r.uri=r.SNAP_STREAM_NAMES=r.SnapIdPrefixes=r.NpmSnapPackageJsonStruct=r.NameStruct=r.NpmSnapFileNames=void 0;const n=e("@metamask/superstruct"),s=e("@metamask/utils");var a,i,o;!function(e){e.PackageJson="package.json",e.Manifest="snap.manifest.json"}(a||(r.NpmSnapFileNames=a={})),r.NameStruct=(0,n.size)((0,n.pattern)((0,n.string)(),/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u),1,214),r.NpmSnapPackageJsonStruct=(0,n.type)({version:s.VersionStruct,name:r.NameStruct,main:(0,n.optional)((0,n.size)((0,n.string)(),1,Infinity)),repository:(0,n.optional)((0,n.type)({type:(0,n.size)((0,n.string)(),1,Infinity),url:(0,n.size)((0,n.string)(),1,Infinity)}))}),function(e){e.npm="npm:",e.local="local:"}(i||(r.SnapIdPrefixes=i={})),function(e){e.JSON_RPC="jsonRpc",e.COMMAND="command"}(o||(r.SNAP_STREAM_NAMES=o={}));r.uri=(e={})=>(0,n.refine)((0,n.union)([(0,n.string)(),(0,n.instance)(URL)]),"uri",(t=>{try{const r=new URL(t),s=(0,n.type)(e);return(0,n.assert)(r,s),!0}catch{return`Expected URL, got "${t.toString()}".`}})),r.isValidUrl=function(e,t={}){return(0,n.is)(e,(0,r.uri)(t))},r.WALLET_SNAP_PERMISSION_KEY="wallet_snap"}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/types.cjs"}],[2133,{"./url.cjs":2134,"@metamask/snaps-sdk":2746,"@metamask/snaps-sdk/jsx":2830,"@metamask/snaps-sdk/jsx-runtime":2829,"@metamask/utils":2950,marked:4866},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.serialiseJsx=r.walkJsx=r.getJsxChildren=r.hasChildren=r.getTotalTextLength=r.validateJsxLinks=r.validateTextLinks=r.validateLink=r.getJsxElementFromComponent=r.getTextChildren=void 0;const n=e("@metamask/snaps-sdk/jsx-runtime"),s=e("@metamask/snaps-sdk"),a=e("@metamask/snaps-sdk/jsx"),i=e("@metamask/utils"),o=e("marked"),c=e("./url.cjs"),u=5e4,l=["https:","mailto:","metamask:"];function d(e){switch(e){case"primary":return"primary";case"secondary":return"destructive";default:return undefined}}function m(e){return 1===e.length?e[0]:e}function p(e){return e.tokens&&e.tokens.length>0?m(e.tokens.flatMap(f)):e.href}function h(e){return m(e.flatMap(f))}function f(e){switch(e.type){case"link":return(0,n.jsx)(a.Link,{href:e.href,children:p(e)});case"text":return e.text;case"strong":return(0,n.jsx)(a.Bold,{children:h(e.tokens)});case"em":return(0,n.jsx)(a.Italic,{children:h(e.tokens)});default:return null}}function g(e){const t=(0,o.lexer)(e,{gfm:!1}),r=[];return(0,o.walkTokens)(t,(e=>{if("paragraph"===e.type){r.length>0&&r.push("\n\n");const{tokens:t}=e;r.push(...t.flatMap(f))}})),r.filter((e=>null!==e))}function y(e,t,r){try{const n=new URL(e);if((0,i.assert)(l.includes(n.protocol),`Protocol must be one of: ${l.join(", ")}.`),"metamask:"===n.protocol){const t=(0,c.parseMetaMaskUrl)(e);t.snapId&&(0,i.assert)(r(t.snapId),"The Snap being navigated to is not installed.")}else if("mailto:"===n.protocol){const e=n.pathname.split(",");for(const r of e){const e=r.split("@")[1];(0,i.assert)(!e.includes(":"));const n=`https://${e}`;(0,i.assert)(!t(n),"The specified URL is not allowed.")}return}(0,i.assert)(!t(n.href),"The specified URL is not allowed.")}catch(e){throw new Error(`Invalid URL: ${"ERR_ASSERTION"===e?.code?e.message:"Unable to parse URL."}`)}}function b(e){const{type:t}=e;switch(t){case s.NodeType.Panel:return e.children.reduce(((e,t)=>e+b(t)),0);case s.NodeType.Row:return b(e.value);case s.NodeType.Text:return e.value.length;default:return 0}}function k(e){return(0,i.hasProperty)(e.props,"children")}function w(e){return Boolean(e)&&!0!==e}function S(e){if(k(e)){if(Array.isArray(e.props.children))return e.props.children.filter(w).flat(Infinity);if(e.props.children)return[e.props.children]}return[]}function _(e,t,r=0){if(Array.isArray(e)){for(const n of e){const e=_(n,t,r);if(e!==undefined)return e}return undefined}const n=t(e,r);if(n!==undefined)return n;if((0,i.hasProperty)(e,"props")&&(0,i.isPlainObject)(e.props)&&(0,i.hasProperty)(e.props,"children")){const n=S(e);for(const e of n)if((0,i.isPlainObject)(e)){const n=_(e,t,r+1);if(n!==undefined)return n}}return undefined}function v(e){return Object.entries(e).filter((([e])=>"children"!==e)).sort((([e],[t])=>e.localeCompare(t))).map((([e,t])=>{return` ${e}=${r=t,"string"==typeof r?`"${r}"`:`{${JSON.stringify(r)}}`}`;var r})).join("")}r.getTextChildren=g,r.getJsxElementFromComponent=function(e){return function(e){const t=b(e);(0,i.assert)(t<=u,`The text in a Snap UI may not be larger than ${u/1e3} kB.`)}(e),function e(t){switch(t.type){case s.NodeType.Address:return(0,n.jsx)(a.Address,{address:t.value});case s.NodeType.Button:return(0,n.jsx)(a.Button,{name:t.name,variant:d(t.variant),type:t.buttonType,children:t.value});case s.NodeType.Copyable:return(0,n.jsx)(a.Copyable,{value:t.value,sensitive:t.sensitive});case s.NodeType.Divider:return(0,n.jsx)(a.Divider,{});case s.NodeType.Form:return(0,n.jsx)(a.Form,{name:t.name,children:m(t.children.map(e))});case s.NodeType.Heading:return(0,n.jsx)(a.Heading,{children:t.value});case s.NodeType.Image:return(0,n.jsx)(a.Image,{src:t.value});case s.NodeType.Input:return(0,n.jsx)(a.Field,{label:t.label,error:t.error,children:(0,n.jsx)(a.Input,{name:t.name,type:t.inputType,value:t.value,placeholder:t.placeholder})});case s.NodeType.Panel:return(0,n.jsx)(a.Box,{children:m(t.children.map(e))});case s.NodeType.Row:return(0,n.jsx)(a.Row,{label:t.label,variant:t.variant,children:e(t.value)});case s.NodeType.Spinner:return(0,n.jsx)(a.Spinner,{});case s.NodeType.Text:return(0,n.jsx)(a.Text,{children:m(g(t.value))});default:return(0,i.assertExhaustive)(t)}}(e)},r.validateLink=y,r.validateTextLinks=function(e,t,r){const n=function(e){const t=(0,o.lexer)(e,{gfm:!1}),r=[];return(0,o.walkTokens)(t,(e=>{"link"===e.type&&r.push(e)})),r}(e);for(const e of n)y(e.href,t,r)},r.validateJsxLinks=function(e,t,r){_(e,(e=>{"Link"===e.type&&y(e.props.href,t,r)}))},r.getTotalTextLength=b,r.hasChildren=k,r.getJsxChildren=S,r.walkJsx=_,r.serialiseJsx=function e(t,r=0){if(Array.isArray(t))return t.map((t=>e(t,r))).join("");const n=" ".repeat(r);if("string"==typeof t)return`${n}${t}\n`;if(!t)return"";const{type:s,props:a}=t,o=r>0?"\n":"";if((0,i.hasProperty)(a,"children")){const t=e(a.children,r+1);return`${n}<${s}${v(a)}>\n${t}${n}</${s}>${o}`}return`${n}<${s}${v(a)} />${o}`}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/ui.cjs"}],[2134,{"./snaps.cjs":2128,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.parseMetaMaskUrl=r.SNAP_PATHS=r.CLIENT_PATHS=void 0;const n=e("@metamask/utils"),s=e("./snaps.cjs");r.CLIENT_PATHS=["/"],r.SNAP_PATHS=["/home"],r.parseMetaMaskUrl=function(e){const t=new URL(e),{protocol:a}=t;if("metamask:"!==a)throw new Error(`Unable to parse URL. Expected the protocol to be "metamask:", but received "${a}".`);const[i,...o]=t.href.replace("metamask://","").split("/"),c=`/${o.join("/")}`;switch(i){case"client":return(0,n.assert)(r.CLIENT_PATHS.includes(c),`Unable to navigate to "${c}". The provided path is not allowed.`),{authority:i,path:c};case"snap":return function(e){const t="Invalid MetaMask url:",a=(0,s.stripSnapPrefix)(e.slice(1)),i=e.slice(1).startsWith("npm:")?"npm:":"local:",o=a.startsWith("@"),c=a.split("/"),u=`/${c[c.length-1]}`;let l;if("local:"===i){const[e,,...s]=c.slice(0,-1);l=`${e}//${s.join("/")}`,(0,n.assert)(r.SNAP_PATHS.includes(u),`${t} invalid snap path.`)}else l=o?`${c[0]}/${c[1]}`:c[0],(0,n.assert)(o?3===c.length&&r.SNAP_PATHS.includes(u):2===c.length&&r.SNAP_PATHS.includes(u),`${t} invalid snap path.`);const d=`${i}${l}`;return(0,s.assertIsValidSnapId)(d),{authority:"snap",snapId:d,path:u}}(c);default:throw new Error(`Expected "metamask:" URL to start with "client" or "snap", but received "${i}".`)}}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/url.cjs"}],[2135,{"./icon.cjs":2115,"./localization.cjs":2120,"./manifest/validation.cjs":2123,"./snaps.cjs":2128},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.validateFetchedSnap=void 0;const n=e("./icon.cjs"),s=e("./localization.cjs"),a=e("./manifest/validation.cjs"),i=e("./snaps.cjs");r.validateFetchedSnap=async function(e){(0,a.assertIsSnapManifest)(e.manifest.result),await(0,i.validateSnapShasum)(e),(0,s.validateSnapManifestLocalizations)(e.manifest.result,e.localizationFiles.map((e=>e.result))),e.svgIcon&&(0,n.assertIsSnapIcon)(e.svgIcon)}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/validation.cjs"}],[2136,{"@metamask/superstruct":2872,"@metamask/utils":2950,semver:5547},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.resolveVersionRange=r.getTargetVersion=r.DEFAULT_REQUESTED_SNAP_VERSION=void 0;const n=e("@metamask/superstruct"),s=e("@metamask/utils"),a=e("semver");r.DEFAULT_REQUESTED_SNAP_VERSION="*",r.getTargetVersion=function(e,t){const r=(0,a.maxSatisfying)(e,t);return r||(0,a.maxSatisfying)(e,t,{includePrerelease:!0})},r.resolveVersionRange=function(e){return e===undefined||"latest"===e?[undefined,r.DEFAULT_REQUESTED_SNAP_VERSION]:(0,n.validate)(e,s.VersionRangeStruct)}}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/versions.cjs"}],[2137,{"../deep-clone.cjs":2108,"@metamask/utils":2950,"@scure/base":3027},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.VirtualFile=void 0;const n=e("@metamask/utils"),s=e("@scure/base"),a=e("../deep-clone.cjs");class i{constructor(e){let t;t="string"==typeof e||e instanceof Uint8Array?{value:e}:e,this.value=t?.value??"",this.result=t?.result??undefined,this.data=t?.data??{},this.path=t?.path??"/"}get size(){return"string"==typeof this.value?this.value.length:this.value.byteLength}toString(e){if("string"==typeof this.value)return(0,n.assert)(e===undefined,"Tried to encode string."),this.value;if(this.value instanceof Uint8Array&&"hex"===e)return(0,n.bytesToHex)(this.value);if(this.value instanceof Uint8Array&&"base64"===e)return s.base64.encode(this.value);return new TextDecoder(e).decode(this.value)}clone(){const e=new i;return"string"==typeof this.value?e.value=this.value:e.value=this.value.slice(0),e.result=(0,a.deepClone)(this.result),e.data=(0,a.deepClone)(this.data),e.path=this.path,e}}r.VirtualFile=i}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/virtual-file/VirtualFile.cjs"}],[2138,{"./VirtualFile.cjs":2137},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./VirtualFile.cjs"),r)}}},{package:"@metamask/multichain-transactions-controller>@metamask/snaps-utils",file:"node_modules/@metamask/multichain-transactions-controller/node_modules/@metamask/snaps-utils/dist/virtual-file/index.cjs"}],[2139,{"../scope/constants.cjs":2152,"../scope/transform.cjs":2156,"../scope/types.cjs":2157,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.setEthAccounts=r.getEthAccounts=void 0;const n=e("@metamask/utils"),s=e("../scope/constants.cjs"),a=e("../scope/transform.cjs"),i=e("../scope/types.cjs"),o=e=>{const{namespace:t}=(0,i.parseScopeString)(e);return t===n.KnownCaipNamespace.Eip155||e===s.KnownWalletScopeString.Eip155},c=e=>{const t=[];return Object.entries(e).forEach((([e,{accounts:r}])=>{r?.forEach((e=>{const{address:r,chainId:s}=(0,n.parseCaipAccountId)(e);o(s)&&((0,n.assertIsStrictHexString)(r),t.push(r))}))})),t};r.getEthAccounts=e=>{const{requiredScopes:t,optionalScopes:r}=e,n=[...c(t),...c(r)];return(0,a.getUniqueArrayItems)(n)};const u=(e,t)=>{const r={};return Object.entries(e).forEach((([e,s])=>{const a=e,c=a===n.KnownCaipNamespace.Wallet,{namespace:u,reference:l}=(0,i.parseScopeString)(a);if(!o(a)&&!c)return void(r[a]=s);let d=[];u&&l&&(d=t.map((e=>`${u}:${l}:${e}`))),r[a]={...s,accounts:d}})),r};r.setEthAccounts=(e,t)=>({...e,requiredScopes:u(e.requiredScopes,t),optionalScopes:u(e.optionalScopes,t)})}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/adapters/caip-permission-adapter-eth-accounts.cjs"}],[2140,{"../scope/transform.cjs":2156,"../scope/types.cjs":2157,"@metamask/controller-utils":1474,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.setPermittedEthChainIds=r.addPermittedEthChainId=r.getPermittedEthChainIds=void 0;const n=e("@metamask/controller-utils"),s=e("@metamask/utils"),a=e("../scope/transform.cjs"),i=e("../scope/types.cjs"),o=e=>{const t=[];return Object.keys(e).forEach((e=>{const{namespace:r,reference:a}=(0,i.parseScopeString)(e);r===s.KnownCaipNamespace.Eip155&&a&&t.push((0,n.toHex)(a))})),t};r.getPermittedEthChainIds=e=>{const{requiredScopes:t,optionalScopes:r}=e,n=[...o(t),...o(r)];return(0,a.getUniqueArrayItems)(n)};r.addPermittedEthChainId=(e,t)=>{const r=`eip155:${(0,s.hexToBigInt)(t).toString(10)}`;return Object.keys(e.requiredScopes).includes(r)||Object.keys(e.optionalScopes).includes(r)?e:{...e,optionalScopes:{...e.optionalScopes,[r]:{accounts:[]}}}};const c=(e,t)=>{const r={};return Object.entries(e).forEach((([e,a])=>{const o=e,{namespace:c,reference:u}=(0,i.parseScopeString)(o);if(u)if(c===s.KnownCaipNamespace.Eip155){const e=(0,n.toHex)(u);t.includes(e)&&(r[o]=a)}else r[o]=a;else r[o]=a})),r};r.setPermittedEthChainIds=(e,t)=>{let n={...e,requiredScopes:c(e.requiredScopes,t),optionalScopes:c(e.optionalScopes,t)};return t.forEach((e=>{n=(0,r.addPermittedEthChainId)(n,e)})),n}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/adapters/caip-permission-adapter-permittedChains.cjs"}],[2141,{"../scope/constants.cjs":2152,"../scope/transform.cjs":2156,"../scope/types.cjs":2157,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getSessionScopes=r.getInternalScopesObject=void 0;const n=e("@metamask/utils"),s=e("../scope/constants.cjs"),a=e("../scope/transform.cjs"),i=e("../scope/types.cjs");r.getInternalScopesObject=e=>{const t={};return Object.entries(e).forEach((([e,{accounts:r}])=>{t[e]={accounts:r}})),t};const o=e=>{const t={};return Object.entries(e).forEach((([e,{accounts:r}])=>{const a=e,{namespace:o,reference:c}=(0,i.parseScopeString)(a);let u=[],l=[];o===n.KnownCaipNamespace.Wallet?u=c?s.KnownWalletNamespaceRpcMethods[c]??[]:s.KnownWalletRpcMethods:(u=s.KnownRpcMethods[o]??[],l=s.KnownNotifications[o]??[]),t[a]={methods:u,notifications:l,accounts:r}})),t};r.getSessionScopes=e=>(0,a.mergeNormalizedScopes)(o(e.requiredScopes),o(e.optionalScopes))}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/adapters/caip-permission-adapter-session-scopes.cjs"}],[2142,{"./adapters/caip-permission-adapter-eth-accounts.cjs":2139,"./scope/assert.cjs":2150,"./scope/supported.cjs":2155,"./scope/transform.cjs":2156,"./scope/types.cjs":2157,"@metamask/permission-controller":2393,"@metamask/utils":2950,lodash:4855},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Caip25CaveatMutators=r.caip25EndowmentBuilder=r.caip25CaveatBuilder=r.diffScopesForCaip25CaveatValue=r.createCaip25Caveat=r.Caip25EndowmentPermissionName=r.Caip25CaveatType=void 0;const n=e("@metamask/permission-controller"),s=e("@metamask/utils"),a=e("lodash"),i=e("./adapters/caip-permission-adapter-eth-accounts.cjs"),o=e("./scope/assert.cjs"),c=e("./scope/supported.cjs"),u=e("./scope/transform.cjs"),l=e("./scope/types.cjs");r.Caip25CaveatType="authorizedScopes",r.Caip25EndowmentPermissionName="endowment:caip25";function d(e,t,r){const n=(0,a.cloneDeep)(e),s=t[r];for(const[e,t]of Object.entries(s)){const s=e,a=n[r][s];if(a){const e=t.accounts.filter((e=>!a?.accounts.includes(e)));if(e.length>0){n[r][s]={accounts:e};continue}delete n[r][s]}else n[r][s]=t}return n}r.createCaip25Caveat=e=>({type:r.Caip25CaveatType,value:e}),r.diffScopesForCaip25CaveatValue=d;r.caip25CaveatBuilder=({findNetworkClientIdByChainId:e,listAccounts:t})=>({type:r.Caip25CaveatType,validator:(n,a,u)=>{if(!(n.value&&(0,s.hasProperty)(n.value,"requiredScopes")&&(0,s.hasProperty)(n.value,"optionalScopes")&&(0,s.hasProperty)(n.value,"isMultichainOrigin")&&"boolean"==typeof n.value.isMultichainOrigin))throw new Error(`${r.Caip25EndowmentPermissionName} error: Received invalid value for caveat of type "${r.Caip25CaveatType}".`);const{requiredScopes:l,optionalScopes:d}=n.value;(0,o.assertIsInternalScopesObject)(l),(0,o.assertIsInternalScopesObject)(d);const m=t=>{try{return e(t),!0}catch(e){return!1}},p=Object.keys(l).every((e=>(0,c.isSupportedScopeString)(e,m))),h=Object.keys(d).every((e=>(0,c.isSupportedScopeString)(e,m)));if(!p||!h)throw new Error(`${r.Caip25EndowmentPermissionName} error: Received scopeString value(s) for caveat of type "${r.Caip25CaveatType}" that are not supported by the wallet.`);const f=t().map((e=>e.address));if(!(0,i.getEthAccounts)({requiredScopes:l,optionalScopes:d}).map((e=>e.toLowerCase())).every((e=>f.includes(e))))throw new Error(`${r.Caip25EndowmentPermissionName} error: Received eip155 account value(s) for caveat of type "${r.Caip25CaveatType}" that were not found in the wallet keyring.`)},merger:(e,t)=>{const r={requiredScopes:(0,u.mergeInternalScopes)(e.requiredScopes,t.requiredScopes),optionalScopes:(0,u.mergeInternalScopes)(e.optionalScopes,t.optionalScopes),isMultichainOrigin:e.isMultichainOrigin},n=d(e,r,"requiredScopes");return[r,d(n,r,"optionalScopes")]}});r.caip25EndowmentBuilder=Object.freeze({targetName:r.Caip25EndowmentPermissionName,specificationBuilder:()=>({permissionType:n.PermissionType.Endowment,targetName:r.Caip25EndowmentPermissionName,allowedCaveats:[r.Caip25CaveatType],endowmentGetter:e=>null,validator:e=>{if(1!==e.caveats?.length||e.caveats?.[0]?.type!==r.Caip25CaveatType)throw new Error(`${r.Caip25EndowmentPermissionName} error: Invalid caveats. There must be a single caveat of type "${r.Caip25CaveatType}".`)}})}),r.Caip25CaveatMutators={[r.Caip25CaveatType]:{removeScope:function(e,t){const r=Object.entries(e.requiredScopes).filter((([e])=>e!==t)),a=Object.entries(e.optionalScopes).filter((([e])=>e!==t)),i=r.length!==Object.keys(e.requiredScopes).length,o=a.length!==Object.keys(e.optionalScopes).length;if(!i&&!o)return{operation:n.CaveatMutatorOperation.Noop};const c={...e,requiredScopes:Object.fromEntries(r),optionalScopes:Object.fromEntries(a)};if([...r,...a].some((([e])=>{const{namespace:t}=(0,l.parseScopeString)(e);return t!==s.KnownCaipNamespace.Wallet})))return{operation:n.CaveatMutatorOperation.UpdateValue,value:c};return{operation:n.CaveatMutatorOperation.RevokePermission}},removeAccount:function(e,t){const r=(0,a.cloneDeep)(e);[r.requiredScopes,r.optionalScopes].forEach((e=>{Object.entries(e).forEach((([,e])=>{!function(e,t){e.accounts&&(e.accounts=e.accounts.filter(function(e){return t=>(0,s.parseCaipAccountId)(t).address!==e}(t)))}(e,t)}))}));if((0,a.isEqual)(r,e))return{operation:n.CaveatMutatorOperation.Noop};if([...Object.values(r.requiredScopes),...Object.values(r.optionalScopes)].some((({accounts:e})=>e.length>0)))return{operation:n.CaveatMutatorOperation.UpdateValue,value:r};return{operation:n.CaveatMutatorOperation.RevokePermission}}}}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/caip25Permission.cjs"}],[2143,{"../adapters/caip-permission-adapter-session-scopes.cjs":2141,"../caip25Permission.cjs":2142},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.walletGetSession=void 0;const n=e("../adapters/caip-permission-adapter-session-scopes.cjs"),s=e("../caip25Permission.cjs");r.walletGetSession={methodNames:["wallet_getSession"],implementation:async function(e,t,r,a,i){let o;try{o=i.getCaveatForOrigin(s.Caip25EndowmentPermissionName,s.Caip25CaveatType)}catch(e){}return o?(t.result={sessionScopes:(0,n.getSessionScopes)(o.value)},a()):(t.result={sessionScopes:{}},a())},hookNames:{getCaveatForOrigin:!0}}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/handlers/wallet-getSession.cjs"}],[2144,{"../adapters/caip-permission-adapter-session-scopes.cjs":2141,"../caip25Permission.cjs":2142,"../scope/assert.cjs":2150,"../scope/types.cjs":2157,"@metamask/rpc-errors":2554,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.walletInvokeMethod=void 0;const n=e("@metamask/rpc-errors"),s=e("@metamask/utils"),a=e("../adapters/caip-permission-adapter-session-scopes.cjs"),i=e("../caip25Permission.cjs"),o=e("../scope/assert.cjs"),c=e("../scope/types.cjs");r.walletInvokeMethod={methodNames:["wallet_invokeMethod"],implementation:async function(e,t,r,u,l){const{scope:d,request:m}=e.params;let p;(0,o.assertIsInternalScopeString)(d);try{p=l.getCaveatForOrigin(i.Caip25EndowmentPermissionName,i.Caip25CaveatType)}catch(e){}if(!p?.value?.isMultichainOrigin)return u(n.providerErrors.unauthorized());const h=(0,a.getSessionScopes)(p.value)[d];if(!h?.methods?.includes(m.method))return u(n.providerErrors.unauthorized());const{namespace:f,reference:g}=(0,c.parseScopeString)(d);let y;switch(f){case"wallet":y=l.getSelectedNetworkClientId();break;case"eip155":g&&(y=l.findNetworkClientIdByChainId((0,s.numberToHex)(parseInt(g,10))));break;default:return console.error("failed to resolve namespace for wallet_invokeMethod",e),u(n.rpcErrors.internal())}return y?(Object.assign(e,{scope:d,networkClientId:y,method:m.method,params:m.params}),r()):(console.error("failed to resolve network client for wallet_invokeMethod",e),u(n.rpcErrors.internal()))},hookNames:{getCaveatForOrigin:!0,findNetworkClientIdByChainId:!0,getSelectedNetworkClientId:!0}}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/handlers/wallet-invokeMethod.cjs"}],[2145,{"../caip25Permission.cjs":2142,"@metamask/permission-controller":2393,"@metamask/rpc-errors":2554},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.walletRevokeSession=void 0;const n=e("@metamask/permission-controller"),s=e("@metamask/rpc-errors"),a=e("../caip25Permission.cjs");r.walletRevokeSession={methodNames:["wallet_revokeSession"],implementation:async function(e,t,r,i,o){try{o.revokePermissionForOrigin(a.Caip25EndowmentPermissionName)}catch(e){if(!(e instanceof n.UnrecognizedSubjectError||e instanceof n.PermissionDoesNotExistError))return console.error(e),i(s.rpcErrors.internal())}return t.result=!0,i()},hookNames:{revokePermissionForOrigin:!0}}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/handlers/wallet-revokeSession.cjs"}],[2146,{"./adapters/caip-permission-adapter-eth-accounts.cjs":2139,"./adapters/caip-permission-adapter-permittedChains.cjs":2140,"./adapters/caip-permission-adapter-session-scopes.cjs":2141,"./caip25Permission.cjs":2142,"./handlers/wallet-getSession.cjs":2143,"./handlers/wallet-invokeMethod.cjs":2144,"./handlers/wallet-revokeSession.cjs":2145,"./middlewares/MultichainMiddlewareManager.cjs":2147,"./middlewares/MultichainSubscriptionManager.cjs":2148,"./middlewares/multichainMethodCallValidator.cjs":2149,"./scope/authorization.cjs":2151,"./scope/constants.cjs":2152,"./scope/filter.cjs":2154,"./scope/transform.cjs":2156,"./scope/types.cjs":2157},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Caip25CaveatMutators=r.caip25EndowmentBuilder=r.Caip25EndowmentPermissionName=r.createCaip25Caveat=r.Caip25CaveatType=r.caip25CaveatBuilder=r.normalizeAndMergeScopes=r.mergeInternalScopes=r.mergeNormalizedScopes=r.mergeScopeObject=r.normalizeScope=r.parseScopeString=r.getSupportedScopeObjects=r.KnownWalletScopeString=r.KnownNotifications=r.KnownWalletNamespaceRpcMethods=r.KnownRpcMethods=r.KnownWalletRpcMethods=r.bucketScopes=r.validateAndNormalizeScopes=r.MultichainSubscriptionManager=r.MultichainMiddlewareManager=r.multichainMethodCallValidatorMiddleware=r.walletRevokeSession=r.walletInvokeMethod=r.walletGetSession=r.getSessionScopes=r.getInternalScopesObject=r.setPermittedEthChainIds=r.addPermittedEthChainId=r.getPermittedEthChainIds=r.setEthAccounts=r.getEthAccounts=void 0;var n=e("./adapters/caip-permission-adapter-eth-accounts.cjs");Object.defineProperty(r,"getEthAccounts",{enumerable:!0,get:function(){return n.getEthAccounts}}),Object.defineProperty(r,"setEthAccounts",{enumerable:!0,get:function(){return n.setEthAccounts}});var s=e("./adapters/caip-permission-adapter-permittedChains.cjs");Object.defineProperty(r,"getPermittedEthChainIds",{enumerable:!0,get:function(){return s.getPermittedEthChainIds}}),Object.defineProperty(r,"addPermittedEthChainId",{enumerable:!0,get:function(){return s.addPermittedEthChainId}}),Object.defineProperty(r,"setPermittedEthChainIds",{enumerable:!0,get:function(){return s.setPermittedEthChainIds}});var a=e("./adapters/caip-permission-adapter-session-scopes.cjs");Object.defineProperty(r,"getInternalScopesObject",{enumerable:!0,get:function(){return a.getInternalScopesObject}}),Object.defineProperty(r,"getSessionScopes",{enumerable:!0,get:function(){return a.getSessionScopes}});var i=e("./handlers/wallet-getSession.cjs");Object.defineProperty(r,"walletGetSession",{enumerable:!0,get:function(){return i.walletGetSession}});var o=e("./handlers/wallet-invokeMethod.cjs");Object.defineProperty(r,"walletInvokeMethod",{enumerable:!0,get:function(){return o.walletInvokeMethod}});var c=e("./handlers/wallet-revokeSession.cjs");Object.defineProperty(r,"walletRevokeSession",{enumerable:!0,get:function(){return c.walletRevokeSession}});var u=e("./middlewares/multichainMethodCallValidator.cjs");Object.defineProperty(r,"multichainMethodCallValidatorMiddleware",{enumerable:!0,get:function(){return u.multichainMethodCallValidatorMiddleware}});var l=e("./middlewares/MultichainMiddlewareManager.cjs");Object.defineProperty(r,"MultichainMiddlewareManager",{enumerable:!0,get:function(){return l.MultichainMiddlewareManager}});var d=e("./middlewares/MultichainSubscriptionManager.cjs");Object.defineProperty(r,"MultichainSubscriptionManager",{enumerable:!0,get:function(){return d.MultichainSubscriptionManager}});var m=e("./scope/authorization.cjs");Object.defineProperty(r,"validateAndNormalizeScopes",{enumerable:!0,get:function(){return m.validateAndNormalizeScopes}}),Object.defineProperty(r,"bucketScopes",{enumerable:!0,get:function(){return m.bucketScopes}});var p=e("./scope/constants.cjs");Object.defineProperty(r,"KnownWalletRpcMethods",{enumerable:!0,get:function(){return p.KnownWalletRpcMethods}}),Object.defineProperty(r,"KnownRpcMethods",{enumerable:!0,get:function(){return p.KnownRpcMethods}}),Object.defineProperty(r,"KnownWalletNamespaceRpcMethods",{enumerable:!0,get:function(){return p.KnownWalletNamespaceRpcMethods}}),Object.defineProperty(r,"KnownNotifications",{enumerable:!0,get:function(){return p.KnownNotifications}}),Object.defineProperty(r,"KnownWalletScopeString",{enumerable:!0,get:function(){return p.KnownWalletScopeString}});var h=e("./scope/filter.cjs");Object.defineProperty(r,"getSupportedScopeObjects",{enumerable:!0,get:function(){return h.getSupportedScopeObjects}});var f=e("./scope/types.cjs");Object.defineProperty(r,"parseScopeString",{enumerable:!0,get:function(){return f.parseScopeString}});var g=e("./scope/transform.cjs");Object.defineProperty(r,"normalizeScope",{enumerable:!0,get:function(){return g.normalizeScope}}),Object.defineProperty(r,"mergeScopeObject",{enumerable:!0,get:function(){return g.mergeScopeObject}}),Object.defineProperty(r,"mergeNormalizedScopes",{enumerable:!0,get:function(){return g.mergeNormalizedScopes}}),Object.defineProperty(r,"mergeInternalScopes",{enumerable:!0,get:function(){return g.mergeInternalScopes}}),Object.defineProperty(r,"normalizeAndMergeScopes",{enumerable:!0,get:function(){return g.normalizeAndMergeScopes}});var y=e("./caip25Permission.cjs");Object.defineProperty(r,"caip25CaveatBuilder",{enumerable:!0,get:function(){return y.caip25CaveatBuilder}}),Object.defineProperty(r,"Caip25CaveatType",{enumerable:!0,get:function(){return y.Caip25CaveatType}}),Object.defineProperty(r,"createCaip25Caveat",{enumerable:!0,get:function(){return y.createCaip25Caveat}}),Object.defineProperty(r,"Caip25EndowmentPermissionName",{enumerable:!0,get:function(){return y.Caip25EndowmentPermissionName}}),Object.defineProperty(r,"caip25EndowmentBuilder",{enumerable:!0,get:function(){return y.caip25EndowmentBuilder}}),Object.defineProperty(r,"Caip25CaveatMutators",{enumerable:!0,get:function(){return y.Caip25CaveatMutators}})}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/index.cjs"}],[2147,{"@metamask/rpc-errors":2554},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i,o,c=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},u=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r};Object.defineProperty(r,"__esModule",{value:!0}),r.MultichainMiddlewareManager=void 0;const l=e("@metamask/rpc-errors"),d=["eth_subscribe","eth_unsubscribe"];r.MultichainMiddlewareManager=class{constructor(){n.add(this),s.set(this,[])}addMiddleware(e){const{scope:t,origin:r,tabId:i}=e;c(this,n,"m",a).call(this,{scope:t,origin:r,tabId:i})||c(this,s,"f").push(e)}removeMiddlewareByScope(e){c(this,s,"f").forEach((t=>{t.scope===e&&c(this,n,"m",o).call(this,t)}))}removeMiddlewareByScopeAndOrigin(e,t){c(this,s,"f").forEach((r=>{r.scope===e&&r.origin===t&&c(this,n,"m",o).call(this,r)}))}removeMiddlewareByOriginAndTabId(e,t){c(this,s,"f").forEach((r=>{r.origin===e&&r.tabId===t&&c(this,n,"m",o).call(this,r)}))}generateMultichainMiddlewareForOriginAndTabId(e,t){const r=(r,s,i,o)=>{const{scope:u}=r,m=c(this,n,"m",a).call(this,{scope:u,origin:e,tabId:t});return d.includes(r.method)?m?(m.middleware(r,s,i,o),undefined):o(l.rpcErrors.methodNotFound()):i()};return r.destroy=this.removeMiddlewareByOriginAndTabId.bind(this,e,t),r}},s=new WeakMap,n=new WeakSet,a=function({scope:e,origin:t,tabId:r}){return c(this,s,"f").find((n=>n.scope===e&&n.origin===t&&n.tabId===r))},i=function({scope:e,origin:t,tabId:r}){u(this,s,c(this,s,"f").filter((n=>n.scope!==e||n.origin!==t||n.tabId!==r)),"f")},o=function(e){Promise.resolve(e.middleware.destroy?.()).catch((()=>{})),c(this,n,"m",i).call(this,e)}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/middlewares/MultichainMiddlewareManager.cjs"}],[2148,{"@metamask/controller-utils":1474,"@metamask/eth-json-rpc-filters/subscriptionManager.js":1559,"@metamask/safe-event-emitter":2556,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i,o,c,u,l=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},d=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},m=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.MultichainSubscriptionManager=void 0;const p=e("@metamask/controller-utils"),h=m(e("@metamask/eth-json-rpc-filters/subscriptionManager.js")),f=m(e("@metamask/safe-event-emitter")),g=e("@metamask/utils");class y extends f.default{constructor(e){super(),n.add(this),s.set(this,void 0),a.set(this,void 0),i.set(this,[]),l(this,s,e.findNetworkClientIdByChainId,"f"),l(this,a,e.getNetworkClientById,"f")}notify({scope:e,origin:t,tabId:r},{method:n,params:s}){this.emit("notification",t,r,{method:"wallet_notify",params:{scope:e,notification:{method:n,params:s}}})}subscribe(e){const t=d(this,n,"m",o).call(this,e);if(t)return t.subscriptionManager;const r=d(this,s,"f").call(this,(0,p.toHex)((0,g.parseCaipChainId)(e.scope).reference)),c=d(this,a,"f").call(this,r),l=(0,h.default)({blockTracker:c.blockTracker,provider:c.provider});l.events.on("notification",(t=>{this.notify(e,t)}));const m={...e,subscriptionManager:l};return l.destroy=l.middleware.destroy,l.middleware.destroy=d(this,n,"m",u).bind(this,m),d(this,i,"f").push(m),l}unsubscribeByScope(e){d(this,i,"f").forEach((t=>{t.scope===e&&d(this,n,"m",u).call(this,t)}))}unsubscribeByScopeAndOrigin(e,t){d(this,i,"f").forEach((r=>{r.scope===e&&r.origin===t&&d(this,n,"m",u).call(this,r)}))}unsubscribeByOriginAndTabId(e,t){d(this,i,"f").forEach((r=>{r.origin===e&&r.tabId===t&&d(this,n,"m",u).call(this,r)}))}}r.MultichainSubscriptionManager=y,s=new WeakMap,a=new WeakMap,i=new WeakMap,n=new WeakSet,o=function({scope:e,origin:t,tabId:r}){return d(this,i,"f").find((n=>n.scope===e&&n.origin===t&&n.tabId===r))},c=function({scope:e,origin:t,tabId:r}){l(this,i,d(this,i,"f").filter((n=>n.scope!==e||n.origin!==t||n.tabId!==r)),"f")},u=function(e){e.subscriptionManager.destroy?.(),d(this,n,"m",c).call(this,e)}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/middlewares/MultichainSubscriptionManager.cjs"}],[2149,{"@metamask/api-specs":2161,"@metamask/json-rpc-engine":1933,"@metamask/rpc-errors":2554,"@metamask/utils":2950,"@open-rpc/schema-utils-js/build/dereference-document.js":3005,"@open-rpc/schema-utils-js/build/parse-open-rpc-document.js":3006,jsonschema:4690},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.multichainMethodCallValidatorMiddleware=void 0;const s=e("@metamask/api-specs"),a=e("@metamask/json-rpc-engine"),i=e("@metamask/rpc-errors"),o=e("@metamask/utils"),c=n(e("@open-rpc/schema-utils-js/build/dereference-document.js")),u=e("@open-rpc/schema-utils-js/build/parse-open-rpc-document.js"),l=e("jsonschema"),d=(e,t,r)=>{const n=`${t.name}${e.path.length>0?`.${e.path.join(".")}`:""} ${e.message}`;return i.rpcErrors.invalidParams({message:n,data:{param:t.name,path:e.path,schema:e.schema,got:r}})},m=new l.Validator,p=(0,c.default)(s.MultiChainOpenRPCDocument,(0,u.makeCustomResolver)({}));r.multichainMethodCallValidatorMiddleware=(0,a.createAsyncMiddleware)((async(e,t,r)=>{const n=await(async(e,t)=>{const r=(await p).methods.find((t=>t.name===e));if(!r||!(0,o.isObject)(r)||!("params"in r))return[i.rpcErrors.methodNotFound({data:{method:e}})];const n=[];for(const e of r.params){if(!(0,o.isObject)(t))return[i.rpcErrors.invalidParams()];const r=e,s=t[r.name],a=m.validate(s,r.schema,{required:r.required});a.errors&&n.push(...a.errors.map((e=>d(e,r,s))))}return n})(e.method,e.params);if(n.length>0)throw i.rpcErrors.invalidParams({data:n});return await r()}))}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/middlewares/multichainMethodCallValidator.cjs"}],[2150,{"./errors.cjs":2153,"./supported.cjs":2155,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.assertIsInternalScopesObject=r.assertIsInternalScopeString=r.assertIsExternalScopesObject=r.assertScopesSupported=r.assertScopeSupported=void 0;const n=e("@metamask/utils"),s=e("./errors.cjs"),a=e("./supported.cjs");r.assertScopeSupported=(e,t,{isChainIdSupported:r})=>{const{methods:n,notifications:i}=t;if(!(0,a.isSupportedScopeString)(e,r))throw s.Caip25Errors.requestedChainsNotSupportedError();if(!n.every((t=>(0,a.isSupportedMethod)(e,t))))throw s.Caip25Errors.requestedMethodsNotSupportedError();if(i&&!i.every((t=>(0,a.isSupportedNotification)(e,t))))throw s.Caip25Errors.requestedNotificationsNotSupportedError()};function i(e){if("object"!=typeof e||null===e)throw new Error("ExternalScopeObject must be an object");if((0,n.hasProperty)(e,"references")&&(!Array.isArray(e.references)||!e.references.every(n.isCaipReference)))throw new Error("ExternalScopeObject.references must be an array of CaipReference");if((0,n.hasProperty)(e,"accounts")&&(!Array.isArray(e.accounts)||!e.accounts.every(n.isCaipAccountId)))throw new Error("ExternalScopeObject.accounts must be an array of CaipAccountId");if((0,n.hasProperty)(e,"methods")&&(!Array.isArray(e.methods)||!e.methods.every((e=>"string"==typeof e))))throw new Error("ExternalScopeObject.methods must be an array of strings");if((0,n.hasProperty)(e,"notifications")&&(!Array.isArray(e.notifications)||!e.notifications.every((e=>"string"==typeof e))))throw new Error("ExternalScopeObject.notifications must be an array of strings");if((0,n.hasProperty)(e,"rpcDocuments")&&(!Array.isArray(e.rpcDocuments)||!e.rpcDocuments.every((e=>"string"==typeof e))))throw new Error("ExternalScopeObject.rpcDocuments must be an array of strings");if((0,n.hasProperty)(e,"rpcEndpoints")&&(!Array.isArray(e.rpcEndpoints)||!e.rpcEndpoints.every((e=>"string"==typeof e))))throw new Error("ExternalScopeObject.rpcEndpoints must be an array of strings")}function o(e){if("string"!=typeof e||!(0,n.isCaipNamespace)(e)&&!(0,n.isCaipChainId)(e))throw new Error("scopeString is not a valid ExternalScopeString")}function c(e){if("object"!=typeof e||null===e)throw new Error("InternalScopeObject must be an object");if(!(0,n.hasProperty)(e,"accounts")||!Array.isArray(e.accounts)||!e.accounts.every(n.isCaipAccountId))throw new Error("InternalScopeObject.accounts must be an array of CaipAccountId")}function u(e){if("string"!=typeof e||e!==n.KnownCaipNamespace.Wallet&&!(0,n.isCaipChainId)(e))throw new Error("scopeString is not a valid InternalScopeString")}r.assertScopesSupported=(e,{isChainIdSupported:t})=>{for(const[n,s]of Object.entries(e))(0,r.assertScopeSupported)(n,s,{isChainIdSupported:t})},r.assertIsExternalScopesObject=function(e){if("object"!=typeof e||null===e)throw new Error("ExternalScopesObject must be an object");for(const[t,r]of Object.entries(e))o(t),i(r)},r.assertIsInternalScopeString=u,r.assertIsInternalScopesObject=function(e){if("object"!=typeof e||null===e)throw new Error("InternalScopesObject must be an object");for(const[t,r]of Object.entries(e))u(t),c(r)}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/scope/assert.cjs"}],[2151,{"./filter.cjs":2154,"./transform.cjs":2156,"./validation.cjs":2158},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.bucketScopes=r.validateAndNormalizeScopes=void 0;const n=e("./filter.cjs"),s=e("./transform.cjs"),a=e("./validation.cjs");r.validateAndNormalizeScopes=(e,t)=>{const{validRequiredScopes:r,validOptionalScopes:n}=(0,a.getValidScopes)(e,t);return{normalizedRequiredScopes:(0,s.normalizeAndMergeScopes)(r),normalizedOptionalScopes:(0,s.normalizeAndMergeScopes)(n)}};r.bucketScopes=(e,{isChainIdSupported:t,isChainIdSupportable:r})=>{const{supportedScopes:s,unsupportedScopes:a}=(0,n.bucketScopesBySupport)(e,{isChainIdSupported:t}),{supportedScopes:i,unsupportedScopes:o}=(0,n.bucketScopesBySupport)(a,{isChainIdSupported:r});return{supportedScopes:s,supportableScopes:i,unsupportableScopes:o}}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/scope/authorization.cjs"}],[2152,{"@metamask/api-specs":2161},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.KnownNotifications=r.KnownWalletNamespaceRpcMethods=r.KnownRpcMethods=r.Eip1193OnlyMethods=r.KnownWalletRpcMethods=r.CaipReferenceRegexes=r.KnownWalletScopeString=void 0;const s=n(e("@metamask/api-specs"));var a;!function(e){e.Eip155="wallet:eip155"}(a||(r.KnownWalletScopeString=a={})),r.CaipReferenceRegexes={eip155:/^(0|[1-9][0-9]*)$/u,bip122:/.*/u,solana:/.*/u},r.KnownWalletRpcMethods=["wallet_registerOnboarding","wallet_scanQRCode"];const i=["wallet_addEthereumChain"];r.Eip1193OnlyMethods=["wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_revokePermissions","eth_requestAccounts","eth_accounts","eth_coinbase","net_version","metamask_logWeb3ShimUsage","metamask_getProviderState","metamask_sendDomainMetadata","wallet_registerOnboarding"];const o=s.default.methods.map((({name:e})=>e)).filter((e=>!i.includes(e))).filter((e=>!r.KnownWalletRpcMethods.includes(e))).filter((e=>!r.Eip1193OnlyMethods.includes(e)));r.KnownRpcMethods={eip155:o,bip122:[],solana:[]},r.KnownWalletNamespaceRpcMethods={eip155:i,bip122:[],solana:[]},r.KnownNotifications={eip155:["eth_subscription"],bip122:[],solana:[]}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/scope/constants.cjs"}],[2153,{"@metamask/rpc-errors":2554},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Caip25Errors=void 0;const n=e("@metamask/rpc-errors");r.Caip25Errors={requestedChainsNotSupportedError:()=>new n.JsonRpcError(5100,"Requested chains are not supported"),requestedMethodsNotSupportedError:()=>new n.JsonRpcError(5101,"Requested methods are not supported"),requestedNotificationsNotSupportedError:()=>new n.JsonRpcError(5102,"Requested notifications are not supported"),unknownMethodsRequestedError:()=>new n.JsonRpcError(5201,"Unknown method(s) requested"),unknownNotificationsRequestedError:()=>new n.JsonRpcError(5202,"Unknown notification(s) requested")}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/scope/errors.cjs"}],[2154,{"./assert.cjs":2150,"./supported.cjs":2155},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getSupportedScopeObjects=r.bucketScopesBySupport=void 0;const n=e("./assert.cjs"),s=e("./supported.cjs");r.bucketScopesBySupport=(e,{isChainIdSupported:t})=>{const r={},s={};for(const[a,i]of Object.entries(e)){(0,n.assertIsInternalScopeString)(a);try{(0,n.assertScopeSupported)(a,i,{isChainIdSupported:t}),r[a]=i}catch(e){s[a]=i}}return{supportedScopes:r,unsupportedScopes:s}};const a=(e,t)=>{const{methods:r,notifications:n}=t,a=r.filter((t=>(0,s.isSupportedMethod)(e,t))),i=n.filter((t=>(0,s.isSupportedNotification)(e,t)));return{...t,methods:a,notifications:i}};r.getSupportedScopeObjects=e=>{const t={};for(const[r,s]of Object.entries(e))(0,n.assertIsInternalScopeString)(r),t[r]=a(r,s);return t}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/scope/filter.cjs"}],[2155,{"./constants.cjs":2152,"./types.cjs":2157,"@metamask/controller-utils":1474,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isSupportedNotification=r.isSupportedMethod=r.isSupportedAccount=r.isSupportedScopeString=void 0;const n=e("@metamask/controller-utils"),s=e("@metamask/utils"),a=e("./constants.cjs"),i=e("./types.cjs");r.isSupportedScopeString=(e,t)=>{const{namespace:r,reference:o}=(0,i.parseScopeString)(e);switch(r){case s.KnownCaipNamespace.Wallet:return!o||o===s.KnownCaipNamespace.Eip155;case s.KnownCaipNamespace.Eip155:return!o||a.CaipReferenceRegexes.eip155.test(o)&&t((0,n.toHex)(o));default:return!1}};r.isSupportedAccount=(e,t)=>{const{address:r,chain:{namespace:a,reference:i}}=(0,s.parseCaipAccountId)(e),o=()=>t().some((e=>["eip155:eoa","eip155:erc4337"].includes(e.type)&&(0,n.isEqualCaseInsensitive)(r,e.address)));switch(a){case s.KnownCaipNamespace.Wallet:return i===s.KnownCaipNamespace.Eip155&&o();case s.KnownCaipNamespace.Eip155:return o();default:return!1}};r.isSupportedMethod=(e,t)=>{const{namespace:r,reference:n}=(0,i.parseScopeString)(e);return!(!r||!o(r))&&(r===s.KnownCaipNamespace.Wallet?n?!(!o(n)||n===s.KnownCaipNamespace.Wallet)&&a.KnownWalletNamespaceRpcMethods[n].includes(t):a.KnownWalletRpcMethods.includes(t):a.KnownRpcMethods[r].includes(t))};function o(e){return Object.keys(s.KnownCaipNamespace).map((e=>e.toLowerCase())).includes(e)}r.isSupportedNotification=(e,t)=>{const{namespace:r}=(0,i.parseScopeString)(e);return!(!r||!o(r)||r===s.KnownCaipNamespace.Wallet)&&a.KnownNotifications[r].includes(t)}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/scope/supported.cjs"}],[2156,{"./types.cjs":2157,lodash:4855},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.normalizeAndMergeScopes=r.mergeInternalScopes=r.mergeNormalizedScopes=r.mergeScopeObject=r.normalizeScope=r.getUniqueArrayItems=void 0;const n=e("lodash"),s=e("./types.cjs");r.getUniqueArrayItems=e=>Array.from(new Set(e));r.normalizeScope=(e,t)=>{const{references:r,...a}=t,{namespace:i,reference:o}=(0,s.parseScopeString)(e),c={accounts:[],...a};return i&&!o&&r!==undefined&&r.length>0?Object.fromEntries(r.map((e=>[`${i}:${e}`,(0,n.cloneDeep)(c)]))):{[e]:c}};r.mergeScopeObject=(e,t)=>{const n={methods:(0,r.getUniqueArrayItems)([...e.methods,...t.methods]),notifications:(0,r.getUniqueArrayItems)([...e.notifications,...t.notifications]),accounts:(0,r.getUniqueArrayItems)([...e.accounts,...t.accounts])};return(e.rpcDocuments||t.rpcDocuments)&&(n.rpcDocuments=(0,r.getUniqueArrayItems)([...e.rpcDocuments??[],...t.rpcDocuments??[]])),(e.rpcEndpoints||t.rpcEndpoints)&&(n.rpcEndpoints=(0,r.getUniqueArrayItems)([...e.rpcEndpoints??[],...t.rpcEndpoints??[]])),n};r.mergeNormalizedScopes=(e,t)=>{const n={};return Object.entries(e).forEach((([e,s])=>{const a=e,i=t[a];n[a]=i?(0,r.mergeScopeObject)(s,i):s})),Object.entries(t).forEach((([t,r])=>{const s=t;e[s]||(n[s]=r)})),n};r.mergeInternalScopes=(e,t)=>{const s=(0,n.cloneDeep)(e);return Object.entries(t).forEach((([e,t])=>{const n=e,a=s[n];s[n]=a?{accounts:(0,r.getUniqueArrayItems)([...a.accounts,...t.accounts])}:t})),s};r.normalizeAndMergeScopes=e=>{let t={};return Object.keys(e).forEach((n=>{const s=(0,r.normalizeScope)(n,e[n]);t=(0,r.mergeNormalizedScopes)(t,s)})),t}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/scope/transform.cjs"}],[2157,{"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.parseScopeString=void 0;const n=e("@metamask/utils");r.parseScopeString=e=>(0,n.isCaipNamespace)(e)?{namespace:e}:(0,n.isCaipChainId)(e)?(0,n.parseCaipChainId)(e):{}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/scope/types.cjs"}],[2158,{"./types.cjs":2157,"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getValidScopes=r.isValidScope=void 0;const n=e("@metamask/utils"),s=e("./types.cjs");r.isValidScope=(e,t)=>{const{namespace:r,reference:a}=(0,s.parseScopeString)(e);if(!r)return!1;const{references:i,methods:o,notifications:c,accounts:u,rpcDocuments:l,rpcEndpoints:d,...m}=t;if(!o||!c)return!1;if(!("wallet"===r||a||i&&0!==i.length))return!1;if(i){if(a)return!1;if(!i.every((e=>(0,n.isCaipReference)(e))))return!1}if(!o.every((e=>"string"==typeof e&&""!==e.trim())))return!1;return!!c.every((e=>"string"==typeof e&&""!==e.trim()))&&!(Object.keys(m).length>0)};r.getValidScopes=(e,t)=>{const n={};for(const[t,s]of Object.entries(e||{}))(0,r.isValidScope)(t,s)&&(n[t]={accounts:[],...s});const s={};for(const[e,n]of Object.entries(t||{}))(0,r.isValidScope)(e,n)&&(s[e]={accounts:[],...n});return{validRequiredScopes:n,validOptionalScopes:s}}}}},{package:"@metamask/multichain",file:"node_modules/@metamask/multichain/dist/scope/validation.cjs"}],[2159,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports={openrpc:"1.2.4",info:{title:"MetaMask MultiChain API",version:"1.0.0",description:"This provides the specs for the MultiChain API Layer for the MetaMask API"},methods:[{name:"wallet_notify",paramStructure:"by-name",params:[{name:"scope",description:"a valid `scope` string that has been previously authorized via `provider_authorize`",required:!0,schema:{$ref:"#/components/schemas/ScopeString"}},{name:"notification",description:"an object containing a JSON-RPC notification with `method` and `params`",deprecated:!1,required:!0,schema:{type:"object",properties:{method:{type:"string"},params:!0}}}]},{name:"wallet_invokeMethod",paramStructure:"by-name",params:[{name:"scope",description:"a valid `scope` string that has been previously authorized via `provider_authorize`",required:!0,schema:{$ref:"#/components/schemas/ScopeString"}},{name:"request",description:"an object containing a JSON-RPC request with `method` and `params`",deprecated:!1,required:!0,schema:{type:"object",properties:{method:{type:"string"},params:!0}}}],result:{name:"wallet_invokeMethodResult",schema:!0},examples:[{name:"wallet_invokeMethodExample",params:[{name:"scope",value:"eip155:1"},{name:"request",value:{method:"eth_getBalance",params:[]}}],result:{name:"wallet_invokeMethodResult",value:"0x1"}}]},{name:"wallet_revokeSession",description:"The `wallet_revokeSession` method revokes the entire active session.",params:[],result:{name:"wallet_revokeSessionResult",schema:{type:"boolean"}},examples:[{name:"wallet_revokeSessionExample",params:[],result:{name:"wallet_revokeSessionExampleResult",value:!0}}],errors:[{$ref:"#/components/errors/UnknownError"}]},{name:"wallet_sessionChanged",paramStructure:"by-name",description:"This notification is published by the wallet to notify the callers of updates to a shared session's authorization scopes. The event payload contains the new `sessionScopes`.",params:[{name:"sessionScopes",schema:{$ref:"#/components/schemas/SessionScopes"}}],examples:[{name:"wallet_sessionChangedExample",description:"Example of a wallet_sessionChanged notification.",params:[{name:"sessionScopes",value:{"eip155:1337":{accounts:["eip155:1337:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"],methods:["wallet_watchAsset","eth_sendTransaction","eth_decrypt","eth_getEncryptionPublicKey","web3_clientVersion","eth_subscribe","eth_unsubscribe","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"],notifications:["eth_subscription"]},wallet:{accounts:[],methods:["wallet_registerOnboarding","wallet_scanQRCode"],notifications:[]},"wallet:eip155":{accounts:["wallet:eip155:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"],methods:["wallet_addEthereumChain","personal_sign","eth_signTypedData_v4"],notifications:[]}}}]}]},{name:"wallet_getSession",description:"The `wallet_getSession` method returns an active session.",params:[],result:{name:"wallet_getSessionResult",schema:{type:"object",properties:{sessionScopes:{$ref:"#/components/schemas/SessionScopes"}}}},examples:[{name:"wallet_getSessionExample",description:"Example of a getSession request.",params:[],result:{name:"wallet_getSessionResultExample",value:{sessionScopes:{"eip155:1337":{accounts:["eip155:1337:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"],methods:["wallet_watchAsset","eth_sendTransaction","eth_decrypt","eth_getEncryptionPublicKey","web3_clientVersion","eth_subscribe","eth_unsubscribe","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"],notifications:["eth_subscription"]},wallet:{accounts:[],methods:["wallet_registerOnboarding","wallet_scanQRCode"],notifications:[]},"wallet:eip155":{accounts:["wallet:eip155:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"],methods:["wallet_addEthereumChain","personal_sign","eth_signTypedData_v4"],notifications:[]}}}}}]},{name:"wallet_createSession",paramStructure:"by-name",params:[{name:"requiredScopes",description:"Scopes that the wallet must support in order to be used with this provider.",schema:{type:"object",patternProperties:{"[-a-z0-9]{3,8}(:[-_a-zA-Z0-9]{1,32})?":{$ref:"#/components/schemas/Scope"}}}},{name:"optionalScopes",description:"Scopes that the wallet may support in order to be used with this provider.",schema:{type:"object",patternProperties:{"[-a-z0-9]{3,8}(:[-_a-zA-Z0-9]{1,32})?":{$ref:"#/components/schemas/Scope"}}}},{name:"sessionProperties",description:"Properties that the wallet may use to determine if the session is valid.",schema:{type:"object",properties:{expiry:{type:"string",format:"date-time"}}}}],result:{name:"wallet_createSessionResult",schema:{type:"object",properties:{sessionScopes:{$ref:"#/components/schemas/SessionScopes"},sessionProperties:{type:"object",properties:{expiry:{type:"string",format:"date-time"}}}}}},examples:[{name:"wallet_createSessionEthExample",description:"Example of a createSession request.",params:[{name:"requiredScopes",value:{"eip155:1337":{methods:["wallet_watchAsset","eth_sendTransaction","eth_decrypt","eth_getEncryptionPublicKey","web3_clientVersion","eth_subscribe","eth_unsubscribe","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"],notifications:["eth_subscription"]},wallet:{methods:["wallet_registerOnboarding","wallet_scanQRCode"],notifications:[]},"wallet:eip155":{methods:["wallet_addEthereumChain","personal_sign","eth_signTypedData_v4"],notifications:[]}}},{name:"sessionProperties",value:{expiry:"2022-12-24T17:07:31+00:00"}}],result:{name:"wallet_createSessionResultExample",value:{sessionScopes:{"eip155:1337":{accounts:["eip155:1337:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"],methods:["wallet_watchAsset","eth_sendTransaction","eth_decrypt","eth_getEncryptionPublicKey","web3_clientVersion","eth_subscribe","eth_unsubscribe","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"],notifications:["eth_subscription"]},wallet:{accounts:[],methods:["wallet_registerOnboarding","wallet_scanQRCode"],notifications:[]},"wallet:eip155":{accounts:["wallet:eip155:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"],methods:["wallet_addEthereumChain","personal_sign","eth_signTypedData_v4"],notifications:[]},sessionProperties:{expiry:"2022-11-31T17:07:31+00:00"}}}}},{name:"wallet_createSessionEthUnsupportedMethodsExample",description:"Example of a createSession request with unsupported eip155 methods.",params:[{name:"optionalScopes",value:{"eip155:1337":{methods:["not_supported"],notifications:[]},wallet:{methods:[],notifications:[]},"wallet:eip155":{methods:[],notifications:[]}}},{name:"sessionProperties",value:{expiry:"2022-12-24T17:07:31+00:00"}}],result:{name:"wallet_createSessionEthUnsupportedMethodsResultExample",value:{sessionScopes:{"eip155:1337":{accounts:["eip155:1337:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"],methods:["wallet_watchAsset","eth_sendTransaction","eth_decrypt","eth_getEncryptionPublicKey","web3_clientVersion","eth_subscribe","eth_unsubscribe","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"],notifications:["eth_subscription"]},wallet:{accounts:[],methods:["wallet_registerOnboarding","wallet_scanQRCode"],notifications:[]},"wallet:eip155":{accounts:["wallet:eip155:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"],methods:["wallet_addEthereumChain","personal_sign","eth_signTypedData_v4"],notifications:[]}},sessionProperties:{expiry:"2022-11-31T17:07:31+00:00"}}}},{name:"wallet_createSessionUnsupportedScopesExample",description:"Example of a createSession request with unsupported scopes.",params:[{name:"requiredScopes",value:{foobar:{methods:["eth_getBalance"],notifications:["eth_subscription"]}}}],result:{name:"wallet_createSessionUnsupportedScopesResultExample",value:{sessionScopes:{"eip155:1":{accounts:["eip155:1:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"],methods:["wallet_watchAsset","eth_sendTransaction","eth_decrypt","eth_getEncryptionPublicKey","web3_clientVersion","eth_subscribe","eth_unsubscribe","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"],notifications:["eth_subscription"]},"eip155:59144":{accounts:["eip155:59144:0x5cfe73b6021e818b776b421b1c4db2474086a7e1"],methods:["wallet_watchAsset","eth_sendTransaction","eth_decrypt","eth_getEncryptionPublicKey","web3_clientVersion","eth_subscribe","eth_unsubscribe","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"],notifications:["eth_subscription"]}}},sessionProperties:{expiry:"2022-11-31T17:07:31+00:00"}}}],errors:[{$ref:"#/components/errors/UnknownError"},{code:5100,message:"Requested networks are not supported"},{code:5101,message:"Requested methods are not supported"},{code:5102,message:"Requested notifications are not supported"},{code:5300,message:"Invalid scopedProperties requested"},{code:5301,message:"scopedProperties can only be outside of sessionScopes"},{code:5302,message:"Invalid sessionProperties requested"}]}],components:{errors:{UnknownError:{code:5e3,message:"Unknown error with request"}},schemas:{SessionScopes:{type:"object",patternProperties:{"[-a-z0-9]{3,8}(:[-_a-zA-Z0-9]{1,32})?":{$ref:"#/components/schemas/Scope"}}},ScopeString:{type:"string",pattern:"[-a-z0-9]{3,8}(:[-_a-zA-Z0-9]{1,32})?"},Scope:{type:"object",title:"Scope",description:"Scope for a multi-chain connection",additionalProperties:!0,required:["notifications","methods"],properties:{scopes:{type:"array",items:{$ref:"#/components/schemas/ScopeString"}},methods:{description:"Methods that the wallet must support in order to be used with this provider.",type:"array",items:{type:"string"}},notifications:{description:"Notifications that the wallet must support in order to be used with this provider.",type:"array",items:{type:"string"}},rpcEndpoints:{description:"JSON-RPC endpoints for this namespace.",type:"array",items:{type:"string",format:"uri"}},rpcDocuments:{type:"array",description:"OpenRPC documents that define RPC methods in which to anchor the methods authorized in a CAIP-25 interaction.",items:{type:"string",format:"uri"}}}}}}}}}},{package:"@metamask/multichain>@metamask/api-specs",file:"node_modules/@metamask/multichain/node_modules/@metamask/api-specs/dist/build/multichain-openrpc.json"}],[2160,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports={openrpc:"1.2.4",info:{title:"JSON-RPC API",version:"1.0.0",description:"This section provides an interactive reference for MetaMask's Wallet JSON-RPC API. The API builds on a set of standard Ethereum methods with MetaMask-specific enhancements, and is designed for seamless integration into dapps."},methods:[{name:"wallet_addEthereumChain",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Multichain"}],summary:"Adds an Ethereum chain to the wallet.",description:"Creates a confirmation asking the user to add the specified chain to the wallet application. The caller must specify a chain ID and some chain metadata. Specified by [EIP-3085](https://eips.ethereum.org/EIPS/eip-3085).",params:[{name:"Chain",schema:{$ref:"#/components/schemas/AddEthereumChainParameter"}}],errors:[{code:-32602,message:"Expected null or array with at least one valid string HTTPS URL 'blockExplorerUrl'. Received: ${blockExplorerUrls}"},{code:-32602,message:"Expected 0x-prefixed, unpadded, non-zero hexadecimal string 'chainId'. Received:\n${chainId}"},{code:-32602,message:'Invalid chain ID "${_chainId}": numerical value greater than max safe value. Received:\n${chainId}'},{code:-32602,message:"May not specify default MetaMask chain."},{code:-32602,message:"Expected 2-6 character string 'nativeCurrency.symbol'. Received:\n${ticker}"},{code:-32602,message:"nativeCurrency.symbol does not match currency symbol for a network the user already has added with the same chainId. Received:\n${ticker}"}],result:{name:"Null response",description:"This method returns `null` if the chain is added.",schema:{type:"null"}},examples:[{name:"wallet_addEthereumChain example",params:[{name:"Chain",value:{chainId:"0x64",chainName:"Gnosis",rpcUrls:["https://rpc.gnosischain.com"],iconUrls:["https://xdaichain.com/fake/example/url/xdai.svg","https://xdaichain.com/fake/example/url/xdai.png"],nativeCurrency:{name:"XDAI",symbol:"XDAI",decimals:18},blockExplorerUrls:["https://blockscout.com/poa/xdai/"]}}],result:{name:"Null response",value:"null"}}]},{name:"wallet_switchEthereumChain",tags:[{$ref:"#/components/tags/MetaMask"}],summary:"Switches the wallet's active Ethereum chain.",description:"Requests that the wallet switches its active Ethereum chain. Specified by [EIP-3326](https://eips.ethereum.org/EIPS/eip-3326).",params:[{name:"Chain",schema:{title:"Chain",description:"Object containing the chain ID to switch to.",type:"object",required:["chainId"],properties:{chainId:{description:"The chain ID as a `0x`-prefixed hexadecimal string, as returned by the `eth_chainId` method.",type:"string"}}}}],result:{name:"Null response",description:"This method returns `null` if the active chain is switched.",schema:{type:"null"}},errors:[{code:4902,message:"Unrecognized chain ID. Try adding the chain using wallet_addEthereumChain first."}],examples:[{name:"wallet_switchEthereumChain example",params:[{name:"Chain",value:{chainId:"0x64"}}],result:{name:"Null response",value:"null"}}]},{name:"wallet_getPermissions",tags:[{$ref:"#/components/tags/MetaMask"}],summary:"Gets the user's permissions.",description:"Gets the user's permissions. Specified by [EIP-2255](https://eips.ethereum.org/EIPS/eip-2255).",params:[],result:{name:"Permissions list",schema:{$ref:"#/components/schemas/PermissionsList"}},examples:[{name:"wallet_getPermissions example",params:[],result:{name:"Permission list",value:{eth_accounts:{}}}}]},{name:"wallet_requestPermissions",tags:[{$ref:"#/components/tags/MetaMask"}],summary:"Requests additional permissions.",description:"Requests additional permissions from the user. This method accepts a single permission per call. Specified by [EIP-2255](https://eips.ethereum.org/EIPS/eip-2255).",params:[{name:"Permission",required:!0,schema:{title:"Permission",description:"Object containing the permission to request.",type:"object",properties:{permission_name:{type:"object",description:"The permission object. `permission_name` is the name of the permission being requested.",additionalProperties:!0}}}}],result:{name:"Permissions list",schema:{$ref:"#/components/schemas/PermissionsList"}},examples:[{name:"wallet_requestPermissions example",params:[{name:"Permission",value:{eth_accounts:{}}}],result:{name:"Permission list",value:{eth_accounts:{}}}}],errors:[{$ref:"#/components/errors/UserRejected"}]},{name:"wallet_revokePermissions",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Experimental"}],summary:"Revokes the current dapp permissions.",description:"Revokes previously granted permissions for the current dapp identified by its origin. This method accepts a single permission per call. Specified by [MIP-2](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-2.md) and only available for the MetaMask browser extension.",params:[{name:"Permission",required:!0,schema:{title:"Permission",description:"Object containing the permission to revoke.",type:"object",properties:{permission_name:{type:"object",description:"The permission object. `permission_name` is the name of the permission being revoked.",additionalProperties:!0}}}}],result:{name:"Null response",description:"This method returns `null` if the permission is revoked.",schema:{type:"null"}},errors:[],examples:[{name:"wallet_revokePermissions example",params:[{name:"Permission",value:{eth_accounts:{}}}],result:{name:"Null response",value:"null"}}]},{name:"personal_sign",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Restricted"},{$ref:"#/components/tags/Multichain"}],summary:"Presents a plain text signature challenge to the user.",description:"Presents a plain text signature challenge to the user and returns the signed response. Prepends a safe prefix to the signed message to prevent the challenge tricking users into signing a financial transaction. <br><br> MetaMask implements `personal_sign` similarly to the Go Ethereum client's `eth_sign` implementation. MetaMask's `personal_sign` doesn't accept a password. <br><br> This method requires that the user has granted permission to interact with their account first, so make sure to call `eth_requestAccounts` (recommended) or `wallet_requestPermissions` first.",deprecated:!1,params:[{name:"Challenge",required:!0,description:"A hex-encoded UTF-8 string to present to the user. See how to encode a string like this in the [`browser-string-hexer`](https://github.com/danfinlay/browser-string-hexer) module.",schema:{type:"string",pattern:"^0x[a-fA-F\\d]+$"}},{name:"Address",required:!0,description:"The address of the requested signing account.",schema:{type:"string",pattern:"^0x[0-9a-fA-F]{40}$"}}],result:{name:"Signature",description:"A hex-encoded signature.",schema:{type:"string",pattern:"^0x[0-9a-f]*$"}},examples:[{name:"personal_sign example",params:[{name:"Challenge",value:"0x506c65617365207369676e2074686973206d65737361676520746f20636f6e6669726d20796f7572206964656e746974792e"},{name:"Address",value:"0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7"}],result:{name:"Signature",value:"0x43d7215ebe96c09a5adac69fc76dea5647286b501954ea273e417cf65e6c80e1db4891826375a7de02467a3e01caf125f64c851a8e9ee9467fd6f7e83523b2115bed8e79d527a85e28a36807d79b85fc551b5c15c1ead2e43456c31f565219203db2aed86cb3601b33ec3b410836d4be7718c6148dc9ac82ecc0a04c5edecd8914"}}]},{name:"eth_signTypedData_v4",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Restricted"},{$ref:"#/components/tags/Multichain"}],summary:"Presents a structured data message for the user to sign.",description:"Presents a data message for the user to sign in a structured and readable format and returns the signed response. Introduced by [EIP-712](https://eips.ethereum.org/EIPS/eip-712). This method requires that the user has granted permission to interact with their account first, so make sure to call `eth_requestAccounts` (recommended) or `wallet_requestPermissions` first.",params:[{name:"Address",required:!0,description:"The address of the requested signing account.",schema:{$ref:"#/components/schemas/address"}},{name:"TypedData",required:!0,schema:{$ref:"#/components/schemas/TypedData"}}],result:{name:"Signature",schema:{$ref:"#/components/schemas/bytes"}},examples:[{name:"eth_SignTypedData_v4 example",params:[{name:"Address",value:"0x0000000000000000000000000000000000000000"},{name:"TypedData",value:{types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Person:[{name:"name",type:"string"},{name:"wallet",type:"address"}],Mail:[{name:"from",type:"Person"},{name:"to",type:"Person"},{name:"contents",type:"string"}]},primaryType:"Mail",domain:{name:"Ether Mail",version:"1",chainId:1,verifyingContract:"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"},message:{from:{name:"Cow",wallet:"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"},to:{name:"Bob",wallet:"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"},contents:"Hello, Bob!"}}}],result:{name:"Signature",value:"0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c"}}]},{name:"wallet_registerOnboarding",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Multichain"}],summary:"Redirects the user back to the site after onboarding.",description:"Registers the requesting site with MetaMask as the initiator of onboarding, enabling MetaMask to redirect the user back to the site after onboarding. Returns a promise that resolves to `true`, or rejects if there's an error. Instead of calling this method directly, you should use the [`@metamask/onboarding`](https://github.com/MetaMask/metamask-onboarding) library.",params:[],result:{name:"RegisterOnboardingResult",description:"`true` if the request was successful, `false` otherwise.",schema:{type:"boolean"}}},{name:"wallet_watchAsset",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Experimental"},{$ref:"#/components/tags/Multichain"}],summary:"Tracks a token in MetaMask.",description:"Requests that the user track the specified token in MetaMask. Returns a boolean indicating if the token was successfully added. Once added, the token is indistinguishable from those added using legacy methods, such as a centralized registry. Introduced by [EIP-747](https://eips.ethereum.org/EIPS/eip-747).",paramStructure:"by-name",params:[{name:"type",schema:{type:"string",description:"Supports ERC-20, ERC-721, and ERC-1155 tokens. Support for ERC-721 and ERC-1155 tokens is experimental and currently only available on the extension (not on mobile). See [MIP-1](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md) and [MIP proposal lifecycle](https://github.com/MetaMask/metamask-improvement-proposals/blob/main/PROCESS-GUIDE.md#proposal-lifecycle) for more information.",enum:["ERC20","ERC721","ERC1155"]},required:!0},{name:"options",schema:{title:"WatchAssetOptions",type:"object",required:["address"],properties:{address:{description:"The address of the token contract.",type:"string"},symbol:{description:"A ticker symbol or shorthand, up to 11 characters (optional for ERC-20 tokens).",minLength:2,maxLength:11,type:"string"},decimals:{description:"The number of token decimals (optional for ERC-20 tokens).",type:"number"},image:{description:"A string URL of the token logo (optional for ERC-20 tokens).",type:"string"},tokenId:{description:"The unique identifier of the NFT (required for ERC-721 and ERC-1155 tokens).",type:"string"}}}}],errors:[{code:-32602,message:"Must specify address, symbol, and decimals."},{code:-32602,message:"Invalid symbol: not a string."},{code:-32602,message:"Invalid symbol '${symbol}': longer than 11 characters."},{code:-32602,message:"Invalid decimals '${decimals}': must be 0 <= 36."},{code:-32602,message:"Invalid address '${address}'."},{code:-32602,message:"Asset type is required."},{code:-32602,message:"Both address and tokenId are required."},{code:-32602,message:"Invalid address."},{code:-32e3,message:"Suggested NFT is not owned by the selected account."},{code:-32e3,message:"Suggested NFT of type ${standard} does not match received type ${type}."},{code:-32002,message:"Unable to verify ownership. Possibly because the standard is not supported or the user's currently selected network does not match the chain of the asset in question."}],result:{name:"WatchAssetResult",description:"`true` if the token was added, `false` otherwise.",schema:{type:"boolean"}},examples:[{name:"wallet_watchAsset ERC-20 example",params:[{name:"type",value:"ERC20"},{name:"options",value:{address:"0xb60e8dd61c5d32be8058bb8eb970870f07233155",symbol:"FOO",decimals:18,image:"https://foo.io/token-image.svg"}}],result:{name:"wallet_watchAssetExampleResult",value:!0}},{name:"wallet_watchAsset ERC-721 example",params:[{name:"type",value:"ERC721"},{name:"options",value:{address:"0x123456789abcdef0123456789abcdef01234567",tokenId:"42"}}],result:{name:"wallet_watchAssetERC721ExampleResult",value:!0}},{name:"wallet_watchAsset ERC-1155 example",params:[{name:"type",value:"ERC1155"},{name:"options",value:{address:"0xabcdef0123456789abcdef0123456789abcdef01",tokenId:"1337"}}],result:{name:"wallet_watchAssetERC1155ExampleResult",value:!0}}]},{name:"wallet_scanQRCode",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Mobile"},{$ref:"#/components/tags/Multichain"}],summary:"Requests that the user scan a QR code.",description:"Requests that the user scan a QR code using their device camera. Introduced by [EIP-945](https://github.com/ethereum/EIPs/issues/945).",params:[{name:"regex",required:!1,description:"A regular expression (regex) string for matching arbitrary QR code strings.",schema:{type:"string",title:"regex"}}],result:{name:"ScanQRCodeResult",description:"A string corresponding to the scanned QR code. If a regex string is provided, the resulting string matches it. If no regex string is provided, the resulting string matches an Ethereum address. If neither condition is met, the method returns an error.",schema:{type:"string",title:"ScanQRCodeResult"}}},{name:"eth_requestAccounts",tags:[{$ref:"#/components/tags/MetaMask"}],description:"Requests that the user provide an Ethereum address to be identified by. This method is specified by [EIP-1102](https://eips.ethereum.org/EIPS/eip-1102). Internally, this method calls `wallet_requestPermissions` for permission to call `eth_accounts`.",summary:"Requests that the user provide an Ethereum address.",params:[],result:{name:"AddressList",schema:{type:"array",items:{$ref:"#/components/schemas/address"}}},errors:[{$ref:"#/components/errors/UserRejected"}],examples:[{name:"eth_requestAccounts example",params:[],result:{name:"eth_requestAccountsExampleResult",value:"0xa77392123a1085f75e62eec7dea7e0e1e5142d5f"}}]},{name:"eth_accounts",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Restricted"}],description:"Returns a list of addresses for the accounts owned by the user. This method requires calling `wallet_requestPermissions` for permission. We recommend using `eth_requestAccounts`, which internally calls `wallet_requestPermission`.",summary:"Gets a list of addresses for the user's accounts.",params:[],result:{name:"AddressList",schema:{type:"array",items:{$ref:"#/components/schemas/address"}}},examples:[{name:"eth_accounts example",params:[],result:{name:"eth_accountsExampleResult",value:"0xa77392123a1085f75e62eec7dea7e0e1e5142d5f"}}]},{name:"eth_sendTransaction",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Restricted"},{$ref:"#/components/tags/Multichain"}],description:"Creates a new wallet confirmation to make an Ethereum transaction from the user's account. This method requires that the user has granted permission to interact with their account first, so make sure to call `eth_requestAccounts` (recommended) or `wallet_requestPermissions` first.",summary:"Initiates a new transaction.",params:[{name:"Transaction",required:!0,description:"The transaction object to sign and send.",schema:{type:"object",title:"Transaction",description:"The parameters to customize a transaction. If a `to` address is not provided, it will be assumed that the transaction is a contract creation transaction, and the `data` field of the transaction will be used as the contract initialization code. `gasPrice` cannot be used together with `maxPriorityFeePerGas` and `maxFeePerGas`.",required:["from"],if:{properties:{to:{not:{type:"string"}}}},then:{required:["data"]},properties:{to:{title:"to address",$ref:"#/components/schemas/address"},from:{title:"from address",$ref:"#/components/schemas/address"},gas:{title:"gas limit",$ref:"#/components/schemas/uint"},value:{title:"value",$ref:"#/components/schemas/uint"},data:{title:"data",$ref:"#/components/schemas/bytes"},gasPrice:{title:"gas price",description:"The gas price the sender is willing to pay to miners in wei. Used in pre-1559 transactions.",$ref:"#/components/schemas/uint"},maxPriorityFeePerGas:{title:"max priority fee per gas",description:"Maximum fee per gas the sender is willing to pay to miners in wei. Used in 1559 transactions.",$ref:"#/components/schemas/uint"},maxFeePerGas:{title:"max fee per gas",description:"The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei. Used in 1559 transactions.",$ref:"#/components/schemas/uint"}}}}],result:{name:"TransactionHash",description:"The transaction hash of the sent transaction.",schema:{$ref:"#/components/schemas/bytes32"}},errors:[{code:4100,message:"The requested account and/or method has not been authorized by the user."}],examples:[{name:"sendTransaction",params:[{name:"Transaction",value:{to:"0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7",from:"0xDeaDbeefdEAdbeefdEadbEEFdeadbeefDEADbEEF",gas:"0x76c0",value:"0x8ac7230489e80000",data:"0x",gasPrice:"0x4a817c800"}}],result:{name:"eth_sendTransactionExampleResult",value:"0x4e306b5a5a37532e1734503f7d2427a86f2c992fbe471f5be403b9f734e667c8"}}]},{name:"eth_decrypt",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Restricted"},{$ref:"#/components/tags/Deprecated"}],summary:"Decrypts an encrypted message.",description:"This method is deprecated and may be removed in the future.\n\n Requests that MetaMask decrypt the specified encrypted message.\n The message must have been encrypted using the public encryption key of the specified Ethereum address.\n Returns a promise that resolves to the decrypted message, or rejects if the decryption attempt fails.",params:[{name:"EncryptedMessage",required:!0,description:"The encrypted message to decrypt.",schema:{type:"string"}},{name:"Address",required:!0,description:"The address of the Ethereum account that can decrypt the message.",schema:{$ref:"#/components/schemas/address"}}],result:{name:"PermissionsList",schema:{$ref:"#/components/schemas/PermissionsList"}},errors:[{code:4100,message:"The requested account and/or method has not been authorized by the user."}],examples:[{name:"decryptExample",params:[{name:"EncryptedMessage",value:"0x7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a2243533967507076467071765358704655416679726a7179774e35302b7a747766222c22657068656d5075626c69634b6579223a224372774b61456d2f4b356d6d714239764c376f5872636d6441417757764479324f784c3333527135576e553d222c2263697068657274657874223a2248347a65336e7177572b753174663956343945506167454e343872774f766b6952676244566e47587a38493d227d"},{name:"Address",value:"0xD1F5279BE4B4dD94133A23deE1B23F5bfC0Db1d0"}],result:{name:"eth_decryptExampleResult",value:"Hello, Ethereum!"}}]},{name:"eth_getEncryptionPublicKey",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Restricted"},{$ref:"#/components/tags/Deprecated"}],summary:"Gets a public key used for encryption.",description:"This method is deprecated and may be removed in the future.\n\n Requests that the user share their public encryption key.\n Returns a public encryption key, or rejects if the user denies the request.\n The public key is computed from entropy associated with the specified user account, using the NaCl implementation of the `X25519_XSalsa20_Poly1305` algorithm.",params:[{name:"Address",required:!0,description:"The address of the Ethereum account that can decrypt the message.",schema:{$ref:"#/components/schemas/address"}}],result:{name:"EncryptionKey",schema:{type:"string"}},examples:[{name:"eth_getEncryptionPublicKey",params:[{name:"Address",value:"0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7"}],result:{name:"eth_getEncryptionPublicKeyExampleResult",value:"0x04bfcab3b7ca7e8b3f3b62b2f7f77e9e4b68080bbf8f0f4a1c8f890864d2c7c1d3c45d8b2e3f5f1c27dfeea4c2f5733e90bfc7484e2a690aa9b8ac4559d2e6a8d7"}}]},{name:"web3_clientVersion",tags:[{$ref:"#/components/tags/Ethereum"},{$ref:"#/components/tags/Multichain"}],description:"Returns the current MetaMask client version. This differs slightly per client. For example, the browser extension returns a string like `MetaMask/v10.33.1`, while the mobile app returns a string like `MetaMask/8.1.2/Mobile`.",summary:"Current client version.",params:[],examples:[{name:"MetaMaskClientVersionExample",description:"Example version response from MetaMask.",params:[],result:{name:"MetaMaskClientVersion",description:"The current client version.",value:"MetaMask/v10.33.1"}},{name:"MetaMaskMobileClientVersionExample",description:"Example version response from MetaMask Mobile.",params:[],result:{name:"MetaMaskClientVersion",description:"The current client version.",value:"MetaMask/8.1.2/Mobile"}}],result:{name:"CurrentVersion",description:"The current client version.",schema:{title:"CurrentClientVersion",type:"string"}}},{name:"eth_subscribe",tags:[{$ref:"#/components/tags/Ethereum"},{$ref:"#/components/tags/Multichain"}],summary:"Subscribes to specific Ethereum events, returning a subscription ID used to receive notifications.",description:"Subscribes to specific events on the Ethereum network, such as new blocks, or logs. When an event occurs, a notification is sent to the client with the corresponding data. To stop receiving notifications, the client can unsubscribe using `eth_unsubscribe`.",params:[{name:"subscriptionType",required:!0,schema:{title:"subscriptionType",type:"string",enum:["newHeads","logs"],description:"The type of subscription to create. Must be one of the following:\n1. `newHeads` - New block headers.\n2. `logs` - Logs matching a filter object."}},{name:"filterOptions",required:!1,schema:{title:"filterOptions",type:"object",description:"(Optional) An object containing filter options specific to the subscription type. Only applicable for the `logs` subscription type.",required:["topics"],properties:{address:{type:"string",description:"(Optional) A single address or an array of addresses to filter the logs by."},topics:{type:"array",description:"An array of topics to filter the logs by.",items:{type:"string"}}}}}],result:{name:"subscriptionId",schema:{type:"string"},description:"A unique subscription ID that can be used to unsubscribe or identify incoming notifications."},examples:[{name:"eth_subscribe example",params:[{name:"subscriptionType",value:"newHeads"}],result:{name:"eth_subscribeExampleResult",value:"0x1b84f2cdf29a204b79e450c1939b30c1"}}]},{name:"eth_unsubscribe",tags:[{$ref:"#/components/tags/Ethereum"},{$ref:"#/components/tags/Multichain"}],summary:"Unsubscribes from a specific Ethereum event, using the subscription ID provided by `eth_subscribe`.",description:"Unsubscribes from specific events on the Ethereum network, to which the client has been previously subscribed using `eth_subscribe`. The client must provide the subscription ID obtained from `eth_subscribe` to stop receiving notifications for the corresponding event.",params:[{name:"subscriptionId",required:!0,schema:{type:"string",description:"The unique subscription ID obtained from `eth_subscribe`, used to identify the subscription to be unsubscribed."}}],result:{name:"unsubscribed",schema:{type:"boolean"},description:"A boolean value indicating whether the unsubscription was successful."},examples:[{name:"eth_unsubscribe example",params:[{name:"subscriptionId",value:"0x1b84f2cdf29a204b79e450c1939b30c1"}],result:{name:"eth_unsubscribeExampleResult",value:!0}}]},{name:"wallet_swapAsset",tags:[{$ref:"#/components/tags/MetaMask"},{$ref:"#/components/tags/Experimental"}],summary:"Allows dApps to request MetaMask to perform a token swap operation.",description:"This method enables dApps to initiate a token swap directly within MetaMask, improving the user experience by streamlining the process of swapping tokens. The method accepts parameters for the source and destination tokens and initiates a token swap operation.",params:[{name:"SwapAssetParameter",required:!0,schema:{title:"SwapAssetParameter",type:"object",required:["fromToken","toToken","userAddress"],properties:{fromToken:{type:"array",items:{type:"object",required:["address"],properties:{address:{type:"string",description:"The CAIP-10 formatted address of the source token.",$ref:"#/components/schemas/Caip10Address"},value:{type:"string",description:"(Optional) The amount of the source token to be swapped, in wei, as a hexadecimal string, defaults to 0.",nullable:!0}}}},toToken:{type:"object",required:["address"],properties:{address:{type:"string",description:"The CAIP-10 formatted address of the destination token.",$ref:"#/components/schemas/Caip10Address"}}},userAddress:{type:"string",description:"The CAIP-10 formatted address of the user performing the swap.",$ref:"#/components/schemas/Caip10Address"}}}}],result:{name:"SwapAssetResult",description:"A boolean indicating if the swap was initiated successfully.",schema:{type:"boolean"}},errors:[{code:6e3,message:"Swap is not available on this chain {{chainName}}"},{code:-32600,message:"Cross-chain swaps are currently not supported. Both fromToken and toToken must be on the same blockchain."}],examples:[{name:"wallet_swapAsset example",params:[{name:"SwapAssetParameter",value:{from:[{tokenAddress:"0x1234567890abcdefABCDEF1234567890ABCDEF",value:"0xDE0B6B3A7640000"}],to:{tokenAddress:"0xabcdef1234567890ABCDEF1234567890abcdef"},userAddress:"0x0000000000000000000000000000000000000000"}}],result:{name:"wallet_swapAssetExampleResult",value:!0}}]},{name:"eth_blockNumber",summary:"Returns the number of most recent block.",params:[],result:{name:"Block number",schema:{$ref:"#/components/schemas/uint"}},examples:[{name:"eth_blockNumber example",params:[],result:{name:"Block number",value:"0x2377"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_call",summary:"Executes a new message call immediately without creating a transaction on the block chain.",params:[{name:"Transaction",required:!0,schema:{$ref:"#/components/schemas/GenericTransaction"}},{name:"Block",required:!1,schema:{$ref:"#/components/schemas/BlockNumberOrTagOrHash"}}],result:{name:"Return data",schema:{$ref:"#/components/schemas/bytes"}},examples:[{name:"eth_call example",params:[{name:"Transaction",value:{to:"0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13",value:"0x1"}},{name:"Block",value:"latest"}],result:{name:"Return data",value:"0x"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_chainId",summary:"Returns the chain ID of the current network.",params:[],result:{name:"Chain ID",schema:{$ref:"#/components/schemas/uint"}},examples:[{name:"eth_chainId example",params:[],result:{name:"Chain ID",value:"0x1"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_coinbase",summary:"Returns the client coinbase address.",params:[],result:{name:"Coinbase address",schema:{$ref:"#/components/schemas/address"}},examples:[{name:"eth_coinbase example",params:[],result:{name:"Coinbase address",value:"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_estimateGas",summary:"Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.",params:[{name:"Transaction",required:!0,schema:{$ref:"#/components/schemas/GenericTransaction"}},{name:"Block",required:!1,schema:{$ref:"#/components/schemas/BlockNumberOrTag"}}],result:{name:"Gas used",schema:{$ref:"#/components/schemas/uint"}},examples:[{name:"eth_estimateGas example",params:[{name:"Transaction",value:{from:"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",to:"0x44aa93095d6749a706051658b970b941c72c1d53",value:"0x1"}}],result:{name:"Gas used",value:"0x5208"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_feeHistory",summary:"Transaction fee history",description:"Returns transaction base fee per gas and effective priority fee per gas for the requested/supported block range.",params:[{name:"blockCount",description:"Requested range of blocks. Clients will return less than the requested range if not all blocks are available.",required:!0,schema:{$ref:"#/components/schemas/uint"}},{name:"newestBlock",description:"Highest block of the requested range.",required:!0,schema:{$ref:"#/components/schemas/BlockNumberOrTag"}},{name:"rewardPercentiles",description:"A monotonically increasing list of percentile values. For each block in the requested range, the transactions will be sorted in ascending order by effective tip per gas and the coresponding effective tip for the percentile will be determined, accounting for gas consumed.",required:!0,schema:{title:"rewardPercentiles",type:"array",items:{title:"rewardPercentile",description:"Floating point value between 0 and 100.",type:"number"}}}],result:{name:"Fee history result",description:"Fee history for the returned block range. This can be a subsection of the requested range if not all blocks are available.",schema:{title:"feeHistoryResults",description:"Fee history results.",type:"object",required:["oldestBlock","baseFeePerGas","gasUsedRatio"],additionalProperties:!1,properties:{oldestBlock:{title:"oldestBlock",description:"Lowest number block of returned range.",$ref:"#/components/schemas/uint"},baseFeePerGas:{title:"baseFeePerGasArray",description:"An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.",type:"array",items:{$ref:"#/components/schemas/uint"}},baseFeePerBlobGas:{title:"baseFeePerBlobGasArray",description:"An array of block base fees per blob gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-4844 blocks.",type:"array",items:{$ref:"#/components/schemas/uint"}},gasUsedRatio:{title:"gasUsedRatio",description:"An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit.",type:"array",items:{$ref:"#/components/schemas/ratio"}},blobGasUsedRatio:{title:"blobGasUsedRatio",description:"An array of block blob gas used ratios. These are calculated as the ratio of blobGasUsed and the max blob gas per block.",type:"array",items:{$ref:"#/components/schemas/ratio"}},reward:{title:"rewardArray",description:"A two-dimensional array of effective priority fees per gas at the requested block percentiles.",type:"array",items:{title:"rewardPercentile",description:"An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.",type:"array",items:{title:"rewardPercentile",description:"A given percentile sample of effective priority fees per gas from a single block in ascending order, weighted by gas used. Zeroes are returned if the block is empty.",$ref:"#/components/schemas/uint"}}}}}},examples:[{name:"eth_feeHistory example",params:[{name:"blockCount",value:"0x5"},{name:"newestblock",value:"latest"},{name:"rewardPercentiles",value:[20,30]}],result:{name:"Fee history result",value:{oldestblock:"0x10b52f",baseFeePerGas:["0x3fa63a3f","0x37f999ee","0x3e36f20a","0x4099f79a","0x430d532d","0x46fcd4a4"],baseFeePerBlobGas:["0x7b7609c19","0x6dbe41789","0x7223341d4","0x6574a002c","0x7223341d4","0x6574a002c"],gasUsedRatio:[.017712333333333333,.9458865666666667,.6534561,.6517375666666667,.7347769666666667],blobGasUsedRatio:[0,.6666666666666666,0,1,0],reward:[["0x3b9aca00","0x59682f00"],["0x3a13012","0x3a13012"],["0x3a13012","0x3a13012"],["0xf4240","0xf4240"],["0xf4240","0xf4240"]]}}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_gasPrice",summary:"Returns the current price per gas in wei.",params:[],result:{name:"Gas price",schema:{title:"Gas price",$ref:"#/components/schemas/uint"}},examples:[{name:"eth_gasPrice example",params:[],result:{name:"Gas price",value:"0x3e8"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getBalance",summary:"Returns the balance of the account of given address.",params:[{name:"Address",required:!0,schema:{$ref:"#/components/schemas/address"}},{name:"Block",required:!0,schema:{$ref:"#/components/schemas/BlockNumberOrTagOrHash"}}],result:{name:"Balance",schema:{$ref:"#/components/schemas/uint"}},examples:[{name:"eth_getBalance example",params:[{name:"Address",value:"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"},{name:"Block",value:"latest"}],result:{name:"Balance",value:"0x1cfe56f3795885980000"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getBlockByHash",summary:"Returns information about a block by hash.",params:[{name:"Block hash",required:!0,schema:{$ref:"#/components/schemas/hash32"}},{name:"Hydrated transactions",required:!0,schema:{title:"hydrated",type:"boolean"}}],result:{name:"Block information",schema:{oneOf:[{$ref:"#/components/schemas/notFound"},{$ref:"#/components/schemas/Block"}]}},examples:[{name:"eth_getBlockByHash example",params:[{name:"Block hash",value:"0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c"},{name:"Hydrated transactions",value:!1}],result:{name:"Block information",value:{number:"0x68b3",hash:"0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c",mixHash:"0x24900fb3da77674a861c428429dce0762707ecb6052325bbd9b3c64e74b5af9d",parentHash:"0x1f68ac259155e2f38211ddad0f0a15394d55417b185a93923e2abe71bb7a4d6d",nonce:"0x378da40ff335b070",sha3Uncles:"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",logsBloom:"0x00000000000000100000004080000000000500000000000000020000100000000800001000000004000001000000000000000800040010000020100000000400000010000000000000000040000000000000040000000000000000000000000000000400002400000000000000000000000000000004000004000000000000840000000800000080010004000000001000000800000000000000000000000000000000000800000000000040000000020000000000000000000800000400000000000000000000000600000400000000002000000000000000000000004000000000000000100000000000000000000000000000000000040000900010000000",transactionsRoot:"0x4d0c8e91e16bdff538c03211c5c73632ed054d00a7e210c0eb25146c20048126",stateRoot:"0x91309efa7e42c1f137f31fe9edbe88ae087e6620d0d59031324da3e2f4f93233",receiptsRoot:"0x68461ab700003503a305083630a8fb8d14927238f0bc8b6b3d246c0c64f21f4a",miner:"0xb42b6c4a95406c78ff892d270ad20b22642e102d",difficulty:"0x66e619a",totalDifficulty:"0x1e875d746ae",extraData:"0xd583010502846765746885676f312e37856c696e7578",size:"0x334",gasLimit:"0x47e7c4",gasUsed:"0x37993",timestamp:"0x5835c54d",uncles:[],transactions:["0xa0807e117a8dd124ab949f460f08c36c72b710188f01609595223b325e58e0fc","0xeae6d797af50cb62a596ec3939114d63967c374fa57de9bc0f4e2b576ed6639d"],baseFeePerGas:"0x7",withdrawalsRoot:"0x7a4ecf19774d15cf9c15adf0dd8e8a250c128b26c9e2ab2a08d6c9c8ffbd104f",withdrawals:[{index:"0x0",validatorIndex:"0x9d8c0",address:"0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f",amount:"0x11a33e3760"}],blobGasUsed:"0x0",excessBlobGas:"0x0",parentBeaconBlockRoot:"0x95c4dbd5b19f6fe3cbc3183be85ff4e85ebe75c5b4fc911f1c91e5b7a554a685"}}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getBlockByNumber",summary:"Returns information about a block by number.",params:[{name:"Block",required:!0,schema:{$ref:"#/components/schemas/BlockNumberOrTag"}},{name:"Hydrated transactions",required:!0,schema:{title:"hydrated",type:"boolean"}}],result:{name:"Block information",schema:{oneOf:[{$ref:"#/components/schemas/notFound"},{$ref:"#/components/schemas/Block"}]}},examples:[{name:"eth_getBlockByNumber example",params:[{name:"block",value:"0x68b3"},{name:"Hydrated transactions",value:!1}],result:{name:"Block information",value:{number:"0x68b3",hash:"0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c",mixHash:"0x24900fb3da77674a861c428429dce0762707ecb6052325bbd9b3c64e74b5af9d",parentHash:"0x1f68ac259155e2f38211ddad0f0a15394d55417b185a93923e2abe71bb7a4d6d",nonce:"0x378da40ff335b070",sha3Uncles:"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",logsBloom:"0x00000000000000100000004080000000000500000000000000020000100000000800001000000004000001000000000000000800040010000020100000000400000010000000000000000040000000000000040000000000000000000000000000000400002400000000000000000000000000000004000004000000000000840000000800000080010004000000001000000800000000000000000000000000000000000800000000000040000000020000000000000000000800000400000000000000000000000600000400000000002000000000000000000000004000000000000000100000000000000000000000000000000000040000900010000000",transactionsRoot:"0x4d0c8e91e16bdff538c03211c5c73632ed054d00a7e210c0eb25146c20048126",stateRoot:"0x91309efa7e42c1f137f31fe9edbe88ae087e6620d0d59031324da3e2f4f93233",receiptsRoot:"0x68461ab700003503a305083630a8fb8d14927238f0bc8b6b3d246c0c64f21f4a",miner:"0xb42b6c4a95406c78ff892d270ad20b22642e102d",difficulty:"0x66e619a",totalDifficulty:"0x1e875d746ae",extraData:"0xd583010502846765746885676f312e37856c696e7578",size:"0x334",gasLimit:"0x47e7c4",gasUsed:"0x37993",timestamp:"0x5835c54d",uncles:[],transactions:["0xa0807e117a8dd124ab949f460f08c36c72b710188f01609595223b325e58e0fc","0xeae6d797af50cb62a596ec3939114d63967c374fa57de9bc0f4e2b576ed6639d"],baseFeePerGas:"0x7",withdrawalsRoot:"0x7a4ecf19774d15cf9c15adf0dd8e8a250c128b26c9e2ab2a08d6c9c8ffbd104f",withdrawals:[{index:"0x0",validatorIndex:"0x9d8c0",address:"0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f",amount:"0x11a33e3760"}],blobGasUsed:"0x0",excessBlobGas:"0x0",parentBeaconBlockRoot:"0x95c4dbd5b19f6fe3cbc3183be85ff4e85ebe75c5b4fc911f1c91e5b7a554a685"}}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getBlockTransactionCountByHash",summary:"Returns the number of transactions in a block from a block matching the given block hash.",params:[{name:"Block hash",schema:{$ref:"#/components/schemas/hash32"}}],result:{name:"Transaction count",schema:{oneOf:[{$ref:"#/components/schemas/notFound"},{title:"Transaction count",$ref:"#/components/schemas/uint"}]}},examples:[{name:"eth_getBlockTransactionCountByHash example",params:[{name:"Block hash",value:"0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"}],result:{name:"Transaction count",value:"0x8"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getBlockTransactionCountByNumber",summary:"Returns the number of transactions in a block matching the given block number.",params:[{name:"Block",schema:{$ref:"#/components/schemas/BlockNumberOrTag"}}],result:{name:"Transaction count",schema:{oneOf:[{$ref:"#/components/schemas/notFound"},{title:"Transaction count",$ref:"#/components/schemas/uint"}]}},examples:[{name:"eth_getBlockTransactionCountByNumber example",params:[{name:"Block",value:"0xe8"}],result:{name:"Transaction count",value:"0x8"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getCode",summary:"Returns code at a given address.",params:[{name:"Address",required:!0,schema:{$ref:"#/components/schemas/address"}},{name:"Block",required:!0,schema:{$ref:"#/components/schemas/BlockNumberOrTagOrHash"}}],result:{name:"Bytecode",schema:{$ref:"#/components/schemas/bytes"}},examples:[{name:"eth_getCode example",params:[{name:"Address",value:"0xa50a51c09a5c451c52bb714527e1974b686d8e77"},{name:"Block",value:"latest"}],result:{name:"Bytecode",value:"0x60806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633fa4f2458114604d57806355241077146071575b600080fd5b348015605857600080fd5b50605f6088565b60408051918252519081900360200190f35b348015607c57600080fd5b506086600435608e565b005b60005481565b60008190556040805182815290517f199cd93e851e4c78c437891155e2112093f8f15394aa89dab09e38d6ca0727879181900360200190a1505600a165627a7a723058209d8929142720a69bde2ab3bfa2da6217674b984899b62753979743c0470a2ea70029"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getFilterChanges",summary:"Polling method for the filter with the given ID (created using `eth_newFilter`). Returns an array of logs which occurred since last poll.",params:[{name:"Filter identifier",schema:{$ref:"#/components/schemas/uint"}}],result:{name:"Log objects",schema:{$ref:"#/components/schemas/FilterResults"}},examples:[{name:"eth_getFilterChanges example",params:[{name:"Filter identifier",value:"0x01"}],result:{name:"Log objects",value:[{logIndex:"0x0",removed:!1,blockNumber:"0x233",blockHash:"0xfc139f5e2edee9e9c888d8df9a2d2226133a9bd87c88ccbd9c930d3d4c9f9ef5",transactionHash:"0x66e7a140c8fa27fe98fde923defea7562c3ca2d6bb89798aabec65782c08f63d",transactionIndex:"0x0",address:"0x42699a7612a82f1d9c36148af9c77354759b210b",data:"0x0000000000000000000000000000000000000000000000000000000000000004",topics:["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"]},{logIndex:"0x0",removed:!1,blockNumber:"0x238",blockHash:"0x98b0ec0f9fea0018a644959accbe69cd046a8582e89402e1ab0ada91cad644ed",transactionHash:"0xdb17aa1c2ce609132f599155d384c0bc5334c988a6c368056d7e167e23eee058",transactionIndex:"0x0",address:"0x42699a7612a82f1d9c36148af9c77354759b210b",data:"0x0000000000000000000000000000000000000000000000000000000000000007",topics:["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"]}]}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getFilterLogs",summary:"Returns an array of all logs matching the filter with the given ID (created using `eth_newFilter`).",params:[{name:"Filter identifier",schema:{$ref:"#/components/schemas/uint"}}],result:{name:"Log objects",schema:{$ref:"#/components/schemas/FilterResults"}},examples:[{name:"eth_getFilterLogs example",params:[{name:"Filter identifier",value:"0x01"}],result:{name:"Log objects",value:[{logIndex:"0x0",removed:!1,blockNumber:"0x233",blockHash:"0xfc139f5e2edee9e9c888d8df9a2d2226133a9bd87c88ccbd9c930d3d4c9f9ef5",transactionHash:"0x66e7a140c8fa27fe98fde923defea7562c3ca2d6bb89798aabec65782c08f63d",transactionIndex:"0x0",address:"0x42699a7612a82f1d9c36148af9c77354759b210b",data:"0x0000000000000000000000000000000000000000000000000000000000000004",topics:["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"]},{logIndex:"0x0",removed:!1,blockNumber:"0x238",blockHash:"0x98b0ec0f9fea0018a644959accbe69cd046a8582e89402e1ab0ada91cad644ed",transactionHash:"0xdb17aa1c2ce609132f599155d384c0bc5334c988a6c368056d7e167e23eee058",transactionIndex:"0x0",address:"0x42699a7612a82f1d9c36148af9c77354759b210b",data:"0x0000000000000000000000000000000000000000000000000000000000000007",topics:["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"]}]}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getLogs",summary:"Returns an array of all logs matching the specified filter.",params:[{name:"Filter",schema:{$ref:"#/components/schemas/Filter"}}],result:{name:"Log objects",schema:{$ref:"#/components/schemas/FilterResults"}},examples:[{name:"eth_getLogs example",params:[{name:"Filter",value:{fromBlock:"0x137d3c2",toBlock:"0x137d3c3",address:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",topics:[]}}],result:{name:"Log objects",value:[{logIndex:"0x0",removed:!1,blockNumber:"0x233",blockHash:"0xfc139f5e2edee9e9c888d8df9a2d2226133a9bd87c88ccbd9c930d3d4c9f9ef5",transactionHash:"0x66e7a140c8fa27fe98fde923defea7562c3ca2d6bb89798aabec65782c08f63d",transactionIndex:"0x0",address:"0x42699a7612a82f1d9c36148af9c77354759b210b",data:"0x0000000000000000000000000000000000000000000000000000000000000004",topics:["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"]},{logIndex:"0x0",removed:!1,blockNumber:"0x238",blockHash:"0x98b0ec0f9fea0018a644959accbe69cd046a8582e89402e1ab0ada91cad644ed",transactionHash:"0xdb17aa1c2ce609132f599155d384c0bc5334c988a6c368056d7e167e23eee058",transactionIndex:"0x0",address:"0x42699a7612a82f1d9c36148af9c77354759b210b",data:"0x0000000000000000000000000000000000000000000000000000000000000007",topics:["0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"]}]}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getProof",summary:"Returns the merkle proof for a given account and optionally some storage keys.",params:[{name:"Address",required:!0,schema:{$ref:"#/components/schemas/address"}},{name:"StorageKeys",required:!0,schema:{title:"Storage keys",type:"array",items:{$ref:"#/components/schemas/bytesMax32"}}},{name:"Block",required:!0,schema:{$ref:"#/components/schemas/BlockNumberOrTagOrHash"}}],result:{name:"Account",schema:{$ref:"#/components/schemas/AccountProof"}},examples:[{name:"eth_getProof example",params:[{name:"Address",value:"0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8"},{name:"StorageKeys",value:["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","0x283s34c8e2b1456f09832c71e5d6a0b4f8c9e1d3a2b5c7f0e6d4a8b2c1f3e5d7"]},{name:"Block",value:"latest"}],result:{name:"Account",value:{accountProof:["0xf90211a06a718c2c9da77c253b12d7b2569657901e37bb691718f5dda1b86157ab1dd5eda0e7f19ed5e21bccc8d3260236b24f80ad88b3634f5d005f37b838881f0e12f1bda0abb301291704e4d92686c0f5f8ebb1734185321559b8d717ffdca95c99591976a0d0c2026bfab65c3b95276bfa82af9dec860b485f8857f293c148d63a2182128fa0c98044ec9a1273a218bed58b478277dd39173ad7b8edb95c200423a6bc8fc25fa056e5a55d9ddccdbf49362857200bbb1f042d61187c9f5f9ddcff5d2f1fc984a2a02a5b7200af424114f99a4b5f0a21c19aac82209e431ed80bfde177adb1004bdfa0026e4374f0518ff44a80fa374838ecb86cc64ac93bb710fea6dff4198f947b27a03fea341d87984673ad523177ed52f278bf4d8f97e6531c8ece932aeede4802f4a0bfe2f4a7fcb78f7e9f080dea7b6977fb1d88c441696e4456dad92b9d34ff0f43a02a3eb5c0edb14626c9c629601027bd60178bb2b688a67cea4d179fc432436615a0747355b8e02f3b884b4ffe5cea1619e32515fea064cca98208591af8c744e894a0874253737bae37f020ad3bb7e3292c7c4a63cdc158af6b33aaa4deaef016dccba03d8192bc1fc6aa1548912e763a0b5013a94399cefad7b47cf388873b2b794068a09b67f9737c6028d796bfd1c5da57a6f45824dc891f848ea0e1f8019d1fb5fba8a0aa871f9de8da85960fcd8a22cdf21c27f11e3966c14a6737ffd414b98dda00b280","0xf90211a0d360be1e1da1a0c32bc4c105833bd531e59d110684007b7c50fb2709002973eca0cf6dd1e350a7031b4e2ab49c899fd8bd47551c8565d8fd8d1d7796c83820c3b1a0eb0a88c29bb33989a589156f7bf07d9efc74034dd9d3f5b73385c3b45c3249bea02783c25f97a6ddb8dc07adf4b176991836d39184b1f678adeda832fff15e3664a00a4e288060045e587774d8a64993a7add73068b16863145e1e8eeb4602e18e19a0340851f4046ad1298962d6e47d05c66329549c839c158748aaad7ae00b943aefa085b127bc2a3bd17604283de21b2b3c9aa8f1d4b7b85c94d8105a46fe32c77688a00f531d62b3c5435324c01009c284fe31277e8d38302b75ea01be89f09e205969a00011c8351c0e3d639ac54b9d3a59de630b16a67de8270d7d6064d0a67e93f9cca048780d32b7f2db88650b51c46f46fd0a68795edee1fd5ecee6eb3595741d9669a0c91afd74eaf8e08a997061a62b354e2516fdc494e8e26cc50ceeb8f4a175608ba0e2c07f1b48fab80eecb340f5882e8c7b32ee416e4045c61f1df646a133487303a01a1eff78435a7a29a29463bdc3486ae81364b00bea82ba0fdf67a110770f2261a04f2eb440ba71c72da5fd7f0e439018d6671dc809f747213a1ea755848124e994a074ff9f37fce99daa3ed01dd763076450022996fc729be2cc43c61ec5182c2366a0b80b36b7b621112592f52390b89748d422e9b1517c4b0203b8176a53f89d4a6680","0xf90211a0b25f283bd01a8c8b2418049f9585bc37ff2c1e2e12eab4b7f64ae1f26647389aa02ad96c150d7c3c9c194d30315456852cf6a0a940e0191ae5d04007454823d4e9a0b220cf7a855e2dbcc0b973134e2e119b982d7d40dbb1b27d99816c41f40e829aa049224431da84cbf1b7ae813abcc9ef4c1dfc1760f6ddc5d57f7354bf3cbf6cc4a015191f879ac115b362f0257fd3eedb789537e836574a5b1abf1c9982ebe3bdfea07913c1b6e7282569d2d421e9fa2257f5d1698e93303bc49b941704287d7aaefea0a526576981ce6fd9f2bd48dd2ca6d5272f2fbdc85f0ee35a295f6ccd97ae8765a0313fad407f0c737c29024c02a890c4ecc12d7771c05ab7b435e5087a7cdef4d9a0d2044603cba9d4afdaf6fd2470e729ef3a65242de71276f20d59accfa6b53a7ca0457caacb9370c09b15f7d904adefd2308be94e23669ba5f43241ffff5f438a0aa09fb2dd45a383a0cc088a72b14117e1e9b7d6889218f3ac7631e8de644c5cb76da0c675dcd4d3fb692b514851c6106e2b09e6f5661d56a0a32ae02e2efc1515c235a074949a59ff1bdba87548510d6e404ec4532f4456dfdec8e753d92fda11a3088ba0a328c6ab1ab8f70db4d23e95bb163c13ba0c508f063a5b1393a4efd7ff375f05a0c722fe3ce796998269373cbb2fc229b2bdf2c43c6c2df003309422e043ce6c03a024e69343286eec44fa4744f6907209116e5383cff3fa98fe81ba06e7e8d4366680","0xf90211a00e99ba2198124b8241ea304551fe973215829e2fbc0438d67922707a2a847432a0bb9ce24fd527879c5fe6dbbec1ef5a05ed9d1ca88e921d140bafbec1112f6a6aa099787fd6c7a1989229c4291ef5267335e66152ce417daea46e66d19cb6f81d1ca0e430ff4b8d5621baa5978673344e78b4d8b4df51431b6e63785267c98a24ce18a0bb3e91a825fe3d42ed270a93e9ad1aabd566c40cb28e622f7f1d7ee967c8afd6a0aa364b0056870c6507bc3262a5f851ecb13684088bdb13996d3cb2db401ce3ffa0a3732eba4c7a6e062665ab5be08acb986c3db87556fb138548cc900ff1e56995a026b088e90c9738b8ce16e853107a937a50d52726a24f9f6ce60f587762eb45a2a006c9d5bc3c064b5c1fb565bff91cace9161c64ae653a329610c1dcf34d434429a06c16df2edc70656d322d0c2403bad7d45bc790ffc3e7adeef856d98ea6afc91ba0ae05ed5d6c34b5da29c2e94d7880aeba0906f95f4ec10b132a1d4766a0701c98a01470a86aa350d1ada0c082eac75de828a851f9c8c7c4aa49b1556fe3a5574966a0334eef025100a6da1033710dd98e0475f29d3d7e397caf618ca71c336c5f4f49a0ef0b3abbebcff34d6a8a8f5cdbfbd154ab3452b58dcb09de58ec983644963675a041857e865ec38e200a13bc1a3cb71c7d69aeef7ffdee8be515c9a5b691ce091fa059edd0eb3bbec36bbf38a19802d4646c00ba821ab55fdeea12e15bab62c4e1e580","0xf90211a0af0c7fa65ffcb84c31e68c1cf00e1a20bf8bb497c39883e19b66a99975b03431a0c492cab3623eb7926069794c3c718733e16c5fd0d4a13fb7c752ee9809aac7ada05003cea7132aa70d6f36731d60640a90bcd8f4fd493e4540d5ab1b4943679c0ca0fd700683405b1d2306b586dd3b5b2f92f1692fae20d17cd8b8e59d09b9c6670da01db8683910e46e56e8afeb9fe2b7c35382e5a0914d7b0dd8f0e8cb9981ba7435a0fa7f75d73aa73c35824387bec81388315caa4aee3f4f5562f971beb256c62d49a0ee478e420d83f413e8568dacfd5d83f83a5dd7c45f494b504828e5dc962f0e3ea094b95444a917ac94a675681f6bf851172ad0969801a783a63a71edafed45e7a7a0a0c46586e109abe80fe50361dd582e3f143cb416828239faa43bb2b890869501a0ae051d5d43634c68bf9c97823256cc68580f194dfdbd0c301140c7ca5853430ca0660b9365bb77ec9cdc6eb95516c162dca20727c6f828dbbeb1ae110dde4d3134a09feb1b75e84ff6722e4d837bfb6d207b6ee3b21b86844a01140ce293813b49a1a0ed58a70b04efa3bdc0babe2abfa20824a75d61d52291bfdb5cf08597800764d6a020a2d5d3a83f9e35ad9fd1c448626d90af0eb3efefaa4f2f93207b4096ef5507a0fc8efc4484dcf0a54f0574de9aaade0dcff6ec3599edb9f82efb26b6566dcaeaa032f7e79856db3fd984f72bb2c93d4dab328198d355a61c975fab1f08bdb2046580"],balance:"0x0",codeHash:"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",nonce:"0x0",storageHash:"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",storageProof:[{key:"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",proof:["0xf90211a0c87222cccea2bf32759fcee9dbaacbe3ea4165dd6184af6773651c5e00e34a8ba0be90e6e5d1a67ab5587779c60ac136d6a96db62b84c04998a5f03a367346abd6a05344aa1c9ca2e3e56bf98fd718ec43728578d148e1967fbaf8bf17a2a073a0bda011a2f9312c3308640a0d6ceeae218747290f23806067456da1d444c65abae437a0b3097a108bfce79af6699da4ae3003cd4929f0b4576aad655c31cb725bde84c7a0c133d3c637e174f36a73c22b1039eb003da6374bc0929321241badb3efa3c4a9a0f13059f2301ad9862ce02e3f7f3f2c9ab78eb30583764d73654f7f1f8b1e86fda06544e3915748b18204e09df75ff20d2fa6bd8121e2e669699012d54590383d6fa070e3a8e093691581d58fadb560b510262a758037632cd8670d3a36df828976b7a062a88a2900544dc76a32255a6b2b2a2eef8fa68279700c00adc7508286702552a0a474aeebd5603dfce46a6ecd1ecd519068dc034a544fde03ac42d4018e60a334a0b7d528fc41c8fdc8ea18c6e7d0099270c777ec1403cf879d1f5134bdc12a6c6ca04440f1242e42c5bfa7c536591ab89c8e84bea417435871c32eef1e25295b20daa06a5dcfe3cc84cff9d3e3c3ae868cfba8f0dd111a90c3f85869dab5b893f96643a026b2fb9dd7d08b0ed2f1c44fbf875011412a384f86f751c92e1013248d4aa371a0c75597b2b789fc4e939b71937390ce9d7d53159431328ac52180eef08ef200f280","0xf90191a0f0c5b800b542001597f2b7a8e106ac0e2849d2cc1df1727ac35c4ea3965f1c9180a08537f2e248702a6ae2a57e9110a5740f5772c876389739ac90debd6a0692713ea00b3a26a05b5494fb3ff6f0b3897688a5581066b20b07ebab9252d169d928717fa0a9a54d84976d134d6dba06a65064c7f3a964a75947d452db6f6bb4b6c47b43aaa01e2a1ed3d1572b872bbf09ee44d2ed737da31f01de3c0f4b4e1f046740066461a076f251d160b9a02eb0b5c1d83b61c9cdd4f37361705e79a45529bf49801fb824a0774a01a624cb14a50d17f2fe4b7ae6af8a67bbb029177ccc3dd729a734484d3ea05921b8a19aebe4fff5a36071e311778f9b93459183fdf7f6d870b401fa25dcbba0c8d71dd13d2806e2865a5c2cfa447f626471bf0b66182a8fd07230434e1cad2680a0e9864fdfaf3693b2602f56cd938ccd494b8634b1f91800ef02203a3609ca4c21a0c69d174ad6b6e58b0bd05914352839ec60915cd066dd2bee2a48016139687f21a0513dd5514fd6bad56871711441d38de2821cc6913cb192416b0385f025650731808080"],value:"0x1"}]}}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getStorageAt",summary:"Returns the value from a storage position at a given address.",params:[{name:"Address",required:!0,schema:{$ref:"#/components/schemas/address"}},{name:"Storage slot",required:!0,schema:{$ref:"#/components/schemas/uint256"}},{name:"Block",required:!0,schema:{$ref:"#/components/schemas/BlockNumberOrTagOrHash"}}],result:{name:"Value",schema:{$ref:"#/components/schemas/bytes"}},examples:[{name:"eth_getStorageAt example",params:[{name:"Address",value:"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"},{name:"Storage slot",value:"0x0"},{name:"Block",value:"latest"}],result:{name:"Value",value:"0x0000000000000000000000000000000000000000000000000000000000000000"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getTransactionByBlockHashAndIndex",summary:"Returns information about a transaction by block hash and transaction index position.",params:[{name:"Block hash",required:!0,schema:{$ref:"#/components/schemas/hash32"}},{name:"Transaction index",required:!0,schema:{$ref:"#/components/schemas/uint"}}],result:{name:"Transaction information",schema:{oneOf:[{$ref:"#/components/schemas/notFound"},{$ref:"#/components/schemas/TransactionInfo"}]}},examples:[{name:"eth_getTransactionByBlockHashAndIndex example",params:[{name:"Block hash",value:"0xbf137c3a7a1ebdfac21252765e5d7f40d115c2757e4a4abee929be88c624fdb7"},{name:"Transaction index",value:"0x2"}],result:{name:"Transaction information",value:{blockHash:"0x510efccf44a192e6e34bcb439a1947e24b86244280762cbb006858c237093fda",blockNumber:"0x422",chainId:2018,from:"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",gas:"0x5208",gasPrice:"0x3b9aca00",hash:"0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44",input:"0x",nonce:"0x1",to:"0x627306090abab3a6e1400e9345bc60c78a8bef57",transactionIndex:"0x0",value:"0x4e1003b28d9280000",v:"0xfe7",r:"0x84caf09aefbd5e539295acc67217563438a4efb224879b6855f56857fa2037d3",s:"0x5e863be3829812c81439f0ae9d8ecb832b531d651fb234c848d1bf45e62be8b9"}}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getTransactionByBlockNumberAndIndex",summary:"Returns information about a transaction by block number and transaction index position.",params:[{name:"Block",required:!0,schema:{$ref:"#/components/schemas/BlockNumberOrTag"}},{name:"Transaction index",required:!0,schema:{$ref:"#/components/schemas/uint"}}],result:{name:"Transaction information",schema:{oneOf:[{$ref:"#/components/schemas/notFound"},{$ref:"#/components/schemas/TransactionInfo"}]}},examples:[{name:"eth_getTransactionByBlockNumberAndIndex example",params:[{name:"Block",value:"0x1442e"},{name:"Transaction index",value:"0x2"}],result:{name:"Transaction information",value:{blockHash:"0x510efccf44a192e6e34bcb439a1947e24b86244280762cbb006858c237093fda",blockNumber:"0x422",chainId:2018,from:"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",gas:"0x5208",gasPrice:"0x3b9aca00",hash:"0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44",input:"0x",nonce:"0x1",to:"0x627306090abab3a6e1400e9345bc60c78a8bef57",transactionIndex:"0x0",value:"0x4e1003b28d9280000",v:"0xfe7",r:"0x84caf09aefbd5e539295acc67217563438a4efb224879b6855f56857fa2037d3",s:"0x5e863be3829812c81439f0ae9d8ecb832b531d651fb234c848d1bf45e62be8b9"}}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getTransactionByHash",summary:"Returns the information about a transaction requested by transaction hash.",params:[{name:"Transaction hash",required:!0,schema:{$ref:"#/components/schemas/hash32"}}],result:{name:"Transaction information",schema:{oneOf:[{$ref:"#/components/schemas/notFound"},{$ref:"#/components/schemas/TransactionInfo"}]}},examples:[{name:"eth_getTransactionByHash example",params:[{name:"Transaction hash",value:"0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44"}],result:{name:"Transaction information",value:{blockHash:"0x510efccf44a192e6e34bcb439a1947e24b86244280762cbb006858c237093fda",blockNumber:"0x422",chainId:2018,from:"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",gas:"0x5208",gasPrice:"0x3b9aca00",hash:"0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44",input:"0x",nonce:"0x1",to:"0x627306090abab3a6e1400e9345bc60c78a8bef57",transactionIndex:"0x0",value:"0x4e1003b28d9280000",v:"0xfe7",r:"0x84caf09aefbd5e539295acc67217563438a4efb224879b6855f56857fa2037d3",s:"0x5e863be3829812c81439f0ae9d8ecb832b531d651fb234c848d1bf45e62be8b9"}}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getTransactionCount",summary:"Returns the number of transactions sent from an address.",params:[{name:"Address",required:!0,schema:{$ref:"#/components/schemas/address"}},{name:"Block",required:!0,schema:{$ref:"#/components/schemas/BlockNumberOrTagOrHash"}}],result:{name:"Transaction count",schema:{$ref:"#/components/schemas/uint"}},examples:[{name:"eth_getTransactionCount example",params:[{name:"Address",value:"0xc94770007dda54cF92009BFF0dE90c06F603a09f"},{name:"Block",value:"latest"}],result:{name:"Transaction count",value:"0x1"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getTransactionReceipt",summary:"Returns the receipt of a transaction by transaction hash.",params:[{name:"Transaction hash",required:!0,schema:{$ref:"#/components/schemas/hash32"}}],result:{name:"Receipt information",schema:{oneOf:[{$ref:"#/components/schemas/notFound"},{$ref:"#/components/schemas/ReceiptInfo"}]}},examples:[{name:"eth_getTransactionReceipt example",params:[{name:"Transaction hash",value:"0x504ce587a65bdbdb6414a0c6c16d86a04dd79bfcc4f2950eec9634b30ce5370f"}],result:{name:"Receipt information",value:{blockHash:"0xe7212a92cfb9b06addc80dec2a0dfae9ea94fd344efeb157c41e12994fcad60a",blockNumber:"0x50",contractAddress:null,cumulativeGasUsed:"0x5208",from:"0x627306090abab3a6e1400e9345bc60c78a8bef57",gasUsed:"0x5208",blobGasUsed:"0x20000",effectiveGasPrice:"0x1",blobGasPrice:"0x3",logs:[],logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",status:"0x1",to:"0xf17f52151ebef6c7334fad080c5704d77216b732",transactionHash:"0xc00e97af59c6f88de163306935f7682af1a34c67245e414537d02e422815efc3",transactionIndex:"0x0"}}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getUncleCountByBlockHash",summary:"Returns the number of uncles in a block from a block matching the given block hash.",params:[{name:"Block hash",schema:{$ref:"#/components/schemas/hash32"}}],result:{name:"Uncle count",schema:{oneOf:[{$ref:"#/components/schemas/notFound"},{title:"Uncle count",$ref:"#/components/schemas/uint"}]}},examples:[{name:"eth_getUncleCountByBlockHash example",params:[{name:"Block hash",value:"0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"}],result:{name:"Uncle count",value:"0x1"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_getUncleCountByBlockNumber",summary:"Returns the number of transactions in a block matching the given block number.",params:[{name:"Block",schema:{$ref:"#/components/schemas/BlockNumberOrTag"}}],result:{name:"Uncle count",schema:{oneOf:[{$ref:"#/components/schemas/notFound"},{title:"Uncle count",$ref:"#/components/schemas/uint"}]}},examples:[{name:"eth_getUncleCountByBlockNumber example",params:[{name:"Block",value:"0xe8"}],result:{name:"Uncle count",value:"0x1"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_newBlockFilter",summary:"Creates a filter in the node, to notify when a new block arrives.",params:[],result:{name:"Filter identifier",schema:{$ref:"#/components/schemas/uint"}},examples:[{name:"eth_newBlockFilter example",params:[],result:{name:"Filter identifier",value:"0x01"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_newFilter",summary:"Creates a filter object, based on filter options, to notify when the state changes (logs).",params:[{name:"Filter",schema:{$ref:"#/components/schemas/Filter"}}],result:{name:"Filter identifier",schema:{$ref:"#/components/schemas/uint"}},examples:[{name:"eth_newFilter example",params:[{name:"Filter",value:{fromBlock:"0x137d3c2",toBlock:"0x137d3c3",address:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",topics:[]}}],result:{name:"Filter identifier",value:"0x01"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_newPendingTransactionFilter",summary:"Creates a filter in the node, to notify when new pending transactions arrive.",params:[],result:{name:"Filter identifier",schema:{$ref:"#/components/schemas/uint"}},examples:[{name:"eth_newPendingTransactionFilter example",params:[],result:{name:"Filter identifier",value:"0x01"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_sendRawTransaction",summary:"Submits a raw transaction. You can create and sign a transaction externally using a library such as [web3.js](https://web3js.readthedocs.io/) or [ethers.js](https://docs.ethers.org/). For [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) transactions, the raw form must be the network form. This means it includes the blobs, KZG commitments, and KZG proofs.",params:[{name:"Transaction",required:!0,schema:{$ref:"#/components/schemas/bytes"}}],result:{name:"Transaction hash",schema:{$ref:"#/components/schemas/hash32"}},examples:[{name:"eth_sendRawTransaction example",params:[{name:"Transaction",value:"0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"}],result:{name:"Transaction hash",value:"0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_syncing",summary:"Returns an object with data about the sync status or false.",params:[],result:{name:"Syncing status",schema:{$ref:"#/components/schemas/SyncingStatus"}},examples:[{name:"eth_syncing example",params:[],result:{name:"Syncing status",value:{startingBlock:"0x0",currentBlock:"0x1518",highestBlock:"0x9567a3"}}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]},{name:"eth_uninstallFilter",summary:"Uninstalls a filter with given id.",params:[{name:"Filter identifier",schema:{$ref:"#/components/schemas/uint"}}],result:{name:"Success",schema:{type:"boolean"}},examples:[{name:"eth_uninstallFilter example",params:[{name:"Filter identifier",value:"0x01"}],result:{name:"Success",value:!0}}],tags:[{name:"Ethereum API",description:"Ethereum Node JSON-RPC method"},{name:"Multichain API",description:"Multichain JSON-RPC method"}]}],components:{errors:{UserRejected:{code:4001,message:"User rejected the request."}},schemas:{TypedData:{title:"TypedData",type:"object",required:["types","primaryType","domain","message"],properties:{types:{type:"object",required:["EIP712Domain"],properties:{EIP712Domain:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}}},description:"An array specifying one or more of the following domain separator values: 1) `name` - The user-readable name of the signing domain, that is, the name of the dapp or the protocol. 2) `version` - The current major version of the signing domain. 3) `chainId` - The chain ID of the network. 4) `verifyingContract` - The address of the contract that will verify the signature. 5) `salt` - A disambiguating salt for the protocol."}},additionalProperties:{type:"array",required:["name","type"],items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}}}}},domain:{type:"object",description:"Contains the domain separator values specified in the `EIP712Domain` type."},primaryType:{type:"string"},message:{type:"object",description:"The message you're proposing the user to sign."}}},AddEthereumChainParameter:{title:"Chain",description:"Object containing information about the chain to add.",type:"object",required:["chainId","chainName","nativeCurrency","rpcUrls"],properties:{chainId:{description:"The chain ID as a `0x`-prefixed hexadecimal string, per the `eth_chainId` method. MetaMask compares this chain ID value with the `eth_chainId` return value. If these values aren't identical, MetaMask rejects the request.",type:"string"},blockExplorerUrls:{description:"(Optional) An array of one or more URLs pointing to block explorer sites for the chain.",type:"array",items:{type:"string",description:"Block explorer URL."}},chainName:{description:"A human-readable name for the chain.",type:"string"},iconUrls:{description:"(Optional) An array of one or more URLs pointing to icons that can be used to visually identify the chain. Note: MetaMask will not currently display these icons. You can still include icon URLs so they are used if MetaMask incorporates them into the display of custom networks in the future.",type:"array",items:{format:"uri",type:"string",description:"Icon URL."}},nativeCurrency:{$ref:"#/components/schemas/NativeCurrency"},rpcUrls:{description:"An array of one or more URLs pointing to RPC endpoints that can be used to communicate with the chain. At least one item is required, and only the first item is used.",type:"array",minItems:1,items:{format:"uri",type:"string",description:"RPC URL."}}}},NativeCurrency:{title:"NativeCurrency",type:"object",description:"An object containing information about the native currency of the chain.",required:["decimals","symbol"],properties:{decimals:{description:"A non-negative integer representing the number of decimals the native currency uses.",minimum:0,type:"integer"},name:{description:"A human-readable name of the native currency.",type:"string"},symbol:{description:"A human-readable symbol of the native currency.",type:"string"}}},Caveats:{title:"Caveats",description:"An array of caveats that specify restrictions on the permission.",type:"array",items:{title:"Caveat",description:"Object containing information about the caveat.",type:"object",properties:{type:{title:"Type",type:"string",description:"Type of caveat."},value:{title:"CaveatValue",description:"Value of the caveat."},name:{title:"Name",type:"string",description:"Name of the caveat."}}}},Permission:{title:"Permission",description:"Object containing information about the permission.",type:"object",properties:{id:{description:"The permission ID.",type:"string"},parentCapability:{description:"The name of the permission being granted. For example, `eth_accounts` or `endowment:permitted-chains`.",type:"string"},invoker:{description:"The URI of the dapp being granted this permission.",type:"string"},caveats:{$ref:"#/components/schemas/Caveats"},date:{description:"The timestamp of the permission request.",type:"number"}}},PermissionsList:{title:"Permissions list",description:"An array of the user's permissions.",type:"array",items:{$ref:"#/components/schemas/Permission"}},Caip10Address:{title:"Caip10Address",type:"string",description:"CAIP-10 defines a way to identify an account/address in any blockchain."},address:{title:"hex encoded address",type:"string",pattern:"^0x[0-9a-fA-F]{40}$"},addresses:{title:"hex encoded address",type:"array",items:{$ref:"#/components/schemas/address"}},byte:{title:"hex encoded byte",type:"string",pattern:"^0x([0-9a-fA-F]?){1,2}$"},bytes:{title:"hex encoded bytes",type:"string",pattern:"^0x[0-9a-f]*$"},bytesMax32:{title:"32 hex encoded bytes",type:"string",pattern:"^0x[0-9a-f]{0,64}$"},bytes8:{title:"8 hex encoded bytes",type:"string",pattern:"^0x[0-9a-f]{16}$"},bytes32:{title:"32 hex encoded bytes",type:"string",pattern:"^0x[0-9a-f]{64}$"},bytes48:{title:"48 hex encoded bytes",type:"string",pattern:"^0x[0-9a-f]{96}$"},bytes96:{title:"96 hex encoded bytes",type:"string",pattern:"^0x[0-9a-f]{192}$"},bytes256:{title:"256 hex encoded bytes",type:"string",pattern:"^0x[0-9a-f]{512}$"},bytes65:{title:"65 hex encoded bytes",type:"string",pattern:"^0x[0-9a-f]{130}$"},ratio:{title:"normalized ratio",type:"number",minimum:0,maximum:1},uint:{title:"hex encoded unsigned integer",type:"string",pattern:"^0x([1-9a-f]+[0-9a-f]*|0)$"},uint64:{title:"hex encoded 64 bit unsigned integer",type:"string",pattern:"^0x([1-9a-f]+[0-9a-f]{0,15})|0$"},uint256:{title:"hex encoded 256 bit unsigned integer",type:"string",pattern:"^0x([1-9a-f]+[0-9a-f]{0,31})|0$"},hash32:{title:"32 byte hex value",type:"string",pattern:"^0x[0-9a-f]{64}$"},notFound:{title:"Not Found (null)",type:"null"},Block:{title:"Block object",type:"object",required:["hash","parentHash","sha3Uncles","miner","stateRoot","transactionsRoot","receiptsRoot","logsBloom","number","gasLimit","gasUsed","timestamp","extraData","mixHash","nonce","size","transactions","uncles"],additionalProperties:!1,properties:{hash:{title:"Hash",$ref:"#/components/schemas/hash32"},parentHash:{title:"Parent block hash",$ref:"#/components/schemas/hash32"},sha3Uncles:{title:"Ommers hash",$ref:"#/components/schemas/hash32"},miner:{title:"Coinbase",$ref:"#/components/schemas/address"},stateRoot:{title:"State root",$ref:"#/components/schemas/hash32"},transactionsRoot:{title:"Transactions root",$ref:"#/components/schemas/hash32"},receiptsRoot:{title:"Receipts root",$ref:"#/components/schemas/hash32"},logsBloom:{title:"Bloom filter",$ref:"#/components/schemas/bytes256"},difficulty:{title:"Difficulty",$ref:"#/components/schemas/uint"},number:{title:"Number",$ref:"#/components/schemas/uint"},gasLimit:{title:"Gas limit",$ref:"#/components/schemas/uint"},gasUsed:{title:"Gas used",$ref:"#/components/schemas/uint"},timestamp:{title:"Timestamp",$ref:"#/components/schemas/uint"},extraData:{title:"Extra data",$ref:"#/components/schemas/bytes"},mixHash:{title:"Mix hash",$ref:"#/components/schemas/hash32"},nonce:{title:"Nonce",$ref:"#/components/schemas/bytes8"},baseFeePerGas:{title:"Base fee per gas",$ref:"#/components/schemas/uint"},withdrawalsRoot:{title:"Withdrawals root",$ref:"#/components/schemas/hash32"},blobGasUsed:{title:"Blob gas used",$ref:"#/components/schemas/uint"},excessBlobGas:{title:"Excess blob gas",$ref:"#/components/schemas/uint"},parentBeaconBlockRoot:{title:"Parent Beacon Block Root",$ref:"#/components/schemas/hash32"},size:{title:"Block size",$ref:"#/components/schemas/uint"},transactions:{anyOf:[{title:"Transaction hashes",type:"array",items:{$ref:"#/components/schemas/hash32"}},{title:"Full transactions",type:"array",items:{$ref:"#/components/schemas/TransactionInfo"}}]},withdrawals:{title:"Withdrawals",type:"array",items:{$ref:"#/components/schemas/Withdrawal"}},uncles:{title:"Uncles",type:"array",items:{$ref:"#/components/schemas/hash32"}}}},BlockTag:{title:"Block tag",type:"string",enum:["earliest","finalized","safe","latest","pending"],description:"`earliest`: The lowest numbered block the client has available; `finalized`: The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination; `safe`: The most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions; `latest`: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions; `pending`: A sample next block built by the client on top of `latest` and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for `finalized` or `safe` block MUST be responded to with `-39001: Unknown block` error"},BlockNumberOrTag:{title:"Block number or tag",oneOf:[{title:"Block number",$ref:"#/components/schemas/uint"},{title:"Block tag",$ref:"#/components/schemas/BlockTag"}]},BlockNumberOrTagOrHash:{title:"Block number, tag, or block hash",anyOf:[{title:"Block number",$ref:"#/components/schemas/uint"},{title:"Block tag",$ref:"#/components/schemas/BlockTag"},{title:"Block hash",$ref:"#/components/schemas/hash32"}]},BadBlock:{title:"Bad block",type:"object",required:["block","hash","rlp"],additionalProperties:!1,properties:{block:{title:"Block",$ref:"#/components/schemas/Block"},hash:{title:"Hash",$ref:"#/components/schemas/hash32"},rlp:{title:"RLP",$ref:"#/components/schemas/bytes"}}},SyncingStatus:{title:"Syncing status",oneOf:[{title:"Syncing progress",type:"object",additionalProperties:!1,properties:{startingBlock:{title:"Starting block",$ref:"#/components/schemas/uint"},currentBlock:{title:"Current block",$ref:"#/components/schemas/uint"},highestBlock:{title:"Highest block",$ref:"#/components/schemas/uint"}}},{title:"Not syncing",description:"Should always return false if not syncing.",type:"boolean"}]},FilterResults:{title:"Filter results",oneOf:[{title:"new block or transaction hashes",type:"array",items:{$ref:"#/components/schemas/hash32"}},{title:"new logs",type:"array",items:{$ref:"#/components/schemas/Log"}}]},Filter:{title:"filter",type:"object",additionalProperties:!1,properties:{fromBlock:{title:"from block",$ref:"#/components/schemas/uint"},toBlock:{title:"to block",$ref:"#/components/schemas/uint"},address:{title:"Address(es)",oneOf:[{title:"Any Address",type:"null"},{title:"Address",$ref:"#/components/schemas/address"},{title:"Addresses",$ref:"#/components/schemas/addresses"}]},topics:{title:"Topics",$ref:"#/components/schemas/FilterTopics"}}},FilterTopics:{title:"Filter Topics",oneOf:[{title:"Any Topic Match",type:"null"},{title:"Specified Filter Topics",type:"array",items:{$ref:"#/components/schemas/FilterTopic"}}]},FilterTopic:{title:"Filter Topic List Entry",oneOf:[{title:"Single Topic Match",$ref:"#/components/schemas/bytes32"},{title:"Multiple Topic Match",type:"array",items:{$ref:"#/components/schemas/bytes32"}}]},Log:{title:"log",type:"object",required:["transactionHash"],additionalProperties:!1,properties:{removed:{title:"removed",type:"boolean"},logIndex:{title:"log index",$ref:"#/components/schemas/uint"},transactionIndex:{title:"transaction index",$ref:"#/components/schemas/uint"},transactionHash:{title:"transaction hash",$ref:"#/components/schemas/hash32"},blockHash:{title:"block hash",$ref:"#/components/schemas/hash32"},blockNumber:{title:"block number",$ref:"#/components/schemas/uint"},address:{title:"address",$ref:"#/components/schemas/address"},data:{title:"data",$ref:"#/components/schemas/bytes"},topics:{title:"topics",type:"array",items:{$ref:"#/components/schemas/bytes32"}}}},ReceiptInfo:{type:"object",title:"Receipt information",required:["blockHash","blockNumber","from","cumulativeGasUsed","gasUsed","logs","logsBloom","transactionHash","transactionIndex","effectiveGasPrice"],additionalProperties:!1,properties:{type:{title:"type",$ref:"#/components/schemas/byte"},transactionHash:{title:"transaction hash",$ref:"#/components/schemas/hash32"},transactionIndex:{title:"transaction index",$ref:"#/components/schemas/uint"},blockHash:{title:"block hash",$ref:"#/components/schemas/hash32"},blockNumber:{title:"block number",$ref:"#/components/schemas/uint"},from:{title:"from",$ref:"#/components/schemas/address"},to:{title:"to",description:"Address of the receiver or null in a contract creation transaction.",oneOf:[{title:"Contract Creation (null)",type:"null"},{title:"Recipient Address",$ref:"#/components/schemas/address"}]},cumulativeGasUsed:{title:"cumulative gas used",description:"The sum of gas used by this transaction and all preceding transactions in the same block.",$ref:"#/components/schemas/uint"},gasUsed:{title:"gas used",description:"The amount of gas used for this specific transaction alone.",$ref:"#/components/schemas/uint"},blobGasUsed:{title:"blob gas used",description:"The amount of blob gas used for this specific transaction. Only specified for blob transactions as defined by EIP-4844.",$ref:"#/components/schemas/uint"},contractAddress:{title:"contract address",description:"The contract address created, if the transaction was a contract creation, otherwise null.",oneOf:[{$ref:"#/components/schemas/address"},{title:"Null",type:"null"}]},logs:{title:"logs",type:"array",items:{$ref:"#/components/schemas/Log"}},logsBloom:{title:"logs bloom",$ref:"#/components/schemas/bytes256"},root:{title:"state root",description:"The post-transaction state root. Only specified for transactions included before the Byzantium upgrade.",$ref:"#/components/schemas/hash32"},status:{title:"status",description:"Either 1 (success) or 0 (failure). Only specified for transactions included after the Byzantium upgrade.",$ref:"#/components/schemas/uint"},effectiveGasPrice:{title:"effective gas price",description:"The actual value per gas deducted from the sender's account. Before EIP-1559, this is equal to the transaction's gas price. After, it is equal to baseFeePerGas + min(maxFeePerGas - baseFeePerGas, maxPriorityFeePerGas).",$ref:"#/components/schemas/uint"},blobGasPrice:{title:"blob gas price",description:"The actual value per gas deducted from the sender's account for blob gas. Only specified for blob transactions as defined by EIP-4844.",$ref:"#/components/schemas/uint"}}},AccountProof:{title:"Account proof",type:"object",required:["address","accountProof","balance","codeHash","nonce","storageHash","storageProof"],additionalProperties:!1,properties:{address:{title:"address",$ref:"#/components/schemas/address"},accountProof:{title:"accountProof",type:"array",items:{$ref:"#/components/schemas/bytes"}},balance:{title:"balance",$ref:"#/components/schemas/uint256"},codeHash:{title:"codeHash",$ref:"#/components/schemas/hash32"},nonce:{title:"nonce",$ref:"#/components/schemas/uint64"},storageHash:{title:"storageHash",$ref:"#/components/schemas/hash32"},storageProof:{title:"Storage proofs",type:"array",items:{$ref:"#/components/schemas/StorageProof"}}}},StorageProof:{title:"Storage proof",type:"object",required:["key","value","proof"],additionalProperties:!1,properties:{key:{title:"key",$ref:"#/components/schemas/bytesMax32"},value:{title:"value",$ref:"#/components/schemas/uint256"},proof:{title:"proof",type:"array",items:{$ref:"#/components/schemas/bytes"}}}},Transaction4844Unsigned:{type:"object",title:"EIP-4844 transaction.",required:["type","nonce","to","gas","value","input","maxPriorityFeePerGas","maxFeePerGas","maxFeePerBlobGas","accessList","blobVersionedHashes","chainId"],properties:{type:{title:"type",$ref:"#/components/schemas/byte"},nonce:{title:"nonce",$ref:"#/components/schemas/uint"},to:{title:"to address",$ref:"#/components/schemas/address"},gas:{title:"gas limit",$ref:"#/components/schemas/uint"},value:{title:"value",$ref:"#/components/schemas/uint"},input:{title:"input data",$ref:"#/components/schemas/bytes"},maxPriorityFeePerGas:{title:"max priority fee per gas",description:"Maximum fee per gas the sender is willing to pay to miners in wei",$ref:"#/components/schemas/uint"},maxFeePerGas:{title:"max fee per gas",description:"The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei",$ref:"#/components/schemas/uint"},maxFeePerBlobGas:{title:"max fee per blob gas",description:"The maximum total fee per gas the sender is willing to pay for blob gas in wei",$ref:"#/components/schemas/uint"},accessList:{title:"accessList",description:"EIP-2930 access list",$ref:"#/components/schemas/AccessList"},blobVersionedHashes:{title:"blobVersionedHashes",description:"List of versioned blob hashes associated with the transaction's EIP-4844 data blobs.",type:"array",items:{$ref:"#/components/schemas/hash32"}},chainId:{title:"chainId",description:"Chain ID that this transaction is valid on.",$ref:"#/components/schemas/uint"}}},AccessListEntry:{title:"Access list entry",type:"object",additionalProperties:!1,properties:{address:{$ref:"#/components/schemas/address"},storageKeys:{type:"array",items:{$ref:"#/components/schemas/hash32"}}}},AccessList:{title:"Access list",type:"array",items:{$ref:"#/components/schemas/AccessListEntry"}},Transaction1559Unsigned:{type:"object",title:"EIP-1559 transaction.",required:["type","nonce","gas","value","input","maxFeePerGas","maxPriorityFeePerGas","gasPrice","chainId","accessList"],properties:{type:{title:"type",type:"string",pattern:"^0x2$"},nonce:{title:"nonce",$ref:"#/components/schemas/uint"},to:{title:"to address",oneOf:[{title:"Contract Creation (null)",type:"null"},{title:"Address",$ref:"#/components/schemas/address"}]},gas:{title:"gas limit",$ref:"#/components/schemas/uint"},value:{title:"value",$ref:"#/components/schemas/uint"},input:{title:"input data",$ref:"#/components/schemas/bytes"},maxPriorityFeePerGas:{title:"max priority fee per gas",description:"Maximum fee per gas the sender is willing to pay to miners in wei",$ref:"#/components/schemas/uint"},maxFeePerGas:{title:"max fee per gas",description:"The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei",$ref:"#/components/schemas/uint"},gasPrice:{title:"gas price",description:"The effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.",$ref:"#/components/schemas/uint"},accessList:{title:"accessList",description:"EIP-2930 access list",$ref:"#/components/schemas/AccessList"},chainId:{title:"chainId",description:"Chain ID that this transaction is valid on.",$ref:"#/components/schemas/uint"}}},Transaction2930Unsigned:{type:"object",title:"EIP-2930 transaction.",required:["type","nonce","gas","value","input","gasPrice","chainId","accessList"],properties:{type:{title:"type",type:"string",pattern:"^0x1$"},nonce:{title:"nonce",$ref:"#/components/schemas/uint"},to:{title:"to address",oneOf:[{title:"Contract Creation (null)",type:"null"},{title:"Address",$ref:"#/components/schemas/address"}]},gas:{title:"gas limit",$ref:"#/components/schemas/uint"},value:{title:"value",$ref:"#/components/schemas/uint"},input:{title:"input data",$ref:"#/components/schemas/bytes"},gasPrice:{title:"gas price",description:"The gas price willing to be paid by the sender in wei",$ref:"#/components/schemas/uint"},accessList:{title:"accessList",description:"EIP-2930 access list",$ref:"#/components/schemas/AccessList"},chainId:{title:"chainId",description:"Chain ID that this transaction is valid on.",$ref:"#/components/schemas/uint"}}},TransactionLegacyUnsigned:{type:"object",title:"Legacy transaction.",required:["type","nonce","gas","value","input","gasPrice"],properties:{type:{title:"type",type:"string",pattern:"^0x0$"},nonce:{title:"nonce",$ref:"#/components/schemas/uint"},to:{title:"to address",oneOf:[{title:"Contract Creation (null)",type:"null"},{title:"Address",$ref:"#/components/schemas/address"}]},gas:{title:"gas limit",$ref:"#/components/schemas/uint"},value:{title:"value",$ref:"#/components/schemas/uint"},input:{title:"input data",$ref:"#/components/schemas/bytes"},gasPrice:{title:"gas price",description:"The gas price willing to be paid by the sender in wei",$ref:"#/components/schemas/uint"},chainId:{title:"chainId",description:"Chain ID that this transaction is valid on.",$ref:"#/components/schemas/uint"}}},TransactionUnsigned:{oneOf:[{$ref:"#/components/schemas/Transaction4844Unsigned"},{$ref:"#/components/schemas/Transaction1559Unsigned"},{$ref:"#/components/schemas/Transaction2930Unsigned"},{$ref:"#/components/schemas/TransactionLegacyUnsigned"}]},Transaction4844Signed:{title:"Signed 4844 Transaction",type:"object",allOf:[{$ref:"#/components/schemas/Transaction4844Unsigned"},{title:"EIP-4844 transaction signature properties.",required:["yParity","r","s"],properties:{yParity:{title:"yParity",description:"The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.",$ref:"#/components/schemas/uint"},r:{title:"r",$ref:"#/components/schemas/uint"},s:{title:"s",$ref:"#/components/schemas/uint"}}}]},Transaction1559Signed:{title:"Signed 1559 Transaction",type:"object",allOf:[{$ref:"#/components/schemas/Transaction1559Unsigned"},{title:"EIP-1559 transaction signature properties.",required:["yParity","r","s"],properties:{yParity:{title:"yParity",description:"The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.",$ref:"#/components/schemas/uint"},v:{title:"v",description:"For backwards compatibility, `v` is optionally provided as an alternative to `yParity`. This field is DEPRECATED and all use of it should migrate to `yParity`.",$ref:"#/components/schemas/uint"},r:{title:"r",$ref:"#/components/schemas/uint"},s:{title:"s",$ref:"#/components/schemas/uint"}}}]},Transaction2930Signed:{title:"Signed 2930 Transaction",type:"object",allOf:[{$ref:"#/components/schemas/Transaction2930Unsigned"},{title:"EIP-2930 transaction signature properties.",required:["yParity","r","s"],properties:{yParity:{title:"yParity",description:"The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.",$ref:"#/components/schemas/uint"},v:{title:"v",description:"For backwards compatibility, `v` is optionally provided as an alternative to `yParity`. This field is DEPRECATED and all use of it should migrate to `yParity`.",$ref:"#/components/schemas/uint"},r:{title:"r",$ref:"#/components/schemas/uint"},s:{title:"s",$ref:"#/components/schemas/uint"}}}]},TransactionLegacySigned:{title:"Signed Legacy Transaction",type:"object",allOf:[{$ref:"#/components/schemas/TransactionLegacyUnsigned"},{title:"Legacy transaction signature properties.",required:["v","r","s"],properties:{v:{title:"v",$ref:"#/components/schemas/uint"},r:{title:"r",$ref:"#/components/schemas/uint"},s:{title:"s",$ref:"#/components/schemas/uint"}}}]},TransactionSigned:{oneOf:[{$ref:"#/components/schemas/Transaction4844Signed"},{$ref:"#/components/schemas/Transaction1559Signed"},{$ref:"#/components/schemas/Transaction2930Signed"},{$ref:"#/components/schemas/TransactionLegacySigned"}]},TransactionInfo:{type:"object",title:"Transaction information",allOf:[{title:"Contextual information",required:["blockHash","blockNumber","from","hash","transactionIndex"],unevaluatedProperties:!1,properties:{blockHash:{title:"block hash",$ref:"#/components/schemas/hash32"},blockNumber:{title:"block number",$ref:"#/components/schemas/uint"},from:{title:"from address",$ref:"#/components/schemas/address"},hash:{title:"transaction hash",$ref:"#/components/schemas/hash32"},transactionIndex:{title:"transaction index",$ref:"#/components/schemas/uint"}}},{$ref:"#/components/schemas/TransactionSigned"}]},GenericTransaction:{type:"object",title:"Transaction object generic to all types",additionalProperties:!1,properties:{type:{title:"type",$ref:"#/components/schemas/byte"},nonce:{title:"nonce",$ref:"#/components/schemas/uint"},to:{title:"to address",oneOf:[{title:"Contract Creation (null)",type:"null"},{title:"Address",$ref:"#/components/schemas/address"}]},from:{title:"from address",$ref:"#/components/schemas/address"},gas:{title:"gas limit",$ref:"#/components/schemas/uint"},value:{title:"value",$ref:"#/components/schemas/uint"},input:{title:"input data",$ref:"#/components/schemas/bytes"},gasPrice:{title:"gas price",description:"The gas price willing to be paid by the sender in wei",$ref:"#/components/schemas/uint"},maxPriorityFeePerGas:{title:"max priority fee per gas",description:"Maximum fee per gas the sender is willing to pay to miners in wei",$ref:"#/components/schemas/uint"},maxFeePerGas:{title:"max fee per gas",description:"The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei",$ref:"#/components/schemas/uint"},maxFeePerBlobGas:{title:"max fee per blob gas",description:"The maximum total fee per gas the sender is willing to pay for blob gas in wei",$ref:"#/components/schemas/uint"},accessList:{title:"accessList",description:"EIP-2930 access list",$ref:"#/components/schemas/AccessList"},blobVersionedHashes:{title:"blobVersionedHashes",description:"List of versioned blob hashes associated with the transaction's EIP-4844 data blobs.",type:"array",items:{$ref:"#/components/schemas/hash32"}},blobs:{title:"blobs",description:"Raw blob data.",type:"array",items:{$ref:"#/components/schemas/bytes"}},chainId:{title:"chainId",description:"Chain ID that this transaction is valid on.",$ref:"#/components/schemas/uint"}}},Withdrawal:{type:"object",title:"Validator withdrawal",required:["index","validatorIndex","address","amount"],additionalProperties:!1,properties:{index:{title:"index of withdrawal",$ref:"#/components/schemas/uint64"},validatorIndex:{title:"index of validator that generated withdrawal",$ref:"#/components/schemas/uint64"},address:{title:"recipient address for withdrawal value",$ref:"#/components/schemas/address"},amount:{title:"value contained in withdrawal",$ref:"#/components/schemas/uint256"}}},ForkchoiceStateV1:{title:"Forkchoice state object V1",type:"object",required:["headBlockHash","safeBlockHash","finalizedBlockHash"],properties:{headBlockHash:{title:"Head block hash",$ref:"#/components/schemas/hash32"},safeBlockHash:{title:"Safe block hash",$ref:"#/components/schemas/hash32"},finalizedBlockHash:{title:"Finalized block hash",$ref:"#/components/schemas/hash32"}}},ForkchoiceUpdatedResponseV1:{title:"Forkchoice updated response",type:"object",required:["payloadStatus"],properties:{payloadStatus:{title:"Payload status",$ref:"#/components/schemas/RestrictedPayloadStatusV1"},payloadId:{title:"Payload id",$ref:"#/components/schemas/bytes8"}}},PayloadAttributesV1:{title:"Payload attributes object V1",type:"object",required:["timestamp","prevRandao","suggestedFeeRecipient"],properties:{timestamp:{title:"Timestamp",$ref:"#/components/schemas/uint64"},prevRandao:{title:"Previous randao value",$ref:"#/components/schemas/bytes32"},suggestedFeeRecipient:{title:"Suggested fee recipient",$ref:"#/components/schemas/address"}}},PayloadAttributesV2:{title:"Payload attributes object V2",type:"object",required:["timestamp","prevRandao","suggestedFeeRecipient","withdrawals"],properties:{timestamp:{$ref:"#/components/schemas/PayloadAttributesV1/properties/timestamp"},prevRandao:{$ref:"#/components/schemas/PayloadAttributesV1/properties/prevRandao"},suggestedFeeRecipient:{$ref:"#/components/schemas/PayloadAttributesV1/properties/suggestedFeeRecipient"},withdrawals:{title:"Withdrawals",type:"array",items:{$ref:"#/components/schemas/WithdrawalV1"}}}},PayloadAttributesV3:{title:"Payload attributes object V3",type:"object",required:["timestamp","prevRandao","suggestedFeeRecipient","withdrawals","parentBeaconBlockRoot"],properties:{timestamp:{$ref:"#/components/schemas/PayloadAttributesV2/properties/timestamp"},prevRandao:{$ref:"#/components/schemas/PayloadAttributesV2/properties/prevRandao"},suggestedFeeRecipient:{$ref:"#/components/schemas/PayloadAttributesV2/properties/suggestedFeeRecipient"},withdrawals:{$ref:"#/components/schemas/PayloadAttributesV2/properties/withdrawals"},parentBeaconBlockRoot:{title:"Parent beacon block root",$ref:"#/components/schemas/hash32"}}},PayloadStatusV1:{title:"Payload status object V1",type:"object",required:["status"],properties:{status:{title:"Payload validation status",type:"string",enum:["VALID","INVALID","SYNCING","ACCEPTED","INVALID_BLOCK_HASH"]},latestValidHash:{title:"The hash of the most recent valid block",$ref:"#/components/schemas/hash32"},validationError:{title:"Validation error message",type:"string"}}},RestrictedPayloadStatusV1:{$ref:"#/components/schemas/PayloadStatusV1",properties:{status:{$ref:"#/components/schemas/PayloadStatusV1/properties/status",description:"Set of possible values is restricted to VALID, INVALID, SYNCING",enum:["VALID","INVALID","SYNCING"]},latestValidHash:{$ref:"#/components/schemas/PayloadStatusV1/properties/latestValidHash"},validationError:{$ref:"#/components/schemas/PayloadStatusV1/properties/validationError"}}},PayloadStatusNoInvalidBlockHash:{$ref:"#/components/schemas/PayloadStatusV1",title:"Payload status object deprecating INVALID_BLOCK_HASH status",properties:{status:{$ref:"#/components/schemas/PayloadStatusV1/properties/status",enum:["VALID","INVALID","SYNCING","ACCEPTED"]},latestValidHash:{$ref:"#/components/schemas/PayloadStatusV1/properties/latestValidHash"},validationError:{$ref:"#/components/schemas/PayloadStatusV1/properties/validationError"}}},ExecutionPayloadV1:{title:"Execution payload object V1",type:"object",required:["parentHash","feeRecipient","stateRoot","receiptsRoot","logsBloom","prevRandao","blockNumber","gasLimit","gasUsed","timestamp","extraData","baseFeePerGas","blockHash","transactions"],properties:{parentHash:{title:"Parent block hash",$ref:"#/components/schemas/hash32"},feeRecipient:{title:"Recipient of transaction priority fees",$ref:"#/components/schemas/address"},stateRoot:{title:"State root",$ref:"#/components/schemas/hash32"},receiptsRoot:{title:"Receipts root",$ref:"#/components/schemas/hash32"},logsBloom:{title:"Bloom filter",$ref:"#/components/schemas/bytes256"},prevRandao:{title:"Previous randao value",$ref:"#/components/schemas/bytes32"},blockNumber:{title:"Block number",$ref:"#/components/schemas/uint64"},gasLimit:{title:"Gas limit",$ref:"#/components/schemas/uint64"},gasUsed:{title:"Gas used",$ref:"#/components/schemas/uint64"},timestamp:{title:"Timestamp",$ref:"#/components/schemas/uint64"},extraData:{title:"Extra data",$ref:"#/components/schemas/bytesMax32"},baseFeePerGas:{title:"Base fee per gas",$ref:"#/components/schemas/uint256"},blockHash:{title:"Block hash",$ref:"#/components/schemas/hash32"},transactions:{title:"Transactions",type:"array",items:{$ref:"#/components/schemas/bytes"}}}},WithdrawalV1:{title:"Withdrawal object V1",type:"object",required:["index","validatorIndex","address","amount"],properties:{index:{title:"Withdrawal index",$ref:"#/components/schemas/uint64"},validatorIndex:{title:"Validator index",$ref:"#/components/schemas/uint64"},address:{title:"Withdrawal address",$ref:"#/components/schemas/address"},amount:{title:"Withdrawal amount",$ref:"#/components/schemas/uint64"}}},ExecutionPayloadV2:{title:"Execution payload object V2",type:"object",required:["parentHash","feeRecipient","stateRoot","receiptsRoot","logsBloom","prevRandao","blockNumber","gasLimit","gasUsed","timestamp","extraData","baseFeePerGas","blockHash","transactions","withdrawals"],properties:{parentHash:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/parentHash"},feeRecipient:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/feeRecipient"},stateRoot:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/stateRoot"},receiptsRoot:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/receiptsRoot"},logsBloom:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/logsBloom"},prevRandao:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/prevRandao"},blockNumber:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/blockNumber"},gasLimit:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/gasLimit"},gasUsed:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/gasUsed"},timestamp:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/timestamp"},extraData:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/extraData"},baseFeePerGas:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/baseFeePerGas"},blockHash:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/blockHash"},transactions:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/transactions"},withdrawals:{title:"Withdrawals",type:"array",items:{$ref:"#/components/schemas/WithdrawalV1"}}}},ExecutionPayloadV3:{title:"Execution payload object V3",type:"object",required:["parentHash","feeRecipient","stateRoot","receiptsRoot","logsBloom","prevRandao","blockNumber","gasLimit","gasUsed","timestamp","extraData","baseFeePerGas","blockHash","transactions","withdrawals","blobGasUsed","excessBlobGas"],properties:{parentHash:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/parentHash"},feeRecipient:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/feeRecipient"},stateRoot:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/stateRoot"},receiptsRoot:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/receiptsRoot"},logsBloom:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/logsBloom"},prevRandao:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/prevRandao"},blockNumber:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/blockNumber"},gasLimit:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/gasLimit"},gasUsed:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/gasUsed"},timestamp:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/timestamp"},extraData:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/extraData"},baseFeePerGas:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/baseFeePerGas"},blockHash:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/blockHash"},transactions:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/transactions"},withdrawals:{$ref:"#/components/schemas/ExecutionPayloadV2/properties/withdrawals"},blobGasUsed:{title:"Blob gas used",$ref:"#/components/schemas/uint64"},excessBlobGas:{title:"Excess blob gas",$ref:"#/components/schemas/uint64"}}},ExecutionPayloadV4:{title:"Execution payload object V4",type:"object",required:["parentHash","feeRecipient","stateRoot","receiptsRoot","logsBloom","prevRandao","blockNumber","gasLimit","gasUsed","timestamp","extraData","baseFeePerGas","blockHash","transactions","withdrawals","blobGasUsed","excessBlobGas","depositRequests","withdrawalRequests","consolidationRequests"],properties:{parentHash:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/parentHash"},feeRecipient:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/feeRecipient"},stateRoot:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/stateRoot"},receiptsRoot:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/receiptsRoot"},logsBloom:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/logsBloom"},prevRandao:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/prevRandao"},blockNumber:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/blockNumber"},gasLimit:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/gasLimit"},gasUsed:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/gasUsed"},timestamp:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/timestamp"},extraData:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/extraData"},baseFeePerGas:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/baseFeePerGas"},blockHash:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/blockHash"},transactions:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/transactions"},withdrawals:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/withdrawals"},blobGasUsed:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/blobGasUsed"},excessBlobGas:{$ref:"#/components/schemas/ExecutionPayloadV3/properties/excessBlobGas"},depositRequests:{title:"Deposit requests",type:"array",items:{$ref:"#/components/schemas/DepositRequestV1"}},withdrawalRequests:{title:"Withdrawals requests",type:"array",items:{$ref:"#/components/schemas/WithdrawalRequestV1"}},consolidationRequests:{title:"Consolidation requests",type:"array",items:{$ref:"#/components/schemas/ConsolidationRequestV1"}}}},ExecutionPayloadBodyV1:{title:"Execution payload body object V1",type:"object",required:["transactions"],properties:{transactions:{$ref:"#/components/schemas/ExecutionPayloadV1/properties/transactions"},withdrawals:{title:"Withdrawals",type:["array","null"],items:{$ref:"#/components/schemas/WithdrawalV1"}}}},ExecutionPayloadBodyV2:{title:"Execution payload body object V2",type:"object",required:["transactions"],properties:{transactions:{title:"Transactions",type:"array",items:{$ref:"#/components/schemas/bytes"}},withdrawals:{title:"Withdrawals",type:["array","null"],items:{$ref:"#/components/schemas/WithdrawalV1"}},depositRequests:{title:"Deposit requests",type:["array","null"],items:{$ref:"#/components/schemas/DepositRequestV1"}},withdrawalRequests:{title:"Withdrawals requests",type:["array","null"],items:{$ref:"#/components/schemas/WithdrawalRequestV1"}},consolidationRequests:{title:"Consolidation requests - array - 'null'",items:{$ref:"#/components/schemas/ConsolidationRequestV1"}}}},BlobsBundleV1:{title:"Blobs bundle object V1",type:"object",required:["commitments","proofs","blobs"],properties:{commitments:{title:"Commitments",type:"array",items:{$ref:"#/components/schemas/bytes48"}},proofs:{title:"Proofs",type:"array",items:{$ref:"#/components/schemas/bytes48"}},blobs:{title:"Blobs",type:"array",items:{$ref:"#/components/schemas/bytes"}}}},DepositRequestV1:{title:"Deposit request object V1",type:"object",required:["pubkey","withdrawalCredentials","amount","signature","index"],properties:{pubkey:{title:"Public key",$ref:"#/components/schemas/bytes48"},withdrawalCredentials:{title:"Withdrawal credentials",$ref:"#/components/schemas/bytes32"},amount:{title:"Deposit amount",$ref:"#/components/schemas/uint64"},signature:{title:"Deposit signature",$ref:"#/components/schemas/bytes96"},index:{title:"Deposit index",$ref:"#/components/schemas/uint64"}}},WithdrawalRequestV1:{title:"Withdrawal request object V1",type:"object",required:["sourceAddress","validatorPubkey","amount"],properties:{sourceAddress:{title:"Source address",$ref:"#/components/schemas/address"},validatorPubkey:{title:"Validator public key",$ref:"#/components/schemas/bytes48"},amount:{title:"Withdraw amount",$ref:"#/components/schemas/uint64"}}},ConsolidationRequestV1:{title:"Consolidation request object V1",type:"object",required:["sourceAddress","sourcePubkey","targetPubkey"],properties:{sourceAddress:{title:"Source address",$ref:"#/components/schemas/address"},sourcePubkey:{title:"Source validator public key",$ref:"#/components/schemas/bytes48"},targetPubkey:{title:"Target validator public key",$ref:"#/components/schemas/bytes48"}}},TransitionConfigurationV1:{title:"Transition configuration object",type:"object",required:["terminalTotalDifficulty","terminalBlockHash","terminalBlockNumber"],properties:{terminalTotalDifficulty:{title:"Terminal total difficulty",$ref:"#/components/schemas/uint256"},terminalBlockHash:{title:"Terminal block hash",$ref:"#/components/schemas/hash32"},terminalBlockNumber:{title:"Terminal block number",$ref:"#/components/schemas/uint64"}}}},tags:{MetaMask:{name:"MetaMask",description:"MetaMask-specific methods."},Restricted:{name:"Restricted",description:"Restricted methods. If a method is restricted, the caller must have the corresponding permission via `wallet_requestPermissions` in order to call it."},Mobile:{name:"Mobile",description:"Mobile-specific methods."},Experimental:{name:"Experimental",description:"Experimental methods."},Deprecated:{name:"Deprecated",description:"Deprecated methods."},Ethereum:{name:"Ethereum API",description:"Ethereum execution API methods."},Multichain:{name:"Multichain API",description:"Multichain API methods."}},contentDescriptors:{},examplePairings:{},links:{},examples:{}}}}}},{package:"@metamask/multichain>@metamask/api-specs",file:"node_modules/@metamask/multichain/node_modules/@metamask/api-specs/dist/build/openrpc.json"}],[2161,{"./build/multichain-openrpc.json":2159,"./build/openrpc.json":2160},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.MultiChainOpenRPCDocument=r.MetaMaskOpenRPCDocument=void 0;const s=n(e("./build/openrpc.json"));r.MetaMaskOpenRPCDocument=s.default;const a=n(e("./build/multichain-openrpc.json"));r.MultiChainOpenRPCDocument=a.default,r.default=s.default}}},{package:"@metamask/multichain>@metamask/api-specs",file:"node_modules/@metamask/multichain/node_modules/@metamask/api-specs/dist/index.js"}],[2162,{"./types.cjs":2170,"@metamask/base-controller":1383,"@metamask/controller-utils":1474},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i,o,c,u,l,d,m,p,h,f,g,y,b,k,w,S,_,v,E,T,A,j,C,I,P,x=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},R=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.NameController=r.NameOrigin=r.PROPOSED_NAME_EXPIRE_DURATION=r.FALLBACK_VARIATION=void 0;const O=e("@metamask/base-controller"),M=e("@metamask/controller-utils"),N=e("./types.cjs");var B;r.FALLBACK_VARIATION="*",r.PROPOSED_NAME_EXPIRE_DURATION=86400,function(e){e.ACCOUNT_IDENTITY="account-identity",e.ADDRESS_BOOK="address-book",e.API="api",e.UI="ui"}(B||(r.NameOrigin=B={}));const $={names:{persist:!0,anonymous:!1},nameSources:{persist:!0,anonymous:!1}};class D extends O.BaseController{constructor({messenger:e,providers:t,state:r,updateDelay:i}){super({name:"NameController",metadata:$,messenger:e,state:{names:{[N.NameType.ETHEREUM_ADDRESS]:{}},nameSources:{},...r}}),n.add(this),s.set(this,void 0),a.set(this,void 0),x(this,s,t,"f"),x(this,a,i??120,"f")}setName(e){R(this,n,"m",g).call(this,e);const{value:t,type:r,name:s,sourceId:a,origin:i,variation:o}=e,c=a??null,u=null===s?null:B.API,l=i??u;R(this,n,"m",h).call(this,t,r,o,(e=>{e.name=s,e.sourceId=c,e.origin=l}))}async updateProposedNames(e){R(this,n,"m",y).call(this,e);const t=(await Promise.all(R(this,s,"f").map((t=>R(this,n,"m",u).call(this,e,t))))).filter((e=>Boolean(e)));return R(this,n,"m",i).call(this,e,t),R(this,n,"m",o).call(this,R(this,s,"f")),R(this,n,"m",I).call(this),R(this,n,"m",c).call(this,t)}}r.NameController=D,s=new WeakMap,a=new WeakMap,n=new WeakSet,i=function(e,t){const{value:r,type:s,variation:a}=e,i=R(this,n,"m",f).call(this);R(this,n,"m",h).call(this,r,s,a,(e=>{R(this,n,"m",C).call(this,e.proposedNames,s);for(const r of t){const{results:t}=r;for(const n of Object.keys(r.results)){const r=t[n],{proposedNames:s,updateDelay:a}=r,o=e.proposedNames[n]??{proposedNames:[],lastRequestTime:null,updateDelay:null};e.proposedNames[n]=o,s&&(o.proposedNames=s),o.lastRequestTime=i,o.updateDelay=a??null}}}))},o=function(e){const t={...this.state.nameSources};for(const r of e){const{sourceLabels:e}=r.getMetadata();for(const r of Object.keys(e))t[r]={label:e[r]}}this.update((e=>{e.nameSources=t}))},c=function(e){return e.reduce(((e,t)=>{const{results:r}=t;for(const t of Object.keys(r)){const{proposedNames:n,error:s}=r[t];e.results[t]={proposedNames:n,error:s}}return e}),{results:{}})},u=async function(e,t){const{value:r,type:s,sourceIds:i,onlyUpdateAfterDelay:o,variation:c}=e,u=c??"",d=R(this,n,"m",j).call(this,t,s),h=R(this,n,"m",f).call(this),g=R(this,n,"m",m).call(this,r,s),y=d.filter((e=>{if(i&&!i.includes(e))return!1;if(o){const t=this.state.names[s]?.[g]?.[u]??{},r=t.proposedNames?.[e]??{},n=r.lastRequestTime??0,i=r.updateDelay??R(this,a,"f");if(h-n<i)return!1}return!0}));if(!y.length)return undefined;const b={value:R(this,n,"m",m).call(this,r,s),type:s,sourceIds:i?y:undefined,variation:R(this,n,"m",p).call(this,u,s)};let k,w;try{w=await t.getProposedNames(b),k=w.error}catch(e){k=e}return R(this,n,"m",l).call(this,w,k,y)},l=function(e,t,r){const s=t??undefined;return{results:r.reduce(((r,s)=>{const a=e?.results?.[s];return{...r,[s]:R(this,n,"m",d).call(this,a,t)}}),{}),error:s}},d=function(e,t){const r=e?.error??t??undefined,n=e?.updateDelay??undefined;let s=r?undefined:e?.proposedNames??undefined;return s&&(s=s.filter((e=>e?.length))),{proposedNames:s,error:r,updateDelay:n}},m=function(e,t){return t===N.NameType.ETHEREUM_ADDRESS?e.toLowerCase():e},p=function(e,t){return t===N.NameType.ETHEREUM_ADDRESS?e.toLowerCase():e},h=function(e,t,r,s){const a=r??"",i=R(this,n,"m",m).call(this,e,t),o=R(this,n,"m",p).call(this,a,t);[i,o].some((e=>!(0,M.isSafeDynamicKey)(e)))||this.update((e=>{const r=e.names[t]||{};e.names[t]=r;const n=r[i]||{};r[i]=n;const a=n[o]??{proposedNames:{},name:null,sourceId:null,origin:null};n[o]=a,s(a)}))},f=function(){return Math.round(Date.now()/1e3)},g=function(e){const{name:t,value:r,type:s,sourceId:a,variation:i,origin:o}=e,c=[];if(R(this,n,"m",b).call(this,r,c),R(this,n,"m",k).call(this,s,c),R(this,n,"m",w).call(this,t,c),R(this,n,"m",_).call(this,a,s,t,c),R(this,n,"m",E).call(this,i,s,c),R(this,n,"m",T).call(this,o,t,c),c.length)throw new Error(c.join(" "))},y=function(e){const{value:t,type:r,sourceIds:s,variation:a}=e,i=[];if(R(this,n,"m",b).call(this,t,i),R(this,n,"m",k).call(this,r,i),R(this,n,"m",S).call(this,s,r,i),R(this,n,"m",v).call(this,r,i),R(this,n,"m",E).call(this,a,r,i),i.length)throw new Error(i.join(" "))},b=function(e,t){e?.length&&"string"==typeof e||t.push("Must specify a non-empty string for value.")},k=function(e,t){Object.values(N.NameType).includes(e)||t.push(`Must specify one of the following types: ${Object.values(N.NameType).join(", ")}`)},w=function(e,t){null!==e&&(e?.length&&"string"==typeof e||t.push("Must specify a non-empty string or null for name."))},S=function(e,t,r){if(!e)return;const s=R(this,n,"m",A).call(this,t),a=[];for(const t of e)s.includes(t)||a.push(t);a.length&&r.push(`Unknown source IDs for type '${t}': ${a.join(", ")}`)},_=function(e,t,r,s){if(null===e||e===undefined)return;if(null===r)return void s.push(`Cannot specify a source ID when clearing the saved name: ${e}`);const a=R(this,n,"m",A).call(this,t);e.length&&"string"==typeof e?a.includes(e)||s.push(`Unknown source ID for type '${t}': ${e}`):s.push("Must specify a non-empty string for sourceId.")},v=function(e,t){const r=R(this,n,"m",A).call(this,e),s=r.filter(((e,t)=>r.indexOf(e)!==t));s.length&&t.push(`Duplicate source IDs found for type '${e}': ${s.join(", ")}`)},E=function(e,t,n){t===N.NameType.ETHEREUM_ADDRESS&&(e?.length&&"string"==typeof e&&(e.match(/^0x[0-9A-Fa-f]+$/u)||e===r.FALLBACK_VARIATION)||n.push(`Must specify a chain ID in hexidecimal format or the fallback, "${r.FALLBACK_VARIATION}", for variation when using '${t}' type.`))},T=function(e,t,r){e&&(null!==t?Object.values(B).includes(e)||r.push(`Must specify one of the following origins: ${Object.values(B).join(", ")}`):r.push(`Cannot specify an origin when clearing the saved name: ${e}`))},A=function(e){return R(this,s,"f").map((t=>R(this,n,"m",j).call(this,t,e))).flat()},j=function(e,t){return e.getMetadata().sourceIds[t]},C=function(e,t){if(0===Object.keys(e).length)return;const r=R(this,n,"m",A).call(this,t),s=Object.keys(e).filter((e=>!r.includes(e)));for(const t of s)delete e[t]},I=function(){const e=R(this,n,"m",f).call(this);this.update((t=>{const s=R(this,n,"m",P).call(this,t);for(const{nameType:n,value:a,variation:i,entry:o}of s){if(null!==o.name)continue;Object.values(o.proposedNames).every((t=>e-(t.lastRequestTime??0)>=r.PROPOSED_NAME_EXPIRE_DURATION))&&delete t.names[n][a][i]}}))},P=function(e){return Object.entries(e.names).flatMap((([e,t])=>Object.entries(t).flatMap((([t,r])=>Object.entries(r).map((([r,n])=>({entry:n,nameType:e,value:t,variation:r})))))))}}}},{package:"@metamask/name-controller",file:"node_modules/@metamask/name-controller/dist/NameController.cjs"}],[2163,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ETHERSCAN_SUPPORTED_NETWORKS=r.CHAIN_IDS=void 0,r.CHAIN_IDS={MAINNET:"0x1",GOERLI:"0x5",BSC:"0x38",BSC_TESTNET:"0x61",OPTIMISM:"0xa",OPTIMISM_SEPOLIA:"0xaa37dc",POLYGON:"0x89",POLYGON_TESTNET:"0x13881",AVALANCHE:"0xa86a",AVALANCHE_TESTNET:"0xa869",FANTOM:"0xfa",FANTOM_TESTNET:"0xfa2",SEPOLIA:"0xaa36a7",LINEA_GOERLI:"0xe704",LINEA_SEPOLIA:"0xe705",LINEA_MAINNET:"0xe708",MOONBEAM:"0x504",MOONBEAM_TESTNET:"0x507",MOONRIVER:"0x505",GNOSIS:"0x64"};const n="etherscan.io",s="api";r.ETHERSCAN_SUPPORTED_NETWORKS={[r.CHAIN_IDS.GOERLI]:{domain:n,subdomain:`${s}-goerli`},[r.CHAIN_IDS.MAINNET]:{domain:n,subdomain:s},[r.CHAIN_IDS.SEPOLIA]:{domain:n,subdomain:`${s}-sepolia`},[r.CHAIN_IDS.LINEA_GOERLI]:{domain:"lineascan.build",subdomain:"goerli"},[r.CHAIN_IDS.LINEA_SEPOLIA]:{domain:"lineascan.build",subdomain:"sepolia"},[r.CHAIN_IDS.LINEA_MAINNET]:{domain:"lineascan.build",subdomain:s},[r.CHAIN_IDS.BSC]:{domain:"bscscan.com",subdomain:s},[r.CHAIN_IDS.BSC_TESTNET]:{domain:"bscscan.com",subdomain:`${s}-testnet`},[r.CHAIN_IDS.OPTIMISM]:{domain:n,subdomain:`${s}-optimistic`},[r.CHAIN_IDS.OPTIMISM_SEPOLIA]:{domain:n,subdomain:`${s}-sepolia-optimistic`},[r.CHAIN_IDS.POLYGON]:{domain:"polygonscan.com",subdomain:s},[r.CHAIN_IDS.POLYGON_TESTNET]:{domain:"polygonscan.com",subdomain:`${s}-mumbai`},[r.CHAIN_IDS.AVALANCHE]:{domain:"snowtrace.io",subdomain:s},[r.CHAIN_IDS.AVALANCHE_TESTNET]:{domain:"snowtrace.io",subdomain:`${s}-testnet`},[r.CHAIN_IDS.FANTOM]:{domain:"ftmscan.com",subdomain:s},[r.CHAIN_IDS.FANTOM_TESTNET]:{domain:"ftmscan.com",subdomain:`${s}-testnet`},[r.CHAIN_IDS.MOONBEAM]:{domain:"moonscan.io",subdomain:`${s}-moonbeam`},[r.CHAIN_IDS.MOONBEAM_TESTNET]:{domain:"moonscan.io",subdomain:`${s}-moonbase`},[r.CHAIN_IDS.MOONRIVER]:{domain:"moonscan.io",subdomain:`${s}-moonriver`},[r.CHAIN_IDS.GNOSIS]:{domain:"gnosisscan.io",subdomain:`${s}-gnosis`}}}}},{package:"@metamask/name-controller",file:"node_modules/@metamask/name-controller/dist/constants.cjs"}],[2164,{"./NameController.cjs":2162,"./providers/ens.cjs":2166,"./providers/etherscan.cjs":2167,"./providers/lens.cjs":2168,"./providers/token.cjs":2169,"./types.cjs":2170},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./NameController.cjs"),r),s(e("./types.cjs"),r),s(e("./providers/ens.cjs"),r),s(e("./providers/etherscan.cjs"),r),s(e("./providers/token.cjs"),r),s(e("./providers/lens.cjs"),r)}}},{package:"@metamask/name-controller",file:"node_modules/@metamask/name-controller/dist/index.cjs"}],[2165,{"@metamask/utils":2950},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createModuleLogger=r.projectLogger=void 0;const n=e("@metamask/utils");Object.defineProperty(r,"createModuleLogger",{enumerable:!0,get:function(){return n.createModuleLogger}}),r.projectLogger=(0,n.createProjectLogger)("name-controller")}}},{package:"@metamask/name-controller",file:"node_modules/@metamask/name-controller/dist/logger.cjs"}],[2166,{"../logger.cjs":2165,"../types.cjs":2170},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.ENSNameProvider=void 0;const o=e("../logger.cjs"),c=e("../types.cjs"),u="ens",l=(0,o.createModuleLogger)(o.projectLogger,"ens");r.ENSNameProvider=class{constructor({isEnabled:e,reverseLookup:t}){n.set(this,void 0),s.set(this,void 0),a(this,n,e||(()=>!0),"f"),a(this,s,t,"f")}getMetadata(){return{sourceIds:{[c.NameType.ETHEREUM_ADDRESS]:[u]},sourceLabels:{[u]:"Ethereum Name Service (ENS)"}}}async getProposedNames(e){if(!i(this,n,"f").call(this))return l("Skipping request as disabled"),{results:{[u]:{proposedNames:[]}}};const{value:t,variation:r}=e;l("Invoking callback",{value:t,chainId:r});try{const e=await i(this,s,"f").call(this,t,r),n=e?[e]:[];return l("New proposed names",n),{results:{[u]:{proposedNames:n}}}}catch(e){throw l("Request failed",e),e}}},n=new WeakMap,s=new WeakMap}}},{package:"@metamask/name-controller",file:"node_modules/@metamask/name-controller/dist/providers/ens.cjs"}],[2167,{"../constants.cjs":2163,"../logger.cjs":2165,"../types.cjs":2170,"../util.cjs":2171,"async-mutex":3913},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i,o,c,u=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},l=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.EtherscanNameProvider=void 0;const d=e("async-mutex"),m=e("../constants.cjs"),p=e("../logger.cjs"),h=e("../types.cjs"),f=e("../util.cjs"),g="etherscan",y=(0,p.createModuleLogger)(p.projectLogger,"etherscan");r.EtherscanNameProvider=class{constructor({isEnabled:e}={}){n.add(this),s.set(this,void 0),a.set(this,0),i.set(this,new d.Mutex),u(this,s,e||(()=>!0),"f")}getMetadata(){return{sourceIds:{[h.NameType.ETHEREUM_ADDRESS]:[g]},sourceLabels:{[g]:"Etherscan (Verified Contract Name)"}}}async getProposedNames(e){if(!l(this,s,"f").call(this))return y("Skipping request as disabled"),{results:{[g]:{proposedNames:[]}}};const t=await l(this,i,"f").acquire();try{const{value:t,variation:r}=e,s=Date.now();if(s-l(this,a,"f")<5e3)return y("Skipping request to avoid rate limit"),{results:{[g]:{updateDelay:5}}};const i=l(this,n,"m",c).call(this,r,{module:"contract",action:"getsourcecode",address:t}),{responseData:u,error:d}=await l(this,n,"m",o).call(this,i);if(d)throw y("Request failed",d),d;if("NOTOK"===u?.message)return y("Request warning",u.result),{results:{[g]:{updateDelay:5}}};const m=(u?.result??[]).map((e=>e.ContractName));return y("New proposed names",m),{results:{[g]:{proposedNames:m}}}}finally{t()}}},s=new WeakMap,a=new WeakMap,i=new WeakMap,n=new WeakSet,o=async function(e){try{y("Sending request",e);return{responseData:await(0,f.handleFetch)(e)}}catch(e){return(0,f.assertIsError)(e),{error:e}}finally{u(this,a,Date.now(),"f")}},c=function(e,t){const r=m.ETHERSCAN_SUPPORTED_NETWORKS[e];if(!r)throw new Error(`Etherscan does not support chain with ID: ${e}`);let n=`https://${r.subdomain}.${r.domain}/api`;return Object.keys(t).forEach(((e,r)=>{const s=t[e];n+=`${0===r?"?":"&"}${e}=${s}`})),n}}}},{package:"@metamask/name-controller",file:"node_modules/@metamask/name-controller/dist/providers/etherscan.cjs"}],[2168,{"../logger.cjs":2165,"../types.cjs":2170,"../util.cjs":2171},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.LensNameProvider=void 0;const i=e("../logger.cjs"),o=e("../types.cjs"),c=e("../util.cjs"),u="lens",l=(0,i.createModuleLogger)(i.projectLogger,"lens");r.LensNameProvider=class{constructor({isEnabled:e}={}){n.set(this,void 0),s(this,n,e||(()=>!0),"f")}getMetadata(){return{sourceIds:{[o.NameType.ETHEREUM_ADDRESS]:[u]},sourceLabels:{[u]:"Lens Protocol"}}}async getProposedNames(e){if(!a(this,n,"f").call(this))return l("Skipping request as disabled"),{results:{[u]:{proposedNames:[]}}};const{value:t}=e,r={address:t};l("Sending request",{variables:r});try{const e=await(0,c.graphQL)("https://api.lens.dev","\nquery HandlesForAddress($address: EthereumAddress!) {\n profiles(request: { ownedBy: [$address] }) {\n items {\n handle\n }\n }\n}",r),t=(e?.profiles?.items??[]).map((e=>e.handle));return l("New proposed names",t),{results:{[u]:{proposedNames:t}}}}catch(e){throw l("Request failed",e),e}}},n=new WeakMap}}},{package:"@metamask/name-controller",file:"node_modules/@metamask/name-controller/dist/providers/lens.cjs"}],[2169,{"../logger.cjs":2165,"../types.cjs":2170,"../util.cjs":2171},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.TokenNameProvider=void 0;const i=e("../logger.cjs"),o=e("../types.cjs"),c=e("../util.cjs"),u="token",l=(0,i.createModuleLogger)(i.projectLogger,"token");r.TokenNameProvider=class{constructor({isEnabled:e}={}){n.set(this,void 0),s(this,n,e||(()=>!0),"f")}getMetadata(){return{sourceIds:{[o.NameType.ETHEREUM_ADDRESS]:[u]},sourceLabels:{[u]:"Blockchain (Token Name)"}}}async getProposedNames(e){if(!a(this,n,"f").call(this))return l("Skipping request as disabled"),{results:{[u]:{proposedNames:[]}}};const{value:t,variation:r}=e,s=`https://token.api.cx.metamask.io/token/${r}?address=${t}`;l("Sending request",s);try{const e=(await(0,c.handleFetch)(s)).name,t=e?[e]:[];return l("New proposed names",t),{results:{[u]:{proposedNames:t}}}}catch(e){throw l("Request failed",e),e}}},n=new WeakMap}}},{package:"@metamask/name-controller",file:"node_modules/@metamask/name-controller/dist/providers/token.cjs"}],[2170,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.NameType=void 0,function(e){e.ETHEREUM_ADDRESS="ethereumAddress"}(n||(r.NameType=n={}))}}},{package:"@metamask/name-controller",file:"node_modules/@metamask/name-controller/dist/types.cjs"}],[2171,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){async function n(e,t){const r=await s(e,t);return await r.json()}async function s(e,t){const r=await fetch(e,t);if(!r.ok)throw new Error(`Fetch failed with status '${r.status}' for request '${e}'`);return r}Object.defineProperty(r,"__esModule",{value:!0}),r.assertIsError=r.successfulFetch=r.handleFetch=r.graphQL=void 0,r.graphQL=async function(e,t,r){const s=JSON.stringify({query:t,variables:r}),a=await n(e,{body:s,method:"POST",headers:{"Content-Type":"application/json"}});return a?.data},r.handleFetch=n,r.successfulFetch=s,r.assertIsError=function(e){if(!(e instanceof Error))throw new Error(`Invalid error of type '${typeof e}'`)}}}},{package:"@metamask/name-controller",file:"node_modules/@metamask/name-controller/dist/util.cjs"}],[2172,{"./constants.cjs":2173,"./create-auto-managed-network-client.cjs":2174,"./logger.cjs":2177,"./types.cjs":2178,"@metamask/base-controller":2240,"@metamask/controller-utils":1474,"@metamask/eth-query":1701,"@metamask/rpc-errors":2554,"@metamask/swappable-obj-proxy":2881,"@metamask/utils":2321,"fast-deep-equal":4427,reselect:5284,"uri-js":5638,uuid:5663},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i,o,c,u,l,d,m,p,h,f,g,y,b,k,w,S,_,v,E=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),T=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),A=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&E(t,e,r);return T(t,e),t},j=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},C=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},I=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.NetworkController=r.selectAvailableNetworkClientIds=r.getAvailableNetworkClientIds=r.getNetworkConfigurations=r.getDefaultNetworkControllerState=r.knownKeysOf=r.RpcEndpointType=void 0;const P=e("@metamask/base-controller"),x=e("@metamask/controller-utils"),R=I(e("@metamask/eth-query")),O=e("@metamask/rpc-errors"),M=e("@metamask/swappable-obj-proxy"),N=e("@metamask/utils"),B=I(e("fast-deep-equal")),$=e("reselect"),D=A(e("uri-js")),U=e("uuid"),L=e("./constants.cjs"),H=e("./create-auto-managed-network-client.cjs"),V=e("./logger.cjs"),K=e("./types.cjs"),F=(0,V.createModuleLogger)(V.projectLogger,"NetworkController"),q=/^https:\/\/(?<networkName>[^.]+)\.infura\.io\/v\d+\/(?<apiKey>.+)$/u;var J;function z(e){return Object.keys(e)}function G(e){return"object"==typeof e&&null!==e&&"code"in e}!function(e){e.Custom="custom",e.Infura="infura"}(J||(r.RpcEndpointType=J={})),r.knownKeysOf=z;const W="NetworkController";function X(){const e=Object.values(x.InfuraNetworkType).reduce(((e,t)=>{const r=x.ChainId[t],n=`https://${t}.infura.io/v3/{infuraProjectId}`;return{...e,[r]:{blockExplorerUrls:[],chainId:r,defaultRpcEndpointIndex:0,name:x.NetworkNickname[t],nativeCurrency:x.NetworksTicker[t],rpcEndpoints:[{networkClientId:t,type:J.Infura,url:n}]}}}),{});return{selectedNetworkClientId:x.InfuraNetworkType.mainnet,networksMetadata:{},networkConfigurationsByChainId:e}}function Z(e){return Object.values(e.networkConfigurationsByChainId)}function Y(e){return e.flatMap((e=>e.rpcEndpoints.map((e=>e.networkClientId))))}function Q(e){const t=D.parse(e);return t.error===undefined&&("http"===t.scheme||"https"===t.scheme)}function ee(e){const t=q.exec(e);if(t?.groups){if((0,x.isInfuraNetworkType)(t.groups.networkName))return t.groups.networkName;throw new Error(`Unknown Infura network '${t.groups.networkName}'`)}throw new Error("Could not derive Infura network from RPC endpoint URL")}function te(e){return new Map(Object.values(e).flatMap((e=>e.rpcEndpoints.map((t=>[t.networkClientId,e])))))}r.getDefaultNetworkControllerState=X,r.getNetworkConfigurations=Z,r.getAvailableNetworkClientIds=Y,r.selectAvailableNetworkClientIds=(0,$.createSelector)([Z],Y);class re extends P.BaseController{constructor({messenger:e,state:t,infuraProjectId:p,log:h}){const f={...X(),...t};if(function(e){const t=Object.entries(e.networkConfigurationsByChainId),n=(0,r.selectAvailableNetworkClientIds)(e);if(0===t.length)throw new Error("NetworkController state is invalid: `networkConfigurationsByChainId` cannot be empty");for(const[e,r]of t){if(e!==r.chainId)throw new Error(`NetworkController state has invalid \`networkConfigurationsByChainId\`: Network configuration '${r.name}' is filed under '${e}' which does not match its \`chainId\` of '${r.chainId}'`);if(r.blockExplorerUrls.length>0?r.defaultBlockExplorerUrlIndex===undefined||r.blockExplorerUrls[r.defaultBlockExplorerUrlIndex]===undefined:r.defaultBlockExplorerUrlIndex!==undefined)throw new Error(`NetworkController state has invalid \`networkConfigurationsByChainId\`: Network configuration '${r.name}' has a \`defaultBlockExplorerUrlIndex\` that does not refer to an entry in \`blockExplorerUrls\``);if(r.rpcEndpoints[r.defaultRpcEndpointIndex]===undefined)throw new Error(`NetworkController state has invalid \`networkConfigurationsByChainId\`: Network configuration '${r.name}' has a \`defaultRpcEndpointIndex\` that does not refer to an entry in \`rpcEndpoints\``)}if([...new Set(n)].length<n.length)throw new Error("NetworkController state has invalid `networkConfigurationsByChainId`: Every RPC endpoint across all network configurations must have a unique `networkClientId`");if(!n.includes(e.selectedNetworkClientId))throw new Error(`NetworkController state is invalid: \`selectedNetworkClientId\` '${e.selectedNetworkClientId}' does not refer to an RPC endpoint within a network configuration`)}(f),!p||"string"!=typeof p)throw new Error("Invalid Infura project ID");super({name:W,metadata:{selectedNetworkClientId:{persist:!0,anonymous:!1},networksMetadata:{persist:!0,anonymous:!1},networkConfigurationsByChainId:{persist:!0,anonymous:!1}},messenger:e,state:f}),n.add(this),s.set(this,void 0),a.set(this,void 0),i.set(this,void 0),o.set(this,void 0),c.set(this,void 0),u.set(this,void 0),l.set(this,void 0),d.set(this,void 0),m.set(this,void 0),j(this,a,p,"f"),j(this,d,h,"f"),j(this,i,this.state.selectedNetworkClientId,"f"),j(this,m,te(this.state.networkConfigurationsByChainId),"f"),this.messagingSystem.registerActionHandler(`${this.name}:getEthQuery`,(()=>C(this,s,"f"))),this.messagingSystem.registerActionHandler(`${this.name}:getNetworkClientById`,this.getNetworkClientById.bind(this)),this.messagingSystem.registerActionHandler(`${this.name}:getEIP1559Compatibility`,this.getEIP1559Compatibility.bind(this)),this.messagingSystem.registerActionHandler(`${this.name}:setActiveNetwork`,this.setActiveNetwork.bind(this)),this.messagingSystem.registerActionHandler(`${this.name}:setProviderType`,this.setProviderType.bind(this)),this.messagingSystem.registerActionHandler(`${this.name}:findNetworkClientIdByChainId`,this.findNetworkClientIdByChainId.bind(this)),this.messagingSystem.registerActionHandler(`${this.name}:getNetworkConfigurationByChainId`,this.getNetworkConfigurationByChainId.bind(this)),this.messagingSystem.registerActionHandler(`${this.name}:getNetworkConfigurationByNetworkClientId`,this.getNetworkConfigurationByNetworkClientId.bind(this)),this.messagingSystem.registerActionHandler(`${this.name}:getSelectedNetworkClient`,this.getSelectedNetworkClient.bind(this)),this.messagingSystem.registerActionHandler(`${this.name}:addNetwork`,this.addNetwork.bind(this)),this.messagingSystem.registerActionHandler(`${this.name}:removeNetwork`,this.removeNetwork.bind(this)),this.messagingSystem.registerActionHandler(`${this.name}:updateNetwork`,this.updateNetwork.bind(this))}getProviderAndBlockTracker(){return{provider:C(this,o,"f"),blockTracker:C(this,c,"f")}}getSelectedNetworkClient(){return C(this,o,"f")&&C(this,c,"f")?{provider:C(this,o,"f"),blockTracker:C(this,c,"f")}:undefined}getNetworkClientRegistry(){const e=C(this,n,"m",S).call(this);return Object.assign({},e[K.NetworkClientType.Infura],e[K.NetworkClientType.Custom])}getNetworkClientById(e){if(!e)throw new Error("No network client ID was provided.");const t=C(this,n,"m",S).call(this);if((0,x.isInfuraNetworkType)(e)){const r=t[K.NetworkClientType.Infura][e];if(!r)throw new Error(`No Infura network client was found with the ID "${e}".`);return r}const r=t[K.NetworkClientType.Custom][e];if(!r)throw new Error(`No custom network client was found with the ID "${e}".`);return r}async initializeProvider(){C(this,n,"m",v).call(this,this.state.selectedNetworkClientId)}async lookupNetworkByClientId(e){const t=(0,x.isInfuraNetworkType)(e);let r,s;try{s=await C(this,n,"m",f).call(this,e),r=L.NetworkStatus.Available}catch(e){if(F("NetworkController: lookupNetworkByClientId: ",e),G(e)){let n;if(t&&(0,N.hasProperty)(e,"message")&&"string"==typeof e.message)try{n=JSON.parse(e.message)}catch{C(this,d,"f")?.warn("NetworkController: lookupNetworkByClientId: json parse error: ",e)}(0,N.isPlainObject)(n)&&n.error===L.INFURA_BLOCKED_KEY?r=L.NetworkStatus.Blocked:e.code===O.errorCodes.rpc.internal?(r=L.NetworkStatus.Unknown,C(this,d,"f")?.warn("NetworkController: lookupNetworkByClientId: rpc internal error: ",e)):(r=L.NetworkStatus.Unavailable,C(this,d,"f")?.warn("NetworkController: lookupNetworkByClientId: ",e))}else{if("undefined"!=typeof Error&&(0,N.hasProperty)(e,"message")&&"string"==typeof e.message&&e.message.includes("No custom network client was found with the ID"))throw e;F("NetworkController - could not determine network status",e),r=L.NetworkStatus.Unknown,C(this,d,"f")?.warn("NetworkController: lookupNetworkByClientId: ",e)}}this.update((t=>{t.networksMetadata[e]===undefined&&(t.networksMetadata[e]={status:L.NetworkStatus.Unknown,EIPS:{}});const n=t.networksMetadata[e];n.status=r,s===undefined?delete n.EIPS[1559]:n.EIPS[1559]=s}))}async lookupNetwork(e){if(e)return void await this.lookupNetworkByClientId(e);if(!C(this,s,"f"))return;const t=C(this,l,"f")?.configuration.type===K.NetworkClientType.Infura;let r=!1;const a=()=>{r=!0,this.messagingSystem.unsubscribe("NetworkController:networkDidChange",a)};let i,o;this.messagingSystem.subscribe("NetworkController:networkDidChange",a);try{const e=await C(this,n,"m",f).call(this,this.state.selectedNetworkClientId);i=L.NetworkStatus.Available,o=e}catch(e){if(G(e)){let r;if(t&&(0,N.hasProperty)(e,"message")&&"string"==typeof e.message)try{r=JSON.parse(e.message)}catch(e){C(this,d,"f")?.warn("NetworkController: lookupNetwork: json parse error",e)}(0,N.isPlainObject)(r)&&r.error===L.INFURA_BLOCKED_KEY?i=L.NetworkStatus.Blocked:e.code===O.errorCodes.rpc.internal?(i=L.NetworkStatus.Unknown,C(this,d,"f")?.warn("NetworkController: lookupNetwork: rpc internal error",e)):(i=L.NetworkStatus.Unavailable,C(this,d,"f")?.warn("NetworkController: lookupNetwork: ",e))}else F("NetworkController - could not determine network status",e),i=L.NetworkStatus.Unknown,C(this,d,"f")?.warn("NetworkController: lookupNetwork: ",e)}r||(this.messagingSystem.unsubscribe("NetworkController:networkDidChange",a),this.update((e=>{const t=e.networksMetadata[e.selectedNetworkClientId];t.status=i,o===undefined?delete t.EIPS[1559]:t.EIPS[1559]=o})),t?i===L.NetworkStatus.Available?this.messagingSystem.publish("NetworkController:infuraIsUnblocked"):i===L.NetworkStatus.Blocked&&this.messagingSystem.publish("NetworkController:infuraIsBlocked"):this.messagingSystem.publish("NetworkController:infuraIsUnblocked"))}async setProviderType(e){if(e===x.NetworkType.rpc)throw new Error(`NetworkController - cannot call "setProviderType" with type "${x.NetworkType.rpc}". Use "setActiveNetwork"`);if(!(0,x.isInfuraNetworkType)(e))throw new Error(`Unknown Infura provider type "${String(e)}".`);await this.setActiveNetwork(e)}async setActiveNetwork(e,t={}){j(this,i,this.state.selectedNetworkClientId,"f"),await C(this,n,"m",p).call(this,e,t)}async getEIP1559Compatibility(e){if(e)return this.get1559CompatibilityWithNetworkClientId(e);if(!C(this,s,"f"))return!1;const{EIPS:t}=this.state.networksMetadata[this.state.selectedNetworkClientId];if(t[1559]!==undefined)return t[1559];const r=await C(this,n,"m",f).call(this,this.state.selectedNetworkClientId);return this.update((e=>{r!==undefined&&(e.networksMetadata[e.selectedNetworkClientId].EIPS[1559]=r)})),r}async get1559CompatibilityWithNetworkClientId(e){let t=this.state.networksMetadata[e];t===undefined&&(await this.lookupNetwork(e),t=this.state.networksMetadata[e]);const{EIPS:r}=t;return r[1559]}async resetConnection(){await C(this,n,"m",p).call(this,this.state.selectedNetworkClientId)}getNetworkConfigurationByChainId(e){return this.state.networkConfigurationsByChainId[e]}getNetworkConfigurationByNetworkClientId(e){return C(this,m,"f").get(e)}addNetwork(e){const{rpcEndpoints:t}=e,r=C(this,n,"m",S).call(this);C(this,n,"m",g).call(this,{mode:"add",networkFields:e,autoManagedNetworkClientRegistry:r});const s=t.map((e=>({type:"add",rpcEndpoint:e.type===J.Custom?{...e,networkClientId:(0,U.v4)()}:e}))),a=C(this,n,"m",y).call(this,{networkFields:e,networkClientOperations:s});return C(this,n,"m",b).call(this,{networkFields:e,networkClientOperations:s,autoManagedNetworkClientRegistry:r}),this.update((t=>{C(this,n,"m",w).call(this,{state:t,mode:"add",networkFields:e,networkConfigurationToPersist:a})})),j(this,m,te(this.state.networkConfigurationsByChainId),"f"),this.messagingSystem.publish(`${W}:networkAdded`,a),a}async updateNetwork(e,t,{replacementSelectedRpcEndpointIndex:r}={}){const s=this.state.networkConfigurationsByChainId[e];if(s===undefined)throw new Error(`Could not update network: Cannot find network configuration for chain '${e}'`);const a=e,{chainId:i,rpcEndpoints:o}=t,c=C(this,n,"m",S).call(this);C(this,n,"m",g).call(this,{mode:"update",networkFields:t,existingNetworkConfiguration:s,autoManagedNetworkClientRegistry:c});const u=[];for(const e of o){const t=s.rpcEndpoints.find((t=>t.type===e.type&&t.url===e.url&&(t.networkClientId===e.networkClientId||e.networkClientId===undefined))),r=s.rpcEndpoints.find((t=>t.type===J.Infura&&e.type===J.Infura||t.type===e.type&&t.networkClientId===e.networkClientId&&t.url===e.url)),n=s.rpcEndpoints.find((t=>t.type===e.type&&(t.url===e.url||t.networkClientId===e.networkClientId)));if(i!==a&&r!==undefined){const t=e.type===J.Infura?e:{...e,networkClientId:(0,U.v4)()};u.push({type:"replace",oldRpcEndpoint:r,newRpcEndpoint:t})}else if(t!==undefined){let r;r=t.type===J.Infura?t:Object.assign({},e,{networkClientId:t.networkClientId}),u.push({type:"noop",rpcEndpoint:r})}else if(n!==undefined){let t;t=e.type===J.Infura?e:{...e,networkClientId:(0,U.v4)()},u.push({type:"replace",oldRpcEndpoint:n,newRpcEndpoint:t})}else{const t={type:"add",rpcEndpoint:e.type===J.Infura?e:{...e,networkClientId:(0,U.v4)()}};u.push(t)}}for(const e of s.rpcEndpoints)if(!u.some((t=>{const r="replace"===t.type?t.oldRpcEndpoint:t.rpcEndpoint;return r.type===e.type&&r.networkClientId===e.networkClientId&&r.url===e.url}))){const t={type:"remove",rpcEndpoint:e};u.push(t)}const l=C(this,n,"m",y).call(this,{networkFields:t,networkClientOperations:u});if(r===undefined&&u.some((e=>"remove"===e.type&&e.rpcEndpoint.networkClientId===this.state.selectedNetworkClientId))&&!u.some((e=>"replace"===e.type&&e.oldRpcEndpoint.networkClientId===this.state.selectedNetworkClientId)))throw new Error(`Could not update network: Cannot update RPC endpoints in such a way that the selected network '${this.state.selectedNetworkClientId}' would be removed without a replacement. Choose a different RPC endpoint as the selected network via the \`replacementSelectedRpcEndpointIndex\` option.`);C(this,n,"m",b).call(this,{networkFields:t,networkClientOperations:u,autoManagedNetworkClientRegistry:c});const d=u.map(((e,t)=>[e,t])).find((([e,t])=>"replace"===e.type&&e.oldRpcEndpoint.networkClientId===this.state.selectedNetworkClientId)),p=r??d?.[1];let h;if(p!==undefined&&(h=l.rpcEndpoints[p],h===undefined))throw new Error(`Could not update network: \`replacementSelectedRpcEndpointIndex\` ${p} does not refer to an entry in \`rpcEndpoints\``);return h&&h.networkClientId!==this.state.selectedNetworkClientId?await this.setActiveNetwork(h.networkClientId,{updateState:e=>{C(this,n,"m",w).call(this,{state:e,mode:"update",networkFields:t,networkConfigurationToPersist:l,existingNetworkConfiguration:s})}}):this.update((e=>{C(this,n,"m",w).call(this,{state:e,mode:"update",networkFields:t,networkConfigurationToPersist:l,existingNetworkConfiguration:s})})),j(this,m,te(this.state.networkConfigurationsByChainId),"f"),C(this,n,"m",k).call(this,{networkClientOperations:u,autoManagedNetworkClientRegistry:c}),l}removeNetwork(e){const t=this.state.networkConfigurationsByChainId[e];if(t===undefined)throw new Error(`Cannot find network configuration for chain '${e}'`);if(t.rpcEndpoints.some((e=>e.networkClientId===this.state.selectedNetworkClientId)))throw new Error("Cannot remove the currently selected network");const r=C(this,n,"m",S).call(this),s=t.rpcEndpoints.map((e=>({type:"remove",rpcEndpoint:e})));C(this,n,"m",k).call(this,{networkClientOperations:s,autoManagedNetworkClientRegistry:r}),this.update((e=>{C(this,n,"m",w).call(this,{state:e,mode:"remove",existingNetworkConfiguration:t})})),j(this,m,te(this.state.networkConfigurationsByChainId),"f"),this.messagingSystem.publish("NetworkController:networkRemoved",t)}async rollbackToPreviousProvider(){await C(this,n,"m",p).call(this,C(this,i,"f"))}async destroy(){await(C(this,c,"f")?.destroy())}loadBackup({networkConfigurationsByChainId:e}){this.update((t=>{t.networkConfigurationsByChainId={...t.networkConfigurationsByChainId,...e}}))}findNetworkClientIdByChainId(e){const t=this.getNetworkClientRegistry(),r=Object.entries(t).find((([t,r])=>r.configuration.chainId===e));if(r===undefined)throw new Error("Couldn't find networkClientId for chainId");return r[0]}}r.NetworkController=re,s=new WeakMap,a=new WeakMap,i=new WeakMap,o=new WeakMap,c=new WeakMap,u=new WeakMap,l=new WeakMap,d=new WeakMap,m=new WeakMap,n=new WeakSet,p=async function(e,t={}){this.messagingSystem.publish("NetworkController:networkWillChange",this.state),C(this,n,"m",v).call(this,e,t),this.messagingSystem.publish("NetworkController:networkDidChange",this.state),await this.lookupNetwork()},h=function(e){e===undefined&&(e=this.state.selectedNetworkClientId);const t=this.getNetworkClientById(e),r=new R.default(t.provider);return new Promise(((e,t)=>{r.sendAsync({method:"eth_getBlockByNumber",params:["latest",!1]},((r,n)=>{r?t(r):e(n)}))}))},f=async function(e){const t=await C(this,n,"m",h).call(this,e);return t?t.baseFeePerGas!==undefined:undefined},g=function(e){const{mode:t,networkFields:r,autoManagedNetworkClientRegistry:n}=e,s="existingNetworkConfiguration"in e?e.existingNetworkConfiguration:null,a="update"===t?"Could not update network":"Could not add network";if(!(0,N.isStrictHexString)(r.chainId)||!(0,x.isSafeChainId)(r.chainId))throw new Error(`${a}: Invalid \`chainId\` '${r.chainId}' (must start with "0x" and not exceed the maximum)`);if(null===s||r.chainId!==s.chainId){const t=this.state.networkConfigurationsByChainId[r.chainId];if(t!==undefined)throw null===s?new Error(`Could not add network for chain ${e.networkFields.chainId} as another network for that chain already exists ('${t.name}')`):new Error(`Cannot move network from chain ${s.chainId} to ${r.chainId} as another network for that chain already exists ('${t.name}')`)}if(r.blockExplorerUrls.length>0?r.defaultBlockExplorerUrlIndex===undefined||r.blockExplorerUrls[r.defaultBlockExplorerUrlIndex]===undefined:r.defaultBlockExplorerUrlIndex!==undefined)throw new Error(`${a}: \`defaultBlockExplorerUrlIndex\` must refer to an entry in \`blockExplorerUrls\``);if(0===r.rpcEndpoints.length)throw new Error(`${a}: \`rpcEndpoints\` must be a non-empty array`);for(const e of r.rpcEndpoints){if(!Q(e.url))throw new Error(`${a}: An entry in \`rpcEndpoints\` has invalid URL '${e.url}'`);const i="networkClientId"in e?e.networkClientId:undefined;if(e.type===J.Custom&&i!==undefined&&(0,x.isInfuraNetworkType)(i))throw new Error(`${a}: Custom RPC endpoint '${e.url}' has invalid network client ID '${i}'`);if("update"===t&&i!==undefined&&e.type===J.Custom&&!Object.values(n).some((e=>i in e)))throw new Error(`${a}: RPC endpoint '${e.url}' refers to network client '${i}' that does not exist`);if(r.rpcEndpoints.some((t=>t!==e&&D.equal(t.url,e.url))))throw new Error(`${a}: Each entry in rpcEndpoints must have a unique URL`);const o=Object.values(this.state.networkConfigurationsByChainId).filter((e=>!s||e.chainId!==s.chainId));for(const r of o){if(r.rpcEndpoints.find((t=>D.equal(e.url,t.url))))throw"update"===t?new Error(`Could not update network to point to same RPC endpoint as existing network for chain ${r.chainId} ('${r.name}')`):new Error(`Could not add network that points to same RPC endpoint as existing network for chain ${r.chainId} ('${r.name}')`)}}if([...new Set(r.rpcEndpoints)].length<r.rpcEndpoints.length)throw new Error(`${a}: Each entry in rpcEndpoints must be unique`);const i=r.rpcEndpoints.map((e=>"networkClientId"in e?e.networkClientId:undefined)).filter((e=>e!==undefined));if([...new Set(i)].length<i.length)throw new Error(`${a}: Each entry in rpcEndpoints must have a unique networkClientId`);const o=r.rpcEndpoints.filter((e=>e.type===J.Infura));if(o.length>1)throw new Error(`${a}: There cannot be more than one Infura RPC endpoint`);const c=o[0];if(c){const e=ee(c.url),n=x.NetworkNickname[e],s=x.ChainId[e];if(r.chainId!==s)throw new Error("add"===t?`Could not add network with chain ID ${r.chainId} and Infura RPC endpoint for '${n}' which represents ${s}, as the two conflict`:`Could not update network with chain ID ${r.chainId} and Infura RPC endpoint for '${n}' which represents ${s}, as the two conflict`)}if(r.rpcEndpoints[r.defaultRpcEndpointIndex]===undefined)throw new Error(`${a}: \`defaultRpcEndpointIndex\` must refer to an entry in \`rpcEndpoints\``)},y=function({networkFields:e,networkClientOperations:t}){return{...e,rpcEndpoints:t.filter((e=>"add"===e.type||"noop"===e.type)).map((e=>e.rpcEndpoint)).concat(t.filter((e=>"replace"===e.type)).map((e=>e.newRpcEndpoint)))}},b=function({networkFields:e,networkClientOperations:t,autoManagedNetworkClientRegistry:r}){const n=t.filter((e=>"add"===e.type)).map((e=>e.rpcEndpoint)).concat(t.filter((e=>"replace"===e.type)).map((e=>e.newRpcEndpoint)));for(const t of n)t.type===J.Infura?r[K.NetworkClientType.Infura][t.networkClientId]=(0,H.createAutoManagedNetworkClient)({type:K.NetworkClientType.Infura,chainId:e.chainId,network:t.networkClientId,infuraProjectId:C(this,a,"f"),ticker:e.nativeCurrency}):r[K.NetworkClientType.Custom][t.networkClientId]=(0,H.createAutoManagedNetworkClient)({type:K.NetworkClientType.Custom,chainId:e.chainId,rpcUrl:t.url,ticker:e.nativeCurrency})},k=function({networkClientOperations:e,autoManagedNetworkClientRegistry:t}){const r=e.filter((e=>"remove"===e.type)).map((e=>e.rpcEndpoint)).concat(e.filter((e=>"replace"===e.type)).map((e=>e.oldRpcEndpoint)));for(const e of r){const r=this.getNetworkClientById(e.networkClientId);r.destroy(),delete t[r.configuration.type][e.networkClientId]}},w=function(e){const{state:t,mode:r}=e;("remove"===r||"update"===r&&e.networkFields.chainId!==e.existingNetworkConfiguration.chainId)&&delete t.networkConfigurationsByChainId[e.existingNetworkConfiguration.chainId],"add"!==r&&"update"!==r||((0,B.default)(t.networkConfigurationsByChainId[e.networkFields.chainId],e.networkConfigurationToPersist)||(e.networkConfigurationToPersist.lastUpdatedAt=Date.now()),t.networkConfigurationsByChainId[e.networkFields.chainId]=e.networkConfigurationToPersist)},S=function(){return j(this,u,C(this,u,"f")??C(this,n,"m",_).call(this),"f")},_=function(){return z(this.state.networkConfigurationsByChainId).flatMap((e=>{const t=this.state.networkConfigurationsByChainId[e];return t.rpcEndpoints.map((e=>{if(e.type===J.Infura){const r=ee(e.url);return[e.networkClientId,(0,H.createAutoManagedNetworkClient)({type:K.NetworkClientType.Infura,network:r,infuraProjectId:C(this,a,"f"),chainId:t.chainId,ticker:t.nativeCurrency})]}return[e.networkClientId,(0,H.createAutoManagedNetworkClient)({type:K.NetworkClientType.Custom,chainId:t.chainId,rpcUrl:e.url,ticker:t.nativeCurrency})]}))})).reduce(((e,[t,r])=>({...e,[r.configuration.type]:{...e[r.configuration.type],[t]:r}})),{[K.NetworkClientType.Custom]:{},[K.NetworkClientType.Infura]:{}})},v=function(e,{updateState:t}={}){const r=C(this,n,"m",S).call(this);let a;if((0,x.isInfuraNetworkType)(e)){const t=r[K.NetworkClientType.Infura][e];if(!t)throw new Error(`No Infura network client found with ID '${e}'`);a=t}else{const t=r[K.NetworkClientType.Custom][e];if(!t)throw new Error(`No network client found with ID '${e}'`);a=t}j(this,l,a,"f"),this.update((r=>{r.selectedNetworkClientId=e,r.networksMetadata[e]===undefined&&(r.networksMetadata[e]={status:L.NetworkStatus.Unknown,EIPS:{}}),t?.(r)})),C(this,o,"f")?C(this,o,"f").setTarget(C(this,l,"f").provider):j(this,o,(0,M.createEventEmitterProxy)(C(this,l,"f").provider),"f"),C(this,c,"f")?C(this,c,"f").setTarget(C(this,l,"f").blockTracker):j(this,c,(0,M.createEventEmitterProxy)(C(this,l,"f").blockTracker,{eventFilter:"skipInternal"}),"f"),j(this,s,new R.default(C(this,o,"f")),"f")}}}},{package:"@metamask/network-controller",file:"node_modules/@metamask/network-controller/dist/NetworkController.cjs"}],[2173,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.INFURA_BLOCKED_KEY=r.NetworkStatus=void 0,function(e){e.Unknown="unknown",e.Available="available",e.Unavailable="unavailable",e.Blocked="blocked"}(n||(r.NetworkStatus=n={})),r.INFURA_BLOCKED_KEY="countryBlocked"}}},{package:"@metamask/network-controller",file:"node_modules/@metamask/network-controller/dist/constants.cjs"}],[2174,{"./create-network-client.cjs":2175},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createAutoManagedNetworkClient=void 0;const n=e("./create-network-client.cjs"),s="__target__",a={__UNINITIALIZED__:!0};r.createAutoManagedNetworkClient=function(e){let t;const r=new Proxy(a,{get(r,a,i){if(a===s)return t?.provider;if(t??(t=(0,n.createNetworkClient)(e)),t===undefined)throw new Error("It looks like `createNetworkClient` didn't return anything. Perhaps it's being mocked?");const{provider:o}=t;if(a in o){const e=o[a];return"function"==typeof e?function(...t){return e.apply(this===i?o:this,t)}:e}return undefined},has(r,a){if(a===s)return!0;t??(t=(0,n.createNetworkClient)(e));const{provider:i}=t;return a in i}}),i=new Proxy(a,{get(r,a,i){if(a===s)return t?.blockTracker;if(t??(t=(0,n.createNetworkClient)(e)),t===undefined)throw new Error("It looks like createNetworkClient returned undefined. Perhaps it's mocked?");const{blockTracker:o}=t;if(a in o){const e=o[a];return"function"==typeof e?function(...t){return e.apply(this===i?o:this,t)}:e}return undefined},has(r,a){if(a===s)return!0;t??(t=(0,n.createNetworkClient)(e));const{blockTracker:i}=t;return a in i}});return{configuration:e,provider:r,blockTracker:i,destroy:()=>{t?.destroy()}}}}}},{package:"@metamask/network-controller",file:"node_modules/@metamask/network-controller/dist/create-auto-managed-network-client.cjs"}],[2175,{"./types.cjs":2178,"@metamask/controller-utils":1474,"@metamask/eth-block-tracker":1507,"@metamask/eth-json-rpc-infura":1564,"@metamask/eth-json-rpc-middleware":2246,"@metamask/eth-json-rpc-provider":1648,"@metamask/json-rpc-engine":1933},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createNetworkClient=void 0;const n=e("@metamask/controller-utils"),s=e("@metamask/eth-block-tracker"),a=e("@metamask/eth-json-rpc-infura"),i=e("@metamask/eth-json-rpc-middleware"),o=e("@metamask/eth-json-rpc-provider"),c=e("@metamask/json-rpc-engine"),u=e("./types.cjs");function l({network:e}){return(0,c.createScaffoldMiddleware)({eth_chainId:n.ChainId[e]})}r.createNetworkClient=function(e){const t=e.type===u.NetworkClientType.Infura?(0,a.createInfuraMiddleware)({network:e.network,projectId:e.infuraProjectId,maxAttempts:5,source:"metamask"}):(0,i.createFetchMiddleware)({btoa:global.btoa,fetch:global.fetch,rpcUrl:e.rpcUrl}),r=(0,o.providerFromMiddleware)(t),n={},m=new s.PollingBlockTracker({...n,provider:r}),p=e.type===u.NetworkClientType.Infura?function({blockTracker:e,network:t,rpcProvider:r,rpcApiMiddleware:n}){return(0,c.mergeMiddleware)([l({network:t}),(0,i.createBlockCacheMiddleware)({blockTracker:e}),(0,i.createInflightCacheMiddleware)(),(0,i.createBlockRefMiddleware)({blockTracker:e,provider:r}),(0,i.createRetryOnEmptyMiddleware)({blockTracker:e,provider:r}),(0,i.createBlockTrackerInspectorMiddleware)({blockTracker:e}),n])}({blockTracker:m,network:e.network,rpcProvider:r,rpcApiMiddleware:t}):function({blockTracker:e,chainId:t,rpcApiMiddleware:r}){const n=[];return(0,c.mergeMiddleware)([...n,d(t),(0,i.createBlockRefRewriteMiddleware)({blockTracker:e}),(0,i.createBlockCacheMiddleware)({blockTracker:e}),(0,i.createInflightCacheMiddleware)(),(0,i.createBlockTrackerInspectorMiddleware)({blockTracker:e}),r])}({blockTracker:m,chainId:e.chainId,rpcApiMiddleware:t}),h=new c.JsonRpcEngine;return h.push(p),{configuration:e,provider:(0,o.providerFromEngine)(h),blockTracker:m,destroy:()=>{m.destroy()}}};const d=e=>(t,r,n,s)=>"eth_chainId"===t.method?(r.result=e,s()):n()}}},{package:"@metamask/network-controller",file:"node_modules/@metamask/network-controller/dist/create-network-client.cjs"}],[2176,{"./NetworkController.cjs":2172,"./constants.cjs":2173,"./types.cjs":2178},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.NetworkClientType=r.RpcEndpointType=r.NetworkController=r.knownKeysOf=r.selectAvailableNetworkClientIds=r.getDefaultNetworkControllerState=void 0;var a=e("./NetworkController.cjs");Object.defineProperty(r,"getDefaultNetworkControllerState",{enumerable:!0,get:function(){return a.getDefaultNetworkControllerState}}),Object.defineProperty(r,"selectAvailableNetworkClientIds",{enumerable:!0,get:function(){return a.selectAvailableNetworkClientIds}}),Object.defineProperty(r,"knownKeysOf",{enumerable:!0,get:function(){return a.knownKeysOf}}),Object.defineProperty(r,"NetworkController",{enumerable:!0,get:function(){return a.NetworkController}}),Object.defineProperty(r,"RpcEndpointType",{enumerable:!0,get:function(){return a.RpcEndpointType}}),s(e("./constants.cjs"),r);var i=e("./types.cjs");Object.defineProperty(r,"NetworkClientType",{enumerable:!0,get:function(){return i.NetworkClientType}})}}},{package:"@metamask/network-controller",file:"node_modules/@metamask/network-controller/dist/index.cjs"}],[2177,{"@metamask/utils":2321},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createModuleLogger=r.projectLogger=void 0;const n=e("@metamask/utils");Object.defineProperty(r,"createModuleLogger",{enumerable:!0,get:function(){return n.createModuleLogger}}),r.projectLogger=(0,n.createProjectLogger)("network-controller")}}},{package:"@metamask/network-controller",file:"node_modules/@metamask/network-controller/dist/logger.cjs"}],[2178,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.NetworkClientType=void 0,function(e){e.Custom="custom",e.Infura="infura"}(n||(r.NetworkClientType=n={}))}}},{package:"@metamask/network-controller",file:"node_modules/@metamask/network-controller/dist/types.cjs"}],[2179,{"./bytes":2182,"./constants":2183,"./helpers":2185,"./internal":2187,"@ethereumjs/rlp":429,buffer:4074,"ethereum-cryptography/keccak":4300,"ethereum-cryptography/secp256k1":4317,"ethereum-cryptography/utils":4319},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.accountBodyToRLP=r.accountBodyToSlim=r.accountBodyFromSlim=r.isZeroAddress=r.zeroAddress=r.importPublic=r.privateToAddress=r.privateToPublic=r.publicToAddress=r.pubToAddress=r.isValidPublic=r.isValidPrivate=r.generateAddress2=r.generateAddress=r.isValidChecksumAddress=r.toChecksumAddress=r.isValidAddress=r.Account=void 0;const n=e("@ethereumjs/rlp"),s=e("ethereum-cryptography/keccak"),a=e("ethereum-cryptography/secp256k1"),i=e("ethereum-cryptography/utils"),o=e("./bytes"),c=e("./constants"),u=e("./helpers"),l=e("./internal"),d=BigInt(0);class m{constructor(e=d,t=d,r=c.KECCAK256_RLP,n=c.KECCAK256_NULL){this.nonce=e,this.balance=t,this.storageRoot=r,this.codeHash=n,this._validate()}static fromAccountData(e){const{nonce:t,balance:r,storageRoot:n,codeHash:s}=e;return new m(t!==undefined?(0,o.bufferToBigInt)((0,o.toBuffer)(t)):undefined,r!==undefined?(0,o.bufferToBigInt)((0,o.toBuffer)(r)):undefined,n!==undefined?(0,o.toBuffer)(n):undefined,s!==undefined?(0,o.toBuffer)(s):undefined)}static fromRlpSerializedAccount(e){const t=(0,o.arrToBufArr)(n.RLP.decode(Uint8Array.from(e)));if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)}static fromValuesArray(e){const[t,r,n,s]=e;return new m((0,o.bufferToBigInt)(t),(0,o.bufferToBigInt)(r),n,s)}_validate(){if(this.nonce<d)throw new Error("nonce must be greater than zero");if(this.balance<d)throw new Error("balance must be greater than zero");if(32!==this.storageRoot.length)throw new Error("storageRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")}raw(){return[(0,o.bigIntToUnpaddedBuffer)(this.nonce),(0,o.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return t.from(n.RLP.encode((0,o.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(c.KECCAK256_NULL)}isEmpty(){return this.balance===d&&this.nonce===d&&this.codeHash.equals(c.KECCAK256_NULL)}}r.Account=m;r.isValidAddress=function(e){try{(0,u.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};r.toChecksumAddress=function(e,r){(0,u.assertIsHexString)(e);const n=(0,l.stripHexPrefix)(e).toLowerCase();let a="";if(r!==undefined){a=(0,o.bufferToBigInt)((0,o.toBuffer)(r)).toString()+"0x"}const c=t.from(a+n,"utf8"),d=(0,i.bytesToHex)((0,s.keccak256)(c));let m="0x";for(let e=0;e<n.length;e++)parseInt(d[e],16)>=8?m+=n[e].toUpperCase():m+=n[e];return m};r.isValidChecksumAddress=function(e,t){return(0,r.isValidAddress)(e)&&(0,r.toChecksumAddress)(e,t)===e};r.generateAddress=function(e,r){return(0,u.assertIsBuffer)(e),(0,u.assertIsBuffer)(r),(0,o.bufferToBigInt)(r)===BigInt(0)?t.from((0,s.keccak256)(n.RLP.encode((0,o.bufArrToArr)([e,null])))).slice(-20):t.from((0,s.keccak256)(n.RLP.encode((0,o.bufArrToArr)([e,r])))).slice(-20)};r.generateAddress2=function(e,r,n){if((0,u.assertIsBuffer)(e),(0,u.assertIsBuffer)(r),(0,u.assertIsBuffer)(n),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==r.length)throw new Error("Expected salt to be of length 32");const a=(0,s.keccak256)(t.concat([t.from("ff","hex"),e,r,(0,s.keccak256)(n)]));return(0,o.toBuffer)(a).slice(-20)};r.isValidPrivate=function(e){return a.secp256k1.utils.isValidPrivateKey(e)};r.isValidPublic=function(e,r=!1){if((0,u.assertIsBuffer)(e),64===e.length)try{return a.secp256k1.ProjectivePoint.fromHex(t.concat([t.from([4]),e])),!0}catch(e){return!1}if(!r)return!1;try{return a.secp256k1.ProjectivePoint.fromHex(e),!0}catch(e){return!1}};r.pubToAddress=function(e,r=!1){if((0,u.assertIsBuffer)(e),r&&64!==e.length&&(e=t.from(a.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),64!==e.length)throw new Error("Expected pubKey to be of length 64");return t.from((0,s.keccak256)(e)).slice(-20)},r.publicToAddress=r.pubToAddress;r.privateToPublic=function(e){return(0,u.assertIsBuffer)(e),t.from(a.secp256k1.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1))};r.privateToAddress=function(e){return(0,r.publicToAddress)((0,r.privateToPublic)(e))};r.importPublic=function(e){return(0,u.assertIsBuffer)(e),64!==e.length&&(e=t.from(a.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),e};r.zeroAddress=function(){const e=(0,o.zeros)(20);return(0,o.bufferToHex)(e)};function p(e){const[t,r,n,s]=e;return[t,r,0===(0,o.arrToBufArr)(n).length?c.KECCAK256_RLP:n,0===(0,o.arrToBufArr)(s).length?c.KECCAK256_NULL:s]}r.isZeroAddress=function(e){try{(0,u.assertIsString)(e)}catch(e){return!1}return(0,r.zeroAddress)()===e},r.accountBodyFromSlim=p;const h=new Uint8Array(0);r.accountBodyToSlim=function(e){const[t,r,n,s]=e;return[t,r,(0,o.arrToBufArr)(n).equals(c.KECCAK256_RLP)?h:n,(0,o.arrToBufArr)(s).equals(c.KECCAK256_NULL)?h:s]},r.accountBodyToRLP=function(e,t=!0){const r=t?p(e):e;return(0,o.arrToBufArr)(n.RLP.encode(r))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/account.js"}],[2180,{"./account":2179,"./bytes":2182,buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.Address=void 0;const n=e("./account"),s=e("./bytes");class a{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.buf=e}static zero(){return new a((0,s.zeros)(20))}static fromString(e){if(!(0,n.isValidAddress)(e))throw new Error("Invalid address");return new a((0,s.toBuffer)(e))}static fromPublicKey(e){if(!t.isBuffer(e))throw new Error("Public key should be Buffer");const r=(0,n.pubToAddress)(e);return new a(r)}static fromPrivateKey(e){if(!t.isBuffer(e))throw new Error("Private key should be Buffer");const r=(0,n.privateToAddress)(e);return new a(r)}static generate(e,t){if("bigint"!=typeof t)throw new Error("Expected nonce to be a bigint");return new a((0,n.generateAddress)(e.buf,(0,s.bigIntToBuffer)(t)))}static generate2(e,r,s){if(!t.isBuffer(r))throw new Error("Expected salt to be a Buffer");if(!t.isBuffer(s))throw new Error("Expected initCode to be a Buffer");return new a((0,n.generateAddress2)(e.buf,r,s))}equals(e){return this.buf.equals(e.buf)}isZero(){return this.equals(a.zero())}isPrecompileOrSystemAddress(){const e=(0,s.bufferToBigInt)(this.buf),t=BigInt(0),r=BigInt("0xffff");return e>=t&&e<=r}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return t.from(this.buf)}}r.Address=a}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/address.js"}],[2181,{events:4399},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.AsyncEventEmitter=void 0;const n=e("events");class s extends n.EventEmitter{emit(e,...t){let[r,n]=t;const s=this;let a=s._events[e]??[];return n===undefined&&"function"==typeof r&&(n=r,r=undefined),"newListener"!==e&&"removeListener"!==e||(r={event:r,fn:n},n=undefined),a=Array.isArray(a)?a:[a],async function(e,t,r){let n;for await(const s of t)try{s.length<2?s.call(e,r):await new Promise(((t,n)=>{s.call(e,r,(e=>{e?n(e):t()}))}))}catch(e){n=e}if(n)throw n}(s,a.slice(),r).then(n).catch(n),s.listenerCount(e)>0}once(e,t){const r=this;let n;if("function"!=typeof t)throw new TypeError("listener must be a function");return n=t.length>=2?function(s,a){r.removeListener(e,n),t(s,a)}:function(s){r.removeListener(e,n),t(s,n)},r.on(e,n),r}first(e,t){let r=this._events[e]??[];if("function"!=typeof t)throw new TypeError("listener must be a function");return Array.isArray(r)||(this._events[e]=r=[r]),r.unshift(t),this}before(e,t,r){return this.beforeOrAfter(e,t,r)}after(e,t,r){return this.beforeOrAfter(e,t,r,"after")}beforeOrAfter(e,t,r,n){let s,a,i=this._events[e]??[];const o="after"===n?1:0;if("function"!=typeof r)throw new TypeError("listener must be a function");if("function"!=typeof t)throw new TypeError("target must be a function");for(Array.isArray(i)||(this._events[e]=i=[i]),a=i.length,s=i.length;s--;)if(i[s]===t){a=s+o;break}return i.splice(a,0,r),this}on(e,t){return super.on(e,t)}addListener(e,t){return super.addListener(e,t)}prependListener(e,t){return super.prependListener(e,t)}prependOnceListener(e,t){return super.prependOnceListener(e,t)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,t){return super.removeListener(e,t)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}r.AsyncEventEmitter=s}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/asyncEventEmitter.js"}],[2182,{"./helpers":2185,"./internal":2187,buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.intToUnpaddedBuffer=r.bigIntToUnpaddedBuffer=r.bigIntToHex=r.bufArrToArr=r.arrToBufArr=r.validateNoLeadingZeroes=r.baToJSON=r.toUtf8=r.short=r.addHexPrefix=r.toUnsigned=r.fromSigned=r.bufferToInt=r.bigIntToBuffer=r.bufferToBigInt=r.bufferToHex=r.toBuffer=r.unpadHexString=r.unpadArray=r.unpadBuffer=r.setLengthRight=r.setLengthLeft=r.zeros=r.intToBuffer=r.intToHex=void 0;const n=e("./helpers"),s=e("./internal");r.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`};r.intToBuffer=function(e){const n=(0,r.intToHex)(e);return t.from((0,s.padToEven)(n.slice(2)),"hex")};r.zeros=function(e){return t.allocUnsafe(e).fill(0)};const a=function(e,t,n){const s=(0,r.zeros)(t);return n?e.length<t?(e.copy(s),s):e.slice(0,t):e.length<t?(e.copy(s,t-e.length),s):e.slice(-t)};r.setLengthLeft=function(e,t){return(0,n.assertIsBuffer)(e),a(e,t,!1)};r.setLengthRight=function(e,t){return(0,n.assertIsBuffer)(e),a(e,t,!0)};const i=function(e){let t=e[0];for(;e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};r.unpadBuffer=function(e){return(0,n.assertIsBuffer)(e),i(e)};r.unpadArray=function(e){return(0,n.assertIsArray)(e),i(e)};r.unpadHexString=function(e){return(0,n.assertIsHexString)(e),e=(0,s.stripHexPrefix)(e),"0x"+i(e)};r.toBuffer=function(e){if(null===e||e===undefined)return t.allocUnsafe(0);if(t.isBuffer(e))return t.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return t.from(e);if("string"==typeof e){if(!(0,s.isHexString)(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return t.from((0,s.padToEven)((0,s.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,r.intToBuffer)(e);if("bigint"==typeof e){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${e}`);let r=e.toString(16);return r.length%2&&(r="0"+r),t.from(r,"hex")}if(e.toArray)return t.from(e.toArray());if(e.toBuffer)return t.from(e.toBuffer());throw new Error("invalid type")};function o(e){const t=(0,r.bufferToHex)(e);return"0x"===t?BigInt(0):BigInt(t)}function c(e){return(0,r.toBuffer)("0x"+e.toString(16))}r.bufferToHex=function(e){return"0x"+(e=(0,r.toBuffer)(e)).toString("hex")},r.bufferToBigInt=o,r.bigIntToBuffer=c;r.bufferToInt=function(e){const t=Number(o(e));if(!Number.isSafeInteger(t))throw new Error("Number exceeds 53 bits");return t};r.fromSigned=function(e){return BigInt.asIntN(256,o(e))};r.toUnsigned=function(e){return c(BigInt.asUintN(256,e))};r.addHexPrefix=function(e){return"string"!=typeof e||(0,s.isHexPrefixed)(e)?e:"0x"+e},r.short=function(e,r=50){const n=t.isBuffer(e)?e.toString("hex"):e;return n.length<=r?n:n.slice(0,r)+"…"};r.toUtf8=function(e){if((e=(0,s.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return t.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};r.baToJSON=function(e){if(t.isBuffer(e))return`0x${e.toString("hex")}`;if(e instanceof Array){const t=[];for(let n=0;n<e.length;n++)t.push((0,r.baToJSON)(e[n]));return t}};r.validateNoLeadingZeroes=function(e){for(const[t,r]of Object.entries(e))if(r!==undefined&&r.length>0&&0===r[0])throw new Error(`${t} cannot have leading zeroes, received: ${r.toString("hex")}`)},r.arrToBufArr=function e(r){return Array.isArray(r)?r.map((t=>e(t))):t.from(r)},r.bufArrToArr=function e(t){return Array.isArray(t)?t.map((t=>e(t))):Uint8Array.from(t??[])};r.bigIntToHex=e=>"0x"+e.toString(16),r.bigIntToUnpaddedBuffer=function(e){return(0,r.unpadBuffer)(c(e))},r.intToUnpaddedBuffer=function(e){return(0,r.unpadBuffer)((0,r.intToBuffer)(e))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/bytes.js"}],[2183,{buffer:4074,"ethereum-cryptography/secp256k1":4317},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MAX_WITHDRAWALS_PER_PAYLOAD=r.RLP_EMPTY_STRING=r.KECCAK256_RLP=r.KECCAK256_RLP_S=r.KECCAK256_RLP_ARRAY=r.KECCAK256_RLP_ARRAY_S=r.KECCAK256_NULL=r.KECCAK256_NULL_S=r.TWO_POW256=r.SECP256K1_ORDER_DIV_2=r.SECP256K1_ORDER=r.MAX_INTEGER_BIGINT=r.MAX_INTEGER=r.MAX_UINT64=void 0;const n=e("buffer"),s=e("ethereum-cryptography/secp256k1");r.MAX_UINT64=BigInt("0xffffffffffffffff"),r.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),r.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),r.SECP256K1_ORDER=s.secp256k1.CURVE.n,r.SECP256K1_ORDER_DIV_2=s.secp256k1.CURVE.n/BigInt(2),r.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),r.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",r.KECCAK256_NULL=n.Buffer.from(r.KECCAK256_NULL_S,"hex"),r.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",r.KECCAK256_RLP_ARRAY=n.Buffer.from(r.KECCAK256_RLP_ARRAY_S,"hex"),r.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",r.KECCAK256_RLP=n.Buffer.from(r.KECCAK256_RLP_S,"hex"),r.RLP_EMPTY_STRING=n.Buffer.from([128]),r.MAX_WITHDRAWALS_PER_PAYLOAD=16}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/constants.js"}],[2184,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.compactBytesToNibbles=r.bytesToNibbles=r.nibblesToCompactBytes=r.nibblesToBytes=r.hasTerminator=void 0;r.hasTerminator=e=>e.length>0&&16===e[e.length-1];r.nibblesToBytes=(e,t)=>{for(let r=0,n=0;n<e.length;r+=1,n+=2)t[r]=e[n]<<4|e[n+1]};r.nibblesToCompactBytes=e=>{let t=0;(0,r.hasTerminator)(e)&&(t=1,e=e.subarray(0,e.length-1));const n=new Uint8Array(e.length/2+1);return n[0]=t<<5,1&~e.length||(n[0]|=16,n[0]|=e[0],e=e.subarray(1)),(0,r.nibblesToBytes)(e,n.subarray(1)),n};r.bytesToNibbles=e=>{const t=2*e.length+1,r=new Uint8Array(t);for(let t=0;t<e.length;t++){const n=e[t];r[2*t]=n/16,r[2*t+1]=n%16}return r[t-1]=16,r};r.compactBytesToNibbles=e=>{if(0===e.length)return e;let t=(0,r.bytesToNibbles)(e);t[0]<2&&(t=t.subarray(0,t.length-1));const n=2-(1&t[0]);return t.subarray(n)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/encoding.js"}],[2185,{"../../../../../../is-buffer/index.js":4657,"./internal":2187},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.assertIsString=r.assertIsArray=r.assertIsBuffer=r.assertIsHexString=void 0;const n=e("./internal");r.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)}};r.assertIsBuffer=function(e){if(!t.isBuffer(e)){throw new Error(`This method only supports Buffer but input was: ${e}`)}};r.assertIsArray=function(e){if(!Array.isArray(e)){throw new Error(`This method only supports number arrays but input was: ${e}`)}};r.assertIsString=function(e){if("string"!=typeof e){throw new Error(`This method only supports strings but input was: ${e}`)}}}).call(this)}).call(this,{isBuffer:e("../../../../../../is-buffer/index.js")})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/helpers.js"}],[2186,{"./account":2179,"./address":2180,"./asyncEventEmitter":2181,"./bytes":2182,"./constants":2183,"./encoding":2184,"./internal":2187,"./lock":2188,"./provider":2189,"./signature":2190,"./types":2191,"./units":2192,"./withdrawal":2193},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.toAscii=r.stripHexPrefix=r.padToEven=r.isHexString=r.isHexPrefixed=r.getKeys=r.getBinarySize=r.fromUtf8=r.fromAscii=r.arrayContainsArray=void 0,s(e("./constants"),r),s(e("./units"),r),s(e("./account"),r),s(e("./address"),r),s(e("./withdrawal"),r),s(e("./signature"),r),s(e("./bytes"),r),s(e("./types"),r),s(e("./encoding"),r),s(e("./asyncEventEmitter"),r);var a=e("./internal");Object.defineProperty(r,"arrayContainsArray",{enumerable:!0,get:function(){return a.arrayContainsArray}}),Object.defineProperty(r,"fromAscii",{enumerable:!0,get:function(){return a.fromAscii}}),Object.defineProperty(r,"fromUtf8",{enumerable:!0,get:function(){return a.fromUtf8}}),Object.defineProperty(r,"getBinarySize",{enumerable:!0,get:function(){return a.getBinarySize}}),Object.defineProperty(r,"getKeys",{enumerable:!0,get:function(){return a.getKeys}}),Object.defineProperty(r,"isHexPrefixed",{enumerable:!0,get:function(){return a.isHexPrefixed}}),Object.defineProperty(r,"isHexString",{enumerable:!0,get:function(){return a.isHexString}}),Object.defineProperty(r,"padToEven",{enumerable:!0,get:function(){return a.padToEven}}),Object.defineProperty(r,"stripHexPrefix",{enumerable:!0,get:function(){return a.stripHexPrefix}}),Object.defineProperty(r,"toAscii",{enumerable:!0,get:function(){return a.toAscii}}),s(e("./lock"),r),s(e("./provider"),r)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/index.js"}],[2187,{buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(e){(function(){function t(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}Object.defineProperty(r,"__esModule",{value:!0}),r.isHexString=r.getKeys=r.fromAscii=r.fromUtf8=r.toAscii=r.arrayContainsArray=r.getBinarySize=r.padToEven=r.stripHexPrefix=r.isHexPrefixed=void 0,r.isHexPrefixed=t;function n(e){let t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received "+typeof t);return t.length%2&&(t=`0${t}`),t}r.stripHexPrefix=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return t(e)?e.slice(2):e},r.padToEven=n,r.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof t);return e.byteLength(t,"utf8")},r.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(!0!==Array.isArray(t))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[!0===r?"some":"every"]((t=>e.indexOf(t)>=0))},r.toAscii=function(e){let t="",r=0;const n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){const n=parseInt(e.substr(r,2),16);t+=String.fromCharCode(n)}return t},r.fromUtf8=function(t){return`0x${n(e.from(t,"utf8").toString("hex")).replace(/^0+|0+$/g,"")}`},r.fromAscii=function(e){let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r).toString(16);t+=n.length<2?`0${n}`:n}return`0x${t}`},r.getKeys=function(e,t,r){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got "+typeof e);if("string"!=typeof t)throw new Error("[getKeys] method expects input 'key' to be type 'string', got "+typeof e);const n=[];for(let s=0;s<e.length;s++){let a=e[s][t];if(!0!==r||a){if("string"!=typeof a)throw new Error("invalid abi - expected type 'string', received "+typeof a)}else a="";n.push(a)}return n},r.isHexString=function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&!(void 0!==t&&t>0&&e.length!==2+2*t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/internal.js"}],[2188,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Lock=void 0;r.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((e=>this.promiseResolverQueue.push(e)))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const e=this.promiseResolverQueue.shift();e&&e(!0)}}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/lock.js"}],[2189,{"micro-ftch":4910},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getProvider=r.fetchFromProvider=void 0;const n=e("micro-ftch");r.fetchFromProvider=async(e,t)=>(await(0,n.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;r.getProvider=e=>{if("string"==typeof e)return e;if(e?.connection?.url!==undefined)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/provider.js"}],[2190,{"./bytes":2182,"./constants":2183,"./helpers":2185,buffer:4074,"ethereum-cryptography/keccak":4300,"ethereum-cryptography/secp256k1":4317},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.hashPersonalMessage=r.isValidSignature=r.fromRpcSig=r.toCompactSig=r.toRpcSig=r.ecrecover=r.ecsign=void 0;const n=e("ethereum-cryptography/keccak"),s=e("ethereum-cryptography/secp256k1"),a=e("./bytes"),i=e("./constants"),o=e("./helpers");function c(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===undefined?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function u(e){return e===BigInt(0)||e===BigInt(1)}r.ecsign=function(e,r,n){const a=s.secp256k1.sign(e,r),i=a.toCompactRawBytes();return{r:t.from(i.slice(0,32)),s:t.from(i.slice(32,64)),v:n===undefined?BigInt(a.recovery+27):BigInt(a.recovery+35)+BigInt(n)*BigInt(2)}};r.ecrecover=function(e,r,n,i,o){const l=t.concat([(0,a.setLengthLeft)(n,32),(0,a.setLengthLeft)(i,32)],64),d=c(r,o);if(!u(d))throw new Error("Invalid signature v value");const m=s.secp256k1.Signature.fromCompact(l).addRecoveryBit(Number(d)).recoverPublicKey(e);return t.from(m.toRawBytes(!1).slice(1))};r.toRpcSig=function(e,r,n,s){if(!u(c(e,s)))throw new Error("Invalid signature v value");return(0,a.bufferToHex)(t.concat([(0,a.setLengthLeft)(r,32),(0,a.setLengthLeft)(n,32),(0,a.toBuffer)(e)]))};r.toCompactSig=function(e,r,n,s){if(!u(c(e,s)))throw new Error("Invalid signature v value");let i=n;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(i=t.from(n),i[0]|=128),(0,a.bufferToHex)(t.concat([(0,a.setLengthLeft)(r,32),(0,a.setLengthLeft)(i,32)]))};r.fromRpcSig=function(e){const t=(0,a.toBuffer)(e);let r,n,s;if(t.length>=65)r=t.slice(0,32),n=t.slice(32,64),s=(0,a.bufferToBigInt)(t.slice(64));else{if(64!==t.length)throw new Error("Invalid signature length");r=t.slice(0,32),n=t.slice(32,64),s=BigInt((0,a.bufferToInt)(t.slice(32,33))>>7),n[0]&=127}return s<27&&(s+=BigInt(27)),{v:s,r:r,s:n}};r.isValidSignature=function(e,t,r,n=!0,s){if(32!==t.length||32!==r.length)return!1;if(!u(c(e,s)))return!1;const o=(0,a.bufferToBigInt)(t),l=(0,a.bufferToBigInt)(r);return!(o===BigInt(0)||o>=i.SECP256K1_ORDER||l===BigInt(0)||l>=i.SECP256K1_ORDER)&&!(n&&l>=i.SECP256K1_ORDER_DIV_2)};r.hashPersonalMessage=function(e){(0,o.assertIsBuffer)(e);const r=t.from(`Ethereum Signed Message:\n${e.length}`,"utf-8");return t.from((0,n.keccak256)(t.concat([r,e])))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/signature.js"}],[2191,{"./bytes":2182,"./internal":2187},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.toType=r.TypeOutput=void 0;const n=e("./bytes"),s=e("./internal");var a;!function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(a=r.TypeOutput||(r.TypeOutput={})),r.toType=function(e,t){if(null===e)return null;if(e===undefined)return undefined;if("string"==typeof e&&!(0,s.isHexString)(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const r=(0,n.toBuffer)(e);switch(t){case a.Buffer:return r;case a.BigInt:return(0,n.bufferToBigInt)(r);case a.Number:{const e=(0,n.bufferToBigInt)(r);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(e)}case a.PrefixedHexString:return(0,n.bufferToHex)(r);default:throw new Error("unknown outputType")}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/types.js"}],[2192,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.GWEI_TO_WEI=void 0,r.GWEI_TO_WEI=BigInt(1e9)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/units.js"}],[2193,{"./address":2180,"./bytes":2182,"./types":2191,buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.Withdrawal=void 0;const n=e("./address"),s=e("./bytes"),a=e("./types");class i{constructor(e,t,r,n){this.index=e,this.validatorIndex=t,this.address=r,this.amount=n}static fromWithdrawalData(e){const{index:t,validatorIndex:r,address:s,amount:o}=e,c=(0,a.toType)(t,a.TypeOutput.BigInt),u=(0,a.toType)(r,a.TypeOutput.BigInt),l=new n.Address((0,a.toType)(s,a.TypeOutput.Buffer)),d=(0,a.toType)(o,a.TypeOutput.BigInt);return new i(c,u,l,d)}static fromValuesArray(e){if(4!==e.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[t,r,n,s]=e;return i.fromWithdrawalData({index:t,validatorIndex:r,address:n,amount:s})}static toBufferArray(e){const{index:r,validatorIndex:s,address:i,amount:o}=e,c=(0,a.toType)(r,a.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,a.toType)(r,a.TypeOutput.Buffer),u=(0,a.toType)(s,a.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,a.toType)(s,a.TypeOutput.Buffer);let l;l=i instanceof n.Address?i.buf:(0,a.toType)(i,a.TypeOutput.Buffer);return[c,u,l,(0,a.toType)(o,a.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,a.toType)(o,a.TypeOutput.Buffer)]}raw(){return i.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,s.bigIntToHex)(this.index),validatorIndex:(0,s.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,s.bigIntToHex)(this.amount)}}}r.Withdrawal=i}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@ethereumjs/util",file:"node_modules/@metamask/network-controller/node_modules/@ethereumjs/util/dist/withdrawal.js"}],[2194,{"./errors":2195,"./packer":2198,"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.decodeSingle=r.decode=r.encodePacked=r.encodeSingle=r.encode=void 0;const n=e("@metamask/utils"),s=e("./errors"),a=e("./packer");r.encode=(e,t,r,n)=>{try{return(0,a.pack)({types:e,values:t,packed:r,tight:n})}catch(e){if(e instanceof s.ParserError)throw new s.ParserError(`Unable to encode value: ${e.message}`,e);throw new s.ParserError(`An unexpected error occurred: ${(0,s.getErrorMessage)(e)}`,e)}};r.encodeSingle=(e,t)=>(0,r.encode)([e],[t]);r.encodePacked=(e,t,n)=>(0,r.encode)(e,t,!0,n);r.decode=(e,t)=>{const r=(0,n.createBytes)(t);try{return(0,a.unpack)(e,r)}catch(e){if(e instanceof s.ParserError)throw new s.ParserError(`Unable to decode value: ${e.message}`,e);throw new s.ParserError(`An unexpected error occurred: ${(0,s.getErrorMessage)(e)}`,e)}};r.decodeSingle=(e,t)=>{const a=(0,r.decode)([e],t);return(0,n.assert)(1===a.length,new s.ParserError("Decoded value array has unexpected length.")),a[0]}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/abi.js"}],[2195,{"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ParserError=r.getErrorStack=r.getErrorMessage=void 0;const n=e("@metamask/utils");r.getErrorMessage=e=>"string"==typeof e?e:e instanceof Error||(0,n.isObject)(e)&&(0,n.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:"Unknown error.";r.getErrorStack=e=>e instanceof Error?e.stack:undefined;class s extends Error{constructor(e,t){super(e),this.name="ParserError";const n=(0,r.getErrorStack)(t);n&&(this.stack=n)}}r.ParserError=s}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/errors.js"}],[2196,{"./abi":2194,"./errors":2195,"./types":2211},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./abi"),r),s(e("./errors"),r),s(e("./types"),r)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/index.js"}],[2197,{"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.iterate=void 0;const n=e("@metamask/utils");r.iterate=function*(e,t=32){for(let r=0;r<e.length;r+=t){const s=e=>{(0,n.assert)(e>=0,"Cannot skip a negative number of bytes."),(0,n.assert)(e%t==0,"Length must be a multiple of the size."),r+=e},a=e.subarray(r);yield{skip:s,value:a}}return{skip:()=>undefined,value:new Uint8Array}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/iterator.js"}],[2198,{"./errors":2195,"./iterator":2197,"./parsers":2205,"./utils":2213,"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.unpack=r.pack=r.isDynamicParser=r.getParser=void 0;const n=e("@metamask/utils"),s=e("./errors"),a=e("./iterator"),i=e("./parsers"),o=e("./utils");r.getParser=e=>{const t={address:i.address,array:i.array,bool:i.bool,bytes:i.bytes,fixedBytes:i.fixedBytes,function:i.fn,number:i.number,string:i.string,tuple:i.tuple},r=t[e];if(r)return r;const n=Object.values(t).find((t=>t.isType(e)));if(n)return n;throw new s.ParserError(`The type "${e}" is not supported.`)};r.isDynamicParser=(e,t)=>{const{isDynamic:r}=e;return"function"==typeof r?r(t):r};r.pack=({types:e,values:t,packed:a=!1,tight:i=!1,arrayPacked:c=!1,byteArray:u=new Uint8Array})=>{(0,n.assert)(e.length===t.length,new s.ParserError(`The number of types (${e.length}) does not match the number of values (${t.length}).`));const{staticBuffer:l,dynamicBuffer:d,pointers:m}=e.reduce((({staticBuffer:e,dynamicBuffer:s,pointers:o},u,l)=>{const d=(0,r.getParser)(u),m=t[l];if(a||c||!(0,r.isDynamicParser)(d,u))return{staticBuffer:d.encode({buffer:e,value:m,type:u,packed:a,tight:i}),dynamicBuffer:s,pointers:o};return{staticBuffer:(0,n.concatBytes)([e,new Uint8Array(32)]),dynamicBuffer:d.encode({buffer:s,value:m,type:u,packed:a,tight:i}),pointers:[...o,{position:e.length,pointer:s.length}]}}),{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,n.assert)(!a&&!c||0===d.length,new s.ParserError("Invalid pack state."));const p=l.length,h=m.reduce(((e,{pointer:t,position:r})=>{const s=(0,o.padStart)((0,n.numberToBytes)(p+t));return(0,o.set)(e,s,r)}),l);return(0,n.concatBytes)([u,h,d])};r.unpack=(e,t)=>{const i=(0,a.iterate)(t);return e.map((e=>{const{value:{value:a,skip:o},done:c}=i.next();(0,n.assert)(!c,new s.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${e}".`));const u=(0,r.getParser)(e);if((0,r.isDynamicParser)(u,e)){const r=(0,n.bytesToNumber)(a.subarray(0,32)),s=t.subarray(r);return u.decode({type:e,value:s,skip:o})}return u.decode({type:e,value:a,skip:o})}))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/packer.js"}],[2199,{"../errors":2195,"../utils":2213,"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.address=r.getAddress=void 0;const n=e("@metamask/utils"),s=e("../errors"),a=e("../utils");r.getAddress=e=>{const t=(0,n.createBytes)(e);return(0,n.assert)(t.length<=20,new s.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${t.length} bytes.`)),(0,a.padStart)(t,20)},r.address={isDynamic:!1,isType:e=>"address"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:s}){const i=(0,r.getAddress)(t);if(s)return(0,n.concatBytes)([e,i]);const o=(0,a.padStart)(i);return(0,n.concatBytes)([e,o])},decode:({value:e})=>(0,n.add0x)((0,n.bytesToHex)(e.slice(12,32)))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/parsers/address.js"}],[2200,{"../errors":2195,"../packer":2198,"../utils":2213,"./fixed-bytes":2203,"./tuple":2209,"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.array=r.getTupleType=r.getArrayType=r.isArrayType=void 0;const n=e("@metamask/utils"),s=e("../errors"),a=e("../packer"),i=e("../utils"),o=e("./fixed-bytes"),c=e("./tuple"),u=/^(?<type>.*)\[(?<length>\d*?)\]$/u;r.isArrayType=e=>u.test(e);r.getArrayType=e=>{const t=e.match(u);return(0,n.assert)(t?.groups?.type,new s.ParserError(`Invalid array type. Expected an array type, but received "${e}".`)),[t.groups.type,t.groups.length?parseInt(t.groups.length,10):undefined]};r.getTupleType=(e,t)=>`(${new Array(t).fill(e).join(",")})`,r.array={isDynamic(e){const[t,n]=(0,r.getArrayType)(e);return n===undefined||(0,a.isDynamicParser)((0,a.getParser)(t),t)},isType:e=>(0,r.isArrayType)(e),getByteLength(e){(0,n.assert)((0,r.isArrayType)(e),new s.ParserError(`Expected an array type, but received "${e}".`));const[t,i]=(0,r.getArrayType)(e);return(0,a.isDynamicParser)(this,e)||i===undefined?32:c.tuple.getByteLength((0,r.getTupleType)(t,i))},encode({type:e,buffer:t,value:u,packed:l,tight:d}){const[m,p]=(0,r.getArrayType)(e);if((0,n.assert)(!l||!(0,r.isArrayType)(m),new s.ParserError("Cannot pack nested arrays.")),l&&(0,a.isDynamicParser)((0,a.getParser)(m),m))return(0,a.pack)({types:new Array(u.length).fill(m),values:u,byteArray:t,packed:l,arrayPacked:!0,tight:d});if(p)return(0,n.assert)(p===u.length,new s.ParserError(`Array length does not match type length. Expected a length of ${p}, but received ${u.length}.`)),c.tuple.encode({type:(0,r.getTupleType)(m,p),buffer:t,value:u,packed:o.fixedBytes.isType(m)&&d,tight:d});if(l)return(0,a.pack)({types:new Array(u.length).fill(m),values:u,byteArray:t,packed:o.fixedBytes.isType(m)&&d,arrayPacked:!0,tight:d});const h=(0,i.padStart)((0,n.numberToBytes)(u.length));return(0,a.pack)({types:new Array(u.length).fill(m),values:u,byteArray:(0,n.concatBytes)([t,h]),packed:l,tight:d})},decode({type:e,value:t,...i}){const[o,u]=(0,r.getArrayType)(e);if(u){const e=c.tuple.decode({type:(0,r.getTupleType)(o,u),value:t,...i});return(0,n.assert)(e.length===u,new s.ParserError(`Array length does not match type length. Expected a length of ${u}, but received ${e.length}.`)),e}const l=(0,n.bytesToNumber)(t.subarray(0,32));return(0,a.unpack)(new Array(l).fill(o),t.subarray(32))}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/parsers/array.js"}],[2201,{"../errors":2195,"./number":2206,"@metamask/superstruct":2872,"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.bool=r.getBooleanValue=void 0;const n=e("@metamask/superstruct"),s=e("@metamask/utils"),a=e("../errors"),i=e("./number"),o=(0,n.coerce)((0,n.boolean)(),(0,n.union)([(0,n.literal)("true"),(0,n.literal)("false")]),(e=>"true"===e));r.getBooleanValue=e=>{try{return(0,n.create)(e,o)?BigInt(1):BigInt(0)}catch{throw new a.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${e}".`)}},r.bool={isDynamic:!1,isType:e=>"bool"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:n,tight:a}){const o=(0,r.getBooleanValue)(t);return n?(0,s.concatBytes)([e,(0,s.bigIntToBytes)(o)]):i.number.encode({type:"uint256",buffer:e,value:o,packed:n,tight:a})},decode:e=>i.number.decode({...e,type:"uint256"})===BigInt(1)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/parsers/bool.js"}],[2202,{"../utils":2213,"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.bytes=void 0;const n=e("@metamask/utils"),s=e("../utils");r.bytes={isDynamic:!0,isType:e=>"bytes"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:r}){const a=(0,n.createBytes)(t);if(r)return(0,n.concatBytes)([e,a]);const i=32*Math.ceil(a.byteLength/32);return(0,n.concatBytes)([e,(0,s.padStart)((0,n.numberToBytes)(a.byteLength)),(0,s.padEnd)(a,i)])},decode({value:e}){const t=e.subarray(0,32),r=(0,n.bytesToNumber)(t);return e.slice(32,32+r)}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/parsers/bytes.js"}],[2203,{"../errors":2195,"../utils":2213,"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.fixedBytes=r.getByteLength=void 0;const n=e("@metamask/utils"),s=e("../errors"),a=e("../utils"),i=/^bytes([0-9]{1,2})$/u;r.getByteLength=e=>{const t=e.match(i)?.[1];(0,n.assert)(t,`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`);const r=Number(t);return(0,n.assert)(r>0&&r<=32,new s.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`)),r},r.fixedBytes={isDynamic:!1,isType:e=>i.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:i,packed:o}){const c=(0,r.getByteLength)(e),u=(0,n.createBytes)(i);return(0,n.assert)(u.length<=c,new s.ParserError(`Expected a value of length ${c}, but received a value of length ${u.length}.`)),o?(0,n.concatBytes)([t,(0,a.padEnd)(u,c)]):(0,n.concatBytes)([t,(0,a.padEnd)(u)])},decode({type:e,value:t}){const n=(0,r.getByteLength)(e);return t.slice(0,n)}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/parsers/fixed-bytes.js"}],[2204,{"../errors":2195,"./fixed-bytes":2203,"@metamask/superstruct":2872,"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.fn=r.getFunction=void 0;const n=e("@metamask/superstruct"),s=e("@metamask/utils"),a=e("../errors"),i=e("./fixed-bytes"),o=(0,n.coerce)((0,n.object)({address:s.StrictHexStruct,selector:s.StrictHexStruct}),(0,n.union)([s.StrictHexStruct,(0,n.instance)(Uint8Array)]),(e=>{const t=(0,s.createBytes)(e);return(0,s.assert)(24===t.length,new a.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${t.length} bytes.`)),{address:(0,s.bytesToHex)(t.subarray(0,20)),selector:(0,s.bytesToHex)(t.subarray(20,24))}}));r.getFunction=e=>{const t=(0,n.create)(e,o);return(0,s.concatBytes)([(0,s.hexToBytes)(t.address),(0,s.hexToBytes)(t.selector)])},r.fn={isDynamic:!1,isType:e=>"function"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:n,tight:s}){const a=(0,r.getFunction)(t);return i.fixedBytes.encode({type:"bytes24",buffer:e,value:a,packed:n,tight:s})},decode:({value:e})=>({address:(0,s.bytesToHex)(e.slice(0,20)),selector:(0,s.bytesToHex)(e.slice(20,24))})}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/parsers/function.js"}],[2205,{"./address":2199,"./array":2200,"./bool":2201,"./bytes":2202,"./fixed-bytes":2203,"./function":2204,"./number":2206,"./parser":2207,"./string":2208,"./tuple":2209},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./address"),r),s(e("./array"),r),s(e("./bool"),r),s(e("./bytes"),r),s(e("./fixed-bytes"),r),s(e("./function"),r),s(e("./number"),r),s(e("./parser"),r),s(e("./string"),r),s(e("./tuple"),r)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/parsers/index.js"}],[2206,{"../errors":2195,"../utils":2213,"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.number=r.getBigInt=r.assertNumberLength=r.getLength=r.isSigned=void 0;const n=e("@metamask/utils"),s=e("../errors"),a=e("../utils"),i=/^u?int(?<length>[0-9]*)?$/u;r.isSigned=e=>!e.startsWith("u");r.getLength=e=>{if("int"===e||"uint"===e)return 256;const t=e.match(i);(0,n.assert)(t?.groups?.length,new s.ParserError(`Invalid number type. Expected a number type, but received "${e}".`));const r=parseInt(t.groups.length,10);return(0,n.assert)(r>=8&&r<=256,new s.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${e}".`)),(0,n.assert)(r%8==0,new s.ParserError(`Invalid number length. Expected a multiple of 8, but received "${e}".`)),r};r.assertNumberLength=(e,t)=>{const a=(0,r.getLength)(t),i=BigInt(2)**BigInt(a-((0,r.isSigned)(t)?1:0))-BigInt(1);(0,r.isSigned)(t)?(0,n.assert)(e>=-(i+BigInt(1))&&e<=i,new s.ParserError(`Number "${e}" is out of range for type "${t}".`)):(0,n.assert)(e<=i,new s.ParserError(`Number "${e}" is out of range for type "${t}".`))};r.getBigInt=e=>{try{return(0,n.createBigInt)(e)}catch{throw new s.ParserError(`Invalid number. Expected a valid number value, but received "${e}".`)}},r.number={isDynamic:!1,isType:e=>i.test(e),getByteLength:()=>32,encode({type:e,buffer:t,value:s,packed:i}){const o=(0,r.getBigInt)(s);if((0,r.assertNumberLength)(o,e),(0,r.isSigned)(e)){if(i){const s=(0,r.getLength)(e)/8;return(0,n.concatBytes)([t,(0,n.signedBigIntToBytes)(o,s)])}return(0,n.concatBytes)([t,(0,a.padStart)((0,n.signedBigIntToBytes)(o,32))])}if(i){const s=(0,r.getLength)(e)/8;return(0,n.concatBytes)([t,(0,a.padStart)((0,n.bigIntToBytes)(o),s)])}return(0,n.concatBytes)([t,(0,a.padStart)((0,n.bigIntToBytes)(o))])},decode({type:e,value:t}){const s=t.subarray(0,32);if((0,r.isSigned)(e)){const t=(0,n.bytesToSignedBigInt)(s);return(0,r.assertNumberLength)(t,e),t}const a=(0,n.bytesToBigInt)(s);return(0,r.assertNumberLength)(a,e),a}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/parsers/number.js"}],[2207,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/parsers/parser.js"}],[2208,{"./bytes":2202,"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.string=void 0;const n=e("@metamask/utils"),s=e("./bytes");r.string={isDynamic:!0,isType:e=>"string"===e,getByteLength:()=>32,encode:({buffer:e,value:t,packed:r,tight:a})=>s.bytes.encode({type:"bytes",buffer:e,value:(0,n.stringToBytes)(t),packed:r,tight:a}),decode:e=>(0,n.bytesToString)(s.bytes.decode(e))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/parsers/string.js"}],[2209,{"../errors":2195,"../packer":2198,"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.tuple=r.getTupleElements=void 0;const n=e("@metamask/utils"),s=e("../errors"),a=e("../packer"),i=/^\((.+)\)$/u;r.getTupleElements=e=>{(0,n.assert)(e.startsWith("(")&&e.endsWith(")"),new s.ParserError(`Invalid tuple type. Expected tuple type, but received "${e}".`));const t=[];let r="",a=0;for(let n=1;n<e.length-1;n++){const s=e[n];","===s&&0===a?(t.push(r.trim()),r=""):(r+=s,"("===s?a+=1:")"===s&&(a-=1))}return r.trim()&&t.push(r.trim()),t},r.tuple={isDynamic:e=>(0,r.getTupleElements)(e).some((e=>{const t=(0,a.getParser)(e);return(0,a.isDynamicParser)(t,e)})),isType:e=>(e=>i.test(e))(e),getByteLength(e){if((0,a.isDynamicParser)(this,e))return 32;return(0,r.getTupleElements)(e).reduce(((e,t)=>e+(0,a.getParser)(t).getByteLength(t)),0)},encode({type:e,buffer:t,value:n,packed:s,tight:i}){const o=(0,r.getTupleElements)(e);return(0,a.pack)({types:o,values:n,byteArray:t,packed:s,tight:i})},decode({type:e,value:t,skip:n}){const s=(0,r.getTupleElements)(e);return n(this.getByteLength(e)-32),(0,a.unpack)(s,t)}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/parsers/tuple.js"}],[2210,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/types/abi.js"}],[2211,{"./abi":2210},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./abi"),r)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/types/index.js"}],[2212,{"@metamask/utils":2224},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.padEnd=r.padStart=r.set=void 0;const n=e("@metamask/utils");r.set=(e,t,r)=>(0,n.concatBytes)([e.subarray(0,r),t,e.subarray(r+t.length)]);r.padStart=(e,t=32)=>{const r=new Uint8Array(Math.max(t-e.length,0)).fill(0);return(0,n.concatBytes)([r,e])};r.padEnd=(e,t=32)=>{const r=new Uint8Array(Math.max(t-e.length,0)).fill(0);return(0,n.concatBytes)([e,r])}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/utils/buffer.js"}],[2213,{"./buffer":2212},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./buffer"),r)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/dist/utils/index.js"}],[2214,{"./errors.cjs":2222,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.assertExhaustive=r.assertStruct=r.assert=r.AssertionError=void 0;const n=e("@metamask/superstruct"),s=e("./errors.cjs");function a(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class i extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}r.AssertionError=i,r.assert=function(e,t="Assertion failed.",r=i){if(!e){if(t instanceof Error)throw t;throw a(r,t)}},r.assertStruct=function(e,t,r="Assertion failed",o=i){try{(0,n.assert)(e,t)}catch(e){throw a(o,`${r}: ${function(e){return(0,s.getErrorMessage)(e).replace(/\.$/u,"")}(e)}.`)}},r.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/assert.cjs"}],[2215,{"./assert.cjs":2214,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.base64=void 0;const n=e("@metamask/superstruct"),s=e("./assert.cjs");r.base64=(e,t={})=>{const r=t.paddingRequired??!1,a=t.characterSet??"base64";let i,o;return"base64"===a?i=String.raw`[A-Za-z0-9+\/]`:((0,s.assert)("base64url"===a),i=String.raw`[-_A-Za-z0-9]`),o=r?new RegExp(`^(?:${i}{4})*(?:${i}{3}=|${i}{2}==)?$`,"u"):new RegExp(`^(?:${i}{4})*(?:${i}{2,3}|${i}{3}=|${i}{2}==)?$`,"u"),(0,n.pattern)(e,o)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/base64.cjs"}],[2216,{"./assert.cjs":2214,"./hex.cjs":2223,"@scure/base":3027,buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.createDataView=r.concatBytes=r.valueToBytes=r.base64ToBytes=r.stringToBytes=r.numberToBytes=r.signedBigIntToBytes=r.bigIntToBytes=r.hexToBytes=r.bytesToBase64=r.bytesToString=r.bytesToNumber=r.bytesToSignedBigInt=r.bytesToBigInt=r.bytesToHex=r.assertIsBytes=r.isBytes=void 0;const n=e("@scure/base"),s=e("./assert.cjs"),a=e("./hex.cjs"),i=48,o=58,c=87;const u=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function l(e){return e instanceof Uint8Array}function d(e){(0,s.assert)(l(e),"Value must be a Uint8Array.")}function m(e){if(d(e),0===e.length)return"0x";const t=u(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,a.add0x)(r.join(""))}function p(e){d(e);const t=m(e);return BigInt(t)}function h(e){if("0x"===e?.toLowerCase?.())return new Uint8Array;(0,a.assertIsHexString)(e);const t=(0,a.remove0x)(e).toLowerCase(),r=t.length%2==0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=r.charCodeAt(2*e),s=r.charCodeAt(2*e+1),a=t-(t<o?i:c),u=s-(s<o?i:c);n[e]=16*a+u}return n}function f(e){(0,s.assert)("bigint"==typeof e,"Value must be a bigint."),(0,s.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return h(e.toString(16))}function g(e){(0,s.assert)("number"==typeof e,"Value must be a number."),(0,s.assert)(e>=0,"Value must be a non-negative number."),(0,s.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return h(e.toString(16))}function y(e){return(0,s.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function b(e){if("bigint"==typeof e)return f(e);if("number"==typeof e)return g(e);if("string"==typeof e)return e.startsWith("0x")?h(e):y(e);if(l(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}r.isBytes=l,r.assertIsBytes=d,r.bytesToHex=m,r.bytesToBigInt=p,r.bytesToSignedBigInt=function(e){d(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},r.bytesToNumber=function(e){d(e);const t=p(e);return(0,s.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},r.bytesToString=function(e){return d(e),(new TextDecoder).decode(e)},r.bytesToBase64=function(e){return d(e),n.base64.encode(e)},r.hexToBytes=h,r.bigIntToBytes=f,r.signedBigIntToBytes=function(e,t){(0,s.assert)("bigint"==typeof e,"Value must be a bigint."),(0,s.assert)("number"==typeof t,"Byte length must be a number."),(0,s.assert)(t>0,"Byte length must be greater than 0."),(0,s.assert)(function(e,t){(0,s.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let e=0;e<n.length;e++)n[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},r.numberToBytes=g,r.stringToBytes=y,r.base64ToBytes=function(e){return(0,s.assert)("string"==typeof e,"Value must be a string."),n.base64.decode(e)},r.valueToBytes=b,r.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const s=b(e[n]);t[n]=s,r+=s.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},r.createDataView=function(e){if(void 0!==t&&e instanceof t){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/bytes.cjs"}],[2217,{"./superstruct.cjs":2232,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.toCaipAssetId=r.toCaipAssetType=r.toCaipAccountId=r.toCaipChainId=r.parseCaipAssetId=r.parseCaipAssetType=r.parseCaipAccountId=r.parseCaipChainId=r.isCaipAssetId=r.isCaipAssetType=r.isCaipTokenId=r.isCaipAssetReference=r.isCaipAssetNamespace=r.isCaipAccountAddress=r.isCaipAccountId=r.isCaipReference=r.isCaipNamespace=r.isCaipChainId=r.KnownCaipNamespace=r.CaipAssetTypeOrIdStruct=r.CaipAssetIdStruct=r.CaipAssetTypeStruct=r.CaipTokenIdStruct=r.CaipAssetReferenceStruct=r.CaipAssetNamespaceStruct=r.CaipAccountAddressStruct=r.CaipAccountIdStruct=r.CaipReferenceStruct=r.CaipNamespaceStruct=r.CaipChainIdStruct=r.CAIP_ASSET_ID_REGEX=r.CAIP_ASSET_TYPE_REGEX=r.CAIP_TOKEN_ID_REGEX=r.CAIP_ASSET_REFERENCE_REGEX=r.CAIP_ASSET_NAMESPACE_REGEX=r.CAIP_ACCOUNT_ADDRESS_REGEX=r.CAIP_ACCOUNT_ID_REGEX=r.CAIP_REFERENCE_REGEX=r.CAIP_NAMESPACE_REGEX=r.CAIP_CHAIN_ID_REGEX=void 0;const n=e("@metamask/superstruct"),s=e("./superstruct.cjs");r.CAIP_CHAIN_ID_REGEX=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,r.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,r.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,r.CAIP_ACCOUNT_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,r.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,r.CAIP_ASSET_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,r.CAIP_ASSET_REFERENCE_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,r.CAIP_TOKEN_ID_REGEX=/^[-.%a-zA-Z0-9]{1,78}$/u,r.CAIP_ASSET_TYPE_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,r.CAIP_ASSET_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u;function a(e){return(0,n.is)(e,r.CaipNamespaceStruct)}function i(e){return(0,n.is)(e,r.CaipReferenceStruct)}function o(e){return(0,n.is)(e,r.CaipAccountAddressStruct)}function c(e){return(0,n.is)(e,r.CaipAssetNamespaceStruct)}function u(e){return(0,n.is)(e,r.CaipAssetReferenceStruct)}function l(e){return(0,n.is)(e,r.CaipTokenIdStruct)}r.CaipChainIdStruct=(0,s.definePattern)("CaipChainId",r.CAIP_CHAIN_ID_REGEX),r.CaipNamespaceStruct=(0,s.definePattern)("CaipNamespace",r.CAIP_NAMESPACE_REGEX),r.CaipReferenceStruct=(0,s.definePattern)("CaipReference",r.CAIP_REFERENCE_REGEX),r.CaipAccountIdStruct=(0,s.definePattern)("CaipAccountId",r.CAIP_ACCOUNT_ID_REGEX),r.CaipAccountAddressStruct=(0,s.definePattern)("CaipAccountAddress",r.CAIP_ACCOUNT_ADDRESS_REGEX),r.CaipAssetNamespaceStruct=(0,s.definePattern)("CaipAssetNamespace",r.CAIP_ASSET_NAMESPACE_REGEX),r.CaipAssetReferenceStruct=(0,s.definePattern)("CaipAssetReference",r.CAIP_ASSET_REFERENCE_REGEX),r.CaipTokenIdStruct=(0,s.definePattern)("CaipTokenId",r.CAIP_TOKEN_ID_REGEX),r.CaipAssetTypeStruct=(0,s.definePattern)("CaipAssetType",r.CAIP_ASSET_TYPE_REGEX),r.CaipAssetIdStruct=(0,s.definePattern)("CaipAssetId",r.CAIP_ASSET_ID_REGEX),r.CaipAssetTypeOrIdStruct=(0,s.definePattern)("CaipAssetTypeOrId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u),function(e){e.Bip122="bip122",e.Solana="solana",e.Eip155="eip155",e.Wallet="wallet"}(r.KnownCaipNamespace||(r.KnownCaipNamespace={})),r.isCaipChainId=function(e){return(0,n.is)(e,r.CaipChainIdStruct)},r.isCaipNamespace=a,r.isCaipReference=i,r.isCaipAccountId=function(e){return(0,n.is)(e,r.CaipAccountIdStruct)},r.isCaipAccountAddress=o,r.isCaipAssetNamespace=c,r.isCaipAssetReference=u,r.isCaipTokenId=l,r.isCaipAssetType=function(e){return(0,n.is)(e,r.CaipAssetTypeStruct)},r.isCaipAssetId=function(e){return(0,n.is)(e,r.CaipAssetIdStruct)},r.parseCaipChainId=function(e){const t=r.CAIP_CHAIN_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}},r.parseCaipAccountId=function(e){const t=r.CAIP_ACCOUNT_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.parseCaipAssetType=function(e){const t=r.CAIP_ASSET_TYPE_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP asset type.");return{assetNamespace:t.groups.assetNamespace,assetReference:t.groups.assetReference,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.parseCaipAssetId=function(e){const t=r.CAIP_ASSET_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP asset ID.");return{assetNamespace:t.groups.assetNamespace,assetReference:t.groups.assetReference,tokenId:t.groups.tokenId,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.toCaipChainId=function(e,t){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);return`${e}:${t}`},r.toCaipAccountId=function(e,t,n){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);if(!o(n))throw new Error(`Invalid "accountAddress", must match: ${r.CAIP_ACCOUNT_ADDRESS_REGEX.toString()}`);return`${e}:${t}:${n}`},r.toCaipAssetType=function(e,t,n,s){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);if(!c(n))throw new Error(`Invalid "assetNamespace", must match: ${r.CAIP_ASSET_NAMESPACE_REGEX.toString()}`);if(!u(s))throw new Error(`Invalid "assetReference", must match: ${r.CAIP_ASSET_REFERENCE_REGEX.toString()}`);return`${e}:${t}/${n}:${s}`},r.toCaipAssetId=function(e,t,n,s,o){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);if(!c(n))throw new Error(`Invalid "assetNamespace", must match: ${r.CAIP_ASSET_NAMESPACE_REGEX.toString()}`);if(!u(s))throw new Error(`Invalid "assetReference", must match: ${r.CAIP_ASSET_REFERENCE_REGEX.toString()}`);if(!l(o))throw new Error(`Invalid "tokenId", must match: ${r.CAIP_TOKEN_ID_REGEX.toString()}`);return`${e}:${t}/${n}:${s}/${o}`}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/caip-types.cjs"}],[2218,{"./base64.cjs":2215,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ChecksumStruct=void 0;const n=e("@metamask/superstruct"),s=e("./base64.cjs");r.ChecksumStruct=(0,n.size)((0,s.base64)((0,n.string)(),{paddingRequired:!0}),44,44)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/checksum.cjs"}],[2219,{"./assert.cjs":2214,"./bytes.cjs":2216,"./hex.cjs":2223,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createHex=r.createBytes=r.createBigInt=r.createNumber=void 0;const n=e("@metamask/superstruct"),s=e("./assert.cjs"),a=e("./bytes.cjs"),i=e("./hex.cjs"),o=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),i.StrictHexStruct]),c=(0,n.coerce)((0,n.number)(),o,Number),u=(0,n.coerce)((0,n.bigint)(),o,BigInt),l=((0,n.union)([i.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([i.StrictHexStruct]),a.hexToBytes)),d=(0,n.coerce)(i.StrictHexStruct,(0,n.instance)(Uint8Array),a.bytesToHex);r.createNumber=function(e){try{const t=(0,n.create)(e,c);return(0,s.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},r.createBigInt=function(e){try{return(0,n.create)(e,u)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},r.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,n.create)(e,l)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},r.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,n.create)(e,d)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/coercers.cjs"}],[2220,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r};Object.defineProperty(r,"__esModule",{value:!0}),r.FrozenSet=r.FrozenMap=void 0;class o{get size(){return a(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return a(this,n,"f")[Symbol.iterator]()}constructor(e){n.set(this,void 0),i(this,n,new Map(e),"f"),Object.freeze(this)}entries(){return a(this,n,"f").entries()}forEach(e,t){return a(this,n,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}get(e){return a(this,n,"f").get(e)}has(e){return a(this,n,"f").has(e)}keys(){return a(this,n,"f").keys()}values(){return a(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}r.FrozenMap=o;class c{get size(){return a(this,s,"f").size}[(s=new WeakMap,Symbol.iterator)](){return a(this,s,"f")[Symbol.iterator]()}constructor(e){s.set(this,void 0),i(this,s,new Set(e),"f"),Object.freeze(this)}entries(){return a(this,s,"f").entries()}forEach(e,t){return a(this,s,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}has(e){return a(this,s,"f").has(e)}keys(){return a(this,s,"f").keys()}values(){return a(this,s,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}r.FrozenSet=c,Object.freeze(o),Object.freeze(o.prototype),Object.freeze(c),Object.freeze(c.prototype)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/collections.cjs"}],[2221,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/encryption-types.cjs"}],[2222,{"./misc.cjs":2228,"pony-cause":5003},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.wrapError=r.getErrorMessage=r.isErrorWithStack=r.isErrorWithMessage=r.isErrorWithCode=void 0;const n=e("pony-cause"),s=e("./misc.cjs");function a(e){return"object"==typeof e&&null!==e&&"code"in e}function i(e){return"object"==typeof e&&null!==e&&"message"in e}r.isErrorWithCode=a,r.isErrorWithMessage=i,r.isErrorWithStack=function(e){return"object"==typeof e&&null!==e&&"stack"in e},r.getErrorMessage=function(e){return i(e)&&"string"==typeof e.message?e.message:(0,s.isNullOrUndefined)(e)?"":String(e)},r.wrapError=function(e,t){if((r=e)instanceof Error||(0,s.isObject)(r)&&"Error"===r.constructor.name){let r;return r=2===Error.length?new Error(t,{cause:e}):new n.ErrorWithCause(t,{cause:e}),a(e)&&(r.code=e.code),r}var r;return t.length>0?new Error(`${String(e)}: ${t}`):new Error(String(e))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/errors.cjs"}],[2223,{"./assert.cjs":2214,"./bytes.cjs":2216,"@metamask/superstruct":2872,"@noble/hashes/sha3":3001},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.remove0x=r.add0x=r.isValidChecksumAddress=r.getChecksumAddress=r.isValidHexAddress=r.assertIsStrictHexString=r.assertIsHexString=r.isStrictHexString=r.isHexString=r.HexChecksumAddressStruct=r.HexAddressStruct=r.StrictHexStruct=r.HexStruct=void 0;const n=e("@metamask/superstruct"),s=e("@noble/hashes/sha3"),a=e("./assert.cjs"),i=e("./bytes.cjs");function o(e){return(0,n.is)(e,r.HexStruct)}function c(e){return(0,n.is)(e,r.StrictHexStruct)}function u(e){(0,a.assert)((0,n.is)(e,r.HexChecksumAddressStruct),"Invalid hex address.");const t=d(e.toLowerCase()),o=d((0,i.bytesToHex)((0,s.keccak_256)(t)));return`0x${t.split("").map(((e,t)=>{const r=o[t];return(0,a.assert)((0,n.is)(r,(0,n.string)()),"Hash shorter than address."),parseInt(r,16)>7?e.toUpperCase():e})).join("")}`}function l(e){return!!(0,n.is)(e,r.HexChecksumAddressStruct)&&u(e)===e}function d(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}r.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),r.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu),r.HexAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]{40}$/u),r.HexChecksumAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-fA-F]{40}$/u),r.isHexString=o,r.isStrictHexString=c,r.assertIsHexString=function(e){(0,a.assert)(o(e),"Value must be a hexadecimal string.")},r.assertIsStrictHexString=function(e){(0,a.assert)(c(e),'Value must be a hexadecimal string, starting with "0x".')},r.isValidHexAddress=function(e){return(0,n.is)(e,r.HexAddressStruct)||l(e)},r.getChecksumAddress=u,r.isValidChecksumAddress=l,r.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},r.remove0x=d}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/hex.cjs"}],[2224,{"./assert.cjs":2214,"./base64.cjs":2215,"./bytes.cjs":2216,"./caip-types.cjs":2217,"./checksum.cjs":2218,"./coercers.cjs":2219,"./collections.cjs":2220,"./encryption-types.cjs":2221,"./errors.cjs":2222,"./hex.cjs":2223,"./json.cjs":2225,"./keyring.cjs":2226,"./logging.cjs":2227,"./misc.cjs":2228,"./number.cjs":2229,"./opaque.cjs":2230,"./promise.cjs":2231,"./superstruct.cjs":2232,"./time.cjs":2233,"./transaction-types.cjs":2234,"./versions.cjs":2235},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./assert.cjs"),r),s(e("./base64.cjs"),r),s(e("./bytes.cjs"),r),s(e("./caip-types.cjs"),r),s(e("./checksum.cjs"),r),s(e("./coercers.cjs"),r),s(e("./collections.cjs"),r),s(e("./encryption-types.cjs"),r),s(e("./errors.cjs"),r),s(e("./hex.cjs"),r),s(e("./json.cjs"),r),s(e("./keyring.cjs"),r),s(e("./logging.cjs"),r),s(e("./misc.cjs"),r),s(e("./number.cjs"),r),s(e("./opaque.cjs"),r),s(e("./promise.cjs"),r),s(e("./superstruct.cjs"),r),s(e("./time.cjs"),r),s(e("./transaction-types.cjs"),r),s(e("./versions.cjs"),r)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/index.cjs"}],[2225,{"./assert.cjs":2214,"./misc.cjs":2228,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getJsonRpcIdValidator=r.assertIsJsonRpcError=r.isJsonRpcError=r.assertIsJsonRpcFailure=r.isJsonRpcFailure=r.assertIsJsonRpcSuccess=r.isJsonRpcSuccess=r.assertIsJsonRpcResponse=r.isJsonRpcResponse=r.assertIsPendingJsonRpcResponse=r.isPendingJsonRpcResponse=r.JsonRpcResponseStruct=r.JsonRpcFailureStruct=r.JsonRpcSuccessStruct=r.PendingJsonRpcResponseStruct=r.assertIsJsonRpcRequest=r.isJsonRpcRequest=r.assertIsJsonRpcNotification=r.isJsonRpcNotification=r.JsonRpcNotificationStruct=r.JsonRpcRequestStruct=r.JsonRpcParamsStruct=r.JsonRpcErrorStruct=r.JsonRpcIdStruct=r.JsonRpcVersionStruct=r.jsonrpc2=r.getJsonSize=r.getSafeJson=r.isValidJson=r.JsonStruct=r.UnsafeJsonStruct=r.exactOptional=r.object=void 0;const n=e("@metamask/superstruct"),s=e("./assert.cjs"),a=e("./misc.cjs");function i({path:e,branch:t}){const r=e[e.length-1];return(0,a.hasProperty)(t[t.length-2],r)}function o(e){return new n.Struct({...e,type:`optional ${e.type}`,validator:(t,r)=>!i(r)||e.validator(t,r),refiner:(t,r)=>!i(r)||e.refiner(t,r)})}function c(e){if(null===e||"boolean"==typeof e||"string"==typeof e)return!0;if("number"==typeof e&&Number.isFinite(e))return!0;if("object"==typeof e){let t=!0;if(Array.isArray(e)){for(let r=0;r<e.length;r++)if(!c(e[r])){t=!1;break}return t}const r=Object.entries(e);for(let e=0;e<r.length;e++)if("string"!=typeof r[e][0]||!c(r[e][1])){t=!1;break}return t}return!1}function u(e){return(0,n.create)(e,r.JsonStruct)}r.object=e=>(0,n.object)(e),r.exactOptional=o,r.UnsafeJsonStruct=(0,n.define)("JSON",(e=>c(e))),r.JsonStruct=(0,n.coerce)(r.UnsafeJsonStruct,(0,n.refine)((0,n.any)(),"JSON",(e=>(0,n.is)(e,r.UnsafeJsonStruct))),(e=>JSON.parse(JSON.stringify(e,((e,t)=>"__proto__"===e||"constructor"===e?undefined:t))))),r.isValidJson=function(e){try{return u(e),!0}catch{return!1}},r.getSafeJson=u,r.getJsonSize=function(e){(0,s.assertStruct)(e,r.JsonStruct,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},r.jsonrpc2="2.0",r.JsonRpcVersionStruct=(0,n.literal)(r.jsonrpc2),r.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),r.JsonRpcErrorStruct=(0,r.object)({code:(0,n.integer)(),message:(0,n.string)(),data:o(r.JsonStruct),stack:o((0,n.string)())}),r.JsonRpcParamsStruct=(0,n.union)([(0,n.record)((0,n.string)(),r.JsonStruct),(0,n.array)(r.JsonStruct)]),r.JsonRpcRequestStruct=(0,r.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,method:(0,n.string)(),params:o(r.JsonRpcParamsStruct)}),r.JsonRpcNotificationStruct=(0,r.object)({jsonrpc:r.JsonRpcVersionStruct,method:(0,n.string)(),params:o(r.JsonRpcParamsStruct)}),r.isJsonRpcNotification=function(e){return(0,n.is)(e,r.JsonRpcNotificationStruct)},r.assertIsJsonRpcNotification=function(e,t){(0,s.assertStruct)(e,r.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",t)},r.isJsonRpcRequest=function(e){return(0,n.is)(e,r.JsonRpcRequestStruct)},r.assertIsJsonRpcRequest=function(e,t){(0,s.assertStruct)(e,r.JsonRpcRequestStruct,"Invalid JSON-RPC request",t)},r.PendingJsonRpcResponseStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(r.JsonRpcErrorStruct)}),r.JsonRpcSuccessStruct=(0,r.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:r.JsonStruct}),r.JsonRpcFailureStruct=(0,r.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,error:r.JsonRpcErrorStruct}),r.JsonRpcResponseStruct=(0,n.union)([r.JsonRpcSuccessStruct,r.JsonRpcFailureStruct]),r.isPendingJsonRpcResponse=function(e){return(0,n.is)(e,r.PendingJsonRpcResponseStruct)},r.assertIsPendingJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",t)},r.isJsonRpcResponse=function(e){return(0,n.is)(e,r.JsonRpcResponseStruct)},r.assertIsJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.JsonRpcResponseStruct,"Invalid JSON-RPC response",t)},r.isJsonRpcSuccess=function(e){return(0,n.is)(e,r.JsonRpcSuccessStruct)},r.assertIsJsonRpcSuccess=function(e,t){(0,s.assertStruct)(e,r.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",t)},r.isJsonRpcFailure=function(e){return(0,n.is)(e,r.JsonRpcFailureStruct)},r.assertIsJsonRpcFailure=function(e,t){(0,s.assertStruct)(e,r.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",t)},r.isJsonRpcError=function(e){return(0,n.is)(e,r.JsonRpcErrorStruct)},r.assertIsJsonRpcError=function(e,t){(0,s.assertStruct)(e,r.JsonRpcErrorStruct,"Invalid JSON-RPC error",t)},r.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/json.cjs"}],[2226,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/keyring.cjs"}],[2227,{debug:4226},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createModuleLogger=r.createProjectLogger=void 0;const s=(0,n(e("debug")).default)("metamask");r.createProjectLogger=function(e){return s.extend(e)},r.createModuleLogger=function(e,t){return e.extend(t)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/logging.cjs"}],[2228,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.calculateNumberSize=r.calculateStringSize=r.isASCII=r.isPlainObject=r.ESCAPE_CHARACTERS_REGEXP=r.JsonSize=r.getKnownPropertyNames=r.hasProperty=r.isObject=r.isNullOrUndefined=r.isNonEmptyArray=void 0,r.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},r.isNullOrUndefined=function(e){return null===e||e===undefined},r.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};function n(e){return e.charCodeAt(0)<=127}r.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),r.getKnownPropertyNames=function(e){return Object.getOwnPropertyNames(e)},function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(r.JsonSize||(r.JsonSize={})),r.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,r.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},r.isASCII=n,r.calculateStringSize=function(e){return e.split("").reduce(((e,t)=>n(t)?e+1:e+2),0)+(e.match(r.ESCAPE_CHARACTERS_REGEXP)??[]).length},r.calculateNumberSize=function(e){return e.toString().length}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/misc.cjs"}],[2229,{"./assert.cjs":2214,"./hex.cjs":2223},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.hexToBigInt=r.hexToNumber=r.bigIntToHex=r.numberToHex=void 0;const n=e("./assert.cjs"),s=e("./hex.cjs");r.numberToHex=e=>((0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,s.add0x)(e.toString(16)));r.bigIntToHex=e=>((0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=0,"Value must be a non-negative bigint."),(0,s.add0x)(e.toString(16)));r.hexToNumber=e=>{(0,s.assertIsHexString)(e);const t=parseInt(e,16);return(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};r.hexToBigInt=e=>((0,s.assertIsHexString)(e),BigInt((0,s.add0x)(e)))}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/number.cjs"}],[2230,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/opaque.cjs"}],[2231,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createDeferredPromise=void 0,r.createDeferredPromise=function({suppressUnhandledRejection:e=!1}={}){let t,r;const n=new Promise(((e,n)=>{t=e,r=n}));return e&&n.catch((e=>{})),{promise:n,resolve:t,reject:r}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/promise.cjs"}],[2232,{"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.definePattern=void 0;const n=e("@metamask/superstruct");r.definePattern=function(e,t){return(0,n.define)(e,(e=>"string"==typeof e&&t.test(e)))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/superstruct.cjs"}],[2233,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.timeSince=r.inMilliseconds=r.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(r.Duration||(r.Duration={}));const n=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};r.inMilliseconds=function(e,t){return n(e,"count"),e*t},r.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/time.cjs"}],[2234,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/transaction-types.cjs"}],[2235,{"./assert.cjs":2214,"@metamask/superstruct":2872,semver:5547},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.satisfiesVersionRange=r.gtRange=r.gtVersion=r.assertIsSemVerRange=r.assertIsSemVerVersion=r.isValidSemVerRange=r.isValidSemVerVersion=r.VersionRangeStruct=r.VersionStruct=void 0;const n=e("@metamask/superstruct"),s=e("semver"),a=e("./assert.cjs");r.VersionStruct=(0,n.refine)((0,n.string)(),"Version",(e=>null!==(0,s.valid)(e)||`Expected SemVer version, got "${e}"`)),r.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",(e=>null!==(0,s.validRange)(e)||`Expected SemVer range, got "${e}"`)),r.isValidSemVerVersion=function(e){return(0,n.is)(e,r.VersionStruct)},r.isValidSemVerRange=function(e){return(0,n.is)(e,r.VersionRangeStruct)},r.assertIsSemVerVersion=function(e){(0,a.assertStruct)(e,r.VersionStruct)},r.assertIsSemVerRange=function(e){(0,a.assertStruct)(e,r.VersionRangeStruct)},r.gtVersion=function(e,t){return(0,s.gt)(e,t)},r.gtRange=function(e,t){return(0,s.gtr)(e,t)},r.satisfiesVersionRange=function(e,t){return(0,s.satisfies)(e,t,{includePrerelease:!0})}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/abi-utils/node_modules/@metamask/utils/dist/versions.cjs"}],[2236,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.BaseControllerV1=r.isBaseControllerV1=void 0,r.isBaseControllerV1=function(e){return"name"in e&&"string"==typeof e.name&&"config"in e&&"object"==typeof e.config&&"defaultConfig"in e&&"object"==typeof e.defaultConfig&&"state"in e&&"object"==typeof e.state&&"defaultState"in e&&"object"==typeof e.defaultState&&"disabled"in e&&"boolean"==typeof e.disabled&&"subscribe"in e&&"function"==typeof e.subscribe};class n{constructor(e={},t={}){this.defaultConfig={},this.defaultState={},this.disabled=!1,this.name="BaseController",this.internalConfig=this.defaultConfig,this.internalState=this.defaultState,this.internalListeners=[],this.initialState=t,this.initialConfig=e}initialize(){return this.internalState=this.defaultState,this.internalConfig=this.defaultConfig,this.configure(this.initialConfig),this.update(this.initialState),this}get config(){return this.internalConfig}get state(){return this.internalState}configure(e,t=!1,r=!0){if(r){this.internalConfig=t?e:Object.assign(this.internalConfig,e);for(const e of Object.keys(this.internalConfig)){const t=this.internalConfig[e];t!==undefined&&(this[e]=t)}}else for(const t of Object.keys(e))if(this.internalConfig[t]!==undefined){const r=e[t];this.internalConfig[t]=r,this[t]=r}}notify(){this.disabled||this.internalListeners.forEach((e=>{e(this.internalState)}))}subscribe(e){this.internalListeners.push(e)}unsubscribe(e){const t=this.internalListeners.findIndex((t=>e===t));return t>-1&&this.internalListeners.splice(t,1),t>-1}update(e,t=!1){this.internalState=t?Object.assign({},e):Object.assign({},this.internalState,e),this.notify()}}r.BaseControllerV1=n,r.default=n}}},{package:"@metamask/network-controller>@metamask/base-controller",file:"node_modules/@metamask/network-controller/node_modules/@metamask/base-controller/dist/BaseControllerV1.cjs"}],[2237,{immer:4649},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.getPersistentState=r.getAnonymizedState=r.BaseController=r.isBaseController=void 0;const i=e("immer");(0,i.enablePatches)(),r.isBaseController=function(e){return"name"in e&&"string"==typeof e.name&&"state"in e&&"object"==typeof e.state&&"metadata"in e&&"object"==typeof e.metadata};function o(e,t,r){return Object.keys(e).reduce(((n,s)=>{try{const a=t[s];if(!a)throw new Error(`No metadata found for '${String(s)}'`);const i=a[r],o=e[s];return"function"==typeof i?n[s]=i(o):i&&(n[s]=o),n}catch(e){return setTimeout((()=>{throw e})),n}}),{})}r.BaseController=class{constructor({messenger:e,metadata:t,name:r,state:a}){n.set(this,void 0),this.messagingSystem=e,this.name=r,s(this,n,(0,i.freeze)(a,!0),"f"),this.metadata=t,this.messagingSystem.registerActionHandler(`${r}:getState`,(()=>this.state)),this.messagingSystem.registerInitialEventPayload({eventType:`${r}:stateChange`,getPayload:()=>[this.state,[]]})}get state(){return a(this,n,"f")}set state(e){throw new Error("Controller state cannot be directly mutated; use 'update' method instead.")}update(e){const[t,r,o]=i.produceWithPatches(a(this,n,"f"),e);return s(this,n,t,"f"),this.messagingSystem.publish(`${this.name}:stateChange`,t,r),{nextState:t,patches:r,inversePatches:o}}applyPatches(e){const t=(0,i.applyPatches)(a(this,n,"f"),e);s(this,n,t,"f"),this.messagingSystem.publish(`${this.name}:stateChange`,t,e)}destroy(){this.messagingSystem.clearEventSubscriptions(`${this.name}:stateChange`)}},n=new WeakMap,r.getAnonymizedState=function(e,t){return o(e,t,"anonymous")},r.getPersistentState=function(e,t){return o(e,t,"persist")}}}},{package:"@metamask/network-controller>@metamask/base-controller",file:"node_modules/@metamask/network-controller/node_modules/@metamask/base-controller/dist/BaseControllerV2.cjs"}],[2238,{"./RestrictedMessenger.cjs":2239},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i,o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.ControllerMessenger=r.Messenger=void 0;const c=e("./RestrictedMessenger.cjs");class u{constructor(){n.set(this,new Map),s.set(this,new Map),a.set(this,new Map),i.set(this,new Map)}registerActionHandler(e,t){if(o(this,n,"f").has(e))throw new Error(`A handler for ${e} has already been registered`);o(this,n,"f").set(e,t)}unregisterActionHandler(e){o(this,n,"f").delete(e)}clearActions(){o(this,n,"f").clear()}call(e,...t){const r=o(this,n,"f").get(e);if(!r)throw new Error(`A handler for ${e} has not been registered`);return r(...t)}registerInitialEventPayload({eventType:e,getPayload:t}){o(this,a,"f").set(e,t)}publish(e,...t){const r=o(this,s,"f").get(e);if(r)for(const[e,n]of r.entries())try{if(n){const r=o(this,i,"f").get(e),s=n(...t);s!==r&&(o(this,i,"f").set(e,s),e(s,r))}else e(...t)}catch(e){setTimeout((()=>{throw e}))}}subscribe(e,t,r){let n=o(this,s,"f").get(e);if(n||(n=new Map,o(this,s,"f").set(e,n)),n.set(t,r),r){const n=o(this,a,"f").get(e);if(n){const e=r(...n());o(this,i,"f").set(t,e)}}}unsubscribe(e,t){const r=o(this,s,"f").get(e);if(!r||!r.has(t))throw new Error(`Subscription not found for event: ${e}`);r.get(t)&&o(this,i,"f").delete(t),r.delete(t)}clearEventSubscriptions(e){o(this,s,"f").delete(e)}clearSubscriptions(){o(this,s,"f").clear()}getRestricted({name:e,allowedActions:t,allowedEvents:r}){return new c.RestrictedMessenger({messenger:this,name:e,allowedActions:t,allowedEvents:r})}}r.Messenger=u,r.ControllerMessenger=u,n=new WeakMap,s=new WeakMap,a=new WeakMap,i=new WeakMap}}},{package:"@metamask/network-controller>@metamask/base-controller",file:"node_modules/@metamask/network-controller/node_modules/@metamask/base-controller/dist/Messenger.cjs"}],[2239,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a,i,o,c,u,l,d=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},m=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(r,"__esModule",{value:!0}),r.RestrictedControllerMessenger=r.RestrictedMessenger=void 0;class p{constructor({controllerMessenger:e,messenger:t,name:r,allowedActions:c,allowedEvents:u}){if(n.add(this),s.set(this,void 0),a.set(this,void 0),i.set(this,void 0),o.set(this,void 0),t&&e)throw new Error("Both messenger properties provided. Provide message using only 'messenger' option, 'controllerMessenger' is deprecated");if(!t&&!e)throw new Error("Messenger not provided");d(this,s,t??e,"f"),d(this,a,r,"f"),d(this,i,c,"f"),d(this,o,u,"f")}registerActionHandler(e,t){if(!m(this,n,"m",l).call(this,e))throw new Error(`Only allowed registering action handlers prefixed by '${m(this,a,"f")}:'`);m(this,s,"f").registerActionHandler(e,t)}unregisterActionHandler(e){if(!m(this,n,"m",l).call(this,e))throw new Error(`Only allowed unregistering action handlers prefixed by '${m(this,a,"f")}:'`);m(this,s,"f").unregisterActionHandler(e)}call(e,...t){if(!m(this,n,"m",u).call(this,e))throw new Error(`Action missing from allow list: ${e}`);return m(this,s,"f").call(e,...t)}registerInitialEventPayload({eventType:e,getPayload:t}){if(!m(this,n,"m",l).call(this,e))throw new Error(`Only allowed publishing events prefixed by '${m(this,a,"f")}:'`);m(this,s,"f").registerInitialEventPayload({eventType:e,getPayload:t})}publish(e,...t){if(!m(this,n,"m",l).call(this,e))throw new Error(`Only allowed publishing events prefixed by '${m(this,a,"f")}:'`);m(this,s,"f").publish(e,...t)}subscribe(e,t,r){if(!m(this,n,"m",c).call(this,e))throw new Error(`Event missing from allow list: ${e}`);return r?m(this,s,"f").subscribe(e,t,r):m(this,s,"f").subscribe(e,t)}unsubscribe(e,t){if(!m(this,n,"m",c).call(this,e))throw new Error(`Event missing from allow list: ${e}`);m(this,s,"f").unsubscribe(e,t)}clearEventSubscriptions(e){if(!m(this,n,"m",l).call(this,e))throw new Error(`Only allowed clearing events prefixed by '${m(this,a,"f")}:'`);m(this,s,"f").clearEventSubscriptions(e)}}r.RestrictedMessenger=p,r.RestrictedControllerMessenger=p,s=new WeakMap,a=new WeakMap,i=new WeakMap,o=new WeakMap,n=new WeakSet,c=function(e){const t=m(this,o,"f");return m(this,n,"m",l).call(this,e)||null!==t&&t.includes(e)},u=function(e){const t=m(this,i,"f");return m(this,n,"m",l).call(this,e)||null!==t&&t.includes(e)},l=function(e){return e.startsWith(`${m(this,a,"f")}:`)}}}},{package:"@metamask/network-controller>@metamask/base-controller",file:"node_modules/@metamask/network-controller/node_modules/@metamask/base-controller/dist/RestrictedMessenger.cjs"}],[2240,{"./BaseControllerV1.cjs":2236,"./BaseControllerV2.cjs":2237,"./Messenger.cjs":2238,"./RestrictedMessenger.cjs":2239},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.RestrictedMessenger=r.RestrictedControllerMessenger=r.Messenger=r.ControllerMessenger=r.isBaseController=r.getPersistentState=r.getAnonymizedState=r.BaseController=r.isBaseControllerV1=r.BaseControllerV1=void 0;var n=e("./BaseControllerV1.cjs");Object.defineProperty(r,"BaseControllerV1",{enumerable:!0,get:function(){return n.BaseControllerV1}}),Object.defineProperty(r,"isBaseControllerV1",{enumerable:!0,get:function(){return n.isBaseControllerV1}});var s=e("./BaseControllerV2.cjs");Object.defineProperty(r,"BaseController",{enumerable:!0,get:function(){return s.BaseController}}),Object.defineProperty(r,"getAnonymizedState",{enumerable:!0,get:function(){return s.getAnonymizedState}}),Object.defineProperty(r,"getPersistentState",{enumerable:!0,get:function(){return s.getPersistentState}}),Object.defineProperty(r,"isBaseController",{enumerable:!0,get:function(){return s.isBaseController}});var a=e("./Messenger.cjs");Object.defineProperty(r,"ControllerMessenger",{enumerable:!0,get:function(){return a.ControllerMessenger}}),Object.defineProperty(r,"Messenger",{enumerable:!0,get:function(){return a.Messenger}});var i=e("./RestrictedMessenger.cjs");Object.defineProperty(r,"RestrictedControllerMessenger",{enumerable:!0,get:function(){return i.RestrictedControllerMessenger}}),Object.defineProperty(r,"RestrictedMessenger",{enumerable:!0,get:function(){return i.RestrictedMessenger}})}}},{package:"@metamask/network-controller>@metamask/base-controller",file:"node_modules/@metamask/network-controller/node_modules/@metamask/base-controller/dist/index.cjs"}],[2241,{"./logging-utils":2248,"./utils/cache":2254,"@metamask/json-rpc-engine":1933},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createBlockCacheMiddleware=void 0;const n=e("@metamask/json-rpc-engine"),s=e("./logging-utils"),a=e("./utils/cache"),i=(0,s.createModuleLogger)(s.projectLogger,"block-cache"),o=[undefined,null,"<nil>"];class c{constructor(){this.cache={}}getBlockCache(e){const t=Number.parseInt(e,16);let r=this.cache[t];if(!r){const e={};this.cache[t]=e,r=e}return r}async get(e,t){const r=this.getBlockCache(t),n=(0,a.cacheIdentifierForRequest)(e,!0);return n?r[n]:undefined}async set(e,t,r){if(!this.canCacheResult(e,r))return;const n=(0,a.cacheIdentifierForRequest)(e,!0);if(!n)return;this.getBlockCache(t)[n]=r}canCacheRequest(e){if(!(0,a.canCache)(e.method))return!1;return"pending"!==(0,a.blockTagForRequest)(e)}canCacheResult(e,t){return!o.includes(t)&&!(e.method&&["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(e.method)&&(!t||!t.blockHash||"0x0000000000000000000000000000000000000000000000000000000000000000"===t.blockHash))}clearBefore(e){const t=Number.parseInt(e,16);Object.keys(this.cache).map(Number).filter((e=>e<t)).forEach((e=>delete this.cache[e]))}}r.createBlockCacheMiddleware=function({blockTracker:e}={}){if(!e)throw new Error("createBlockCacheMiddleware - No PollingBlockTracker specified");const t=new c,r={[a.CacheStrategy.Permanent]:t,[a.CacheStrategy.Block]:t,[a.CacheStrategy.Fork]:t,[a.CacheStrategy.Never]:undefined};return(0,n.createAsyncMiddleware)((async(n,s,o)=>{if(n.skipCache)return o();const c=(0,a.cacheTypeForMethod)(n.method),u=r[c];if(!u)return o();if(!u.canCacheRequest(n))return o();const l=(0,a.blockTagForRequest)(n),d=l&&"string"==typeof l?l:"latest";let m;if(i("blockTag = %o, req = %o",d,n),"earliest"===d)m="0x00";else if("latest"===d){i("Fetching latest block number to determine cache key");const r=await e.getLatestBlock();i("Clearing values stored under block numbers before %o",r),t.clearBefore(r),m=r}else m=d;const p=await u.get(n,m);return p===undefined?(i("No cache stored under block number %o, carrying request forward",m),await o(),i("Populating cache with",s),await u.set(n,m,s.result)):(i("Cache hit, reusing cache result stored under block number %o",m),s.result=p),undefined}))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/block-cache.js"}],[2242,{"./utils/cache":2254,"@metamask/json-rpc-engine":1933},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createBlockRefRewriteMiddleware=void 0;const n=e("@metamask/json-rpc-engine"),s=e("./utils/cache");r.createBlockRefRewriteMiddleware=function({blockTracker:e}={}){if(!e)throw Error('BlockRefRewriteMiddleware - mandatory "blockTracker" option is missing.');return(0,n.createAsyncMiddleware)((async(t,r,n)=>{const a=(0,s.blockTagParamIndex)(t.method);if(a===undefined)return n();if("latest"!==(Array.isArray(t.params)&&t.params[a]?t.params[a]:"latest"))return n();const i=await e.getLatestBlock();return Array.isArray(t.params)&&(t.params[a]=i),n()}))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/block-ref-rewrite.js"}],[2243,{"./logging-utils":2248,"./utils/cache":2254,"@metamask/json-rpc-engine":1933,"klona/full":4707},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createBlockRefMiddleware=void 0;const n=e("@metamask/json-rpc-engine"),s=e("klona/full"),a=e("./logging-utils"),i=e("./utils/cache"),o=(0,a.createModuleLogger)(a.projectLogger,"block-ref");r.createBlockRefMiddleware=function({provider:e,blockTracker:t}={}){if(!e)throw Error('BlockRefMiddleware - mandatory "provider" option is missing.');if(!t)throw Error('BlockRefMiddleware - mandatory "blockTracker" option is missing.');return(0,n.createAsyncMiddleware)((async(r,n,a)=>{var c;const u=(0,i.blockTagParamIndex)(r.method);if(u===undefined)return a();if("latest"!==(Array.isArray(r.params)&&null!==(c=r.params[u])&&void 0!==c?c:"latest"))return o('blockRef is not "latest", carrying request forward'),a();const l=await t.getLatestBlock();o(`blockRef is "latest", setting param ${u} to latest block ${l}`);const d=(0,s.klona)(r);return Array.isArray(d.params)&&(d.params[u]=l),o("Performing another request %o",d),n.result=await e.request(d),undefined}))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/block-ref.js"}],[2244,{"./logging-utils":2248,"@metamask/json-rpc-engine":1933},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createBlockTrackerInspectorMiddleware=void 0;const n=e("@metamask/json-rpc-engine"),s=e("./logging-utils"),a=(0,s.createModuleLogger)(s.projectLogger,"block-tracker-inspector"),i=["eth_getTransactionByHash","eth_getTransactionReceipt"];function o(e){const{result:t}=e;return t&&"object"==typeof t&&(r=t,n="blockNumber",Object.hasOwnProperty.call(r,n))&&"string"==typeof t.blockNumber?t.blockNumber:undefined;var r,n}r.createBlockTrackerInspectorMiddleware=function({blockTracker:e}){return(0,n.createAsyncMiddleware)((async(t,r,n)=>{if(!i.includes(t.method))return n();await n();const s=o(r);if(!s)return undefined;a("res.result.blockNumber exists, proceeding. res = %o",r);return Number.parseInt(s,16)>Number.parseInt(e.getCurrentBlock(),16)&&(a("blockNumber from response is greater than current block number, refreshing current block number"),await e.checkForLatestBlock()),undefined}))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/block-tracker-inspector.js"}],[2245,{"./utils/timeout":2258,"@metamask/json-rpc-engine":1933,"@metamask/rpc-errors":2554,"@metamask/utils":2271},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createFetchConfigFromReq=r.createFetchMiddleware=void 0;const n=e("@metamask/json-rpc-engine"),s=e("@metamask/rpc-errors"),a=e("@metamask/utils"),i=e("./utils/timeout"),o=["Gateway timeout","ETIMEDOUT","failed to parse response body","Failed to fetch"];function c(e){switch(e.status){case 405:throw s.rpcErrors.methodNotFound();case 418:throw s.rpcErrors.internal({message:"Request is being rate limited."});case 503:case 504:throw function(){let e="Gateway timeout. The request took too long to process. ";return e+="This can happen when querying logs over too wide a block range.",s.rpcErrors.internal({message:e})}()}}function u(e,t){if(200!==e.status)throw s.rpcErrors.internal({message:`Non-200 status code: '${e.status}'`,data:t});if(t.error)throw s.rpcErrors.internal({data:t.error});return t.result}function l({btoa:e,req:t,rpcUrl:r,originHttpHeaderKey:n}){const s=new URL(r),a=function(e){let t="";t+=e.protocol,t+=`//${e.hostname}`,e.port&&(t+=`:${e.port}`);return t+=`${e.pathname}`,t+=`${e.search}`,t}(s),i={id:t.id,jsonrpc:t.jsonrpc,method:t.method,params:t.params},o=t.origin,c={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)};if(s.username&&s.password){const t=e(`${s.username}:${s.password}`);c.headers.Authorization=`Basic ${t}`}return n&&o&&(c.headers[n]=o),{fetchUrl:a,fetchParams:c}}r.createFetchMiddleware=function(e){return"rpcService"in e?function({rpcService:e,options:t={}}){return(0,n.createAsyncMiddleware)((async(r,n)=>{const i="originHttpHeaderKey"in t&&t.originHttpHeaderKey!==undefined&&r.origin!==undefined?{[t.originHttpHeaderKey]:r.origin}:{},o=await e.request({id:r.id,jsonrpc:r.jsonrpc,method:r.method,params:r.params},{headers:i});if((0,a.isJsonRpcFailure)(o))throw s.rpcErrors.internal({data:o.error});n.result=o.result}))}(e):function({btoa:e,fetch:t,rpcUrl:r,originHttpHeaderKey:s}){return(0,n.createAsyncMiddleware)((async(n,a,d)=>{const{fetchUrl:m,fetchParams:p}=l({btoa:e,req:n,rpcUrl:r,originHttpHeaderKey:s}),h=5,f=1e3;for(let e=0;e<h;e++){try{const e=await t(m,p);c(e);const r=await e.text();let n;try{n=JSON.parse(r)}catch(e){throw new Error(`FetchMiddleware - failed to parse response body: "${r}"`)}const s=u(e,n);return void(a.result=s)}catch(e){const t=e.toString();if(!o.some((e=>t.includes(e))))throw e}await(0,i.timeout)(f)}}))}(e)},r.createFetchConfigFromReq=l}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/fetch.js"}],[2246,{"./block-cache":2241,"./block-ref":2243,"./block-ref-rewrite":2242,"./block-tracker-inspector":2244,"./fetch":2245,"./inflight-cache":2247,"./providerAsMiddleware":2252,"./retryOnEmpty":2253,"./wallet":2260},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./block-cache"),r),s(e("./block-ref-rewrite"),r),s(e("./block-ref"),r),s(e("./block-tracker-inspector"),r),s(e("./fetch"),r),s(e("./inflight-cache"),r),s(e("./providerAsMiddleware"),r),s(e("./retryOnEmpty"),r),s(e("./wallet"),r)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/index.js"}],[2247,{"./logging-utils":2248,"./utils/cache":2254,"@metamask/json-rpc-engine":1933,"klona/full":4707},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createInflightCacheMiddleware=void 0;const n=e("@metamask/json-rpc-engine"),s=e("klona/full"),a=e("./logging-utils"),i=e("./utils/cache"),o=(0,a.createModuleLogger)(a.projectLogger,"inflight-cache");r.createInflightCacheMiddleware=function(){const e={};return(0,n.createAsyncMiddleware)((async(t,r,n)=>{if(t.skipCache)return n();const a=(0,i.cacheIdentifierForRequest)(t);if(!a)return o("Request is not cacheable, proceeding. req = %o",t),n();let c=e[a];return c?(o("Running %i handler(s) for request %o",c.length,t),await async function(e,t){const{resolve:r,promise:n}=function(){let e;const t=new Promise((t=>{e=t}));return{resolve:e,promise:t}}();return t.push((t=>{e.result=(0,s.klona)(t.result),e.error=(0,s.klona)(t.error),r()})),n}(r,c),undefined):(c=[],e[a]=c,o("Carrying original request forward %o",t),await n(),delete e[a],o("Running %i collected handler(s) for request %o",c.length,t),function(e,t){setTimeout((()=>{t.forEach((t=>{try{t(e)}catch(e){console.error(e)}}))}))}(r,c),undefined)}))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/inflight-cache.js"}],[2248,{"@metamask/utils":2271},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createModuleLogger=r.projectLogger=void 0;const n=e("@metamask/utils");Object.defineProperty(r,"createModuleLogger",{enumerable:!0,get:function(){return n.createModuleLogger}}),r.projectLogger=(0,n.createProjectLogger)("eth-json-rpc-middleware")}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/logging-utils.js"}],[2249,{"../utils/validation":2259,"@metamask/rpc-errors":2554,"@metamask/superstruct":2872,"@metamask/utils":2271},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.walletGetCallsStatus=void 0;const n=e("@metamask/rpc-errors"),s=e("@metamask/superstruct"),a=e("@metamask/utils"),i=e("../utils/validation"),o=(0,s.tuple)([(0,s.nonempty)((0,s.string)())]),c=(0,s.object)({logs:(0,s.optional)((0,s.array)((0,s.object)({address:(0,s.optional)(a.HexChecksumAddressStruct),data:(0,s.optional)(a.StrictHexStruct),topics:(0,s.optional)((0,s.array)(a.StrictHexStruct))}))),status:(0,s.optional)(a.StrictHexStruct),chainId:(0,s.optional)(a.StrictHexStruct),blockHash:(0,s.optional)(a.StrictHexStruct),blockNumber:(0,s.optional)(a.StrictHexStruct),gasUsed:(0,s.optional)(a.StrictHexStruct),transactionHash:(0,s.optional)(a.StrictHexStruct)});r.walletGetCallsStatus=async function(e,t,{getTransactionReceiptsByBatchId:r}){if(!r)throw n.rpcErrors.methodNotSupported();(0,i.validateParams)(e.params,o);const a=e.params[0],u=await r(a,e);if(!u.length)return void(t.result=null);const l=u.every((e=>Boolean(e))),d=l?"CONFIRMED":"PENDING",m=l?u.map((e=>(0,s.mask)(e,c))):null;t.result={status:d,receipts:m}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/methods/wallet-get-calls-status.js"}],[2250,{"../utils/validation":2259,"@metamask/rpc-errors":2554,"@metamask/superstruct":2872,"@metamask/utils":2271},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.walletGetCapabilities=void 0;const n=e("@metamask/rpc-errors"),s=e("@metamask/superstruct"),a=e("@metamask/utils"),i=e("../utils/validation"),o=(0,s.tuple)([a.HexChecksumAddressStruct]);r.walletGetCapabilities=async function(e,t,{getCapabilities:r}){if(!r)throw n.rpcErrors.methodNotSupported();(0,i.validateParams)(e.params,o);const s=e.params[0],a=await r(s,e);t.result=a}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/methods/wallet-get-capabilities.js"}],[2251,{"../utils/validation":2259,"@metamask/rpc-errors":2554,"@metamask/superstruct":2872,"@metamask/utils":2271},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.walletSendCalls=void 0;const n=e("@metamask/rpc-errors"),s=e("@metamask/superstruct"),a=e("@metamask/utils"),i=e("../utils/validation"),o=(0,s.tuple)([(0,s.object)({version:(0,s.nonempty)((0,s.string)()),from:a.HexChecksumAddressStruct,chainId:(0,s.optional)(a.StrictHexStruct),calls:(0,s.array)((0,s.object)({to:(0,s.optional)(a.HexChecksumAddressStruct),data:(0,s.optional)(a.StrictHexStruct),value:(0,s.optional)(a.StrictHexStruct)})),capabilities:(0,s.optional)((0,s.type)({}))})]);r.walletSendCalls=async function(e,t,{getAccounts:r,processSendCalls:s}){if(!s)throw n.rpcErrors.methodNotSupported();(0,i.validateParams)(e.params,o);const a=e.params[0],c=await(0,i.validateAndNormalizeKeyholder)(a.from,e,{getAccounts:r}),u=Object.assign(Object.assign({},a),{from:c});t.result=await s(u,e)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/methods/wallet-send-calls.js"}],[2252,{"@metamask/json-rpc-engine":1933},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ethersProviderAsMiddleware=r.providerAsMiddleware=void 0;const n=e("@metamask/json-rpc-engine");r.providerAsMiddleware=function(e){return(0,n.createAsyncMiddleware)((async(t,r)=>{r.result=await e.request(t)}))},r.ethersProviderAsMiddleware=function(e){return(t,r,n,s)=>{e.send(t,((e,t)=>e?s(e):(Object.assign(r,t),s())))}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/providerAsMiddleware.js"}],[2253,{"./logging-utils":2248,"./utils/cache":2254,"./utils/error":2256,"./utils/timeout":2258,"@metamask/json-rpc-engine":1933,"klona/full":4707},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createRetryOnEmptyMiddleware=void 0;const n=e("@metamask/json-rpc-engine"),s=e("klona/full"),a=e("./logging-utils"),i=e("./utils/cache"),o=e("./utils/error"),c=e("./utils/timeout"),u=(0,a.createModuleLogger)(a.projectLogger,"retry-on-empty"),l=[undefined,null,"<nil>"];r.createRetryOnEmptyMiddleware=function({provider:e,blockTracker:t}={}){if(!e)throw Error('RetryOnEmptyMiddleware - mandatory "provider" option is missing.');if(!t)throw Error('RetryOnEmptyMiddleware - mandatory "blockTracker" option is missing.');return(0,n.createAsyncMiddleware)((async(r,n,a)=>{const d=(0,i.blockTagParamIndex)(r.method);if(d===undefined)return a();let m=Array.isArray(r.params)&&r.params[d]?r.params[d]:undefined;if(m===undefined&&(m="latest"),["latest","pending"].includes(m))return a();const p=Number.parseInt(m.slice(2),16);if(Number.isNaN(p))return a();const h=await t.getLatestBlock(),f=Number.parseInt(h.slice(2),16);if(p>f)return u("Requested block number %o is higher than latest block number %o, falling through to original request",p,f),a();u("Requested block number %o is not higher than latest block number %o, trying request until non-empty response is received",p,f);const g=(0,s.klona)(r),y=await async function(e,t){for(let r=0;r<e;r++)try{return await t()}catch(e){if((0,o.isExecutionRevertedError)(e))throw e;u("(call %i) Request failed, waiting 1s to retry again...",r+1),await(0,c.timeout)(1e3)}throw u("Retries exhausted"),new Error("RetryOnEmptyMiddleware - retries exhausted")}(10,(async()=>{u("Performing request %o",g);const t=await e.request(g);u("Result is %o",t);if(l.includes(t))throw new Error(`RetryOnEmptyMiddleware - empty result "${JSON.stringify(t)}" for request "${JSON.stringify(g)}"`);return t}));return u("Copying result %o",y),n.result=y,undefined}))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/retryOnEmpty.js"}],[2254,{"safe-stable-stringify":5515},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.cacheTypeForMethod=r.blockTagParamIndex=r.blockTagForRequest=r.canCache=r.cacheIdentifierForRequest=r.CacheStrategy=void 0;const n=(0,e("safe-stable-stringify").configure)({bigint:!1,circularValue:Error});var s;function a(e){return o(e)!==s.Never}function i(e){switch(e){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return undefined}}function o(e){switch(e){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return s.Permanent;case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return s.Fork;case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return s.Block;default:return s.Never}}!function(e){e.Block="block",e.Fork="fork",e.Never="never",e.Permanent="perma"}(s=r.CacheStrategy||(r.CacheStrategy={})),r.cacheIdentifierForRequest=function(e,t){var r;const s=t?function(e){if(!e.params)return[];const t=i(e.method);if(t===undefined||!Array.isArray(e.params)||t>=e.params.length)return e.params;if("eth_getBlockByNumber"===e.method)return e.params.slice(1);return e.params.slice(0,t)}(e):null!==(r=e.params)&&void 0!==r?r:[];return a(e.method)?`${e.method}:${n(s)}`:null},r.canCache=a,r.blockTagForRequest=function(e){if(!e.params)return undefined;const t=i(e.method);return t===undefined||!Array.isArray(e.params)||t>=e.params.length?undefined:e.params[t]},r.blockTagParamIndex=i,r.cacheTypeForMethod=o}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/utils/cache.js"}],[2255,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.stripArrayTypeIfPresent=void 0;r.stripArrayTypeIfPresent=e=>(null==e?void 0:e.match(/\S\[\d*\]$/u))?e.replace(/\[\d*\]$/gu,"").trim():e}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/utils/common.js"}],[2256,{"@metamask/rpc-errors":2554,"@metamask/utils":2271},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isExecutionRevertedError=void 0;const n=e("@metamask/rpc-errors"),s=e("@metamask/utils");r.isExecutionRevertedError=function(e){return(0,s.isJsonRpcError)(e)&&e.code===n.errorCodes.rpc.invalidInput&&"execution reverted"===e.message}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/utils/error.js"}],[2257,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){function n(e){return"string"!=typeof e?e:JSON.parse(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.parseTypedMessage=r.normalizeTypedMessage=void 0,r.normalizeTypedMessage=function(e){var t;let r;try{r=n(e)}catch(t){return e}const{verifyingContract:s}=null!==(t=r.domain)&&void 0!==t?t:{};return s?(r.domain.verifyingContract=function(e){if(e.startsWith("0X"))return`0x${e.slice(2)}`;return e}(s),JSON.stringify(r)):e},r.parseTypedMessage=n}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/utils/normalize.js"}],[2258,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.timeout=void 0,r.timeout=async function(e){return new Promise((t=>setTimeout(t,e)))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/utils/timeout.js"}],[2259,{"@metamask/rpc-errors":2554,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.resemblesAddress=r.validateParams=r.validateAndNormalizeKeyholder=void 0;const n=e("@metamask/rpc-errors"),s=e("@metamask/superstruct");function a(e){return 42===e.length}r.validateAndNormalizeKeyholder=async function(e,t,{getAccounts:r}){if("string"==typeof e&&e.length>0&&a(e)){const s=(await r(t)).map((e=>e.toLowerCase())),a=e.toLowerCase();if(s.includes(a))return a;throw n.providerErrors.unauthorized()}throw n.rpcErrors.invalidParams({message:"Invalid parameters: must provide an Ethereum address."})},r.validateParams=function(e,t){const[r]=(0,s.validate)(e,t);if(r)throw n.rpcErrors.invalidInput(function(e,t){return`${t}\n\n${e.failures().map((e=>`${e.path.join(" > ")}${e.path.length?" - ":""}${e.message}`)).join("\n")}`}(r,"Invalid params"))},r.resemblesAddress=a}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/utils/validation.js"}],[2260,{"./methods/wallet-get-calls-status":2249,"./methods/wallet-get-capabilities":2250,"./methods/wallet-send-calls":2251,"./utils/common":2255,"./utils/normalize":2257,"./utils/validation":2259,"@metamask/eth-sig-util":2284,"@metamask/json-rpc-engine":1933,"@metamask/rpc-errors":2554,"@metamask/utils":2271},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.createWalletMiddleware=void 0;const i=a(e("@metamask/eth-sig-util")),o=e("@metamask/json-rpc-engine"),c=e("@metamask/rpc-errors"),u=e("@metamask/utils"),l=e("./methods/wallet-get-calls-status"),d=e("./methods/wallet-get-capabilities"),m=e("./methods/wallet-send-calls"),p=e("./utils/common"),h=e("./utils/normalize"),f=e("./utils/validation");function g(e){const{primaryType:t,types:r}=(0,h.parseTypedMessage)(e);if(!r)throw c.rpcErrors.invalidInput();if(!r[(0,p.stripArrayTypeIfPresent)(t)])throw c.rpcErrors.invalidInput()}function y(e){const{domain:{verifyingContract:t}={}}=(0,h.parseTypedMessage)(e);if(t&&"cosmos"!==t&&!(0,u.isValidHexAddress)(t))throw c.rpcErrors.invalidInput()}r.createWalletMiddleware=function({getAccounts:e,getCapabilities:t,getTransactionReceiptsByBatchId:r,processDecryptMessage:n,processEncryptionPublicKey:s,processPersonalMessage:a,processTransaction:u,processSignTransaction:p,processTypedMessage:b,processTypedMessageV3:k,processTypedMessageV4:w,processSendCalls:S}){if(!e)throw new Error("opts.getAccounts is required");return(0,o.createScaffoldMiddleware)({eth_accounts:(0,o.createAsyncMiddleware)((async function(t,r){r.result=await e(t)})),eth_coinbase:(0,o.createAsyncMiddleware)((async function(t,r){const n=await e(t);r.result=n[0]||null})),eth_sendTransaction:(0,o.createAsyncMiddleware)((async function(e,t){if(!u)throw c.rpcErrors.methodNotSupported();if(!(e.params&&Array.isArray(e.params)&&e.params.length>=1))throw c.rpcErrors.invalidInput();const r=e.params[0],n=Object.assign(Object.assign({},r),{from:await _((null==r?void 0:r.from)||"",e)});t.result=await u(n,e)})),eth_signTransaction:(0,o.createAsyncMiddleware)((async function(e,t){if(!p)throw c.rpcErrors.methodNotSupported();if(!(e.params&&Array.isArray(e.params)&&e.params.length>=1))throw c.rpcErrors.invalidInput();const r=e.params[0],n=Object.assign(Object.assign({},r),{from:await _((null==r?void 0:r.from)||"",e)});t.result=await p(n,e)})),eth_signTypedData:(0,o.createAsyncMiddleware)((async function(e,t){if(!b)throw c.rpcErrors.methodNotSupported();if(!((null==e?void 0:e.params)&&Array.isArray(e.params)&&e.params.length>=2))throw c.rpcErrors.invalidInput();const r=e.params,n=r[0],s=await _(r[1],e),a=r[2]||{},i=Object.assign(Object.assign({},a),{from:s,data:n,signatureMethod:"eth_signTypedData",version:"V1"});t.result=await b(i,e,"V1")})),eth_signTypedData_v3:(0,o.createAsyncMiddleware)((async function(e,t){if(!k)throw c.rpcErrors.methodNotSupported();if(!((null==e?void 0:e.params)&&Array.isArray(e.params)&&e.params.length>=2))throw c.rpcErrors.invalidInput();const r=e.params,n=await _(r[0],e),s=(0,h.normalizeTypedMessage)(r[1]);g(s),y(s);const a={data:s,from:n,version:"V3",signatureMethod:"eth_signTypedData_v3"};t.result=await k(a,e,"V3")})),eth_signTypedData_v4:(0,o.createAsyncMiddleware)((async function(e,t){if(!w)throw c.rpcErrors.methodNotSupported();if(!((null==e?void 0:e.params)&&Array.isArray(e.params)&&e.params.length>=2))throw c.rpcErrors.invalidInput();const r=e.params,n=await _(r[0],e),s=(0,h.normalizeTypedMessage)(r[1]);g(s),y(s);const a={data:s,from:n,version:"V4",signatureMethod:"eth_signTypedData_v4"};t.result=await w(a,e,"V4")})),personal_sign:(0,o.createAsyncMiddleware)((async function(e,t){if(!a)throw c.rpcErrors.methodNotSupported();if(!((null==e?void 0:e.params)&&Array.isArray(e.params)&&e.params.length>=2))throw c.rpcErrors.invalidInput();const r=e.params,n=r[0],s=r[1],i=r[2]||{};let o,u;if((0,f.resemblesAddress)(n)&&!(0,f.resemblesAddress)(s)){let e="The eth_personalSign method requires params ordered ";e+="[message, address]. This was previously handled incorrectly, ",e+="and has been corrected automatically. ",e+="Please switch this param order for smooth behavior in the future.",t.warning=e,o=n,u=s}else u=n,o=s;o=await _(o,e);const l=Object.assign(Object.assign({},i),{from:o,data:u,signatureMethod:"personal_sign"});t.result=await a(l,e)})),eth_getEncryptionPublicKey:(0,o.createAsyncMiddleware)((async function(e,t){if(!s)throw c.rpcErrors.methodNotSupported();if(!((null==e?void 0:e.params)&&Array.isArray(e.params)&&e.params.length>=1))throw c.rpcErrors.invalidInput();const r=e.params,n=await _(r[0],e);t.result=await s(n,e)})),eth_decrypt:(0,o.createAsyncMiddleware)((async function(e,t){if(!n)throw c.rpcErrors.methodNotSupported();if(!((null==e?void 0:e.params)&&Array.isArray(e.params)&&e.params.length>=1))throw c.rpcErrors.invalidInput();const r=e.params,s=r[0],a=await _(r[1],e),i=r[2]||{},o=Object.assign(Object.assign({},i),{from:a,data:s});t.result=await n(o,e)})),personal_ecRecover:(0,o.createAsyncMiddleware)((async function(e,t){if(!((null==e?void 0:e.params)&&Array.isArray(e.params)&&e.params.length>=2))throw c.rpcErrors.invalidInput();const r=e.params,n=r[0],s=r[1],a=i.recoverPersonalSignature({data:n,signature:s});t.result=a})),wallet_getCapabilities:(0,o.createAsyncMiddleware)((async(e,r)=>(0,d.walletGetCapabilities)(e,r,{getCapabilities:t}))),wallet_sendCalls:(0,o.createAsyncMiddleware)((async(t,r)=>(0,m.walletSendCalls)(t,r,{getAccounts:e,processSendCalls:S}))),wallet_getCallsStatus:(0,o.createAsyncMiddleware)((async(e,t)=>(0,l.walletGetCallsStatus)(e,t,{getTransactionReceiptsByBatchId:r})))});async function _(t,r){return(0,f.validateAndNormalizeKeyholder)(t,r,{getAccounts:e})}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/dist/wallet.js"}],[2261,{"./errors.cjs":2269,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.assertExhaustive=r.assertStruct=r.assert=r.AssertionError=void 0;const n=e("@metamask/superstruct"),s=e("./errors.cjs");function a(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class i extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}r.AssertionError=i,r.assert=function(e,t="Assertion failed.",r=i){if(!e){if(t instanceof Error)throw t;throw a(r,t)}},r.assertStruct=function(e,t,r="Assertion failed",o=i){try{(0,n.assert)(e,t)}catch(e){throw a(o,`${r}: ${function(e){return(0,s.getErrorMessage)(e).replace(/\.$/u,"")}(e)}.`)}},r.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/assert.cjs"}],[2262,{"./assert.cjs":2261,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.base64=void 0;const n=e("@metamask/superstruct"),s=e("./assert.cjs");r.base64=(e,t={})=>{const r=t.paddingRequired??!1,a=t.characterSet??"base64";let i,o;return"base64"===a?i=String.raw`[A-Za-z0-9+\/]`:((0,s.assert)("base64url"===a),i=String.raw`[-_A-Za-z0-9]`),o=r?new RegExp(`^(?:${i}{4})*(?:${i}{3}=|${i}{2}==)?$`,"u"):new RegExp(`^(?:${i}{4})*(?:${i}{2,3}|${i}{3}=|${i}{2}==)?$`,"u"),(0,n.pattern)(e,o)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/base64.cjs"}],[2263,{"./assert.cjs":2261,"./hex.cjs":2270,"@scure/base":3027,buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.createDataView=r.concatBytes=r.valueToBytes=r.base64ToBytes=r.stringToBytes=r.numberToBytes=r.signedBigIntToBytes=r.bigIntToBytes=r.hexToBytes=r.bytesToBase64=r.bytesToString=r.bytesToNumber=r.bytesToSignedBigInt=r.bytesToBigInt=r.bytesToHex=r.assertIsBytes=r.isBytes=void 0;const n=e("@scure/base"),s=e("./assert.cjs"),a=e("./hex.cjs"),i=48,o=58,c=87;const u=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function l(e){return e instanceof Uint8Array}function d(e){(0,s.assert)(l(e),"Value must be a Uint8Array.")}function m(e){if(d(e),0===e.length)return"0x";const t=u(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,a.add0x)(r.join(""))}function p(e){d(e);const t=m(e);return BigInt(t)}function h(e){if("0x"===e?.toLowerCase?.())return new Uint8Array;(0,a.assertIsHexString)(e);const t=(0,a.remove0x)(e).toLowerCase(),r=t.length%2==0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=r.charCodeAt(2*e),s=r.charCodeAt(2*e+1),a=t-(t<o?i:c),u=s-(s<o?i:c);n[e]=16*a+u}return n}function f(e){(0,s.assert)("bigint"==typeof e,"Value must be a bigint."),(0,s.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return h(e.toString(16))}function g(e){(0,s.assert)("number"==typeof e,"Value must be a number."),(0,s.assert)(e>=0,"Value must be a non-negative number."),(0,s.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return h(e.toString(16))}function y(e){return(0,s.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function b(e){if("bigint"==typeof e)return f(e);if("number"==typeof e)return g(e);if("string"==typeof e)return e.startsWith("0x")?h(e):y(e);if(l(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}r.isBytes=l,r.assertIsBytes=d,r.bytesToHex=m,r.bytesToBigInt=p,r.bytesToSignedBigInt=function(e){d(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},r.bytesToNumber=function(e){d(e);const t=p(e);return(0,s.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},r.bytesToString=function(e){return d(e),(new TextDecoder).decode(e)},r.bytesToBase64=function(e){return d(e),n.base64.encode(e)},r.hexToBytes=h,r.bigIntToBytes=f,r.signedBigIntToBytes=function(e,t){(0,s.assert)("bigint"==typeof e,"Value must be a bigint."),(0,s.assert)("number"==typeof t,"Byte length must be a number."),(0,s.assert)(t>0,"Byte length must be greater than 0."),(0,s.assert)(function(e,t){(0,s.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let e=0;e<n.length;e++)n[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},r.numberToBytes=g,r.stringToBytes=y,r.base64ToBytes=function(e){return(0,s.assert)("string"==typeof e,"Value must be a string."),n.base64.decode(e)},r.valueToBytes=b,r.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const s=b(e[n]);t[n]=s,r+=s.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},r.createDataView=function(e){if(void 0!==t&&e instanceof t){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/bytes.cjs"}],[2264,{"./superstruct.cjs":2279,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.toCaipAssetId=r.toCaipAssetType=r.toCaipAccountId=r.toCaipChainId=r.parseCaipAssetId=r.parseCaipAssetType=r.parseCaipAccountId=r.parseCaipChainId=r.isCaipAssetId=r.isCaipAssetType=r.isCaipTokenId=r.isCaipAssetReference=r.isCaipAssetNamespace=r.isCaipAccountAddress=r.isCaipAccountId=r.isCaipReference=r.isCaipNamespace=r.isCaipChainId=r.KnownCaipNamespace=r.CaipAssetTypeOrIdStruct=r.CaipAssetIdStruct=r.CaipAssetTypeStruct=r.CaipTokenIdStruct=r.CaipAssetReferenceStruct=r.CaipAssetNamespaceStruct=r.CaipAccountAddressStruct=r.CaipAccountIdStruct=r.CaipReferenceStruct=r.CaipNamespaceStruct=r.CaipChainIdStruct=r.CAIP_ASSET_ID_REGEX=r.CAIP_ASSET_TYPE_REGEX=r.CAIP_TOKEN_ID_REGEX=r.CAIP_ASSET_REFERENCE_REGEX=r.CAIP_ASSET_NAMESPACE_REGEX=r.CAIP_ACCOUNT_ADDRESS_REGEX=r.CAIP_ACCOUNT_ID_REGEX=r.CAIP_REFERENCE_REGEX=r.CAIP_NAMESPACE_REGEX=r.CAIP_CHAIN_ID_REGEX=void 0;const n=e("@metamask/superstruct"),s=e("./superstruct.cjs");r.CAIP_CHAIN_ID_REGEX=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,r.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,r.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,r.CAIP_ACCOUNT_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,r.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,r.CAIP_ASSET_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,r.CAIP_ASSET_REFERENCE_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,r.CAIP_TOKEN_ID_REGEX=/^[-.%a-zA-Z0-9]{1,78}$/u,r.CAIP_ASSET_TYPE_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,r.CAIP_ASSET_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u;function a(e){return(0,n.is)(e,r.CaipNamespaceStruct)}function i(e){return(0,n.is)(e,r.CaipReferenceStruct)}function o(e){return(0,n.is)(e,r.CaipAccountAddressStruct)}function c(e){return(0,n.is)(e,r.CaipAssetNamespaceStruct)}function u(e){return(0,n.is)(e,r.CaipAssetReferenceStruct)}function l(e){return(0,n.is)(e,r.CaipTokenIdStruct)}r.CaipChainIdStruct=(0,s.definePattern)("CaipChainId",r.CAIP_CHAIN_ID_REGEX),r.CaipNamespaceStruct=(0,s.definePattern)("CaipNamespace",r.CAIP_NAMESPACE_REGEX),r.CaipReferenceStruct=(0,s.definePattern)("CaipReference",r.CAIP_REFERENCE_REGEX),r.CaipAccountIdStruct=(0,s.definePattern)("CaipAccountId",r.CAIP_ACCOUNT_ID_REGEX),r.CaipAccountAddressStruct=(0,s.definePattern)("CaipAccountAddress",r.CAIP_ACCOUNT_ADDRESS_REGEX),r.CaipAssetNamespaceStruct=(0,s.definePattern)("CaipAssetNamespace",r.CAIP_ASSET_NAMESPACE_REGEX),r.CaipAssetReferenceStruct=(0,s.definePattern)("CaipAssetReference",r.CAIP_ASSET_REFERENCE_REGEX),r.CaipTokenIdStruct=(0,s.definePattern)("CaipTokenId",r.CAIP_TOKEN_ID_REGEX),r.CaipAssetTypeStruct=(0,s.definePattern)("CaipAssetType",r.CAIP_ASSET_TYPE_REGEX),r.CaipAssetIdStruct=(0,s.definePattern)("CaipAssetId",r.CAIP_ASSET_ID_REGEX),r.CaipAssetTypeOrIdStruct=(0,s.definePattern)("CaipAssetTypeOrId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u),function(e){e.Bip122="bip122",e.Solana="solana",e.Eip155="eip155",e.Wallet="wallet"}(r.KnownCaipNamespace||(r.KnownCaipNamespace={})),r.isCaipChainId=function(e){return(0,n.is)(e,r.CaipChainIdStruct)},r.isCaipNamespace=a,r.isCaipReference=i,r.isCaipAccountId=function(e){return(0,n.is)(e,r.CaipAccountIdStruct)},r.isCaipAccountAddress=o,r.isCaipAssetNamespace=c,r.isCaipAssetReference=u,r.isCaipTokenId=l,r.isCaipAssetType=function(e){return(0,n.is)(e,r.CaipAssetTypeStruct)},r.isCaipAssetId=function(e){return(0,n.is)(e,r.CaipAssetIdStruct)},r.parseCaipChainId=function(e){const t=r.CAIP_CHAIN_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}},r.parseCaipAccountId=function(e){const t=r.CAIP_ACCOUNT_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.parseCaipAssetType=function(e){const t=r.CAIP_ASSET_TYPE_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP asset type.");return{assetNamespace:t.groups.assetNamespace,assetReference:t.groups.assetReference,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.parseCaipAssetId=function(e){const t=r.CAIP_ASSET_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP asset ID.");return{assetNamespace:t.groups.assetNamespace,assetReference:t.groups.assetReference,tokenId:t.groups.tokenId,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.toCaipChainId=function(e,t){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);return`${e}:${t}`},r.toCaipAccountId=function(e,t,n){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);if(!o(n))throw new Error(`Invalid "accountAddress", must match: ${r.CAIP_ACCOUNT_ADDRESS_REGEX.toString()}`);return`${e}:${t}:${n}`},r.toCaipAssetType=function(e,t,n,s){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);if(!c(n))throw new Error(`Invalid "assetNamespace", must match: ${r.CAIP_ASSET_NAMESPACE_REGEX.toString()}`);if(!u(s))throw new Error(`Invalid "assetReference", must match: ${r.CAIP_ASSET_REFERENCE_REGEX.toString()}`);return`${e}:${t}/${n}:${s}`},r.toCaipAssetId=function(e,t,n,s,o){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);if(!c(n))throw new Error(`Invalid "assetNamespace", must match: ${r.CAIP_ASSET_NAMESPACE_REGEX.toString()}`);if(!u(s))throw new Error(`Invalid "assetReference", must match: ${r.CAIP_ASSET_REFERENCE_REGEX.toString()}`);if(!l(o))throw new Error(`Invalid "tokenId", must match: ${r.CAIP_TOKEN_ID_REGEX.toString()}`);return`${e}:${t}/${n}:${s}/${o}`}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/caip-types.cjs"}],[2265,{"./base64.cjs":2262,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ChecksumStruct=void 0;const n=e("@metamask/superstruct"),s=e("./base64.cjs");r.ChecksumStruct=(0,n.size)((0,s.base64)((0,n.string)(),{paddingRequired:!0}),44,44)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/checksum.cjs"}],[2266,{"./assert.cjs":2261,"./bytes.cjs":2263,"./hex.cjs":2270,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createHex=r.createBytes=r.createBigInt=r.createNumber=void 0;const n=e("@metamask/superstruct"),s=e("./assert.cjs"),a=e("./bytes.cjs"),i=e("./hex.cjs"),o=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),i.StrictHexStruct]),c=(0,n.coerce)((0,n.number)(),o,Number),u=(0,n.coerce)((0,n.bigint)(),o,BigInt),l=((0,n.union)([i.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([i.StrictHexStruct]),a.hexToBytes)),d=(0,n.coerce)(i.StrictHexStruct,(0,n.instance)(Uint8Array),a.bytesToHex);r.createNumber=function(e){try{const t=(0,n.create)(e,c);return(0,s.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},r.createBigInt=function(e){try{return(0,n.create)(e,u)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},r.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,n.create)(e,l)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},r.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,n.create)(e,d)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/coercers.cjs"}],[2267,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r};Object.defineProperty(r,"__esModule",{value:!0}),r.FrozenSet=r.FrozenMap=void 0;class o{get size(){return a(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return a(this,n,"f")[Symbol.iterator]()}constructor(e){n.set(this,void 0),i(this,n,new Map(e),"f"),Object.freeze(this)}entries(){return a(this,n,"f").entries()}forEach(e,t){return a(this,n,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}get(e){return a(this,n,"f").get(e)}has(e){return a(this,n,"f").has(e)}keys(){return a(this,n,"f").keys()}values(){return a(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}r.FrozenMap=o;class c{get size(){return a(this,s,"f").size}[(s=new WeakMap,Symbol.iterator)](){return a(this,s,"f")[Symbol.iterator]()}constructor(e){s.set(this,void 0),i(this,s,new Set(e),"f"),Object.freeze(this)}entries(){return a(this,s,"f").entries()}forEach(e,t){return a(this,s,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}has(e){return a(this,s,"f").has(e)}keys(){return a(this,s,"f").keys()}values(){return a(this,s,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}r.FrozenSet=c,Object.freeze(o),Object.freeze(o.prototype),Object.freeze(c),Object.freeze(c.prototype)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/collections.cjs"}],[2268,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/encryption-types.cjs"}],[2269,{"./misc.cjs":2275,"pony-cause":5003},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.wrapError=r.getErrorMessage=r.isErrorWithStack=r.isErrorWithMessage=r.isErrorWithCode=void 0;const n=e("pony-cause"),s=e("./misc.cjs");function a(e){return"object"==typeof e&&null!==e&&"code"in e}function i(e){return"object"==typeof e&&null!==e&&"message"in e}r.isErrorWithCode=a,r.isErrorWithMessage=i,r.isErrorWithStack=function(e){return"object"==typeof e&&null!==e&&"stack"in e},r.getErrorMessage=function(e){return i(e)&&"string"==typeof e.message?e.message:(0,s.isNullOrUndefined)(e)?"":String(e)},r.wrapError=function(e,t){if((r=e)instanceof Error||(0,s.isObject)(r)&&"Error"===r.constructor.name){let r;return r=2===Error.length?new Error(t,{cause:e}):new n.ErrorWithCause(t,{cause:e}),a(e)&&(r.code=e.code),r}var r;return t.length>0?new Error(`${String(e)}: ${t}`):new Error(String(e))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/errors.cjs"}],[2270,{"./assert.cjs":2261,"./bytes.cjs":2263,"@metamask/superstruct":2872,"@noble/hashes/sha3":3001},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.remove0x=r.add0x=r.isValidChecksumAddress=r.getChecksumAddress=r.isValidHexAddress=r.assertIsStrictHexString=r.assertIsHexString=r.isStrictHexString=r.isHexString=r.HexChecksumAddressStruct=r.HexAddressStruct=r.StrictHexStruct=r.HexStruct=void 0;const n=e("@metamask/superstruct"),s=e("@noble/hashes/sha3"),a=e("./assert.cjs"),i=e("./bytes.cjs");function o(e){return(0,n.is)(e,r.HexStruct)}function c(e){return(0,n.is)(e,r.StrictHexStruct)}function u(e){(0,a.assert)((0,n.is)(e,r.HexChecksumAddressStruct),"Invalid hex address.");const t=d(e.toLowerCase()),o=d((0,i.bytesToHex)((0,s.keccak_256)(t)));return`0x${t.split("").map(((e,t)=>{const r=o[t];return(0,a.assert)((0,n.is)(r,(0,n.string)()),"Hash shorter than address."),parseInt(r,16)>7?e.toUpperCase():e})).join("")}`}function l(e){return!!(0,n.is)(e,r.HexChecksumAddressStruct)&&u(e)===e}function d(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}r.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),r.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu),r.HexAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]{40}$/u),r.HexChecksumAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-fA-F]{40}$/u),r.isHexString=o,r.isStrictHexString=c,r.assertIsHexString=function(e){(0,a.assert)(o(e),"Value must be a hexadecimal string.")},r.assertIsStrictHexString=function(e){(0,a.assert)(c(e),'Value must be a hexadecimal string, starting with "0x".')},r.isValidHexAddress=function(e){return(0,n.is)(e,r.HexAddressStruct)||l(e)},r.getChecksumAddress=u,r.isValidChecksumAddress=l,r.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},r.remove0x=d}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/hex.cjs"}],[2271,{"./assert.cjs":2261,"./base64.cjs":2262,"./bytes.cjs":2263,"./caip-types.cjs":2264,"./checksum.cjs":2265,"./coercers.cjs":2266,"./collections.cjs":2267,"./encryption-types.cjs":2268,"./errors.cjs":2269,"./hex.cjs":2270,"./json.cjs":2272,"./keyring.cjs":2273,"./logging.cjs":2274,"./misc.cjs":2275,"./number.cjs":2276,"./opaque.cjs":2277,"./promise.cjs":2278,"./superstruct.cjs":2279,"./time.cjs":2280,"./transaction-types.cjs":2281,"./versions.cjs":2282},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./assert.cjs"),r),s(e("./base64.cjs"),r),s(e("./bytes.cjs"),r),s(e("./caip-types.cjs"),r),s(e("./checksum.cjs"),r),s(e("./coercers.cjs"),r),s(e("./collections.cjs"),r),s(e("./encryption-types.cjs"),r),s(e("./errors.cjs"),r),s(e("./hex.cjs"),r),s(e("./json.cjs"),r),s(e("./keyring.cjs"),r),s(e("./logging.cjs"),r),s(e("./misc.cjs"),r),s(e("./number.cjs"),r),s(e("./opaque.cjs"),r),s(e("./promise.cjs"),r),s(e("./superstruct.cjs"),r),s(e("./time.cjs"),r),s(e("./transaction-types.cjs"),r),s(e("./versions.cjs"),r)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/index.cjs"}],[2272,{"./assert.cjs":2261,"./misc.cjs":2275,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getJsonRpcIdValidator=r.assertIsJsonRpcError=r.isJsonRpcError=r.assertIsJsonRpcFailure=r.isJsonRpcFailure=r.assertIsJsonRpcSuccess=r.isJsonRpcSuccess=r.assertIsJsonRpcResponse=r.isJsonRpcResponse=r.assertIsPendingJsonRpcResponse=r.isPendingJsonRpcResponse=r.JsonRpcResponseStruct=r.JsonRpcFailureStruct=r.JsonRpcSuccessStruct=r.PendingJsonRpcResponseStruct=r.assertIsJsonRpcRequest=r.isJsonRpcRequest=r.assertIsJsonRpcNotification=r.isJsonRpcNotification=r.JsonRpcNotificationStruct=r.JsonRpcRequestStruct=r.JsonRpcParamsStruct=r.JsonRpcErrorStruct=r.JsonRpcIdStruct=r.JsonRpcVersionStruct=r.jsonrpc2=r.getJsonSize=r.getSafeJson=r.isValidJson=r.JsonStruct=r.UnsafeJsonStruct=r.exactOptional=r.object=void 0;const n=e("@metamask/superstruct"),s=e("./assert.cjs"),a=e("./misc.cjs");function i({path:e,branch:t}){const r=e[e.length-1];return(0,a.hasProperty)(t[t.length-2],r)}function o(e){return new n.Struct({...e,type:`optional ${e.type}`,validator:(t,r)=>!i(r)||e.validator(t,r),refiner:(t,r)=>!i(r)||e.refiner(t,r)})}function c(e){if(null===e||"boolean"==typeof e||"string"==typeof e)return!0;if("number"==typeof e&&Number.isFinite(e))return!0;if("object"==typeof e){let t=!0;if(Array.isArray(e)){for(let r=0;r<e.length;r++)if(!c(e[r])){t=!1;break}return t}const r=Object.entries(e);for(let e=0;e<r.length;e++)if("string"!=typeof r[e][0]||!c(r[e][1])){t=!1;break}return t}return!1}function u(e){return(0,n.create)(e,r.JsonStruct)}r.object=e=>(0,n.object)(e),r.exactOptional=o,r.UnsafeJsonStruct=(0,n.define)("JSON",(e=>c(e))),r.JsonStruct=(0,n.coerce)(r.UnsafeJsonStruct,(0,n.refine)((0,n.any)(),"JSON",(e=>(0,n.is)(e,r.UnsafeJsonStruct))),(e=>JSON.parse(JSON.stringify(e,((e,t)=>"__proto__"===e||"constructor"===e?undefined:t))))),r.isValidJson=function(e){try{return u(e),!0}catch{return!1}},r.getSafeJson=u,r.getJsonSize=function(e){(0,s.assertStruct)(e,r.JsonStruct,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},r.jsonrpc2="2.0",r.JsonRpcVersionStruct=(0,n.literal)(r.jsonrpc2),r.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),r.JsonRpcErrorStruct=(0,r.object)({code:(0,n.integer)(),message:(0,n.string)(),data:o(r.JsonStruct),stack:o((0,n.string)())}),r.JsonRpcParamsStruct=(0,n.union)([(0,n.record)((0,n.string)(),r.JsonStruct),(0,n.array)(r.JsonStruct)]),r.JsonRpcRequestStruct=(0,r.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,method:(0,n.string)(),params:o(r.JsonRpcParamsStruct)}),r.JsonRpcNotificationStruct=(0,r.object)({jsonrpc:r.JsonRpcVersionStruct,method:(0,n.string)(),params:o(r.JsonRpcParamsStruct)}),r.isJsonRpcNotification=function(e){return(0,n.is)(e,r.JsonRpcNotificationStruct)},r.assertIsJsonRpcNotification=function(e,t){(0,s.assertStruct)(e,r.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",t)},r.isJsonRpcRequest=function(e){return(0,n.is)(e,r.JsonRpcRequestStruct)},r.assertIsJsonRpcRequest=function(e,t){(0,s.assertStruct)(e,r.JsonRpcRequestStruct,"Invalid JSON-RPC request",t)},r.PendingJsonRpcResponseStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(r.JsonRpcErrorStruct)}),r.JsonRpcSuccessStruct=(0,r.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:r.JsonStruct}),r.JsonRpcFailureStruct=(0,r.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,error:r.JsonRpcErrorStruct}),r.JsonRpcResponseStruct=(0,n.union)([r.JsonRpcSuccessStruct,r.JsonRpcFailureStruct]),r.isPendingJsonRpcResponse=function(e){return(0,n.is)(e,r.PendingJsonRpcResponseStruct)},r.assertIsPendingJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",t)},r.isJsonRpcResponse=function(e){return(0,n.is)(e,r.JsonRpcResponseStruct)},r.assertIsJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.JsonRpcResponseStruct,"Invalid JSON-RPC response",t)},r.isJsonRpcSuccess=function(e){return(0,n.is)(e,r.JsonRpcSuccessStruct)},r.assertIsJsonRpcSuccess=function(e,t){(0,s.assertStruct)(e,r.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",t)},r.isJsonRpcFailure=function(e){return(0,n.is)(e,r.JsonRpcFailureStruct)},r.assertIsJsonRpcFailure=function(e,t){(0,s.assertStruct)(e,r.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",t)},r.isJsonRpcError=function(e){return(0,n.is)(e,r.JsonRpcErrorStruct)},r.assertIsJsonRpcError=function(e,t){(0,s.assertStruct)(e,r.JsonRpcErrorStruct,"Invalid JSON-RPC error",t)},r.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/json.cjs"}],[2273,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/keyring.cjs"}],[2274,{debug:4226},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createModuleLogger=r.createProjectLogger=void 0;const s=(0,n(e("debug")).default)("metamask");r.createProjectLogger=function(e){return s.extend(e)},r.createModuleLogger=function(e,t){return e.extend(t)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/logging.cjs"}],[2275,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.calculateNumberSize=r.calculateStringSize=r.isASCII=r.isPlainObject=r.ESCAPE_CHARACTERS_REGEXP=r.JsonSize=r.getKnownPropertyNames=r.hasProperty=r.isObject=r.isNullOrUndefined=r.isNonEmptyArray=void 0,r.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},r.isNullOrUndefined=function(e){return null===e||e===undefined},r.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};function n(e){return e.charCodeAt(0)<=127}r.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),r.getKnownPropertyNames=function(e){return Object.getOwnPropertyNames(e)},function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(r.JsonSize||(r.JsonSize={})),r.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,r.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},r.isASCII=n,r.calculateStringSize=function(e){return e.split("").reduce(((e,t)=>n(t)?e+1:e+2),0)+(e.match(r.ESCAPE_CHARACTERS_REGEXP)??[]).length},r.calculateNumberSize=function(e){return e.toString().length}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/misc.cjs"}],[2276,{"./assert.cjs":2261,"./hex.cjs":2270},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.hexToBigInt=r.hexToNumber=r.bigIntToHex=r.numberToHex=void 0;const n=e("./assert.cjs"),s=e("./hex.cjs");r.numberToHex=e=>((0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,s.add0x)(e.toString(16)));r.bigIntToHex=e=>((0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=0,"Value must be a non-negative bigint."),(0,s.add0x)(e.toString(16)));r.hexToNumber=e=>{(0,s.assertIsHexString)(e);const t=parseInt(e,16);return(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};r.hexToBigInt=e=>((0,s.assertIsHexString)(e),BigInt((0,s.add0x)(e)))}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/number.cjs"}],[2277,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/opaque.cjs"}],[2278,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createDeferredPromise=void 0,r.createDeferredPromise=function({suppressUnhandledRejection:e=!1}={}){let t,r;const n=new Promise(((e,n)=>{t=e,r=n}));return e&&n.catch((e=>{})),{promise:n,resolve:t,reject:r}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/promise.cjs"}],[2279,{"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.definePattern=void 0;const n=e("@metamask/superstruct");r.definePattern=function(e,t){return(0,n.define)(e,(e=>"string"==typeof e&&t.test(e)))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/superstruct.cjs"}],[2280,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.timeSince=r.inMilliseconds=r.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(r.Duration||(r.Duration={}));const n=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};r.inMilliseconds=function(e,t){return n(e,"count"),e*t},r.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/time.cjs"}],[2281,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/transaction-types.cjs"}],[2282,{"./assert.cjs":2261,"@metamask/superstruct":2872,semver:5547},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.satisfiesVersionRange=r.gtRange=r.gtVersion=r.assertIsSemVerRange=r.assertIsSemVerVersion=r.isValidSemVerRange=r.isValidSemVerVersion=r.VersionRangeStruct=r.VersionStruct=void 0;const n=e("@metamask/superstruct"),s=e("semver"),a=e("./assert.cjs");r.VersionStruct=(0,n.refine)((0,n.string)(),"Version",(e=>null!==(0,s.valid)(e)||`Expected SemVer version, got "${e}"`)),r.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",(e=>null!==(0,s.validRange)(e)||`Expected SemVer range, got "${e}"`)),r.isValidSemVerVersion=function(e){return(0,n.is)(e,r.VersionStruct)},r.isValidSemVerRange=function(e){return(0,n.is)(e,r.VersionRangeStruct)},r.assertIsSemVerVersion=function(e){(0,a.assertStruct)(e,r.VersionStruct)},r.assertIsSemVerRange=function(e){(0,a.assertStruct)(e,r.VersionRangeStruct)},r.gtVersion=function(e,t){return(0,s.gt)(e,t)},r.gtRange=function(e,t){return(0,s.gtr)(e,t)},r.satisfiesVersionRange=function(e,t){return(0,s.satisfies)(e,t,{includePrerelease:!0})}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-json-rpc-middleware/node_modules/@metamask/utils/dist/versions.cjs"}],[2283,{"./utils":2288,"@scure/base":3027,buffer:4074,tweetnacl:5616},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.getEncryptionPublicKey=r.decryptSafely=r.decrypt=r.encryptSafely=r.encrypt=void 0;const i=e("@scure/base"),o=a(e("tweetnacl")),c=e("./utils");function u({publicKey:e,data:t,version:r}){if((0,c.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,c.isNullish)(t))throw new Error("Missing data parameter");if((0,c.isNullish)(r))throw new Error("Missing version parameter");if("x25519-xsalsa20-poly1305"===r){if("string"!=typeof t)throw new Error("Message data must be given as a string");const r=o.box.keyPair();let n;try{n=i.base64.decode(e)}catch(e){throw new Error("Bad public key")}const s=i.utf8.decode(t),a=o.randomBytes(o.box.nonceLength),c=o.box(s,a,n,r.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:i.base64.encode(a),ephemPublicKey:i.base64.encode(r.publicKey),ciphertext:i.base64.encode(c)}}throw new Error("Encryption type/version not supported")}function l({encryptedData:e,privateKey:r}){if((0,c.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,c.isNullish)(r))throw new Error("Missing privateKey parameter");if("x25519-xsalsa20-poly1305"===e.version){const n=t.from(r,"hex"),s=o.box.keyPair.fromSecretKey(n).secretKey,a=i.base64.decode(e.nonce),c=i.base64.decode(e.ciphertext),u=i.base64.decode(e.ephemPublicKey),l=o.box.open(c,a,u,s);try{if(!l)throw new Error;const e=i.utf8.encode(l);if(!e)throw new Error;return e}catch(e){if(e&&"string"==typeof e.message&&e.message.length)throw new Error(`Decryption failed: ${e.message}`);throw new Error("Decryption failed.")}}throw new Error("Encryption type/version not supported.")}r.encrypt=u,r.encryptSafely=function({publicKey:e,data:r,version:n}){if((0,c.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,c.isNullish)(r))throw new Error("Missing data parameter");if((0,c.isNullish)(n))throw new Error("Missing version parameter");if("object"==typeof r&&r&&"toJSON"in r)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const s={data:r,padding:""},a=t.byteLength(JSON.stringify(s),"utf-8")%2048;let i=0;return a>0&&(i=2048-a-16),s.padding="0".repeat(i),u({publicKey:e,data:JSON.stringify(s),version:n})},r.decrypt=l,r.decryptSafely=function({encryptedData:e,privateKey:t}){if((0,c.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,c.isNullish)(t))throw new Error("Missing privateKey parameter");return JSON.parse(l({encryptedData:e,privateKey:t})).data},r.getEncryptionPublicKey=function(e){const r=t.from(e,"hex"),n=o.box.keyPair.fromSecretKey(r).publicKey;return i.base64.encode(n)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/dist/encryption.js"}],[2284,{"./encryption":2283,"./personal-sign":2285,"./sign-eip7702-authorization":2286,"./sign-typed-data":2287,"./utils":2288},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.normalize=r.concatSig=void 0,s(e("./personal-sign"),r),s(e("./sign-typed-data"),r),s(e("./encryption"),r),s(e("./sign-eip7702-authorization"),r);var a=e("./utils");Object.defineProperty(r,"concatSig",{enumerable:!0,get:function(){return a.concatSig}}),Object.defineProperty(r,"normalize",{enumerable:!0,get:function(){return a.normalize}})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/dist/index.js"}],[2285,{"./utils":2288,"@ethereumjs/util":2186},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.extractPublicKey=r.recoverPersonalSignature=r.personalSign=void 0;const n=e("@ethereumjs/util"),s=e("./utils");function a(e,t){const r=(0,n.hashPersonalMessage)((0,s.legacyToBuffer)(e));return(0,s.recoverPublicKey)(r,t)}r.personalSign=function({privateKey:e,data:t}){if((0,s.isNullish)(t))throw new Error("Missing data parameter");if((0,s.isNullish)(e))throw new Error("Missing privateKey parameter");const r=(0,s.legacyToBuffer)(t),a=(0,n.hashPersonalMessage)(r),i=(0,n.ecsign)(a,e);return(0,s.concatSig)((0,n.toBuffer)(i.v),i.r,i.s)},r.recoverPersonalSignature=function({data:e,signature:t}){if((0,s.isNullish)(e))throw new Error("Missing data parameter");if((0,s.isNullish)(t))throw new Error("Missing signature parameter");const r=a(e,t),i=(0,n.publicToAddress)(r);return(0,n.bufferToHex)(i)},r.extractPublicKey=function({data:e,signature:t}){if((0,s.isNullish)(e))throw new Error("Missing data parameter");if((0,s.isNullish)(t))throw new Error("Missing signature parameter");return`0x${a(e,t).toString("hex")}`}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/dist/personal-sign.js"}],[2286,{"./utils":2288,"@ethereumjs/rlp":429,"@ethereumjs/util":2186,"@metamask/utils":2299,buffer:4074,"ethereum-cryptography/keccak":4300},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.hashEIP7702Authorization=r.recoverEIP7702Authorization=r.signEIP7702Authorization=void 0;const n=e("@ethereumjs/rlp"),s=e("@ethereumjs/util"),a=e("@metamask/utils"),i=e("ethereum-cryptography/keccak"),o=e("./utils");function c(e){u(e);const r=(0,n.encode)(e),s=t.concat([t.from("05","hex"),r]);return t.from((0,i.keccak256)(s))}function u(e){if((0,o.isNullish)(e))throw new Error("Missing authorization parameter");const[t,r,n]=e;if((0,o.isNullish)(t))throw new Error("Missing chainId parameter");if((0,o.isNullish)(r))throw new Error("Missing contractAddress parameter");if((0,o.isNullish)(n))throw new Error("Missing nonce parameter")}r.signEIP7702Authorization=function({privateKey:e,authorization:t}){if(u(t),(0,o.isNullish)(e))throw new Error("Missing privateKey parameter");const r=c(t),{r:n,s:a,v:i}=(0,s.ecsign)(r,e),l=(0,s.toBuffer)(i);return(0,o.concatSig)(l,n,a)},r.recoverEIP7702Authorization=function({signature:e,authorization:t}){if(u(t),(0,o.isNullish)(e))throw new Error("Missing signature parameter");const r=c(t),n=(0,o.recoverPublicKey)(r,e),i=(0,s.publicToAddress)(n);return(0,a.bytesToHex)(i)},r.hashEIP7702Authorization=c}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/dist/sign-eip7702-authorization.js"}],[2287,{"./utils":2288,"@ethereumjs/util":2186,"@metamask/abi-utils":2196,"@metamask/abi-utils/dist/parsers":2205,"@metamask/abi-utils/dist/utils":2213,"@metamask/utils":2299,"ethereum-cryptography/keccak":4300},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.recoverTypedSignature=r.signTypedData=r.typedSignatureHash=r.TypedDataUtils=r.TYPED_MESSAGE_SCHEMA=r.SignTypedDataVersion=void 0;const n=e("@ethereumjs/util"),s=e("@metamask/abi-utils"),a=e("@metamask/abi-utils/dist/parsers"),i=e("@metamask/abi-utils/dist/utils"),o=e("@metamask/utils"),c=e("ethereum-cryptography/keccak"),u=e("./utils");var l;function d(e,t){if(!Object.keys(l).includes(e))throw new Error(`Invalid version: '${e}'`);if(t&&!t.includes(e))throw new Error(`SignTypedDataVersion not allowed: '${e}'. Allowed versions are: ${t.join(", ")}`)}function m(e,t){(0,o.assert)(null!==t,`Unable to encode value: Invalid number. Expected a valid number value, but received "${t}".`);const r=BigInt(t),n=(0,a.getLength)(e),s=BigInt(2)**BigInt(n)-BigInt(1);return(0,o.assert)(r>=-s&&r<=s,`Unable to encode value: Number "${t}" is out of range for type "${e}".`),r}function p(e){let t=BigInt(0);for(let r=0;r<e.length;r++){const n=BigInt(e.charCodeAt(r)-48);t*=BigInt(10),t+=n>=49?n-BigInt(49)+BigInt(10):n>=17?n-BigInt(17)+BigInt(10):n}return(0,i.padStart)((0,o.bigIntToBytes)(t),20)}function h(e,t,r,a,u){if(d(u,[l.V3,l.V4]),e[r]!==undefined)return["bytes32",u===l.V4&&null==a?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,n.arrToBufArr)((0,c.keccak256)(f(r,a,e,u)))];if("function"===r)throw new Error('Unsupported or invalid type: "function"');if(a===undefined)throw new Error(`missing value for field ${t} of type ${r}`);if("address"===r){if("number"==typeof a)return["address",(0,i.padStart)((0,o.numberToBytes)(a),20)];if((0,o.isStrictHexString)(a))return["address",(0,o.add0x)(a)];if("string"==typeof a)return["address",p(a).subarray(0,20)]}if("bool"===r)return["bool",Boolean(a)];if("bytes"===r)return"number"==typeof a?a=(0,o.numberToBytes)(a):(0,o.isStrictHexString)(a)||"0x"===a?a=(0,o.hexToBytes)(a):"string"==typeof a&&(a=(0,o.stringToBytes)(a)),["bytes32",(0,n.arrToBufArr)((0,c.keccak256)(a))];if(r.startsWith("bytes")&&"bytes"!==r&&!r.includes("["))return"number"==typeof a?a<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,o.bigIntToBytes)(BigInt(a))]:(0,o.isStrictHexString)(a)?["bytes32",(0,o.hexToBytes)(a)]:["bytes32",a];if(r.startsWith("int")&&!r.includes("[")){const e=m(r,a);return e>=BigInt(0)?["uint256",e]:["int256",e]}if("string"===r)return a="number"==typeof a?(0,o.numberToBytes)(a):(0,o.stringToBytes)(null!=a?a:""),["bytes32",(0,n.arrToBufArr)((0,c.keccak256)(a))];if(r.endsWith("]")){if(u===l.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const i=r.slice(0,r.lastIndexOf("[")),o=a.map((r=>h(e,t,i,r,u)));return["bytes32",(0,n.arrToBufArr)((0,c.keccak256)((0,s.encode)(o.map((([e])=>e)),o.map((([,e])=>e)))))]}return[r,a]}function f(e,t,r,a){d(a,[l.V3,l.V4]);const i=["bytes32"],o=[k(e,r)];for(const n of r[e]){if(a===l.V3&&t[n.name]===undefined)continue;const[e,s]=h(r,n.name,n.type,t[n.name],a);i.push(e),o.push(s)}return(0,n.arrToBufArr)((0,s.encode)(i,o))}function g(e,t){let r="";const n=y(e,t);n.delete(e);const s=[e,...Array.from(n).sort()];for(const e of s){if(!t[e])throw new Error(`No type definition specified: ${e}`);r+=`${e}(${t[e].map((({name:e,type:t})=>`${t} ${e}`)).join(",")})`}return r}function y(e,t,r=new Set){if("string"!=typeof e)throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(e)}`);const n=e.match(/^\w*/u);if([e]=n,r.has(e)||t[e]===undefined)return r;r.add(e);for(const n of t[e])y(n.type,t,r);return r}function b(e,t,r,s){d(s,[l.V3,l.V4]);const a=f(e,t,r,s),i=(0,c.keccak256)(a);return(0,n.arrToBufArr)(i)}function k(e,t){const r=(0,o.stringToBytes)(g(e,t));return(0,n.arrToBufArr)((0,c.keccak256)(r))}function w(e){const t={};for(const n in r.TYPED_MESSAGE_SCHEMA.properties)e[n]&&(t[n]=e[n]);return"types"in t&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t}function S(e,t){d(t,[l.V3,l.V4]);const r=w(e),{domain:n}=r;return b("EIP712Domain",n,{EIP712Domain:r.types.EIP712Domain},t)}function _(e,t){if((0,a.isArrayType)(e)&&Array.isArray(t)){const[r]=(0,a.getArrayType)(e);return t.map((e=>_(r,e)))}if("address"===e){if((0,o.isStrictHexString)(t))return(0,i.padStart)((0,o.hexToBytes)(t).subarray(0,20),20);if(t instanceof Uint8Array)return(0,i.padStart)(t.subarray(0,20),20)}if("bool"===e)return Boolean(t);if(e.startsWith("bytes")&&"bytes"!==e){const r=(0,a.getByteLength)(e);if("number"==typeof t)return t<0?new Uint8Array:(0,o.numberToBytes)(t).subarray(0,r);if((0,o.isStrictHexString)(t))return(0,o.hexToBytes)(t).subarray(0,r);if(t instanceof Uint8Array)return t.subarray(0,r)}if(e.startsWith("uint")&&"number"==typeof t)return Math.abs(t);if(e.startsWith("int")&&"number"==typeof t){const r=(0,a.getLength)(e);return BigInt.asIntN(r,BigInt(t))}return t}function v(e,t){return t.map((t=>{if("string"==typeof t||"number"==typeof t||"bigint"==typeof t){const r=m(e,t);if(r>=BigInt(0))return(0,i.padStart)((0,o.bigIntToBytes)(r),32);const n=(0,a.getLength)(e),s=BigInt.asIntN(n,r);return(0,o.signedBigIntToBytes)(s,32)}return t}))}function E(e){const t=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!("length"in e)||!e.length)throw t;const r=e.map((({name:e,type:t,value:r})=>{if("address[]"===t)return{name:e,type:"bytes32[]",value:(n=r,n.map((e=>"number"==typeof e?(0,i.padStart)((0,o.numberToBytes)(e),32):(0,o.isStrictHexString)(e)?(0,i.padStart)((0,o.hexToBytes)(e).subarray(0,32),32):e instanceof Uint8Array?(0,i.padStart)(e.subarray(0,32),32):e)))};var n;if(t.startsWith("int")&&(0,a.isArrayType)(t)){const[n,s]=(0,a.getArrayType)(t);return{name:e,type:`bytes32[${null!=s?s:""}]`,value:v(n,r)}}return{name:e,type:t,value:_(t,r)}})),l=r.map((e=>"bytes"!==e.type?e.value:(0,u.legacyToBuffer)(e.value))),d=r.map((e=>{if("function"===e.type)throw new Error('Unsupported or invalid type: "function"');return e.type})),m=e.map((e=>{if(!e.name)throw t;return`${e.type} ${e.name}`}));return(0,n.arrToBufArr)((0,c.keccak256)((0,s.encodePacked)(["bytes32","bytes32"],[(0,c.keccak256)((0,s.encodePacked)(["string[]"],[m],!0)),(0,c.keccak256)((0,s.encodePacked)(d,l,!0))])))}!function(e){e.V1="V1",e.V3="V3",e.V4="V4"}(l=r.SignTypedDataVersion||(r.SignTypedDataVersion={})),r.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},r.TypedDataUtils={encodeData:f,encodeType:g,findTypeDependencies:y,hashStruct:b,hashType:k,sanitizeData:w,eip712Hash:function(e,t){d(t,[l.V3,l.V4]);const r=w(e),s=[(0,o.hexToBytes)("1901")];return s.push(S(e,t)),"EIP712Domain"!==r.primaryType&&s.push(b(r.primaryType,r.message,r.types,t)),(0,n.arrToBufArr)((0,c.keccak256)((0,o.concatBytes)(s)))},eip712DomainHash:S},r.typedSignatureHash=function(e){const t=E(e);return(0,o.bytesToHex)(t)},r.signTypedData=function({privateKey:e,data:t,version:s}){if(d(s),(0,u.isNullish)(t))throw new Error("Missing data parameter");if((0,u.isNullish)(e))throw new Error("Missing private key parameter");const a=s===l.V1?E(t):r.TypedDataUtils.eip712Hash(t,s),i=(0,n.ecsign)(a,e);return(0,u.concatSig)((0,n.arrToBufArr)((0,o.bigIntToBytes)(i.v)),i.r,i.s)},r.recoverTypedSignature=function({data:e,signature:t,version:s}){if(d(s),(0,u.isNullish)(e))throw new Error("Missing data parameter");if((0,u.isNullish)(t))throw new Error("Missing signature parameter");const a=s===l.V1?E(e):r.TypedDataUtils.eip712Hash(e,s),i=(0,u.recoverPublicKey)(a,t),c=(0,n.publicToAddress)(i);return(0,o.bytesToHex)(c)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/dist/sign-typed-data.js"}],[2288,{"@ethereumjs/util":2186,"@metamask/utils":2299,buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.normalize=r.recoverPublicKey=r.concatSig=r.legacyToBuffer=r.isNullish=r.padWithZeroes=void 0;const n=e("@ethereumjs/util"),s=e("@metamask/utils");function a(e,t){if(""!==e&&!/^[a-f0-9]+$/iu.test(e))throw new Error(`Expected an unprefixed hex string. Received: ${e}`);if(t<0)throw new Error(`Expected a non-negative integer target length. Received: ${t}`);return String.prototype.padStart.call(e,t,"0")}function i(e){return null===e||e===undefined}r.padWithZeroes=a,r.isNullish=i,r.legacyToBuffer=function(e){return"string"!=typeof e||(0,n.isHexString)(e)?(0,n.toBuffer)(e):t.from(e)},r.concatSig=function(e,t,r){const i=(0,n.fromSigned)(t),o=(0,n.fromSigned)(r),c=(0,n.bufferToInt)(e),u=a((0,n.toUnsigned)(i).toString("hex"),64),l=a((0,n.toUnsigned)(o).toString("hex"),64),d=(0,s.remove0x)((0,s.numberToHex)(c));return(0,s.add0x)(u.concat(l,d))},r.recoverPublicKey=function(e,t){const r=(0,n.fromRpcSig)(t);return(0,n.ecrecover)(e,r.v,r.r,r.s)},r.normalize=function(e){if(i(e))return undefined;if("number"==typeof e){if(e<0)return"0x";const t=(0,s.numberToBytes)(e);e=(0,s.bytesToHex)(t)}if("string"!=typeof e){let t="eth-sig-util.normalize() requires hex string or integer input.";throw t+=` received ${typeof e}: ${e}`,new Error(t)}return(0,s.add0x)(e.toLowerCase())}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/dist/utils.js"}],[2289,{"./errors.cjs":2297,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.assertExhaustive=r.assertStruct=r.assert=r.AssertionError=void 0;const n=e("@metamask/superstruct"),s=e("./errors.cjs");function a(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class i extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}r.AssertionError=i,r.assert=function(e,t="Assertion failed.",r=i){if(!e){if(t instanceof Error)throw t;throw a(r,t)}},r.assertStruct=function(e,t,r="Assertion failed",o=i){try{(0,n.assert)(e,t)}catch(e){throw a(o,`${r}: ${function(e){return(0,s.getErrorMessage)(e).replace(/\.$/u,"")}(e)}.`)}},r.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/assert.cjs"}],[2290,{"./assert.cjs":2289,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.base64=void 0;const n=e("@metamask/superstruct"),s=e("./assert.cjs");r.base64=(e,t={})=>{const r=t.paddingRequired??!1,a=t.characterSet??"base64";let i,o;return"base64"===a?i=String.raw`[A-Za-z0-9+\/]`:((0,s.assert)("base64url"===a),i=String.raw`[-_A-Za-z0-9]`),o=r?new RegExp(`^(?:${i}{4})*(?:${i}{3}=|${i}{2}==)?$`,"u"):new RegExp(`^(?:${i}{4})*(?:${i}{2,3}|${i}{3}=|${i}{2}==)?$`,"u"),(0,n.pattern)(e,o)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/base64.cjs"}],[2291,{"./assert.cjs":2289,"./hex.cjs":2298,"@scure/base":3027,buffer:4074},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.createDataView=r.concatBytes=r.valueToBytes=r.base64ToBytes=r.stringToBytes=r.numberToBytes=r.signedBigIntToBytes=r.bigIntToBytes=r.hexToBytes=r.bytesToBase64=r.bytesToString=r.bytesToNumber=r.bytesToSignedBigInt=r.bytesToBigInt=r.bytesToHex=r.assertIsBytes=r.isBytes=void 0;const n=e("@scure/base"),s=e("./assert.cjs"),a=e("./hex.cjs"),i=48,o=58,c=87;const u=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function l(e){return e instanceof Uint8Array}function d(e){(0,s.assert)(l(e),"Value must be a Uint8Array.")}function m(e){if(d(e),0===e.length)return"0x";const t=u(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,a.add0x)(r.join(""))}function p(e){d(e);const t=m(e);return BigInt(t)}function h(e){if("0x"===e?.toLowerCase?.())return new Uint8Array;(0,a.assertIsHexString)(e);const t=(0,a.remove0x)(e).toLowerCase(),r=t.length%2==0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=r.charCodeAt(2*e),s=r.charCodeAt(2*e+1),a=t-(t<o?i:c),u=s-(s<o?i:c);n[e]=16*a+u}return n}function f(e){(0,s.assert)("bigint"==typeof e,"Value must be a bigint."),(0,s.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return h(e.toString(16))}function g(e){(0,s.assert)("number"==typeof e,"Value must be a number."),(0,s.assert)(e>=0,"Value must be a non-negative number."),(0,s.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return h(e.toString(16))}function y(e){return(0,s.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function b(e){if("bigint"==typeof e)return f(e);if("number"==typeof e)return g(e);if("string"==typeof e)return e.startsWith("0x")?h(e):y(e);if(l(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}r.isBytes=l,r.assertIsBytes=d,r.bytesToHex=m,r.bytesToBigInt=p,r.bytesToSignedBigInt=function(e){d(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},r.bytesToNumber=function(e){d(e);const t=p(e);return(0,s.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},r.bytesToString=function(e){return d(e),(new TextDecoder).decode(e)},r.bytesToBase64=function(e){return d(e),n.base64.encode(e)},r.hexToBytes=h,r.bigIntToBytes=f,r.signedBigIntToBytes=function(e,t){(0,s.assert)("bigint"==typeof e,"Value must be a bigint."),(0,s.assert)("number"==typeof t,"Byte length must be a number."),(0,s.assert)(t>0,"Byte length must be greater than 0."),(0,s.assert)(function(e,t){(0,s.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let e=0;e<n.length;e++)n[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},r.numberToBytes=g,r.stringToBytes=y,r.base64ToBytes=function(e){return(0,s.assert)("string"==typeof e,"Value must be a string."),n.base64.decode(e)},r.valueToBytes=b,r.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const s=b(e[n]);t[n]=s,r+=s.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},r.createDataView=function(e){if(void 0!==t&&e instanceof t){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/bytes.cjs"}],[2292,{"./superstruct.cjs":2307,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.toCaipAssetId=r.toCaipAssetType=r.toCaipAccountId=r.toCaipChainId=r.parseCaipAssetId=r.parseCaipAssetType=r.parseCaipAccountId=r.parseCaipChainId=r.isCaipAssetId=r.isCaipAssetType=r.isCaipTokenId=r.isCaipAssetReference=r.isCaipAssetNamespace=r.isCaipAccountAddress=r.isCaipAccountId=r.isCaipReference=r.isCaipNamespace=r.isCaipChainId=r.KnownCaipNamespace=r.CaipAssetTypeOrIdStruct=r.CaipAssetIdStruct=r.CaipAssetTypeStruct=r.CaipTokenIdStruct=r.CaipAssetReferenceStruct=r.CaipAssetNamespaceStruct=r.CaipAccountAddressStruct=r.CaipAccountIdStruct=r.CaipReferenceStruct=r.CaipNamespaceStruct=r.CaipChainIdStruct=r.CAIP_ASSET_ID_REGEX=r.CAIP_ASSET_TYPE_REGEX=r.CAIP_TOKEN_ID_REGEX=r.CAIP_ASSET_REFERENCE_REGEX=r.CAIP_ASSET_NAMESPACE_REGEX=r.CAIP_ACCOUNT_ADDRESS_REGEX=r.CAIP_ACCOUNT_ID_REGEX=r.CAIP_REFERENCE_REGEX=r.CAIP_NAMESPACE_REGEX=r.CAIP_CHAIN_ID_REGEX=void 0;const n=e("@metamask/superstruct"),s=e("./superstruct.cjs");r.CAIP_CHAIN_ID_REGEX=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,r.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,r.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,r.CAIP_ACCOUNT_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,r.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,r.CAIP_ASSET_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,r.CAIP_ASSET_REFERENCE_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,r.CAIP_TOKEN_ID_REGEX=/^[-.%a-zA-Z0-9]{1,78}$/u,r.CAIP_ASSET_TYPE_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,r.CAIP_ASSET_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u;function a(e){return(0,n.is)(e,r.CaipNamespaceStruct)}function i(e){return(0,n.is)(e,r.CaipReferenceStruct)}function o(e){return(0,n.is)(e,r.CaipAccountAddressStruct)}function c(e){return(0,n.is)(e,r.CaipAssetNamespaceStruct)}function u(e){return(0,n.is)(e,r.CaipAssetReferenceStruct)}function l(e){return(0,n.is)(e,r.CaipTokenIdStruct)}r.CaipChainIdStruct=(0,s.definePattern)("CaipChainId",r.CAIP_CHAIN_ID_REGEX),r.CaipNamespaceStruct=(0,s.definePattern)("CaipNamespace",r.CAIP_NAMESPACE_REGEX),r.CaipReferenceStruct=(0,s.definePattern)("CaipReference",r.CAIP_REFERENCE_REGEX),r.CaipAccountIdStruct=(0,s.definePattern)("CaipAccountId",r.CAIP_ACCOUNT_ID_REGEX),r.CaipAccountAddressStruct=(0,s.definePattern)("CaipAccountAddress",r.CAIP_ACCOUNT_ADDRESS_REGEX),r.CaipAssetNamespaceStruct=(0,s.definePattern)("CaipAssetNamespace",r.CAIP_ASSET_NAMESPACE_REGEX),r.CaipAssetReferenceStruct=(0,s.definePattern)("CaipAssetReference",r.CAIP_ASSET_REFERENCE_REGEX),r.CaipTokenIdStruct=(0,s.definePattern)("CaipTokenId",r.CAIP_TOKEN_ID_REGEX),r.CaipAssetTypeStruct=(0,s.definePattern)("CaipAssetType",r.CAIP_ASSET_TYPE_REGEX),r.CaipAssetIdStruct=(0,s.definePattern)("CaipAssetId",r.CAIP_ASSET_ID_REGEX),r.CaipAssetTypeOrIdStruct=(0,s.definePattern)("CaipAssetTypeOrId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u),function(e){e.Bip122="bip122",e.Solana="solana",e.Eip155="eip155",e.Wallet="wallet"}(r.KnownCaipNamespace||(r.KnownCaipNamespace={})),r.isCaipChainId=function(e){return(0,n.is)(e,r.CaipChainIdStruct)},r.isCaipNamespace=a,r.isCaipReference=i,r.isCaipAccountId=function(e){return(0,n.is)(e,r.CaipAccountIdStruct)},r.isCaipAccountAddress=o,r.isCaipAssetNamespace=c,r.isCaipAssetReference=u,r.isCaipTokenId=l,r.isCaipAssetType=function(e){return(0,n.is)(e,r.CaipAssetTypeStruct)},r.isCaipAssetId=function(e){return(0,n.is)(e,r.CaipAssetIdStruct)},r.parseCaipChainId=function(e){const t=r.CAIP_CHAIN_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}},r.parseCaipAccountId=function(e){const t=r.CAIP_ACCOUNT_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.parseCaipAssetType=function(e){const t=r.CAIP_ASSET_TYPE_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP asset type.");return{assetNamespace:t.groups.assetNamespace,assetReference:t.groups.assetReference,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.parseCaipAssetId=function(e){const t=r.CAIP_ASSET_ID_REGEX.exec(e);if(!t?.groups)throw new Error("Invalid CAIP asset ID.");return{assetNamespace:t.groups.assetNamespace,assetReference:t.groups.assetReference,tokenId:t.groups.tokenId,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}},r.toCaipChainId=function(e,t){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);return`${e}:${t}`},r.toCaipAccountId=function(e,t,n){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);if(!o(n))throw new Error(`Invalid "accountAddress", must match: ${r.CAIP_ACCOUNT_ADDRESS_REGEX.toString()}`);return`${e}:${t}:${n}`},r.toCaipAssetType=function(e,t,n,s){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);if(!c(n))throw new Error(`Invalid "assetNamespace", must match: ${r.CAIP_ASSET_NAMESPACE_REGEX.toString()}`);if(!u(s))throw new Error(`Invalid "assetReference", must match: ${r.CAIP_ASSET_REFERENCE_REGEX.toString()}`);return`${e}:${t}/${n}:${s}`},r.toCaipAssetId=function(e,t,n,s,o){if(!a(e))throw new Error(`Invalid "namespace", must match: ${r.CAIP_NAMESPACE_REGEX.toString()}`);if(!i(t))throw new Error(`Invalid "reference", must match: ${r.CAIP_REFERENCE_REGEX.toString()}`);if(!c(n))throw new Error(`Invalid "assetNamespace", must match: ${r.CAIP_ASSET_NAMESPACE_REGEX.toString()}`);if(!u(s))throw new Error(`Invalid "assetReference", must match: ${r.CAIP_ASSET_REFERENCE_REGEX.toString()}`);if(!l(o))throw new Error(`Invalid "tokenId", must match: ${r.CAIP_TOKEN_ID_REGEX.toString()}`);return`${e}:${t}/${n}:${s}/${o}`}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/caip-types.cjs"}],[2293,{"./base64.cjs":2290,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ChecksumStruct=void 0;const n=e("@metamask/superstruct"),s=e("./base64.cjs");r.ChecksumStruct=(0,n.size)((0,s.base64)((0,n.string)(),{paddingRequired:!0}),44,44)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/checksum.cjs"}],[2294,{"./assert.cjs":2289,"./bytes.cjs":2291,"./hex.cjs":2298,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createHex=r.createBytes=r.createBigInt=r.createNumber=void 0;const n=e("@metamask/superstruct"),s=e("./assert.cjs"),a=e("./bytes.cjs"),i=e("./hex.cjs"),o=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),i.StrictHexStruct]),c=(0,n.coerce)((0,n.number)(),o,Number),u=(0,n.coerce)((0,n.bigint)(),o,BigInt),l=((0,n.union)([i.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([i.StrictHexStruct]),a.hexToBytes)),d=(0,n.coerce)(i.StrictHexStruct,(0,n.instance)(Uint8Array),a.bytesToHex);r.createNumber=function(e){try{const t=(0,n.create)(e,c);return(0,s.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},r.createBigInt=function(e){try{return(0,n.create)(e,u)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},r.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,n.create)(e,l)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},r.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,n.create)(e,d)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/coercers.cjs"}],[2295,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n,s,a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},i=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r};Object.defineProperty(r,"__esModule",{value:!0}),r.FrozenSet=r.FrozenMap=void 0;class o{get size(){return a(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return a(this,n,"f")[Symbol.iterator]()}constructor(e){n.set(this,void 0),i(this,n,new Map(e),"f"),Object.freeze(this)}entries(){return a(this,n,"f").entries()}forEach(e,t){return a(this,n,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}get(e){return a(this,n,"f").get(e)}has(e){return a(this,n,"f").has(e)}keys(){return a(this,n,"f").keys()}values(){return a(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}r.FrozenMap=o;class c{get size(){return a(this,s,"f").size}[(s=new WeakMap,Symbol.iterator)](){return a(this,s,"f")[Symbol.iterator]()}constructor(e){s.set(this,void 0),i(this,s,new Set(e),"f"),Object.freeze(this)}entries(){return a(this,s,"f").entries()}forEach(e,t){return a(this,s,"f").forEach(((r,n,s)=>e.call(t,r,n,this)))}has(e){return a(this,s,"f").has(e)}keys(){return a(this,s,"f").keys()}values(){return a(this,s,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}r.FrozenSet=c,Object.freeze(o),Object.freeze(o.prototype),Object.freeze(c),Object.freeze(c.prototype)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/collections.cjs"}],[2296,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/encryption-types.cjs"}],[2297,{"./misc.cjs":2303,"pony-cause":5003},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.wrapError=r.getErrorMessage=r.isErrorWithStack=r.isErrorWithMessage=r.isErrorWithCode=void 0;const n=e("pony-cause"),s=e("./misc.cjs");function a(e){return"object"==typeof e&&null!==e&&"code"in e}function i(e){return"object"==typeof e&&null!==e&&"message"in e}r.isErrorWithCode=a,r.isErrorWithMessage=i,r.isErrorWithStack=function(e){return"object"==typeof e&&null!==e&&"stack"in e},r.getErrorMessage=function(e){return i(e)&&"string"==typeof e.message?e.message:(0,s.isNullOrUndefined)(e)?"":String(e)},r.wrapError=function(e,t){if((r=e)instanceof Error||(0,s.isObject)(r)&&"Error"===r.constructor.name){let r;return r=2===Error.length?new Error(t,{cause:e}):new n.ErrorWithCause(t,{cause:e}),a(e)&&(r.code=e.code),r}var r;return t.length>0?new Error(`${String(e)}: ${t}`):new Error(String(e))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/errors.cjs"}],[2298,{"./assert.cjs":2289,"./bytes.cjs":2291,"@metamask/superstruct":2872,"@noble/hashes/sha3":3001},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.remove0x=r.add0x=r.isValidChecksumAddress=r.getChecksumAddress=r.isValidHexAddress=r.assertIsStrictHexString=r.assertIsHexString=r.isStrictHexString=r.isHexString=r.HexChecksumAddressStruct=r.HexAddressStruct=r.StrictHexStruct=r.HexStruct=void 0;const n=e("@metamask/superstruct"),s=e("@noble/hashes/sha3"),a=e("./assert.cjs"),i=e("./bytes.cjs");function o(e){return(0,n.is)(e,r.HexStruct)}function c(e){return(0,n.is)(e,r.StrictHexStruct)}function u(e){(0,a.assert)((0,n.is)(e,r.HexChecksumAddressStruct),"Invalid hex address.");const t=d(e.toLowerCase()),o=d((0,i.bytesToHex)((0,s.keccak_256)(t)));return`0x${t.split("").map(((e,t)=>{const r=o[t];return(0,a.assert)((0,n.is)(r,(0,n.string)()),"Hash shorter than address."),parseInt(r,16)>7?e.toUpperCase():e})).join("")}`}function l(e){return!!(0,n.is)(e,r.HexChecksumAddressStruct)&&u(e)===e}function d(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}r.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),r.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu),r.HexAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]{40}$/u),r.HexChecksumAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-fA-F]{40}$/u),r.isHexString=o,r.isStrictHexString=c,r.assertIsHexString=function(e){(0,a.assert)(o(e),"Value must be a hexadecimal string.")},r.assertIsStrictHexString=function(e){(0,a.assert)(c(e),'Value must be a hexadecimal string, starting with "0x".')},r.isValidHexAddress=function(e){return(0,n.is)(e,r.HexAddressStruct)||l(e)},r.getChecksumAddress=u,r.isValidChecksumAddress=l,r.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},r.remove0x=d}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/hex.cjs"}],[2299,{"./assert.cjs":2289,"./base64.cjs":2290,"./bytes.cjs":2291,"./caip-types.cjs":2292,"./checksum.cjs":2293,"./coercers.cjs":2294,"./collections.cjs":2295,"./encryption-types.cjs":2296,"./errors.cjs":2297,"./hex.cjs":2298,"./json.cjs":2300,"./keyring.cjs":2301,"./logging.cjs":2302,"./misc.cjs":2303,"./number.cjs":2304,"./opaque.cjs":2305,"./promise.cjs":2306,"./superstruct.cjs":2307,"./time.cjs":2308,"./transaction-types.cjs":2309,"./versions.cjs":2310},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),s(e("./assert.cjs"),r),s(e("./base64.cjs"),r),s(e("./bytes.cjs"),r),s(e("./caip-types.cjs"),r),s(e("./checksum.cjs"),r),s(e("./coercers.cjs"),r),s(e("./collections.cjs"),r),s(e("./encryption-types.cjs"),r),s(e("./errors.cjs"),r),s(e("./hex.cjs"),r),s(e("./json.cjs"),r),s(e("./keyring.cjs"),r),s(e("./logging.cjs"),r),s(e("./misc.cjs"),r),s(e("./number.cjs"),r),s(e("./opaque.cjs"),r),s(e("./promise.cjs"),r),s(e("./superstruct.cjs"),r),s(e("./time.cjs"),r),s(e("./transaction-types.cjs"),r),s(e("./versions.cjs"),r)}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/index.cjs"}],[2300,{"./assert.cjs":2289,"./misc.cjs":2303,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getJsonRpcIdValidator=r.assertIsJsonRpcError=r.isJsonRpcError=r.assertIsJsonRpcFailure=r.isJsonRpcFailure=r.assertIsJsonRpcSuccess=r.isJsonRpcSuccess=r.assertIsJsonRpcResponse=r.isJsonRpcResponse=r.assertIsPendingJsonRpcResponse=r.isPendingJsonRpcResponse=r.JsonRpcResponseStruct=r.JsonRpcFailureStruct=r.JsonRpcSuccessStruct=r.PendingJsonRpcResponseStruct=r.assertIsJsonRpcRequest=r.isJsonRpcRequest=r.assertIsJsonRpcNotification=r.isJsonRpcNotification=r.JsonRpcNotificationStruct=r.JsonRpcRequestStruct=r.JsonRpcParamsStruct=r.JsonRpcErrorStruct=r.JsonRpcIdStruct=r.JsonRpcVersionStruct=r.jsonrpc2=r.getJsonSize=r.getSafeJson=r.isValidJson=r.JsonStruct=r.UnsafeJsonStruct=r.exactOptional=r.object=void 0;const n=e("@metamask/superstruct"),s=e("./assert.cjs"),a=e("./misc.cjs");function i({path:e,branch:t}){const r=e[e.length-1];return(0,a.hasProperty)(t[t.length-2],r)}function o(e){return new n.Struct({...e,type:`optional ${e.type}`,validator:(t,r)=>!i(r)||e.validator(t,r),refiner:(t,r)=>!i(r)||e.refiner(t,r)})}function c(e){if(null===e||"boolean"==typeof e||"string"==typeof e)return!0;if("number"==typeof e&&Number.isFinite(e))return!0;if("object"==typeof e){let t=!0;if(Array.isArray(e)){for(let r=0;r<e.length;r++)if(!c(e[r])){t=!1;break}return t}const r=Object.entries(e);for(let e=0;e<r.length;e++)if("string"!=typeof r[e][0]||!c(r[e][1])){t=!1;break}return t}return!1}function u(e){return(0,n.create)(e,r.JsonStruct)}r.object=e=>(0,n.object)(e),r.exactOptional=o,r.UnsafeJsonStruct=(0,n.define)("JSON",(e=>c(e))),r.JsonStruct=(0,n.coerce)(r.UnsafeJsonStruct,(0,n.refine)((0,n.any)(),"JSON",(e=>(0,n.is)(e,r.UnsafeJsonStruct))),(e=>JSON.parse(JSON.stringify(e,((e,t)=>"__proto__"===e||"constructor"===e?undefined:t))))),r.isValidJson=function(e){try{return u(e),!0}catch{return!1}},r.getSafeJson=u,r.getJsonSize=function(e){(0,s.assertStruct)(e,r.JsonStruct,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},r.jsonrpc2="2.0",r.JsonRpcVersionStruct=(0,n.literal)(r.jsonrpc2),r.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),r.JsonRpcErrorStruct=(0,r.object)({code:(0,n.integer)(),message:(0,n.string)(),data:o(r.JsonStruct),stack:o((0,n.string)())}),r.JsonRpcParamsStruct=(0,n.union)([(0,n.record)((0,n.string)(),r.JsonStruct),(0,n.array)(r.JsonStruct)]),r.JsonRpcRequestStruct=(0,r.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,method:(0,n.string)(),params:o(r.JsonRpcParamsStruct)}),r.JsonRpcNotificationStruct=(0,r.object)({jsonrpc:r.JsonRpcVersionStruct,method:(0,n.string)(),params:o(r.JsonRpcParamsStruct)}),r.isJsonRpcNotification=function(e){return(0,n.is)(e,r.JsonRpcNotificationStruct)},r.assertIsJsonRpcNotification=function(e,t){(0,s.assertStruct)(e,r.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",t)},r.isJsonRpcRequest=function(e){return(0,n.is)(e,r.JsonRpcRequestStruct)},r.assertIsJsonRpcRequest=function(e,t){(0,s.assertStruct)(e,r.JsonRpcRequestStruct,"Invalid JSON-RPC request",t)},r.PendingJsonRpcResponseStruct=(0,n.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(r.JsonRpcErrorStruct)}),r.JsonRpcSuccessStruct=(0,r.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,result:r.JsonStruct}),r.JsonRpcFailureStruct=(0,r.object)({id:r.JsonRpcIdStruct,jsonrpc:r.JsonRpcVersionStruct,error:r.JsonRpcErrorStruct}),r.JsonRpcResponseStruct=(0,n.union)([r.JsonRpcSuccessStruct,r.JsonRpcFailureStruct]),r.isPendingJsonRpcResponse=function(e){return(0,n.is)(e,r.PendingJsonRpcResponseStruct)},r.assertIsPendingJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",t)},r.isJsonRpcResponse=function(e){return(0,n.is)(e,r.JsonRpcResponseStruct)},r.assertIsJsonRpcResponse=function(e,t){(0,s.assertStruct)(e,r.JsonRpcResponseStruct,"Invalid JSON-RPC response",t)},r.isJsonRpcSuccess=function(e){return(0,n.is)(e,r.JsonRpcSuccessStruct)},r.assertIsJsonRpcSuccess=function(e,t){(0,s.assertStruct)(e,r.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",t)},r.isJsonRpcFailure=function(e){return(0,n.is)(e,r.JsonRpcFailureStruct)},r.assertIsJsonRpcFailure=function(e,t){(0,s.assertStruct)(e,r.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",t)},r.isJsonRpcError=function(e){return(0,n.is)(e,r.JsonRpcErrorStruct)},r.assertIsJsonRpcError=function(e,t){(0,s.assertStruct)(e,r.JsonRpcErrorStruct,"Invalid JSON-RPC error",t)},r.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/json.cjs"}],[2301,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/keyring.cjs"}],[2302,{debug:4226},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.createModuleLogger=r.createProjectLogger=void 0;const s=(0,n(e("debug")).default)("metamask");r.createProjectLogger=function(e){return s.extend(e)},r.createModuleLogger=function(e,t){return e.extend(t)}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/logging.cjs"}],[2303,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.calculateNumberSize=r.calculateStringSize=r.isASCII=r.isPlainObject=r.ESCAPE_CHARACTERS_REGEXP=r.JsonSize=r.getKnownPropertyNames=r.hasProperty=r.isObject=r.isNullOrUndefined=r.isNonEmptyArray=void 0,r.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},r.isNullOrUndefined=function(e){return null===e||e===undefined},r.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};function n(e){return e.charCodeAt(0)<=127}r.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),r.getKnownPropertyNames=function(e){return Object.getOwnPropertyNames(e)},function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(r.JsonSize||(r.JsonSize={})),r.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,r.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},r.isASCII=n,r.calculateStringSize=function(e){return e.split("").reduce(((e,t)=>n(t)?e+1:e+2),0)+(e.match(r.ESCAPE_CHARACTERS_REGEXP)??[]).length},r.calculateNumberSize=function(e){return e.toString().length}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/misc.cjs"}],[2304,{"./assert.cjs":2289,"./hex.cjs":2298},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.hexToBigInt=r.hexToNumber=r.bigIntToHex=r.numberToHex=void 0;const n=e("./assert.cjs"),s=e("./hex.cjs");r.numberToHex=e=>((0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,s.add0x)(e.toString(16)));r.bigIntToHex=e=>((0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=0,"Value must be a non-negative bigint."),(0,s.add0x)(e.toString(16)));r.hexToNumber=e=>{(0,s.assertIsHexString)(e);const t=parseInt(e,16);return(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};r.hexToBigInt=e=>((0,s.assertIsHexString)(e),BigInt((0,s.add0x)(e)))}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/number.cjs"}],[2305,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/opaque.cjs"}],[2306,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.createDeferredPromise=void 0,r.createDeferredPromise=function({suppressUnhandledRejection:e=!1}={}){let t,r;const n=new Promise(((e,n)=>{t=e,r=n}));return e&&n.catch((e=>{})),{promise:n,resolve:t,reject:r}}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/promise.cjs"}],[2307,{"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.definePattern=void 0;const n=e("@metamask/superstruct");r.definePattern=function(e,t){return(0,n.define)(e,(e=>"string"==typeof e&&t.test(e)))}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/superstruct.cjs"}],[2308,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.timeSince=r.inMilliseconds=r.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(r.Duration||(r.Duration={}));const n=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};r.inMilliseconds=function(e,t){return n(e,"count"),e*t},r.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/time.cjs"}],[2309,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/transaction-types.cjs"}],[2310,{"./assert.cjs":2289,"@metamask/superstruct":2872,semver:5547},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.satisfiesVersionRange=r.gtRange=r.gtVersion=r.assertIsSemVerRange=r.assertIsSemVerVersion=r.isValidSemVerRange=r.isValidSemVerVersion=r.VersionRangeStruct=r.VersionStruct=void 0;const n=e("@metamask/superstruct"),s=e("semver"),a=e("./assert.cjs");r.VersionStruct=(0,n.refine)((0,n.string)(),"Version",(e=>null!==(0,s.valid)(e)||`Expected SemVer version, got "${e}"`)),r.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",(e=>null!==(0,s.validRange)(e)||`Expected SemVer range, got "${e}"`)),r.isValidSemVerVersion=function(e){return(0,n.is)(e,r.VersionStruct)},r.isValidSemVerRange=function(e){return(0,n.is)(e,r.VersionRangeStruct)},r.assertIsSemVerVersion=function(e){(0,a.assertStruct)(e,r.VersionStruct)},r.assertIsSemVerRange=function(e){(0,a.assertStruct)(e,r.VersionRangeStruct)},r.gtVersion=function(e,t){return(0,s.gt)(e,t)},r.gtRange=function(e,t){return(0,s.gtr)(e,t)},r.satisfiesVersionRange=function(e,t){return(0,s.satisfies)(e,t,{includePrerelease:!0})}}}},{package:"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/eth-sig-util/node_modules/@metamask/utils/dist/versions.cjs"}],[2311,{"./errors.cjs":2319,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.assertExhaustive=r.assertStruct=r.assert=r.AssertionError=void 0;const n=e("@metamask/superstruct"),s=e("./errors.cjs");function a(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class i extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}r.AssertionError=i,r.assert=function(e,t="Assertion failed.",r=i){if(!e){if(t instanceof Error)throw t;throw a(r,t)}},r.assertStruct=function(e,t,r="Assertion failed",o=i){try{(0,n.assert)(e,t)}catch(e){throw a(o,`${r}: ${function(e){return(0,s.getErrorMessage)(e).replace(/\.$/u,"")}(e)}.`)}},r.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}}}},{package:"@metamask/network-controller>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/utils/dist/assert.cjs"}],[2312,{"./assert.cjs":2311,"@metamask/superstruct":2872},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.base64=void 0;const n=e("@metamask/superstruct"),s=e("./assert.cjs");r.base64=(e,t={})=>{const r=t.paddingRequired??!1,a=t.characterSet??"base64";let i,o;return"base64"===a?i=String.raw`[A-Za-z0-9+\/]`:((0,s.assert)("base64url"===a),i=String.raw`[-_A-Za-z0-9]`),o=r?new RegExp(`^(?:${i}{4})*(?:${i}{3}=|${i}{2}==)?$`,"u"):new RegExp(`^(?:${i}{4})*(?:${i}{2,3}|${i}{3}=|${i}{2}==)?$`,"u"),(0,n.pattern)(e,o)}}}},{package:"@metamask/network-controller>@metamask/utils",file:"node_modules/@metamask/network-controller/node_modules/@metamask/utils/dist/base64.cjs"}]],[],{});