Star Tower Chain
Developer Support
Developer Support
  • StarTowerChain Open-Source Explorer
  • 💡About SAVWSCAN
    • Features
  • 🫂Using SAVWSCAN
    • Getting Started
      • Glossary of Terms
      • Main Menu
      • Blocks
      • Transaction Types
      • Beacon Chain Withdrawal Views
  • CSV Exports
  • Token Support
    • RIP-1155 Support
  • 🧑‍💻Developer Support
    • SAVWSCAN APIS
      • Requests & Limits
    • REST API Endpoints
      • Stats API
      • Interpreter API
    • JSON RPC & SAVW Compatible RPC Endpoints
      • Account
      • Block
      • Contract
      • Logs
      • Stats
      • Token
      • Transaction
      • StarTower RPC API
      • GraphQL in StarTower
  • Smart Contract Verification
    • StarTower UI
    • StarTower smart-contract verification API
    • Hardhat Verification Plugin
      • Sourcify Plugin for Hardhat
    • Foundry Verification
    • Sourcify Verification
    • OpenZeppelin Contract Verification
    • Automate verifications with Catapulta
  • 🏃‍♂️Setup and Run StarTowerChain
    • General Overview
      • Separate Indexer, Web App, and API
      • Umbrella Project Organization
      • Indexer Architecture Overview
  • Requirements
    • General Backend Requirements / StarTower Backend Prerequisites
    • Hardware & Hosting Requirements
    • Database Storage Requirements
    • Client Setting Requirements
    • Node Tracing / JSON RPC Requirements
  • ⚙️ENV Variables
    • Backend ENVs: Common
Powered by GitBook
On this page
  • https://instance_base_url/api?module=block
  • Get block reward by block number
  • Get estimated block countdown time by block number
  • Get block number by time stamp
  • Get the latest block number
  1. Developer Support
  2. JSON RPC & SAVW Compatible RPC Endpoints

Block

?module=block

https://instance_base_url/api?module=block

Get block reward by block number

getblockreward

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

Example:

https://instance_base_url/api
   ?module=block
   &action=getblockreward
   &blockno={blockNumber}

ParameterDescription

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 estimated block countdown time by block number

getblockcountdown

Returns the estimated time remaining, in seconds, until a certain block is included in blockchain.

Example:

https://instance_base_url/api
   ?module=block
   &action=getblockcountdown
   &blockno={blockNumber}

ParameterDescription

blockno

integer block number to check block rewards for eg. 2165403

{
  "message": "OK",
  "result": {
    "CurrentBlock": "115334213",
    "CountdownBlock": "116015880",
    "RemainingBlock": "681667",
    "EstimateTimeInSec": "1363349.0"
  },
  "status": "1"
}

Get block number by time stamp

getblocknobytime

Returns the block number created closest to a provided timestamp.

Example:

https://instance_base_url/api
   ?module=block
   &action=getblocknobytime
   &timestamp={blockTimestamp}
   &closest={before/after}

ParameterDescription

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 StarTower JSON RPC's eth_blockNumber.

Example:

https://instance_base_url/api
   ?module=block
   &action=eth_block_number

ParameterDescription

id

optional nonnegative integer that represents the json rpc request id.

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

Last updated 1 month ago

Note: .

More on .

🧑‍💻
How to convert date/time to a Unix timestamp
json rpc request id