• RPC Service
  • Supported Chains
  • Fantom

Fantom

Fantom is a secure platform to build DApps. It is fully permissionless and open-source. Powered by Fantom’s aBFT consensus algorithm, it leverages its speed to produce real-world applications with no risks of congestion or long confirmation times. The Fantom Opera mainnet is compatible with the Ethereum Virtual Machine (EVM) and provides full smart contracts support through Solidity.

Quick links

Fantom

Docs

Github


Connect wallet

You can set up your MetaMask wallet to connect to Fantom RPC. You can then perform transactions and interact with the network.

Get started

  1. Open your Metamask Extension and click the 'Network' drop down menu at the top.
  2. Select 'Custom RPC'.
  3. Enter the settings for the required project as follows in the table below:
ChainCustom RPC CategoryDetails
FantomNETWORK NAME:Fantom RPC
NEW RPC URL:https://rpc.ankr.com/fantom
CHAIN ID:250
SYMBOL:FTM
BLOCK EXPLORER:https://explorer.fantom.network/

Integrate code

web3 library

  • clientVersion

Returns the current client version.

Example request

curl https://rpc.ankr.com/fantom \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}'

Example response

{"jsonrpc":"2.0","id":1,"result":"go-opera/v1.1.0-rc.3-4f960171-1645028798/linux-amd64/go1.17.7"}

net library

  • net_version

Returns the current network id.

Example request

  
  curl https://rpc.ankr.com/fantom\
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}'

Example response

{"jsonrpc":"2.0","id":67,"result":"250"}

eth library

Example request


curl https://rpc.ankr.com/fantom \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":67}'

Example response

{"jsonrpc":"2.0","id":67,"result":"0x1fe0cee"}