File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
packages/snaps-controllers/src Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,11 @@ import {
88import type { Json , JsonRpcRequest , SnapId } from '@metamask/snaps-sdk' ;
99import type { Caip2ChainId } from '@metamask/snaps-utils' ;
1010import { HandlerType } from '@metamask/snaps-utils' ;
11- import type { CaipAccountId , CaipChainId } from '@metamask/utils' ;
11+ import type {
12+ CaipAccountId ,
13+ CaipChainId ,
14+ JsonRpcParams ,
15+ } from '@metamask/utils' ;
1216import { hasProperty , parseCaipAccountId } from '@metamask/utils' ;
1317
1418import { getRunnableSnaps } from '../snaps' ;
@@ -245,7 +249,7 @@ export class MultichainRouter {
245249 scope,
246250 request : {
247251 method,
248- params,
252+ params : params as JsonRpcParams ,
249253 } ,
250254 } ) ,
251255 ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import type { PermissionConstraint } from '@metamask/permission-controller';
22import { SnapEndowments } from '@metamask/snaps-rpc-methods' ;
33import { SnapCaveatType } from '@metamask/snaps-utils' ;
44import { MOCK_SNAP_ID } from '@metamask/snaps-utils/test-utils' ;
5- import type { CaipAccountId , CaipChainId } from '@metamask/utils' ;
5+ import type { CaipAccountId , CaipChainId , Json } from '@metamask/utils' ;
66
77export const BTC_CAIP2 =
88 'bip122:000000000019d6689c085ae165831e93' as CaipChainId ;
@@ -89,13 +89,13 @@ export const MOCK_SOLANA_SNAP_PERMISSIONS: Record<
8989} ;
9090
9191type MockSnapKeyring = {
92- submitRequest : ( request : unknown ) => Promise < unknown > ;
93- resolveAccountAddress : ( options : unknown ) => Promise < unknown > ;
92+ submitRequest : ( request : unknown ) => Promise < Json > ;
93+ resolveAccountAddress : (
94+ options : unknown ,
95+ ) => Promise < { address : CaipAccountId } | null > ;
9496} ;
9597
96- type MockOperationCallback = < ReturnType > (
97- keyring : MockSnapKeyring ,
98- ) => Promise < ReturnType > ;
98+ type MockOperationCallback = ( keyring : MockSnapKeyring ) => Promise < Json > ;
9999
100100export const getMockWithSnapKeyring = (
101101 { submitRequest = jest . fn ( ) , resolveAccountAddress = jest . fn ( ) } = {
You can’t perform that action at this time.
0 commit comments