Join our
Discord!
LogoLogo
SupraScan ExplorerStarKey WalletDiscord
MoveVM
  • Network
  • Oracles
  • Automation
  • SupraNova
  • Guides
MoveVM
  • Overview
  • Getting Started
    • Install Supra CLI with Docker
    • Create a Supra Account
    • Create a Move Package
      • Initialize a Package
      • Write a Module
      • Compile and Publish
      • Interact with a Package
    • Create a dApp with StarKey
  • Network Information
  • Token Standards
  • Learn Move 101
    • Getting Started with Move
    • Unsigned Integers in Move
    • Math Operations in Move
    • Using Vectors in Move
    • Reading Resource Data with borrow_global
    • Passing Data in Move: Value vs. Reference
    • Adding Elements with vector::push_back
    • Emitting Events with event::emit
  • Move Book
    • Getting Started
      • Modules and Scripts
      • Move Tutorial
    • Primitive Types
      • Integers
      • Bool
      • Address
      • Vector
      • Signer
      • References
      • Tuples and Unit
    • Basic Concepts
      • Local Variables and Scope
      • Equality
      • Abort and Assert
      • Conditionals
      • While, For, and Loop
      • Functions
      • Structs and Resources
      • Constants
      • Generics
      • Type Abilities
      • Uses and Aliases
      • Friends
      • Packages
      • Package Upgrades
      • Unit Tests
    • Global Storage
      • Structure
      • Operators
    • Reference
      • Standard Library
      • Coding Conventions
  • TypeScript SDK
    • Guides
      • Create Supra Accounts
      • Publish a Package
    • Documentation
    • Repository
  • Rest API
    • Mainnet
      • Accounts
      • Faucet
      • Transactions
      • Block
      • View
      • Consensus
      • Events
      • Tables
    • Testnet
      • Accounts
      • Faucet
      • Transactions
      • Block
      • View
      • Events
      • Tables
  • Developer Resources
    • Supra Dapp Templates
    • Supra Move VS Code Extension
  • Links
    • Supra DevHub
    • SupraScan Block Explorer
    • StarKey Wallet
    • Live Data Feeds
    • Whitepapers
    • Security Audits
    • Supra's Official GitHub
Powered by GitBook
On this page
  1. Rest API
  2. Testnet

Block

PreviousTransactionsNextView

Block Api

Deprecated

Get latest block v1

get

Get the header of the most recently finalized block.

Responses
200
Returns the header of the most recently finalized block.
application/json
Responseone of
nullOptional
or
get
GET /rpc/v1/block HTTP/1.1
Host: rpc-testnet.supra.com
Accept: */*
200

Returns the header of the most recently finalized block.

No content

Deprecated

Get block by height v1

get

Get information about the block that has been finalized at the given height.

Path parameters
heightinteger · u-int64Required

Block height

Query parameters
with_finalized_transactionsbooleanRequired

If true, returns all transactions that were finalized by this block in the order that they were executed.

Responses
200
Information about the block that has been finalized at the given height.
application/json
Responseone of
nullOptional
or
get
GET /rpc/v1/block/height/{height} HTTP/1.1
Host: rpc-testnet.supra.com
Accept: */*
200

Information about the block that has been finalized at the given height.

No content

Deprecated

Get block by hash v1

get

Get the header of the block with the given hash.

Path parameters
block_hashstringRequired

Hash of block to retrieve

Responses
200
The header of the block with the given hash.
application/json
Responseone of
nullOptional
or
get
GET /rpc/v1/block/{block_hash} HTTP/1.1
Host: rpc-testnet.supra.com
Accept: */*
200

The header of the block with the given hash.

No content

Get transactions by block hash v1

get

Get a list containing the hashes of the transactions that were finalized in the block with the given hash in the order that they were executed.

Path parameters
block_hashstringRequired

Hex encoded block hash

Responses
200
List of the hashes of the transactions contained in the block.
application/json
Responsestring[]

Hex encoded hash

get
GET /rpc/v1/block/{block_hash}/transactions HTTP/1.1
Host: rpc-testnet.supra.com
Accept: */*
200

List of the hashes of the transactions contained in the block.

[
  "text"
]

Get latest block v2

get

Get the header of the most recently finalized block.

Responses
200
Returns the header of the most recently finalized block.
application/json
get
GET /rpc/v2/block HTTP/1.1
Host: rpc-testnet.supra.com
Accept: */*
200

Returns the header of the most recently finalized block.

{
  "author": "text",
  "hash": "text",
  "height": 1,
  "parent": "text",
  "timestamp": {
    "timestamp": 1
  },
  "view": {
    "epoch_id": {
      "chain_id": 1,
      "epoch": 1
    },
    "round": 1
  }
}

Get block by height v2

get

Get information about the block that has been finalized at the given height.

Path parameters
heightinteger · u-int64Required

Block height

Query parameters
with_finalized_transactionsbooleanRequired

If true, returns all transactions that were finalized by this block in the order that they were executed.

Responses
200
Information about the block that has been finalized at the given height.
application/json
get
GET /rpc/v2/block/height/{height} HTTP/1.1
Host: rpc-testnet.supra.com
Accept: */*
200

Information about the block that has been finalized at the given height.

