diff --git a/packages/get-starknet/src/wallet.test.ts b/packages/get-starknet/src/wallet.test.ts index ad72a3de..135f4bb0 100644 --- a/packages/get-starknet/src/wallet.test.ts +++ b/packages/get-starknet/src/wallet.test.ts @@ -137,18 +137,18 @@ describe('MetaMaskSnapWallet', () => { }); describe('on', () => { - it('throws `Method not supported` error', async () => { + it('does nothing and not throw any error', async () => { const wallet = createWallet(); - expect(() => wallet.on()).toThrow('Method not supported'); + expect(() => wallet.on('accountsChanged', jest.fn())).not.toThrow(); }); }); describe('off', () => { - it('throws `Method not supported` error', async () => { + it('does nothing and not throw any error', async () => { const wallet = createWallet(); - expect(() => wallet.off()).toThrow('Method not supported'); + expect(() => wallet.off('accountsChanged', jest.fn())).not.toThrow(); }); }); }); diff --git a/packages/get-starknet/src/wallet.ts b/packages/get-starknet/src/wallet.ts index 3c313368..63d2fe60 100644 --- a/packages/get-starknet/src/wallet.ts +++ b/packages/get-starknet/src/wallet.ts @@ -1,6 +1,7 @@ import type { MutexInterface } from 'async-mutex'; import { Mutex } from 'async-mutex'; -import { type RpcMessage, type WalletEvents, type StarknetWindowObject } from 'get-starknet-core'; +import type { WalletEventHandlers } from 'get-starknet-core'; +import { type RpcMessage, type StarknetWindowObject } from 'get-starknet-core'; import type { AccountInterface, ProviderInterface } from 'starknet'; import { Provider } from 'starknet'; @@ -208,12 +209,12 @@ export class MetaMaskSnapWallet implements StarknetWindowObject { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - on() { - throw new Error('Method not supported'); + on(_event: Event, _handleEvent: WalletEventHandlers[Event]): void { + // No operation for now } // eslint-disable-next-line @typescript-eslint/no-unused-vars - off() { - throw new Error('Method not supported'); + off(_event: Event, _handleEvent?: WalletEventHandlers[Event]): void { + // No operation for now } }