Management API Reference

eth_sendTransaction

Send a transaction from the wallet to the blockchain.

Instructs the Wallet to broadcast a transaction to the network.

This method is deprecated and exists for compatibility. Please use wallet_sendCalls instead.

Request#


_15
type Request = {
_15
method: 'eth_sendTransaction',
_15
params: [{
_15
/** Target chain ID. Defaults to the connected chain. */
_15
chainId?: `0x${string}`,
_15
/** Calldata to send with the transaction. */
_15
data?: `0x${string}`,
_15
/** Address of the sender. */
_15
from: `0x${string}`,
_15
/** Address of the recipient. */
_15
to: `0x${string}`,
_15
/** Value to transfer. Defaults to 0. */
_15
value?: `0x${string}`,
_15
}]
_15
}

Response#

Transaction hash.


_10
type Response = `0x${string}`

Example#

To make these instructions concrete, we have created a sample cross-app wallet called Rapidfire ID. To interact with it, you can find its SDK in the NPM package directory: @rapidfire/id.

You can check out the GitHub repository for Rapidfire Wallet to learn how to create your own wallet.


_13
import RapidfireID from '@rapidfire/id'
_13
_13
const rapidfire = new RapidfireID()
_13
const provider = rapidfire.getEthereumProvider()
_13
_13
const hash = await provider.request({
_13
method: 'eth_sendTransaction',
_13
params: [{
_13
from: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
_13
to: '0xcafebabecafebabecafebabecafebabecafebabe',
_13
value: '0x1',
_13
}],
_13
})

Mint ERC20 Tokens#

The example below demonstrates minting 100 EXP on the Odyssey testnet.


_24
import RapidfireID from '@rapidfire/id'
_24
_24
const rapidfire = new RapidfireID()
_24
const provider = rapidfire.getEthereumProvider()
_24
import { encodeFunctionData, parseAbi, parseEther } from 'viem'
_24
_24
const [account] = await provider.request({
_24
method: 'eth_accounts',
_24
})
_24
_24
const hash = await provider.request({
_24
method: 'eth_sendTransaction',
_24
params: [{
_24
from: account,
_24
to: '0x706aa5c8e5cc2c67da21ee220718f6f6b154e75c',
_24
data: encodeFunctionData({
_24
abi: parseAbi([
_24
'function mint(address, uint256)',
_24
]),
_24
functionName: 'mint',
_24
args: [account, parseEther('100')],
_24
}),
_24
}],
_24
})