diff --git a/packages/snaps-controllers/src/multichain/MultichainRouter.ts b/packages/snaps-controllers/src/multichain/MultichainRouter.ts index 702bd6b13b..917c43ec1f 100644 --- a/packages/snaps-controllers/src/multichain/MultichainRouter.ts +++ b/packages/snaps-controllers/src/multichain/MultichainRouter.ts @@ -8,7 +8,11 @@ import { import type { Json, JsonRpcRequest, SnapId } from '@metamask/snaps-sdk'; import type { Caip2ChainId } from '@metamask/snaps-utils'; import { HandlerType } from '@metamask/snaps-utils'; -import type { CaipAccountId, CaipChainId } from '@metamask/utils'; +import type { + CaipAccountId, + CaipChainId, + JsonRpcParams, +} from '@metamask/utils'; import { hasProperty, parseCaipAccountId } from '@metamask/utils'; import { getRunnableSnaps } from '../snaps'; @@ -245,7 +249,7 @@ export class MultichainRouter { scope, request: { method, - params, + params: params as JsonRpcParams, }, }), ); diff --git a/packages/snaps-controllers/src/test-utils/multichain.ts b/packages/snaps-controllers/src/test-utils/multichain.ts index c4f7a39269..6a28f1513a 100644 --- a/packages/snaps-controllers/src/test-utils/multichain.ts +++ b/packages/snaps-controllers/src/test-utils/multichain.ts @@ -2,7 +2,7 @@ import type { PermissionConstraint } from '@metamask/permission-controller'; import { SnapEndowments } from '@metamask/snaps-rpc-methods'; import { SnapCaveatType } from '@metamask/snaps-utils'; import { MOCK_SNAP_ID } from '@metamask/snaps-utils/test-utils'; -import type { CaipAccountId, CaipChainId } from '@metamask/utils'; +import type { CaipAccountId, CaipChainId, Json } from '@metamask/utils'; export const BTC_CAIP2 = 'bip122:000000000019d6689c085ae165831e93' as CaipChainId; @@ -89,13 +89,13 @@ export const MOCK_SOLANA_SNAP_PERMISSIONS: Record< }; type MockSnapKeyring = { - submitRequest: (request: unknown) => Promise; - resolveAccountAddress: (options: unknown) => Promise; + submitRequest: (request: unknown) => Promise; + resolveAccountAddress: ( + options: unknown, + ) => Promise<{ address: CaipAccountId } | null>; }; -type MockOperationCallback = ( - keyring: MockSnapKeyring, -) => Promise; +type MockOperationCallback = (keyring: MockSnapKeyring) => Promise; export const getMockWithSnapKeyring = ( { submitRequest = jest.fn(), resolveAccountAddress = jest.fn() } = {