UNPKG

@bobanetwork/snap-account-abstraction-keyring-hc

Version:

An account abstraction keyring snap that integrates with MetaMask accounts on Boba Network

1 lines 1.13 MB
(()=>{var e={7296:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcRequestStruct=void 0;const r=n(5072),a=n(4584),s=n(9400);t.JsonRpcRequestStruct=(0,s.object)({jsonrpc:(0,a.literal)("2.0"),id:(0,a.union)([(0,a.string)(),(0,a.number)(),(0,a.literal)(null)]),method:(0,a.string)(),params:(0,s.exactOptional)((0,a.union)([(0,a.array)(r.JsonStruct),(0,a.record)((0,a.string)(),r.JsonStruct)]))})},3992:function(e,t,n){"use strict";var r,a,s,i=this&&this.__classPrivateFieldSet||function(e,t,n,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,n):a?a.value=n:t.set(e,n),n},o=this&&this.__classPrivateFieldGet||function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyringClient=void 0;const c=n(4584),f=n(8128),u=n(6036),d=n(4712),l=n(5512);t.KeyringClient=class{constructor(e){r.add(this),a.set(this,void 0),i(this,a,e,"f")}async listAccounts(){return(0,l.strictMask)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.ListAccounts}),u.ListAccountsResponseStruct)}async getAccount(e){return(0,l.strictMask)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.GetAccount,params:{id:e}}),u.GetAccountResponseStruct)}async createAccount(e={}){return(0,l.strictMask)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.CreateAccount,params:{options:e}}),u.CreateAccountResponseStruct)}async filterAccountChains(e,t){return(0,l.strictMask)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.FilterAccountChains,params:{id:e,chains:t}}),u.FilterAccountChainsResponseStruct)}async updateAccount(e){(0,c.assert)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.UpdateAccount,params:{account:e}}),u.UpdateAccountResponseStruct)}async deleteAccount(e){(0,c.assert)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.DeleteAccount,params:{id:e}}),u.DeleteAccountResponseStruct)}async exportAccount(e){return(0,l.strictMask)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.ExportAccount,params:{id:e}}),u.ExportAccountResponseStruct)}async listRequests(){return(0,l.strictMask)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.ListRequests}),u.ListRequestsResponseStruct)}async getRequest(e){return(0,l.strictMask)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.GetRequest,params:{id:e}}),u.GetRequestResponseStruct)}async submitRequest(e){return(0,l.strictMask)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.SubmitRequest,params:e}),u.SubmitRequestResponseStruct)}async approveRequest(e,t={}){(0,c.assert)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.ApproveRequest,params:{id:e,data:t}}),u.ApproveRequestResponseStruct)}async rejectRequest(e){(0,c.assert)(await o(this,r,"m",s).call(this,{method:d.KeyringRpcMethod.RejectRequest,params:{id:e}}),u.RejectRequestResponseStruct)}},a=new WeakMap,r=new WeakSet,s=async function(e){return o(this,a,"f").send({jsonrpc:"2.0",id:(0,f.v4)(),...e})}},920:function(e,t,n){"use strict";var r,a,s=this&&this.__classPrivateFieldSet||function(e,t,n,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,n):a?a.value=n:t.set(e,n),n},i=this&&this.__classPrivateFieldGet||function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyringSnapRpcClient=t.SnapRpcSender=void 0;const o=n(3992);class c{constructor(e,t){r.set(this,void 0),a.set(this,void 0),s(this,r,e,"f"),s(this,a,t,"f")}async send(e){return i(this,a,"f").request({method:"wallet_invokeKeyring",params:{snapId:i(this,r,"f"),request:e}})}}t.SnapRpcSender=c,r=new WeakMap,a=new WeakMap;class f extends o.KeyringClient{constructor(e,t){super(new c(e,t))}}t.KeyringSnapRpcClient=f},212:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyringResponseStruct=t.KeyringAccountDataStruct=t.KeyringRequestStruct=t.KeyringAccountStruct=t.EthAccountType=t.EthMethod=void 0;const r=n(5072),a=n(4584),s=n(9400),i=n(5512);var o,c;!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"}(o=t.EthMethod||(t.EthMethod={})),function(e){e.Eoa="eip155:eoa",e.Erc4337="eip155:erc4337"}(c=t.EthAccountType||(t.EthAccountType={})),t.KeyringAccountStruct=(0,s.object)({id:i.UuidStruct,address:(0,a.string)(),options:(0,a.record)((0,a.string)(),r.JsonStruct),methods:(0,a.array)((0,a.enums)([`${o.PersonalSign}`,`${o.Sign}`,`${o.SignTransaction}`,`${o.SignTypedDataV1}`,`${o.SignTypedDataV3}`,`${o.SignTypedDataV4}`,`${o.PrepareUserOperation}`,`${o.PatchUserOperation}`,`${o.SignUserOperation}`])),type:(0,a.enums)([`${c.Eoa}`,`${c.Erc4337}`])}),t.KeyringRequestStruct=(0,s.object)({id:i.UuidStruct,scope:(0,a.string)(),account:i.UuidStruct,request:(0,s.object)({method:(0,a.string)(),params:(0,s.exactOptional)((0,a.union)([(0,a.array)(r.JsonStruct),(0,a.record)((0,a.string)(),r.JsonStruct)]))})}),t.KeyringAccountDataStruct=(0,a.record)((0,a.string)(),r.JsonStruct),t.KeyringResponseStruct=(0,a.union)([(0,s.object)({pending:(0,a.literal)(!0),redirect:(0,s.exactOptional)((0,s.object)({message:(0,s.exactOptional)((0,a.string)()),url:(0,s.exactOptional)((0,a.string)())}))}),(0,s.object)({pending:(0,a.literal)(!1),result:r.JsonStruct})])},9060:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9224:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(4636),t)},4636:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthUserOperationPatchStruct=t.EthBaseUserOperationStruct=t.EthBaseTransactionStruct=t.EthUserOperationStruct=void 0;const r=n(9400),a=n(2644);t.EthUserOperationStruct=(0,r.object)({sender:a.EthAddressStruct,nonce:a.EthUint256Struct,initCode:a.EthBytesStruct,callData:a.EthBytesStruct,callGasLimit:a.EthUint256Struct,verificationGasLimit:a.EthUint256Struct,preVerificationGas:a.EthUint256Struct,maxFeePerGas:a.EthUint256Struct,maxPriorityFeePerGas:a.EthUint256Struct,paymasterAndData:a.EthBytesStruct,signature:a.EthBytesStruct}),t.EthBaseTransactionStruct=(0,r.object)({to:a.EthAddressStruct,value:a.EthUint256Struct,data:a.EthBytesStruct}),t.EthBaseUserOperationStruct=(0,r.object)({nonce:a.EthUint256Struct,initCode:a.EthBytesStruct,callData:a.EthBytesStruct,gasLimits:(0,r.exactOptional)((0,r.object)({callGasLimit:a.EthUint256Struct,verificationGasLimit:a.EthUint256Struct,preVerificationGas:a.EthUint256Struct})),dummyPaymasterAndData:a.EthBytesStruct,dummySignature:a.EthBytesStruct,bundlerUrl:r.UrlStruct}),t.EthUserOperationPatchStruct=(0,r.object)({paymasterAndData:a.EthBytesStruct,callGasLimit:(0,r.exactOptional)(a.EthUint256Struct),verificationGasLimit:(0,r.exactOptional)(a.EthUint256Struct),preVerificationGas:(0,r.exactOptional)(a.EthUint256Struct)})},9768:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(9224),t),a(n(2644),t)},2644:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthUint256Struct=t.EthAddressStruct=t.EthBytesStruct=void 0;const r=n(9400);t.EthBytesStruct=(0,r.definePattern)("EthBytes",/^0x[0-9a-f]*$/iu),t.EthAddressStruct=(0,r.definePattern)("EthAddress",/^0x[0-9a-f]{40}$/iu),t.EthUint256Struct=(0,r.definePattern)("EthUint256",/^0x([1-9a-f][0-9a-f]*|0)$/iu)},2448:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyringEvent=void 0,function(e){e.AccountCreated="notify:accountCreated",e.AccountUpdated="notify:accountUpdated",e.AccountDeleted="notify:accountDeleted",e.RequestApproved="notify:requestApproved",e.RequestRejected="notify:requestRejected"}(t.KeyringEvent||(t.KeyringEvent={}))},3604:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(212),t),a(n(9060),t),a(n(9768),t),a(n(2448),t),a(n(2224),t),a(n(3992),t),a(n(920),t),a(n(4672),t),a(n(3008),t),a(n(9400),t)},6036:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RejectRequestResponseStruct=t.RejectRequestRequestStruct=t.ApproveRequestResponseStruct=t.ApproveRequestRequestStruct=t.SubmitRequestResponseStruct=t.SubmitRequestRequestStruct=t.GetRequestResponseStruct=t.GetRequestRequestStruct=t.ListRequestsResponseStruct=t.ListRequestsRequestStruct=t.ExportAccountResponseStruct=t.ExportAccountRequestStruct=t.DeleteAccountResponseStruct=t.DeleteAccountRequestStruct=t.UpdateAccountResponseStruct=t.UpdateAccountRequestStruct=t.FilterAccountChainsResponseStruct=t.FilterAccountChainsStruct=t.CreateAccountResponseStruct=t.CreateAccountRequestStruct=t.GetAccountResponseStruct=t.GetAccountRequestStruct=t.ListAccountsResponseStruct=t.ListAccountsRequestStruct=void 0;const r=n(5072),a=n(4584),s=n(212),i=n(5512),o={jsonrpc:(0,a.literal)("2.0"),id:(0,a.union)([(0,a.string)(),(0,a.number)(),(0,a.literal)(null)])};t.ListAccountsRequestStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_listAccounts")}),t.ListAccountsResponseStruct=(0,a.array)(s.KeyringAccountStruct),t.GetAccountRequestStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_getAccount"),params:(0,a.object)({id:i.UuidStruct})}),t.GetAccountResponseStruct=s.KeyringAccountStruct,t.CreateAccountRequestStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_createAccount"),params:(0,a.object)({options:(0,a.record)((0,a.string)(),r.JsonStruct)})}),t.CreateAccountResponseStruct=s.KeyringAccountStruct,t.FilterAccountChainsStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_filterAccountChains"),params:(0,a.object)({id:i.UuidStruct,chains:(0,a.array)((0,a.string)())})}),t.FilterAccountChainsResponseStruct=(0,a.array)((0,a.string)()),t.UpdateAccountRequestStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_updateAccount"),params:(0,a.object)({account:s.KeyringAccountStruct})}),t.UpdateAccountResponseStruct=(0,a.literal)(null),t.DeleteAccountRequestStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_deleteAccount"),params:(0,a.object)({id:i.UuidStruct})}),t.DeleteAccountResponseStruct=(0,a.literal)(null),t.ExportAccountRequestStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_exportAccount"),params:(0,a.object)({id:i.UuidStruct})}),t.ExportAccountResponseStruct=s.KeyringAccountDataStruct,t.ListRequestsRequestStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_listRequests")}),t.ListRequestsResponseStruct=(0,a.array)(s.KeyringRequestStruct),t.GetRequestRequestStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_getRequest"),params:(0,a.object)({id:i.UuidStruct})}),t.GetRequestResponseStruct=s.KeyringRequestStruct,t.SubmitRequestRequestStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_submitRequest"),params:s.KeyringRequestStruct}),t.SubmitRequestResponseStruct=s.KeyringResponseStruct,t.ApproveRequestRequestStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_approveRequest"),params:(0,a.object)({id:i.UuidStruct,data:(0,a.record)((0,a.string)(),r.JsonStruct)})}),t.ApproveRequestResponseStruct=(0,a.literal)(null),t.RejectRequestRequestStruct=(0,a.object)({...o,method:(0,a.literal)("keyring_rejectRequest"),params:(0,a.object)({id:i.UuidStruct})}),t.RejectRequestResponseStruct=(0,a.literal)(null)},312:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6072:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(312),t)},5816:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RequestRejectedEventStruct=t.RequestApprovedEventStruct=t.AccountDeletedEventStruct=t.AccountUpdatedEventStruct=t.AccountCreatedEventStruct=void 0;const r=n(5072),a=n(4584),s=n(212),i=n(2448),o=n(5512);t.AccountCreatedEventStruct=(0,a.object)({method:(0,a.literal)(`${i.KeyringEvent.AccountCreated}`),params:(0,a.object)({account:s.KeyringAccountStruct})}),t.AccountUpdatedEventStruct=(0,a.object)({method:(0,a.literal)(`${i.KeyringEvent.AccountUpdated}`),params:(0,a.object)({account:s.KeyringAccountStruct})}),t.AccountDeletedEventStruct=(0,a.object)({method:(0,a.literal)(`${i.KeyringEvent.AccountDeleted}`),params:(0,a.object)({id:o.UuidStruct})}),t.RequestApprovedEventStruct=(0,a.object)({method:(0,a.literal)(`${i.KeyringEvent.RequestApproved}`),params:(0,a.object)({id:o.UuidStruct,result:r.JsonStruct})}),t.RequestRejectedEventStruct=(0,a.object)({method:(0,a.literal)(`${i.KeyringEvent.RequestRejected}`),params:(0,a.object)({id:o.UuidStruct})})},2224:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(6036),t),a(n(6072),t),a(n(5816),t),a(n(4712),t),a(n(8408),t)},4712:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.isKeyringRpcMethod=t.KeyringRpcMethod=void 0,function(e){e.ListAccounts="keyring_listAccounts",e.GetAccount="keyring_getAccount",e.CreateAccount="keyring_createAccount",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"}(n=t.KeyringRpcMethod||(t.KeyringRpcMethod={})),t.isKeyringRpcMethod=function(e){return Object.values(n).includes(e)}},8408:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InternalAccountStruct=void 0;const r=n(4584),a=n(212),s=n(9400);t.InternalAccountStruct=(0,s.object)({...a.KeyringAccountStruct.schema,metadata:(0,s.object)({name:(0,r.string)(),snap:(0,s.exactOptional)((0,s.object)({id:(0,r.string)(),enabled:(0,r.boolean)(),name:(0,r.string)()})),lastSelected:(0,s.exactOptional)((0,r.number)()),keyring:(0,s.object)({type:(0,r.string)()})})})},4672:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleKeyringRequest=t.MethodNotSupportedError=void 0;const r=n(4584),a=n(6036),s=n(4712),i=n(7296);class o extends Error{constructor(e){super(`Method not supported: ${e}`)}}t.MethodNotSupportedError=o,t.handleKeyringRequest=async function(e,t){switch((0,r.assert)(t,i.JsonRpcRequestStruct),t.method){case s.KeyringRpcMethod.ListAccounts:return(0,r.assert)(t,a.ListAccountsRequestStruct),e.listAccounts();case s.KeyringRpcMethod.GetAccount:return(0,r.assert)(t,a.GetAccountRequestStruct),e.getAccount(t.params.id);case s.KeyringRpcMethod.CreateAccount:return(0,r.assert)(t,a.CreateAccountRequestStruct),e.createAccount(t.params.options);case s.KeyringRpcMethod.FilterAccountChains:return(0,r.assert)(t,a.FilterAccountChainsStruct),e.filterAccountChains(t.params.id,t.params.chains);case s.KeyringRpcMethod.UpdateAccount:return(0,r.assert)(t,a.UpdateAccountRequestStruct),e.updateAccount(t.params.account);case s.KeyringRpcMethod.DeleteAccount:return(0,r.assert)(t,a.DeleteAccountRequestStruct),e.deleteAccount(t.params.id);case s.KeyringRpcMethod.ExportAccount:if(void 0===e.exportAccount)throw new o(t.method);return(0,r.assert)(t,a.ExportAccountRequestStruct),e.exportAccount(t.params.id);case s.KeyringRpcMethod.ListRequests:if(void 0===e.listRequests)throw new o(t.method);return(0,r.assert)(t,a.ListRequestsRequestStruct),e.listRequests();case s.KeyringRpcMethod.GetRequest:if(void 0===e.getRequest)throw new o(t.method);return(0,r.assert)(t,a.GetRequestRequestStruct),e.getRequest(t.params.id);case s.KeyringRpcMethod.SubmitRequest:return(0,r.assert)(t,a.SubmitRequestRequestStruct),e.submitRequest(t.params);case s.KeyringRpcMethod.ApproveRequest:if(void 0===e.approveRequest)throw new o(t.method);return(0,r.assert)(t,a.ApproveRequestRequestStruct),e.approveRequest(t.params.id,t.params.data);case s.KeyringRpcMethod.RejectRequest:if(void 0===e.rejectRequest)throw new o(t.method);return(0,r.assert)(t,a.RejectRequestRequestStruct),e.rejectRequest(t.params.id);default:throw new o(t.method)}}},3008:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.emitSnapKeyringEvent=void 0,t.emitSnapKeyringEvent=async function(e,t,n){await e.request({method:"snap_manageAccounts",params:{method:t,params:{...n}}})}},9400:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlStruct=t.definePattern=t.exactOptional=t.object=void 0;const r=n(4584);function a(e){return e.path[e.path.length-1]in e.branch[e.branch.length-2]}t.object=function(e){return(0,r.object)(e)},t.exactOptional=function(e){return new r.Struct({...e,validator:(t,n)=>!a(n)||e.validator(t,n),refiner:(t,n)=>!a(n)||e.refiner(t,n)})},t.definePattern=function(e,t){return(0,r.define)(e,(e=>"string"==typeof e&&t.test(e)))},t.UrlStruct=(0,r.define)("Url",(e=>{let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}))},5512:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.strictMask=t.UuidStruct=void 0;const r=n(4584),a=n(9400);t.UuidStruct=(0,a.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),t.strictMask=function(e,t,n){return(0,r.assert)(e,t,n),e}},1324:(e,t,n)=>{"use strict";var r,a,s,i,o,c=Object.defineProperty,f=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,l=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},p=(e,t,n)=>(l(e,t,"read from private field"),n?n.call(e):t.get(e)),b=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},y=(e,t,n,r)=>(l(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),h={};((e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})})(h,{AddressStruct:()=>oe,AuxiliaryFileEncoding:()=>At,ButtonClickEventStruct:()=>ht,ButtonStruct:()=>Re,ButtonType:()=>Ie,ButtonVariant:()=>Se,ChainDisconnectedError:()=>q,ComponentStruct:()=>Ye,CopyableStruct:()=>ue,DialogType:()=>vt,DisconnectedError:()=>z,DividerStruct:()=>pe,FormComponentStruct:()=>je,FormStateStruct:()=>Ot,FormStruct:()=>Ue,FormSubmitEventStruct:()=>gt,GenericEventStruct:()=>yt,HeadingStruct:()=>he,ImageStruct:()=>Pe,InputChangeEventStruct:()=>mt,InputStruct:()=>Ne,InputType:()=>_e,InterfaceStateStruct:()=>xt,InternalError:()=>M,InvalidInputError:()=>j,InvalidParamsError:()=>U,InvalidRequestError:()=>L,LimitExceededError:()=>F,ManageStateOperation:()=>Et,MethodNotFoundError:()=>D,MethodNotSupportedError:()=>G,NodeType:()=>ae,NotificationType:()=>Pt,PanelStruct:()=>Ze,ParseError:()=>H,ResourceNotFoundError:()=>V,ResourceUnavailableError:()=>K,RowStruct:()=>$e,RowVariant:()=>Ve,SNAP_ERROR_CODE:()=>v,SNAP_ERROR_MESSAGE:()=>A,SeverityLevel:()=>lt,SnapError:()=>g,SpinnerStruct:()=>Je,TextStruct:()=>Ge,TransactionRejected:()=>$,UnauthorizedError:()=>J,UnsupportedMethodError:()=>W,UserInputEventStruct:()=>wt,UserInputEventType:()=>bt,UserRejectedRequestError:()=>Q,address:()=>ce,assert:()=>_.assert,assertIsComponent:()=>rt,button:()=>ke,copyable:()=>de,divider:()=>be,enumValue:()=>I,form:()=>Le,getErrorData:()=>T,getErrorMessage:()=>E,getErrorStack:()=>P,getImageComponent:()=>st,getImageData:()=>at,heading:()=>ge,image:()=>Te,input:()=>Me,isComponent:()=>nt,isSvg:()=>C,literal:()=>x,panel:()=>Xe,parseSvg:()=>B,row:()=>qe,spinner:()=>We,text:()=>He,union:()=>S}),e.exports=(r=h,((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of u(t))d.call(e,a)||a===n||c(e,a,{get:()=>t[a],enumerable:!(r=f(t,a))||r.enumerable});return e})(c({},"__esModule",{value:!0}),r));var g=class extends Error{constructor(e,t={}){const n=E(e);super(n),b(this,a,void 0),b(this,s,void 0),b(this,i,void 0),b(this,o,void 0),y(this,s,n),y(this,a,function(e){if((0,w.isObject)(e)&&(0,w.hasProperty)(e,"code")&&"number"==typeof e.code&&Number.isInteger(e.code))return e.code;return-32603}(e));const r={...T(e),...t};Object.keys(r).length>0&&y(this,i,r),y(this,o,super.stack)}get name(){return"SnapError"}get code(){return p(this,a)}get message(){return p(this,s)}get data(){return p(this,i)}get stack(){return p(this,o)}toJSON(){return{code:v,message:A,data:{cause:{code:this.code,message:this.message,stack:this.stack,...this.data?{data:this.data}:{}}}}}serialize(){return this.toJSON()}};function m(e){return class extends g{constructor(t,n){if("object"==typeof t){const n=e();return void super({code:n.code,message:n.message,data:t})}const r=e(t);super({code:r.code,message:r.message,data:n})}}}a=new WeakMap,s=new WeakMap,i=new WeakMap,o=new WeakMap;var w=n(5072),v=-31002,A="Snap Error";function E(e){return(0,w.isObject)(e)&&(0,w.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:String(e)}function P(e){if((0,w.isObject)(e)&&(0,w.hasProperty)(e,"stack")&&"string"==typeof e.stack)return e.stack}function T(e){return(0,w.isObject)(e)&&(0,w.hasProperty)(e,"data")&&"object"==typeof e.data&&null!==e.data&&(0,w.isValidJson)(e.data)&&!Array.isArray(e.data)?e.data:{}}var O=n(4584);function x(e){return(0,O.define)(JSON.stringify(e),(0,O.literal)(e).validator)}function S([e,...t]){const n=(0,O.union)([e,...t]);return new O.Struct({...n,schema:[e,...t]})}function I(e){return x(e)}var R=n(5072),k=n(8692);function B(e){try{const t=e.trim();(0,R.assert)(t.length>0);const n=new k.XMLParser({ignoreAttributes:!1,parseAttributeValue:!0}).parse(t,!0);return(0,R.assert)((0,R.hasProperty)(n,"svg")),(0,R.isObject)(n.svg)?n.svg:{}}catch{throw new Error("Snap icon must be a valid SVG.")}}function C(e){try{return B(e),!0}catch{return!1}}var _=n(5072),N=n(3856),M=m(N.rpcErrors.internal),j=m(N.rpcErrors.invalidInput),U=m(N.rpcErrors.invalidParams),L=m(N.rpcErrors.invalidRequest),F=m(N.rpcErrors.limitExceeded),D=m(N.rpcErrors.methodNotFound),G=m(N.rpcErrors.methodNotSupported),H=m(N.rpcErrors.parse),V=m(N.rpcErrors.resourceNotFound),K=m(N.rpcErrors.resourceUnavailable),$=m(N.rpcErrors.transactionRejected),q=m(N.providerErrors.chainDisconnected),z=m(N.providerErrors.disconnected),J=m(N.providerErrors.unauthorized),W=m(N.providerErrors.unsupportedMethod),Q=m(N.providerErrors.userRejectedRequest),Z=n(5072),X=n(5072),Y=n(4584),ee=n(5072);function te(e,t,n=[]){return(...r)=>{if(1===r.length&&(0,ee.isPlainObject)(r[0])){const n={...r[0],type:e};return(0,ee.assertStruct)(n,t,`Invalid ${e} component`),n}const a=n.reduce(((e,t,n)=>void 0!==r[n]?{...e,[t]:r[n]}:e),{type:e});return(0,ee.assertStruct)(a,t,`Invalid ${e} component`),a}}var ne,re=n(4584),ae=((ne=ae||{}).Copyable="copyable",ne.Divider="divider",ne.Heading="heading",ne.Panel="panel",ne.Spinner="spinner",ne.Text="text",ne.Image="image",ne.Row="row",ne.Address="address",ne.Button="button",ne.Input="input",ne.Form="form",ne),se=(0,re.object)({type:(0,re.string)()}),ie=(0,re.assign)(se,(0,re.object)({value:(0,re.unknown)()})),oe=(0,Y.assign)(ie,(0,Y.object)({type:(0,Y.literal)("address"),value:X.HexChecksumAddressStruct})),ce=te("address",oe,["value"]),fe=n(4584),ue=(0,fe.assign)(ie,(0,fe.object)({type:(0,fe.literal)("copyable"),value:(0,fe.string)(),sensitive:(0,fe.optional)((0,fe.boolean)())})),de=te("copyable",ue,["value","sensitive"]),le=n(4584),pe=(0,le.assign)(se,(0,le.object)({type:(0,le.literal)("divider")})),be=te("divider",pe),ye=n(4584),he=(0,ye.assign)(ie,(0,ye.object)({type:(0,ye.literal)("heading"),value:(0,ye.string)()})),ge=te("heading",he,["value"]),me=n(4584);var we,ve,Ae,Ee,Pe=(0,me.assign)(se,(0,me.object)({type:(0,me.literal)("image"),value:(0,me.refine)((0,me.string)(),"SVG",(e=>!!C(e)||"Value is not a valid SVG."))})),Te=te("image",Pe,["value"]),Oe=n(4584),xe=n(4584),Se=((we=Se||{}).Primary="primary",we.Secondary="secondary",we),Ie=((ve=Ie||{}).Button="button",ve.Submit="submit",ve),Re=(0,xe.assign)(ie,(0,xe.object)({type:(0,xe.literal)("button"),value:(0,xe.string)(),variant:(0,xe.optional)((0,xe.union)([I("primary"),I("secondary")])),buttonType:(0,xe.optional)((0,xe.union)([I("button"),I("submit")])),name:(0,xe.optional)((0,xe.string)())})),ke=te("button",Re,["value","buttonType","name","variant"]),Be=n(4584),Ce=n(4584),_e=((Ae=_e||{}).Text="text",Ae.Number="number",Ae.Password="password",Ae),Ne=(0,Ce.assign)(ie,(0,Ce.object)({type:(0,Ce.literal)("input"),value:(0,Ce.optional)((0,Ce.string)()),name:(0,Ce.string)(),inputType:(0,Ce.optional)((0,Ce.union)([I("text"),I("password"),I("number")])),placeholder:(0,Ce.optional)((0,Ce.string)()),label:(0,Ce.optional)((0,Ce.string)()),error:(0,Ce.optional)((0,Ce.string)())})),Me=te("input",Ne,["name","inputType","placeholder","value","label"]),je=(0,Be.union)([Ne,Re]),Ue=(0,Be.assign)(se,(0,Be.object)({type:(0,Be.literal)("form"),children:(0,Be.array)(je),name:(0,Be.string)()})),Le=te("form",Ue,["name","children"]),Fe=n(4584),De=n(4584),Ge=(0,De.assign)(ie,(0,De.object)({type:(0,De.literal)("text"),value:(0,De.string)(),markdown:(0,De.optional)((0,De.boolean)())})),He=te("text",Ge,["value","markdown"]),Ve=((Ee=Ve||{}).Default="default",Ee.Critical="critical",Ee.Warning="warning",Ee),Ke=(0,Fe.union)([Pe,Ge,oe]),$e=(0,Fe.assign)(ie,(0,Fe.object)({type:(0,Fe.literal)("row"),variant:(0,Fe.optional)((0,Fe.union)([I("default"),I("critical"),I("warning")])),label:(0,Fe.string)(),value:Ke})),qe=te("row",$e,["label","value","variant"]),ze=n(4584),Je=(0,ze.assign)(se,(0,ze.object)({type:(0,ze.literal)("spinner")})),We=te("spinner",Je),Qe=(0,Oe.assign)(se,(0,Oe.object)({children:(0,Oe.array)((0,Oe.lazy)((()=>Ye)))})),Ze=(0,Oe.assign)(Qe,(0,Oe.object)({type:(0,Oe.literal)("panel")})),Xe=te("panel",Ze,["children"]),Ye=(0,Oe.union)([ue,pe,he,Pe,Ze,Je,Ge,$e,oe,Ne,Ue,Re]),et=n(5072),tt=n(4584);function nt(e){return(0,tt.is)(e,Ye)}function rt(e){(0,et.assertStruct)(e,Ye,"Invalid component")}async function at(e,t){const n=await async function(e,t){if("function"!=typeof fetch)throw new Error(`Failed to fetch image data from "${e}": Using this function requires the "endowment:network-access" permission.`);return fetch(e,t).then((async t=>{if(!t.ok)throw new Error(`Failed to fetch image data from "${e}": ${t.status} ${t.statusText}`);const n=await t.blob();return(0,Z.assert)("image/jpeg"===n.type||"image/png"===n.type,"Expected image data to be a JPEG or PNG image."),n}))}(e,t),r=new Uint8Array(await n.arrayBuffer());return`data:${n.type};base64,${(0,Z.bytesToBase64)(r)}`}async function st(e,{width:t,height:n=t,request:r}){(0,Z.assert)("number"==typeof t&&t>0,"Expected width to be a number greater than 0."),(0,Z.assert)("number"==typeof n&&n>0,"Expected height to be a number greater than 0.");const a=await at(e,r),s=`width="${t}" height="${n}"`;return Te(`<svg ${s.trim()} xmlns="http://www.w3.org/2000/svg"><image ${s.trim()} href="${a}" /></svg>`)}var it,ot,ct,ft,ut,dt,lt=((it=lt||{}).Critical="critical",it),pt=n(4584),bt=((ot=bt||{}).ButtonClickEvent="ButtonClickEvent",ot.FormSubmitEvent="FormSubmitEvent",ot.InputChangeEvent="InputChangeEvent",ot),yt=(0,pt.object)({type:(0,pt.string)(),name:(0,pt.optional)((0,pt.string)())}),ht=(0,pt.assign)(yt,(0,pt.object)({type:(0,pt.literal)("ButtonClickEvent"),name:(0,pt.optional)((0,pt.string)())})),gt=(0,pt.assign)(yt,(0,pt.object)({type:(0,pt.literal)("FormSubmitEvent"),value:(0,pt.record)((0,pt.string)(),(0,pt.string)()),name:(0,pt.string)()})),mt=(0,pt.assign)(yt,(0,pt.object)({type:(0,pt.literal)("InputChangeEvent"),name:(0,pt.string)(),value:(0,pt.string)()})),wt=(0,pt.union)([ht,gt,mt]),vt=((ct=vt||{}).Alert="alert",ct.Confirmation="confirmation",ct.Prompt="prompt",ct),At=((ft=At||{}).Base64="base64",ft.Hex="hex",ft.Utf8="utf8",ft),Et=((ut=Et||{}).ClearState="clear",ut.GetState="get",ut.UpdateState="update",ut),Pt=((dt=Pt||{}).InApp="inApp",dt.Native="native",dt),Tt=n(4584),Ot=(0,Tt.record)((0,Tt.string)(),(0,Tt.nullable)((0,Tt.string)())),xt=(0,Tt.record)((0,Tt.string)(),(0,Tt.union)([Ot,(0,Tt.nullable)((0,Tt.string)())]))},8156:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=n(4176),s=n(5072),i=n(128),o=(r=i)&&r.__esModule?r:{default:r},c=class extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a non-empty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,s.isPlainObject.call(void 0,this.data)&&(e.data.cause=a.serializeCause.call(void 0,this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return o.default.call(void 0,this.serialize(),f,2)}};function f(e,t){if("[Circular]"!==t)return t}t.JsonRpcError=c,t.EthereumProviderError=class extends c{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}},944:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},8720:(e,t,n)=>{"use strict";function r(e,t){return null!=e?e:t()}Object.defineProperty(t,"__esModule",{value:!0});var a=n(8156),s=n(4176),i=n(944),o={parse:e=>f(i.errorCodes.rpc.parse,e),invalidRequest:e=>f(i.errorCodes.rpc.invalidRequest,e),invalidParams:e=>f(i.errorCodes.rpc.invalidParams,e),methodNotFound:e=>f(i.errorCodes.rpc.methodNotFound,e),internal:e=>f(i.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return f(t,e)},invalidInput:e=>f(i.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>f(i.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>f(i.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>f(i.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>f(i.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>f(i.errorCodes.rpc.limitExceeded,e)},c={userRejectedRequest:e=>u(i.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>u(i.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>u(i.errorCodes.provider.unsupportedMethod,e),disconnected:e=>u(i.errorCodes.provider.disconnected,e),chainDisconnected:e=>u(i.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:n,data:r}=e;if(!n||"string"!=typeof n)throw new Error('"message" must be a nonempty string');return new(0,a.EthereumProviderError)(t,n,r)}};function f(e,t){const[n,i]=d(t);return new(0,a.JsonRpcError)(e,r(n,(()=>s.getMessageFromCode.call(void 0,e))),i)}function u(e,t){const[n,i]=d(t);return new(0,a.EthereumProviderError)(e,r(n,(()=>s.getMessageFromCode.call(void 0,e))),i)}function d(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[r(t,(()=>{})),n]}}return[]}t.rpcErrors=o,t.providerErrors=c},4176:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(944),a=n(5072),s=r.errorCodes.rpc.internal,i={code:s,message:c(s)},o="Unspecified server error.";function c(e,t="Unspecified error message. This is a bug, please report it."){if(f(e)){const t=e.toString();if(a.hasProperty.call(void 0,r.errorValues,t))return r.errorValues[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return o}return t}function f(e){return Number.isInteger(e)}function u(e){return Array.isArray(e)?e.map((e=>a.isValidJson.call(void 0,e)?e:a.isObject.call(void 0,e)?d(e):null)):a.isObject.call(void 0,e)?d(e):a.isValidJson.call(void 0,e)?e:null}function d(e){return Object.getOwnPropertyNames(e).reduce(((t,n)=>{const r=e[n];return a.isValidJson.call(void 0,r)&&(t[n]=r),t}),{})}t.JSON_RPC_SERVER_ERROR_MESSAGE=o,t.getMessageFromCode=c,t.isValidCode=f,t.serializeError=function(e,{fallbackError:t=i,shouldIncludeStack:n=!0}={}){if(!a.isJsonRpcError.call(void 0,t))throw new Error("Must provide fallback error with integer number code and string message.");const r=function(e,t){if(e&&"object"==typeof e&&"serialize"in e&&"function"==typeof e.serialize)return e.serialize();if(a.isJsonRpcError.call(void 0,e))return e;const n=u(e),r={...t,data:{cause:n}};return r}(e,t);return n||delete r.stack,r},t.serializeCause=u},3856:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8720),a=n(8156),s=n(4176),i=n(944);t.EthereumProviderError=a.EthereumProviderError,t.JsonRpcError=a.JsonRpcError,t.errorCodes=i.errorCodes,t.getMessageFromCode=s.getMessageFromCode,t.providerErrors=r.providerErrors,t.rpcErrors=r.rpcErrors,t.serializeCause=s.serializeCause,t.serializeError=s.serializeError},4884:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=n(5348),s=((r=a)&&r.__esModule?r:{default:r}).default.call(void 0,"metamask");t.createProjectLogger=function(e){return s.extend(e)},t.createModuleLogger=function(e,t){return e.extend(t)}},9480:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};t.__privateGet=(e,t,r)=>(n(e,t,"read from private field"),r?r.call(e):t.get(e)),t.__privateAdd=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},t.__privateSet=(e,t,r,a)=>(n(e,t,"write to private field"),a?a.call(e,r):t.set(e,r),r)},6444:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7432),a=n(9848),s=n(4584),i=s.refine.call(void 0,s.string.call(void 0),"Version",(e=>null!==a.valid.call(void 0,e)||`Expected SemVer version, got "${e}"`)),o=s.refine.call(void 0,s.string.call(void 0),"Version range",(e=>null!==a.validRange.call(void 0,e)||`Expected SemVer range, got "${e}"`));t.VersionStruct=i,t.VersionRangeStruct=o,t.isValidSemVerVersion=function(e){return s.is.call(void 0,e,i)},t.isValidSemVerRange=function(e){return s.is.call(void 0,e,o)},t.assertIsSemVerVersion=function(e){r.assertStruct.call(void 0,e,i)},t.assertIsSemVerRange=function(e){r.assertStruct.call(void 0,e,o)},t.gtVersion=function(e,t){return a.gt.call(void 0,e,t)},t.gtRange=function(e,t){return a.gtr.call(void 0,e,t)},t.satisfiesVersionRange=function(e,t){return a.satisfies.call(void 0,e,t,{includePrerelease:!0})}},6408:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDeferredPromise=function({suppressUnhandledRejection:e=!1}={}){let t,n;const r=new Promise(((e,r)=>{t=e,n=r}));return e&&r.catch((e=>{})),{promise:r,resolve:t,reject:n}}},3800:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,r=((n=r||{})[n.Millisecond=1]="Millisecond",n[n.Second=1e3]="Second",n[n.Minute=6e4]="Minute",n[n.Hour=36e5]="Hour",n[n.Day=864e5]="Day",n[n.Week=6048e5]="Week",n[n.Year=31536e6]="Year",n),a=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};t.Duration=r,t.inMilliseconds=function(e,t){return a(e,"count"),e*t},t.timeSince=function(e){return a(e,"timestamp"),Date.now()-e}},2776:()=>{},3400:(e,t,n)=>{"use strict";function r(e,t){return null!=e?e:t()}Object.defineProperty(t,"__esModule",{value:!0});var a=n(7432),s=n(4584);t.base64=(e,t={})=>{const n=r(t.paddingRequired,(()=>!1)),i=r(t.characterSet,(()=>"base64"));let o,c;return"base64"===i?o=String.raw`[A-Za-z0-9+\/]`:(a.assert.call(void 0,"base64url"===i),o=String.raw`[-_A-Za-z0-9]`),c=n?new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),s.pattern.call(void 0,e,c)}},7432:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1456),a=n(4584);function s(e,t){return Boolean("string"==typeof function(e){let t,n=e[0],r=1;for(;r<e.length;){const a=e[r],s=e[r+1];if(r+=2,("optionalAccess"===a||"optionalCall"===a)&&null==n)return;"access"===a||"optionalAccess"===a?(t=n,n=s(n)):"call"!==a&&"optionalCall"!==a||(n=s(((...e)=>n.call(t,...e))),t=void 0)}return n}([e,"optionalAccess",e=>e.prototype,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name]))?new e({message:t}):e({message:t})}var i=class extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}};t.AssertionError=i,t.assert=function(e,t="Assertion failed.",n=i){if(!e){if(t instanceof Error)throw t;throw s(n,t)}},t.assertStruct=function(e,t,n="Assertion failed",o=i){try{a.assert.call(void 0,e,t)}catch(e){throw s(o,`${n}: ${function(e){return r.getErrorMessage.call(void 0,e).replace(/\.$/u,"")}(e)}.`)}},t.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},6580:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7248),a=n(7432),s=n(4584),i=s.union.call(void 0,[s.number.call(void 0),s.bigint.call(void 0),s.string.call(void 0),r.StrictHexStruct]),o=s.coerce.call(void 0,s.number.call(void 0),i,Number),c=s.coerce.call(void 0,s.bigint.call(void 0),i,BigInt),f=(s.union.call(void 0,[r.StrictHexStruct,s.instance.call(void 0,Uint8Array)]),s.coerce.call(void 0,s.instance.call(void 0,Uint8Array),s.union.call(void 0,[r.StrictHexStruct]),r.hexToBytes)),u=s.coerce.call(void 0,r.StrictHexStruct,s.instance.call(void 0,Uint8Array),r.bytesToHex);t.createNumber=function(e){try{const t=s.create.call(void 0,e,o);return a.assert.call(void 0,Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof s.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},t.createBigInt=function(e){try{return s.create.call(void 0,e,c)}catch(e){if(e instanceof s.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},t.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return s.create.call(void 0,e,f)}catch(e){if(e instanceof s.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},t.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return s.create.call(void 0,e,u)}catch(e){if(e instanceof s.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},9312:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3400),a=n(4584),s=a.size.call(void 0,r.base64.call(void 0,a.string.call(void 0),{paddingRequired:!0}),44,44);t.ChecksumStruct=s},1928:()=>{},1456:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5428),a=n(2213);function s(e){return"object"==typeof e&&null!==e&&"code"in e}function i(e){return"object"==typeof e&&null!==e&&"message"in e}t.isErrorWithCode=s,t.isErrorWithMessage=i,t.isErrorWithStack=function(e){return"object"==typeof e&&null!==e&&"stack"in e},t.getErrorMessage=function(e){return i(e)&&"string"==typeof e.message?e.message:r.isNullOrUndefined.call(void 0,e)?"":String(e)},t.wrapError=function(e,t){if((n=e)instanceof Error||r.isObject.call(void 0,n)&&"Error"===n.constructor.name){let n;return n=2===Error.length?new Error(t,{cause:e}):new(0,a.ErrorWithCause)(t,{cause:e}),s(e)&&(n.code=e.code),n}var n;return t.length>0?new Error(`${String(e)}: ${t}`):new Error(String(e))}},9088:()=>{},6192:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7432),a=n(5428),s=n(4584),i=e=>s.object.call(void 0,e);function o({path:e,branch:t}){const n=e[e.length-1];return a.hasProperty.call(void 0,t[t.length-2],n)}function c(e){return new(0,s.Struct)({...e,type:`optional ${e.type}`,validator:(t,n)=>!o(n)||e.validator(t,n),refiner:(t,n)=>!o(n)||e.refiner(t,n)})}var f=s.union.call(void 0,[s.literal.call(void 0,null),s.boolean.call(void 0),s.define.call(void 0,"finite number",(e=>s.is.call(void 0,e,s.number.call(void 0))&&Number.isFinite(e))),s.string.call(void 0),s.array.call(void 0,s.lazy.call(void 0,(()=>f))),s.record.call(void 0,s.string.call(void 0),s.lazy.call(void 0,(()=>f)))]),u=s.coerce.call(void 0,f,s.any.call(void 0),(e=>(r.assertStruct.call(void 0,e,f),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))))));function d(e){return s.create.call(void 0,e,u)}var l=s.literal.call(void 0,"2.0"),p=s.nullable.call(void 0,s.union.call(void 0,[s.number.call(void 0),s.string.call(void 0)])),b=i({code:s.integer.call(void 0),message:s.string.call(void 0),data:c(u),stack:c(s.string.call(void 0))}),y=s.union.call(void 0,[s.record.call(void 0,s.string.call(void 0),u),s.array.call(void 0,u)]),h=i({id:p,jsonrpc:l,method:s.string.call(void 0),params:c(y)}),g=i({jsonrpc:l,method:s.string.call(void 0),params:c(y)});var m=s.object.call(void 0,{id:p,jsonrpc:l,result:s.optional.call(void 0,s.unknown.call(void 0)),error:s.optional.call(void 0,b)}),w=i({id:p,jsonrpc:l,result:u}),v=i({id:p,jsonrpc:l,error:b}),A=s.union.call(void 0,[w,v]);t.object=i,t.exactOptional=c,t.UnsafeJsonStruct=f,t.JsonStruct=u,t.isValidJson=function(e){try{return d(e),!0}catch(e){return!1}},t.getSafeJson=d,t.getJsonSize=function(e){r.assertStruct.call(void 0,e,u,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},t.jsonrpc2="2.0",t.JsonRpcVersionStruct=l,t.JsonRpcIdStruct=p,t.JsonRpcErrorStruct=b,t.JsonRpcParamsStruct=y,t.JsonRpcRequestStruct=h,t.JsonRpcNotificationStruct=g,t.isJsonRpcNotification=function(e){return s.is.call(void 0,e,g)},t.assertIsJsonRpcNotification=function(e,t){r.assertStruct.call(void 0,e,g,"Invalid JSON-RPC notification",t)},t.isJsonRpcRequest=function(e){return s.is.call(void 0,e,h)},t.assertIsJsonRpcRequest=function(e,t){r.assertStruct.call(void 0,e,h,"Invalid JSON-RPC request",t)},t.PendingJsonRpcResponseStruct=m,t.JsonRpcSuccessStruct=w,t.JsonRpcFailureStruct=v,t.JsonRpcResponseStruct=A,t.isPendingJsonRpcResponse=function(e){return s.is.call(void 0,e,m)},t.assertIsPendingJsonRpcResponse=function(e,t){r.assertStruct.call(void 0,e,m,"Invalid pending JSON-RPC response",t)},t.isJsonRpcResponse=function(e){return s.is.call(void 0,e,A)},t.assertIsJsonRpcResponse=function(e,t){r.assertStruct.call(void 0,e,A,"Invalid JSON-RPC response",t)},t.isJsonRpcSuccess=function(e){return s.is.call(void 0,e,w)},t.assertIsJsonRpcSuccess=function(e,t){r.assertStruct.call(void 0,e,w,"Invalid JSON-RPC success response",t)},t.isJsonRpcFailure=function(e){return s.is.call(void 0,e,v)},t.assertIsJsonRpcFailure=function(e,t){r.assertStruct.call(void 0,e,v,"Invalid JSON-RPC failure response",t)},t.isJsonRpcError=function(e){return s.is.call(void 0,e,b)},t.assertIsJsonRpcError=function(e,t){r.assertStruct.call(void 0,e,b,"Invalid JSON-RPC error",t)},t.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:n,permitNull:r}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(n||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||r&&null===e)}},7248:(e,t,n)=>{"use strict";var r=n(2768).Buffer;Object.defineProperty(t,"__esModule",{value:!0});var a=n(7432),s=n(1916),i=n(4584),o=n(3372),c=48,f=58,u=87;var d=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 p(e){a.assert.call(void 0,l(e),"Value must be a Uint8Array.")}function b(e){if(p(e),0===e.length)return"0x";const t=d(),n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=t[e[r]];return k(n.join(""))}function y(e){p(e);const t=b(e);return BigInt(t)}function h(e){if("0x"===function(e){let t,n=e[0],r=1;for(;r<e.length;){const a=e[r],s=e[r+1];if(r+=2,("optionalAccess"===a||"optionalCall"===a)&&null==n)return;"access"===a||"optionalAccess"===a?(t=n,n=s(n)):"call"!==a&&"optionalCall"!==a||(n=s(((...e)=>n.call(t,...e))),t=void 0)}return n}([e,"optionalAccess",e=>e.toLowerCase,"optionalCall",e=>e()]))return new Uint8Array;S(e);const t=B(e).toLowerCase(),n=t.length%2==0?t:`0${t}`,r=new Uint8Array(n.length/2);for(let e=0;e<r.length;e++){const t=n.charCodeAt(2*e),a=n.charCodeAt(2*e+1),s=t-(t<f?c:u),i=a-(a<f?c:u);r[e]=16*s+i}return r}function g(e){a.assert.call(void 0,"bigint"==typeof e,"Value must be a bigint."),a.assert.call(void 0,e>=BigInt(0),"Value must be a non-negative bigint.");return h(e.toString(16))}function m(e){a.assert.call(void 0,"number"==typeof e,"Value must be a number."),a.assert.call(void 0,e>=0,"Value must be a non-negative number."),a.assert.call(void 0,Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return h(e.toString(16))}function w(e){return a.assert.call(void 0,"string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function v(e){if("bigint"==typeof e)return g(e);if("number"==typeof e)return m(e);if("string"==typeof e)return e.startsWith("0x")?h(e):w(e);if(l(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}var A=i.pattern.call(void 0,i.string.call(void 0),/^(?:0x)?[0-9a-f]+$/iu),E=i.pattern.call(void 0,i.string.call(void 0),/^0x[0-9a-f]+$/iu),P=i.pattern.call(void 0,i.string.call(void 0),/^0x[0-9a-f]{40}$/u),T=i.pattern.call(void 0,i.string.call(void 0),/^0x[0-9a-fA-F]{40}$/u);function O(e){return i.is.c