Skip to main content

REST API

The Cedra REST API provides direct access to blockchain state and transaction submission. Every response includes headers with current chain state (X-CEDRA-LEDGER-VERSION, X-CEDRA-BLOCK-HEIGHT, etc.).

Browse all endpoints in the interactive explorer: testnet.cedra.dev/v1/spec


Accounts

MethodPathDescription
GET/accounts/{address}Get account info
GET/accounts/{address}/resourcesGet all resources
GET/accounts/{address}/resource/{type}Get specific resource
GET/accounts/{address}/modulesGet all modules
GET/accounts/{address}/module/{name}Get specific module
GET/accounts/{address}/balance/{asset_type}Get balance
GET/accounts/{address}/transactionsGet account transactions
GET/accounts/{address}/events/{creation_number}Get events

Transactions

MethodPathDescription
GET/transactionsList transactions
POST/transactionsSubmit transaction
GET/transactions/by_hash/{hash}Get by hash
GET/transactions/by_version/{version}Get by version
GET/transactions/wait_by_hash/{hash}Wait for transaction
POST/transactions/simulateSimulate transaction
POST/transactions/encode_submissionEncode for signing
POST/transactions/batchSubmit batch

Blocks

MethodPathDescription
GET/blocks/by_height/{height}Get block by height
GET/blocks/by_version/{version}Get block by version

View Functions

MethodPathDescription
POST/viewExecute read-only Move function

General

MethodPathDescription
GET/Ledger info
GET/infoNode info
GET/-/healthyHealth check
GET/estimate_gas_priceGas price estimate

Response Headers

All responses include blockchain state:

HeaderDescription
X-CEDRA-CHAIN-IDChain ID
X-CEDRA-LEDGER-VERSIONCurrent ledger version
X-CEDRA-BLOCK-HEIGHTCurrent block height
X-CEDRA-EPOCHCurrent epoch
X-CEDRA-LEDGER-TIMESTAMPUSECTimestamp (microseconds)
X-CEDRA-CURSORPagination cursor

Content Types

Accept HeaderDescription
application/jsonJSON (default)
application/x-bcsBinary Canonical Serialization