Skip to content

Commit ea1e1fc

Browse files
PR fixes
1 parent 08ef414 commit ea1e1fc

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

packages/core-mobile/app/hooks/browser/useEvmInjectedProvider.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import { selectActiveNetwork } from 'store/network/slice'
55
import { NetworkVMType } from '@avalabs/core-chains-sdk'
66
import RNWebView from 'react-native-webview'
77
import Logger from 'utils/Logger'
8-
import { RpcMethod } from 'store/rpc/types'
98
import { createInAppRequest } from 'store/rpc/utils/createInAppRequest'
10-
import { RpcMethod as VmModuleRpcMethod } from '@avalabs/vm-module-types'
9+
import { RpcMethod } from '@avalabs/vm-module-types'
1110
import { getEvmCaip2ChainId } from 'utils/caip2ChainIds'
1211
import { buildEvmProviderShim } from './evmProviderShim'
1312

@@ -49,13 +48,13 @@ const READ_ONLY_METHODS = new Set([
4948
])
5049

5150
const SIGNING_METHODS: Record<string, RpcMethod> = {
52-
eth_sendTransaction: RpcMethod.ETH_SEND_TRANSACTION,
53-
personal_sign: RpcMethod.PERSONAL_SIGN,
54-
eth_sign: RpcMethod.ETH_SIGN,
55-
eth_signTypedData: RpcMethod.SIGN_TYPED_DATA,
56-
eth_signTypedData_v1: RpcMethod.SIGN_TYPED_DATA_V1,
57-
eth_signTypedData_v3: RpcMethod.SIGN_TYPED_DATA_V3,
58-
eth_signTypedData_v4: RpcMethod.SIGN_TYPED_DATA_V4
51+
[RpcMethod.ETH_SEND_TRANSACTION]: RpcMethod.ETH_SEND_TRANSACTION,
52+
[RpcMethod.PERSONAL_SIGN]: RpcMethod.PERSONAL_SIGN,
53+
[RpcMethod.ETH_SIGN]: RpcMethod.ETH_SIGN,
54+
[RpcMethod.SIGN_TYPED_DATA]: RpcMethod.SIGN_TYPED_DATA,
55+
[RpcMethod.SIGN_TYPED_DATA_V1]: RpcMethod.SIGN_TYPED_DATA_V1,
56+
[RpcMethod.SIGN_TYPED_DATA_V3]: RpcMethod.SIGN_TYPED_DATA_V3,
57+
[RpcMethod.SIGN_TYPED_DATA_V4]: RpcMethod.SIGN_TYPED_DATA_V4
5958
}
6059

6160
/**
@@ -168,7 +167,7 @@ export function useEvmInjectedProvider(
168167

169168
try {
170169
const result = await request({
171-
method: rpcMethod as unknown as VmModuleRpcMethod,
170+
method: rpcMethod,
172171
params,
173172
chainId: caip2ChainId
174173
})

0 commit comments

Comments
 (0)