{
  "header": {
    "author": "text",
    "hash": "text",
    "height": 1,
    "parent": "text",
    "timestamp": {
      "timestamp": 1
    },
    "view": {
      "epoch_id": {
        "chain_id": 1,
        "epoch": 1
      },
      "round": 1
    }
  },
  "transactions": [
    {
      "authenticator": {},
      "block_header": null,
      "hash": "text",
      "header": {
        "chain_id": 1,
        "expiration_timestamp": {
          "timestamp": 1
        },
        "sender": "text",
        "sequence_number": 1,
        "gas_unit_price": 1,
        "max_gas_amount": 1
      },
      "payload": {},
      "output": {
        "Dkg": "Success"
      },
      "status": "Success"
    }
  ]
}

Get block by hash v2

get

Get the header of the block with the given hash.

Path parameters
block_hashstringRequired

Hex encoded block hash

Responses
200
The header of the block with the given hash.
application/json
get
GET /rpc/v2/block/{block_hash} HTTP/1.1
Host: rpc-testnet.supra.com
Accept: */*
200

The header of the block with the given hash.

{
  "author": "text",
  "hash": "text",
  "height": 1,
  "parent": "text",
  "timestamp": {
    "timestamp": 1
  },
  "view": {
    "epoch_id": {
      "chain_id": 1,
      "epoch": 1
    },
    "round": 1
  }
}

Get latest block v3

get

Get the meta information of the most recently finalized and executed block.

Responses
200
Returns the header of the most recently finalized block.
application/json
get
GET /rpc/v3/block HTTP/1.1
Host: rpc-testnet.supra.com
Accept: */*
200

Returns the header of the most recently finalized block.

{
  "header": {
    "author": "text",
    "hash": "text",
    "height": 1,
    "parent": "text",
    "timestamp": {
      "timestamp": 1
    },
    "view": {
      "epoch_id": {
        "chain_id": 1,
        "epoch": 1
      },
      "round": 1
    }
  },
  "execution_statistics": {
    "automated_txn_count": null,
    "automated_txn_gas_unit_price": null,
    "block_gas_unit_price_min": null,
    "block_gas_unit_price_max": null,
    "block_total_user_gas_used": null,
    "block_total_automated_gas_used": null,
    "user_txn_count": null
  }
}

Get block by height v3

get

Get information about the block that has been finalized at the given height.

Path parameters
heightinteger · u-int64Required

Block height

Query parameters
with_finalized_transactionsbooleanOptional

If true, returns all transactions that were finalized by this block in the order that they were executed.

typestring · enumOptional

Type of the transaction to be queried.

Possible values:
Responses
200
Information about the block that has been finalized at the given height.
application/json
get
GET /rpc/v3/block/height/{height} HTTP/1.1
Host: rpc-testnet.supra.com
Accept: */*
200

Information about the block that has been finalized at the given height.

{
  "header": {
    "author": "text",
    "hash": "text",
    "height": 1,
    "parent": "text",
    "timestamp": {
      "timestamp": 1
    },
    "view": {
      "epoch_id": {
        "chain_id": 1,
        "epoch": 1
      },
      "round": 1
    }
  },
  "execution_statistics": {
    "automated_txn_count": null,
    "automated_txn_gas_unit_price": null,
    "block_gas_unit_price_min": null,
    "block_gas_unit_price_max": null,
    "block_total_user_gas_used": null,
    "block_total_automated_gas_used": null,
    "user_txn_count": null
  },
  "transactions": [
    {
      "authenticator": {},
      "block_header": null,
      "hash": "text",
      "header": {
        "chain_id": 1,
        "expiration_timestamp": {
          "timestamp": 1
        },
        "sender": "text",
        "sequence_number": 1,
        "gas_unit_price": 1,
        "max_gas_amount": 1
      },
      "payload": {},
      "output": {
        "Dkg": "Success"
      },
      "status": "Success",
      "txn_type": "user"
    }
  ]
}

Get block by hash v3

get

Get the header and execution output statistics of the block with the given hash.

Path parameters
block_hashstringRequired

Hex encoded block hash

Responses
200
The header of the block with the given hash.
application/json
get
GET /rpc/v3/block/{block_hash} HTTP/1.1
Host: rpc-testnet.supra.com
Accept: */*
200

The header of the block with the given hash.

{
  "header": {
    "author": "text",
    "hash": "text",
    "height": 1,
    "parent": "text",
    "timestamp": {
      "timestamp": 1
    },
    "view": {
      "epoch_id": {
        "chain_id": 1,
        "epoch": 1
      },
      "round": 1
    }
  },
  "execution_statistics": {
    "automated_txn_count": null,
    "automated_txn_gas_unit_price": null,
    "block_gas_unit_price_min": null,
    "block_gas_unit_price_max": null,
    "block_total_user_gas_used": null,
    "block_total_automated_gas_used": null,
    "user_txn_count": null
  }
}

Get transactions by block hash v3

get

Get a list containing the hashes of the transactions that were finalized in the block with the given hash in the order that they were executed.

Path parameters
block_hashstringRequired

Hex encoded block hash

Query parameters
typestring · enumOptional

Type of the transaction to be queried.

Possible values:
Responses
200
List of the hashes of the transactions contained in the block.
application/json
Responsestring[]

Hex encoded hash

get
GET /rpc/v3/block/{block_hash}/transactions HTTP/1.1
Host: rpc-testnet.supra.com
Accept: */*
200

List of the hashes of the transactions contained in the block.

[
  "text"
]
  • GETGet latest block v1
  • GETGet block by height v1
  • GETGet block by hash v1
  • GETGet transactions by block hash v1
  • GETGet latest block v2
  • GETGet block by height v2
  • GETGet block by hash v2
  • GETGet latest block v3
  • GETGet block by height v3
  • GETGet block by hash v3
  • GETGet transactions by block hash v3