Optimism
Optimism
Optimism
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_sendRawTransaction broadcasts a fully signed, RLP-encoded transaction to OP Mainnet and returns its 32-byte hash. OP Mainnet is the ETH-gas OP Stack rollup at chain ID 10 (0xa); you sign the transaction client-side with a library such as ethers, viem, or web3.js — including chain ID 10 so it cannot be replayed on other chains — and submit the resulting hex string to the sequencer for inclusion. The node validates the signature, nonce, and balance, then admits the transaction to its mempool, returning the hash so you can track inclusion. Submit to https://optimism.therpc.io/YOUR_API_KEY.
to field and setting data to the contract's creation bytecode; the receipt's contractAddress will hold the deployed address.transfer or a Velodrome swap — by encoding the call into data, signing, and broadcasting it.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | signedTransaction | string | 是 | The serialized signed transaction. Build and sign it client-side with a library (e.g. ethers, viem, web3.js); never send a private key to the node. |
| 类型 | 描述 |
|---|---|
| string | 32-byte transaction hash (0x-prefixed). The transaction is now in the mempool but not yet confirmed. |
Try it live in the Optimism playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32000 | nonce too low | The nonce in the signed transaction is lower than the sender's current on-chain nonce. |
-32000 | insufficient funds for gas * price + value | The sender does not have enough native-token balance to cover gas cost and the transferred value. |
-32000 | replacement transaction underpriced | Tried to replace a pending transaction (same nonce) but the new fee is not high enough (typically requires ≥10% bump). |
eth_getTransactionReceipt until you get a non-null receipt to confirm inclusion — usually quick on OP Mainnet's ~2s blocks.status: "0x0" means the sequencer included it but execution reverted, and you still pay the L2 gas plus the L1 data fee.eth_getTransactionCount immediately before signing to avoid nonce too low collisions; and budget for the OP Stack L1 data fee on top of L2 gas, since it can dominate the total cost of a small transaction.参数
0x-prefixed hex string of the RLP-encoded signed transaction