eth_sendTransaction
Overview
Creates and submits a transaction via the node or wallet. For hosted RPC, this is typically unsupported; use eth_sendRawTransaction
.
Movement-Specific Considerations
- Prefer
eth_sendRawTransaction
with a client-side wallet; Movement EVM chain ID is 3073.
Parameters
Name | Type | Required | Description |
---|---|---|---|
tx | object | Yes | From, to, value, gas, data, etc. |
Returns
Transaction hash.
Code Examples
Ethers.js v6 (wallet required)
import { Wallet, JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1');
const wallet = new Wallet(process.env.PRIV_KEY!, provider);
const tx = await wallet.sendTransaction({ to: '0x0000000000000000000000000000000000000000', value: 0n });
console.log(tx.hash);
Web3.js (wallet required)
import Web3 from 'web3';
const web3 = new Web3('https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1');
// Use web3.eth.accounts.signTransaction + eth_sendRawTransaction as recommended