Mantle Node API

RPC API Reference

Mantle v2 Tectonic has been released, please move to the new documentation!

Applications need to connect to a node to fetch block data and send transactions to the Mantle network. Mantle Network shares the same JSON-RPC API implementation as Ethereum.

You can refer to the common endpoints here.

We've also introduced custom methods to simplify certain Mantle-specific interactions.

API Access

All methods can be accessed via https and websocket.

NameMainnetTestnet

RPC URL

Websocket URL

wss://wss.mantle.xyz

The websocket supports an access method equivalent to the https interface, along with event subscription and cancellation. See here for reference.

Custom methods

MethodDescription

Returns block info for multiple blocks, takes a block range as parameter

Returns L2 node info

Returns the current L1 and L2 gas prices that a Sequencer node would use to calculate gas fees

eth_getBlockRange

Returns the block info in the form of an array of block objects for multiple blocks within a specified range. (See eth_getBlockByHash for the structure of a block object)

Parameters

No.ParameterTypeDescription

1

QUANTITY|TAG

Integer | String

Starting block no. of the range, or one of "earliest", "latest", or "pending", as in the default block parameter

2

QUANTITY|TAG

Integer | String

Ending block no. of the range, or one of "earliest", "latest", or "pending", as in the default block parameter

3

BOOLEAN

Boolean

If true, returns full transaction objects If false, returns transaction hashes only

Sample Request

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockRange","params":["0x1", "0x2", false],"id":1}' <node url>

Sample Response

{
  "jsonrpc":"2.0",
  "id":1,
  "result":[
    {
      "difficulty":"0x2",
      "extraData":"0xd97735082a846765746889676f312e31352e3133856c696e75780000000000009c3827892825f0825a7e329b6913b84c9e4f89168350aff0939e0e6609629f2e7f07f2aeb62acbf4b16a739cab68866f4880ea406583a4b28a59d4f55dc2314e00",
      "gasLimit":"0xe4e1c0",
      "gasUsed":"0x3183d",
      "hash":"0xbee7192e575af30420cae0c7776304ac196077ee72b048970549e4f08e875453",
      "logsBloom":"0x00000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000400000000000100000000000000200000000002000000000000001000000000000000000004000000000000000000000000000040000400000100400000000000000100000000000000000000000000000020000000000000000000000000000000000000000000000001000000000000000000000100000000000000000000000000000000000000000000000000000000000000088000000080000000000010000000000000000000000000000800008000120000000000000000000000000000000002000",
      "miner":"0x0000000000000000000000000000000000000000",
      "mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
      "nonce":"0x0000000000000000",
      "number":"0x1",
      "parentHash":"0x7ca38a1916c42007829c55e69d3e9a73265554b586a499015373241b8a3fa48b",
      "receiptsRoot":"0xf4c97b1186b690ad3318f907c0cdaf46f4598f27f711a5609064b2690a767287",
      "sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
      "size":"0x30c",
      "stateRoot":"0xd3ac40854cd2ac17d8effeae6065cea990b04be714f7061544973feeb2f1c95f",
      "timestamp":"0x618d4769",
      "totalDifficulty":"0x3",
      "transactions":["0x5e77a04531c7c107af1882d76cbff9486d0a9aa53701c30888509d4f5f2b003a"],
      "transactionsRoot":"0x19f5efd0d94386e72fcb3f296f1cb2936d017c37487982f76f09c591129f561f",
      "uncles":[]
    },
    {
      "difficulty":"0x2",
      "extraData":"0xd98301090a848932606889676f312e61742e3133856c696e757800000000000064a82cb66c7810b9619e7f14ab65c769a828b1616974987c530684eb3870b65e5b2400c1b61c6d340beef8c8e99127ac0de50e479d21f0833a5e2910fe64b41801",
      "gasLimit":"0xe4e1c0",
      "gasUsed":"0x1c60d",
      "hash":"0x45fd6ce41bb8ebb2bccdaa92dd1619e367404cb07722039901a7eba63dea1d13",
      "logsBloom":"0x00080000000200000000000000000008000000000000000000000100008000000000000000000000000000000000000000000000000000000000400000000000100000000000000000000000020000000000000000000000000000000000004000000000000000000000000000000000400000000400000000000000100000000000000000000000000000020000000000000000000000000000000000000000100000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000008400000000000000000010000000000000000020000000020000000000000000000000000000000000000000000002000",
      "miner":"0x0000000000000000000000000000000000000000",
      "mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
      "nonce":"0x0000000000000000",
      "number":"0x2",
      "parentHash":"0xbee7192e575af30420cae0c7776304ac196077ee72b048970549e4f08e875453",
      "receiptsRoot":"0x2057c8fb79c0f294062c1436aa56741134dc46d228a4f874929f8b791a7007a4",
      "sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
      "size":"0x30c",
      "stateRoot":"0x87026f3a614318ae24bcef6bc8f7564479afbbbe2b1fb189bc133a5de5a2b0f8",
      "timestamp":"0x618d8837",
      "totalDifficulty":"0x5",
      "transactions":["0xaf6ed8a6864d44989adc47c84f6fe0aeb1819817505c42cde6cbbcd5e14dd317"],
      "transactionsRoot":"0xa39c4d0d2397f8fcb1683ba833d4ab935cd2f4c5ca6f56a7d9a45b9904ea1c69",
      "uncles":[]
    }
  ]
}

