Docs
Docs
Home
Getting Started
Agent Tooling
CLI
Supported Chains
Acala
Aptos
Arbitrum
Arc
Asset Hub
Astar
Avalanche
Base
Berachain
Bifrost
Binance Smart Chain
Bittensor
Blast
Boba Network
Bridge Hub
Celo
Centrifuge
Chiliz
Cronos
Enjin
Ethereum
Etherlink
Flow EVM Gateway
Gnosis
Hydration
Hyperliquid
Immutable
Ink
IoTeX
Kusama
Linea
LISK
Manta Atlantic
Manta Pacific
Mantle
MegaETH
Monad
Movement
Neuroweb
opBNB
Optimism
Plasma
Polkadot
Polygon
Pulsechain
Robinhood
Ronin
Scroll
Sonic
Starknet
Taiko
Tempo
Sui
TRON
Unichain
Viction
World Chain
XDC Network
XX Network
Zetachain
zkSync Era
Zora
Supported ChainsPlasmaJSON-RPC APITransaction Methods

eth_sendRawTransaction - Plasma RPC Method

Submit signed transactions to Plasma. Essential for broadcasting transactions for stablecoin transfers, payment apps, and wallets that need 1 second confirmation.

Plasma RPC endpoint: endpoint URLs, plans and pricing.

Submits a pre-signed transaction for broadcast to Plasma.

Why Plasma? Build on an EVM Layer 1 for stablecoin payments with PlasmaBFT consensus and Reth execution with 1 second blocks, XPL gas, full EVM JSON-RPC, and debug plus txpool on Dwellir.

When to Use This Method

The eth_sendRawTransaction method serves these key scenarios for payment app developers, wallet teams, and teams shipping Solidity contracts for dollar transfers:

  • Submit pre-signed transactions - Broadcast transactions that were signed offline or in a secure enclave, keeping private keys away from the RPC endpoint
  • Broadcast from offline signers - Air-gapped devices and hardware wallets first sign, then use this method to push the signed payload to Plasma
  • Resubmit stuck transactions - Replace pending transactions with the same nonce and a higher gas price when the original is not being included in blocks
  • Deploy contracts programmatically - Submit contract creation transactions containing compiled bytecode and constructor arguments

Common Use Cases

1. Sign and Send an ETH Transfer

Build, sign, and broadcast a native ETH transfer with proper nonce management. The nonce must be retrieved from the node immediately before signing to avoid conflicts with pending transactions.

JavaScript
import { JsonRpcProvider, Wallet, parseEther, Transaction } from 'ethers';

const provider = new JsonRpcProvider('https://api-plasma-mainnet.n.dwellir.com/YOUR_API_KEY');
const wallet = new Wallet('PRIVATE_KEY', provider);

async function sendNativeTransfer(to, amountInEth) {
  const tx = await wallet.sendTransaction({
    to: to,
    value: parseEther(amountInEth)
  });

  console.log('Transaction submitted:', tx.hash);

  const receipt = await tx.wait();
  console.log(`Confirmed in block ${receipt.blockNumber}, gas used: ${receipt.gasUsed}`);
  return receipt;
}

const receipt = await sendNativeTransfer('0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb', '0.01');

2. Resubmit a Stuck Transaction

If a pending transaction is not being confirmed due to low gas, submit a replacement with the same nonce and a higher gas price. The replacement must use an increased fee to be accepted by the Plasma mempool.

JavaScript
import { JsonRpcProvider, Wallet, parseEther } from 'ethers';

const provider = new JsonRpcProvider('https://api-plasma-mainnet.n.dwellir.com/YOUR_API_KEY');
const wallet = new Wallet('PRIVATE_KEY', provider);

async function speedUpTransaction(originalTxHash, gasMultiplier = 1.5) {
  const pendingTx = await provider.getTransaction(originalTxHash);
  if (!pendingTx) throw new Error('Transaction not found');

  const feeData = await provider.getFeeData();

  const replacementTx = {
    to: pendingTx.to,
    value: pendingTx.value,
    data: pendingTx.data,
    nonce: pendingTx.nonce,
    maxFeePerGas: feeData.maxFeePerGas * BigInt(Math.floor(gasMultiplier * 100)) / 100n,
    maxPriorityFeePerGas: feeData.maxPriorityFeePerGas * BigInt(Math.floor(gasMultiplier * 100)) / 100n,
    gasLimit: pendingTx.gasLimit
  };

  const tx = await wallet.sendTransaction(replacementTx);
  console.log('Replacement transaction:', tx.hash);
  return tx;
}

const newTx = await speedUpTransaction('0x...');

3. Deploy a Compiled Contract

Submit a contract deployment transaction containing the compiled bytecode. The to field is omitted for contract creation transactions; the contract address is deterministically derived from the sender address and nonce.

JavaScript
import { JsonRpcProvider, Wallet, ContractFactory } from 'ethers';

const provider = new JsonRpcProvider('https://api-plasma-mainnet.n.dwellir.com/YOUR_API_KEY');
const wallet = new Wallet('PRIVATE_KEY', provider);

const contractAbi = ['constructor(string memory name, uint256 supply)'];
const contractBytecode = '0x608060...';

async function deployContract(constructorArgs) {
  const factory = new ContractFactory(contractAbi, contractBytecode, wallet);
  const contract = await factory.deploy(...constructorArgs);

  console.log('Deployment tx:', contract.deploymentTransaction().hash);

  await contract.waitForDeployment();
  console.log('Contract deployed at:', await contract.getAddress());
  return contract;
}

const contract = await deployContract(['MyToken', 1000000]);

Best Practices

  • Always sign transactions client-side: never send private keys to any RPC endpoint, including https://api-plasma-mainnet.n.dwellir.com/YOUR_API_KEY
  • Track nonces carefully to avoid gaps or conflicts: retrieve the pending nonce from eth_getTransactionCount with "pending" tag before each signing
  • The return value is a transaction hash: use eth_getTransactionReceipt to poll for confirmation status
  • Handle replacement transactions correctly: the replacement must use the same nonce with a higher gas price
  • Use eth_estimateGas to set an appropriate gas limit before signing and sending
JSON-RPC request
{
  "jsonrpc": "2.0",
  "method": "eth_sendRawTransaction",
  "params": ["0xf86c..."],
  "id": 1
}

Code Examples

Error Handling

Error CodeMessageDescription
-32000Nonce too lowTransaction nonce already used
-32000Insufficient fundsAccount has insufficient balance
-32000Gas too lowGas limit insufficient
-32000Replacement underpricedGas price too low for replacement

Related Methods

  • eth_estimateGas - Estimate gas required
  • eth_gasPrice - Get current gas price
  • eth_getTransactionReceipt - Get transaction result

eth_accounts

Returns a list of addresses owned by the client on Plasma. Typically returns an empty array on public RPC endpoints.

eth_getTransactionByHash

Retrieve transaction details by hash on Plasma. Essential for payment app developers, wallet teams, and teams shipping Solidity contracts for dollar transfers tracking transactions on an EVM Layer 1 for stablecoin payments with PlasmaBFT consensus and Reth execution.

On this page

When to Use This MethodCommon Use Cases1. Sign and Send an ETH Transfer2. Resubmit a Stuck Transaction3. Deploy a Compiled ContractBest PracticesCode ExamplesError HandlingRelated Methods