EVM Integrations
The EthereumProvider
defined in Tomo Connect SDK contains all the necessary functions to interact with EVM chains. Core functions are:
requestAddresses
Implemented eth_requestAccounts
public async requestAddresses()
getAddresses
Implemented eth_accounts
public async getAddresses()
signMessage
Implemented personal_sign
public async signMessage(msg: string, address: string)
signTypedData
Implemented eth_signTypedData_v4
public async signTypedData(address: string, msg: string)
sendTransaction
Implemented eth_sendTransaction
export interface EvmTxParams {
from: string,
to: string,
value: string,
gasPrice?: string,
gasLimit?: string,
maxFeePerGas?: string,
maxPriorityFeePerGas?: string,
data?: string,
}
public async sendTransaction(params: EvmTxParams)
sendRawTransaction
Implemented eth_sendRawTransaction
public async sendRawTransaction(signedTx: string)
swithChain
Implemented wallet_switchEthereumChain
public async swithChain(chainId: string)
recoverMessageAddress
Implemented personal_ecRecover
public async recoverMessageAddress(message: string, signature: string)
Also EthereumProvider is a provider compatible with EIP 1193. It can be integrated with third-party libraries like viem, ethers, just like window.ethereum.
// Integrated with viem
const client = createWalletClient({
chain: mainnet,
transport: custom(tomoSDK.ethereumProvider)
})
Last updated