FONSmartChain
English
English
  • ๐ŸงฟIntroduce
  • ๐ŸงถTutorial
  • ๐Ÿ›ก๏ธSecurity Audit Report
  • ๐Ÿ’ซCross-chain bridges and wallets
    • โšกCross-chain bridge
    • ๐Ÿ’ฐWallet
    • ๐Ÿ”‘Key management
    • ๐Ÿ’ฐThird-Party Wallet Tutorial
      • 1๏ธโƒฃMetamask
      • 2๏ธโƒฃTokenPocket
      • 3๏ธโƒฃBitkeep
      • 4๏ธโƒฃAve.ai
  • ๐Ÿ†Core idea
    • ๐ŸŽ†Consensus engine
  • โ›ฑ๏ธDevelop
    • ๐ŸŸขRPC
    • ๐Ÿ”—FSC Browser
    • ๐ŸงŠRun full node
    • ๐Ÿ’ŽValidator
      • Create a validator
      • Run validator
    • ๐Ÿ“‘Validate contracts at FONSCAN
    • ๐ŸŒพLogos
  • โ˜”ScanApi
    • RPC API Endpoints
      • Account
      • Block
      • Contract
      • Logs
      • Stats
      • Token
      • Transaction
    • ETH RPC API
    • ๐Ÿ“”White Paper
      • Background overview
        • Introduction to FON smart chain
        • Design Principles
        • Application target
        • Advantages of implementation
      • Ecological sector overview
        • RosSwap
        • Time Farm
        • HieSwap
        • Myth NFT
      • Token economy
        • Economic model
        • Staking and governance
        • Circulation example
      • FSC technology systemFSC will
        • Proof of Stake
        • Cross-chain mechanism
        • Repeater
        • Hard forks, specifications and dispute resolution
      • Risk assessment and decision-making
      • Disclaimer
Powered by GitBook
On this page
  • Get block reward by block number
  • Get block number by time stamp
  • Get the latest block number
  1. ScanApi
  2. RPC API Endpoints

Block

?module=block

https://fonscan.io/api?module=block

Get block reward by block number

getblockreward

Returns the block reward and 'uncle' block rewards when applicable.

Example:

https://fonscan.io/api
   ?module=block
   &action=getblockreward
   &blockno={blockNumber}
Parameter
Description

blockno

integer block number to check block rewards for eg. 2165403

{
  "message": "OK",
  "result": {
    "blockMiner": "0x13a06d3dfe21e0db5c016c03ea7d2509f7f8d1e3",
    "blockNumber": "2165403",
    "blockReward": "5314181600000000000",
    "timeStamp": "1472533979",
    "uncleInclusionReward": null,
    "uncles": null
  },
  "status": "1"
}

Get block number by time stamp

getblocknobytime

Returns the block number created closest to a provided timestamp.

Example:

https://fonscan.io/api
   ?module=block
   &action=getblocknobytime
   &timestamp={blockTimestamp}
   &closest={before/after}
Parameter
Description

timestamp

integer representing the Unix timestamp in seconds.

closest

closest block to the provided timestamp, either before or after.

{
  "message": "OK",
  "result": {
    "blockNumber": "2165403"
  },
  "status": "1"
}

Get the latest block number

eth_block_number

Mimics Ethereum JSON RPC's eth_blockNumber.

Example:

https://fonscan.io/api
   ?module=block
   &action=eth_block_number
Parameter
Description

id

optional nonnegative integer that represents the json rpc request id.

{
  "jsonrpc": "2.0",
  "result": "0x103538a",
  "id": 1
}
PreviousAccountNextContract

Last updated 1 year ago

Note: .

More on .

โ˜”
How to convert date/time to a Unix timestamp
json rpc request id