rollup_getInfo

Returns various pieces of information in the form of an Object for a specified node.

The response Object structure is as follows:

FieldTypeDescription

mode

String

Node's mode of operation - "sequencer" or "verifier"

syncing

Boolean

true if the node is currently syncing false otherwise

ethContext

Object

Nested object. Contains blockNumber and timestamp

blockNumber

Quantity

Block no. of the latest known L1 block

timestamp

Quantity

Timestamp of the latest known L1 block

rollupContext

Object

Nested object. Contains queueIndex, index, and verifiedIndex

queueIndex

Quantity

Index within the CTC of the last L1 to L2 message ingested

index

Quantity

Index of the last L2 transaction processed

verifiedIndex

Quantity

Index of the last transaction that was ingested from a batch that was posted to L1

Parameters

None

Sample Request

curl -X POST --data '{"jsonrpc":"2.0","method":"rollup_getInfo","params":[],"id":1}' <node url>

Sample Response

{
  "jsonrpc":"2.0",
  "id":1,
  "result":{
    "mode":"verifier",
    "syncing":false,
    "ethContext":{
      "blockNumber":10743302,
      "timestamp":1957082793
    },
    "rollupContext":{
      "index":11287,
      "queueIndex":14362,
      "verifiedIndex":0
    }
  }
}

rollup_gasPrices

Returns an Object containing the L1 and L2 gas prices used by the Sequencer to calculate transaction gas fees.

The response Object structure is as follows:

FieldTypeDescription

l1GasPrice

Quantity

L1 gas price in wei (used to estimate L1 calldata costs)

l2GasPrice

Quantity

L2 gas price in wei (used to estimate L2 execution costs)

Parameters

None

Sample Request

curl -X POST --data '{"jsonrpc":"2.0","method":"rollup_gasPrices","params":[],"id":1}' <node url>

Sample Response

{
  "jsonrpc":"2.0",
  "id":1,
  "result":{
    "l1GasPrice":"0x254aa66732",
    "l2GasPrice":"0xf3792"
  }
}

Unsupported Methods

MethodDescription

eth_getAccounts

Used to fetch the list of addresses owned by a user. Mantle nodes do not expose internal wallets for security reasons, and thus block the eth_getAccounts method.

You can use an external wallet service as an alternative.

eth_sendTransaction

Mantle nodes block eth_sendTransaction for security reasons as well.

This is different from eth_sendRawTransaction which takes a signed transaction as input, and is supported by Mantle nodes.

Last updated