Injection

Ethereum, Polygon and Binance Smart Chain are currently supported. Get an API Key in the Merkle Developer Dashboard.

Injection allows you to push a transaction to the blockchain as quickly as possible. Transactions injected are not protected against MEV.

Injection is possible using the standard eth_sendRawTransaction JSON-RPC method. This simplifies the integration with common Web3 libraries and leverages a well known interface for every blockchain developer.

As described in Listen to transactions, the RPC endpoint is the following:

wss://txs.merkle.io/rpc/{api-key}/{chain-id}

The chain ID must follow the format described in the table and defaults to mainnet when omitted:

chainchain-id

Mainnet

1 | eth | mainnet

Polygon

137 | polygon

BSC

56 | bsc

Only theeth_sendRawTransactionmethod is supported through this endpoint.

sendRawTransaction

Submits a pre-signed transaction for broadcast to the network and returns the transaction's hash in case of success.

The chain ID must follow the format described in the reference and defaults to mainnet when omitted.

Request

curl https://txs.merkle.io/rpc/{api-key}/mainnet \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
        "jsonrpc": "2.0",
        "id": 1,
        "method": "eth_sendRawTransaction",
        "params": [
          "0x02f9015e0182095c86016c9cdfac0086016c9cdfac00830e7ef0947a250d5630b4cf539739df2c5dacb4c659f2488d887ce66c50e2840000b8e47ff36ab5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000009afda3adfc3588b4404f79792a97f2116957300c0000000000000000000000000000000000000000000930de8a4f1dde8b1c71c70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000068b429161ec09a6c1d65ba70727ab1faa5bc4026c080a09b48abf01c4802ba26028a38e05d3075f36b1ca9a33301bd6de41c52a8f23004a06c17a89ba3dbf641582d9e10ad8f87e38fefdd50b492d81bafe0b16d1e27a8ba"
        ]
      }'

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x1f42673cb8932154aa76dc815d4301daf986019b8482d2cccb6f7339cf3f381b"
}

Last updated