Download OpenAPI specification:Download
This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission.
It is designed for use by wallets and explorers. For simple use cases, you can typically use the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up.
The Gateway API is implemented by the Network Gateway, which is configured to read from full node(s) to extract and index data from the network.
This document is an API reference documentation, visit User Guide to learn more about how to run a Gateway of your own.
Please see the latest release notes.
We give no guarantees that other endpoints will not change before Babylon mainnet launch, although changes are expected to be minimal.
The Gateway API is split into 5 sub APIs:
/status/*
) - For status and configuration details for the Gateway / Network./transaction/*
) - For transaction construction, preview, submission, and monitoring the status of an individual transaction./transaction/*
) - For reading committed transactions./state/*
) - For reading the current or past ledger state of the network./statistics/*
) - For calculating particular statistics against the current or past ledger state of the network.Interacting with this API effectively may require knowledge about the Radix Babylon Transaction Model and the State Model.
We share some very high-level details below, but please see the official documentation for more details on this.
User transactions are formed of a core "intent", which is then signed by 0+ signatories, before being notarized. The output is called a notarized payload. It is this notarized transaction payload which is submitted to the network.
For most users, this construction process will generally happen in their Radix Wallet. If you wish to construct transactions programmatically or offline, you will need to integrate the Radix Engine Toolkit into your application for construction and finalization.
Once submitted, a transaction payload can end up being either rejected or committed. Transactions get rejected if they fail to pass certain criteria at the given time. A transaction payload can be marked as a:
A given intent typically is only part of one submitted notarized payload, but it's possible for a notary to notarize and submit multiple payloads for the same intent. The Radix Engine ensures that any intent can only be committed once.
A committed transaction is either committed with an outcome of "Success" or "Failure":
Only committed transactions appear on ledger.
The gateway will attempt to submit your transaction to nodes on the network. If it gets temporarily rejected, the error message will be recorded against the transaction, but the Gateway will retry submission for a limited time. During this time, the status will be reported as pending.
The Radix Engine consists of "global entities". A global entity has a Bech32m Address, with a human-readable-prefix (and prefix byte) matching the entity type.
As an example, entities include concepts like Components, Packages, Vaults, Resource Managers and Key-Value Stores.
Each entity owns substates which store data, and these substates can own other entities. For example, an Account Component has a struct substate which owns a Key-Value Store. This Key-Value store has an entry for each resoure the Account owns, and each Key-Value Store Entry owns a corresponding Vault.
For each global entity, the Gateway aggregates its owned resources by looking at the contents of Vaults in the subtree of entities under that global entity.
The API is designed in a JSON-RPC-like style, using HTTP as a transport layer, which means that:
code
type
discriminator, allowing for structured error interpretation in client software.Collections can grow in size therefore every dynamic-length collection is a subject to pagination where a generic data struct is used to represent a chunk (page) of underlying data. Gateway API uses cursor-based pagination model where the sole existence of the cursor indicates that next chunk (page) of the underlying collection is available.
collection {
int64? total_count,
string? next_cursor,
T[] items
}
total_count
(optional) if present specifies the overall size of the underlying collection,next_cursor
(optional) if present indicates that the next chunk (page) exists and can be fetched using collection-specific endpoint and cursor value,items
a chunk (page) of unerlying collection items.Returns the Gateway API version and current ledger state.
Network Gateway Information
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "release_info": {
- "release_version": "string",
- "open_api_schema_version": "string",
- "image_tag": "string"
}
}
Returns network identifier, network name and well-known network addresses.
Network Configuration
{- "network_id": "<network-id>",
- "network_name": "<network-name>",
- "well_known_addresses": {
- "xrd": "string",
- "secp256k1_signature_virtual_badge": "string",
- "ed25519_signature_virtual_badge": "string",
- "package_of_direct_caller_virtual_badge": "string",
- "global_caller_virtual_badge": "string",
- "system_transaction_badge": "string",
- "package_owner_badge": "string",
- "validator_owner_badge": "string",
- "account_owner_badge": "string",
- "identity_owner_badge": "string",
- "package_package": "string",
- "resource_package": "string",
- "account_package": "string",
- "identity_package": "string",
- "consensus_manager_package": "string",
- "access_controller_package": "string",
- "transaction_processor_package": "string",
- "metadata_module_package": "string",
- "royalty_module_package": "string",
- "access_rules_package": "string",
- "genesis_helper_package": "string",
- "faucet_package": "string",
- "consensus_manager": "string",
- "genesis_helper": "string",
- "faucet": "string",
- "pool_package": "string"
}
}
Returns information needed to construct a new transaction including current epoch
number.
Returns information needed to construct transaction.
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}
}
Previews transaction against the network.
This endpoint is effectively a proxy towards CoreApi's /v0/transaction/preview
endpoint. See CoreApi's documentation for more details.
Successful Preview
Client-originated request error
{- "manifest": "string",
- "blobs_hex": [
- "string"
], - "start_epoch_inclusive": 10000000000,
- "end_epoch_exclusive": 10000000000,
- "notary_public_key": {
- "key_type": "EcdsaSecp256k1"
}, - "notary_is_signatory": true,
- "tip_percentage": 255,
- "nonce": 0,
- "signer_public_keys": [
- {
- "key_type": "EcdsaSecp256k1"
}
], - "flags": {
- "use_free_credit": true,
- "assume_all_signature_proofs": true,
- "skip_epoch_check": true
}
}
{- "encoded_receipt": "string",
- "receipt": { },
- "resource_changes": [
- { }
], - "logs": [
- {
- "level": "string",
- "message": "string"
}
]
}
Submits a signed transaction payload to the network.
Successful Submission
Client-originated request error
{- "notarized_transaction_hex": "string"
}
{- "duplicate": true
}
Returns the committed details and receipt of the transaction for a given transaction identifier.
Transaction identifiers which don't correspond to a committed transaction will return a TransactionNotFoundError
.
Transaction Status
Client-originated request error
{- "intent_hash": "<transaction-intent-hash>"
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "transaction": {
- "state_version": 0,
- "epoch": 0,
- "round": 0,
- "round_timestamp": "string",
- "transaction_status": "Unknown",
- "payload_hash": "string",
- "intent_hash": "string",
- "fee_paid": "string",
- "affected_global_entities": [
- "string"
], - "confirmed_at": "2019-08-24T14:15:22Z",
- "error_message": "string",
- "raw_hex": "string",
- "receipt": {
- "status": { },
- "fee_summary": { },
- "costing_parameters": { },
- "fee_destination": { },
- "fee_source": { },
- "state_updates": { },
- "next_epoch": { },
- "output": { },
- "events": { },
- "error_message": "string"
}, - "message": { }
}
}
Returns overall transaction status and all of its known payloads based on supplied intent hash.
Transaction Status
Client-originated request error
{- "intent_hash": "<transaction-intent-hash>"
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "status": "Unknown",
- "known_payloads": [
- {
- "payload_hash": "string",
- "status": "Unknown",
- "error_message": "string"
}
], - "error_message": "string"
}
Returns transactions which have been committed to the ledger.
Transactions (paginated)
Client-originated request error
{- "limit_per_page": 5
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "state_version": 0,
- "epoch": 0,
- "round": 0,
- "round_timestamp": "string",
- "transaction_status": "Unknown",
- "payload_hash": "string",
- "intent_hash": "string",
- "fee_paid": "string",
- "affected_global_entities": [
- "string"
], - "confirmed_at": "2019-08-24T14:15:22Z",
- "error_message": "string",
- "raw_hex": "string",
- "receipt": {
- "status": { },
- "fee_summary": { },
- "costing_parameters": { },
- "fee_destination": { },
- "fee_source": { },
- "state_updates": { },
- "next_epoch": { },
- "output": { },
- "events": { },
- "error_message": "string"
}, - "message": { }
}
]
}
Returns detailed information for collection of entities. Aggregate resources globally by default.
Entity Details
Client-originated request error
{- "addresses": [
- "<entity-address>"
], - "aggregation_level": "Vault",
- "opt_ins": {
- "ancestor_identities": true,
- "component_royalty_vault_balance": true,
- "package_royalty_vault_balance": true,
- "non_fungible_include_nfids": true,
- "explicit_metadata": [
- "name",
- "description"
]
}
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "items": [
- {
- "address": "string",
- "fungible_resources": {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "aggregation_level": "Global",
- "resource_address": "string",
- "explicit_metadata": {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- null
]
}
}
]
}, - "non_fungible_resources": {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "aggregation_level": "Global",
- "resource_address": "string",
- "explicit_metadata": {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- null
]
}
}
]
}, - "ancestor_identities": {
- "parent_address": "string",
- "owner_address": "string",
- "global_address": "string"
}, - "metadata": {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "key": "string",
- "value": {
- "raw_hex": "string",
- "programmatic_json": { },
- "typed": {
- "type": null
}
}, - "is_locked": true,
- "last_updated_at_state_version": 0
}
]
}, - "explicit_metadata": {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "key": "string",
- "value": {
- "raw_hex": "string",
- "programmatic_json": { },
- "typed": {
- "type": null
}
}, - "is_locked": true,
- "last_updated_at_state_version": 0
}
]
}, - "details": {
- "type": "FungibleResource"
}
}
]
}
Returns all the metadata properties associated with a given global entity. The returned response is in a paginated format, ordered by first appearance on the ledger.
Entity Metadata (paginated)
Client-originated request error
{- "address": "<entity-address>"
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "key": "string",
- "value": {
- "raw_hex": "string",
- "programmatic_json": { },
- "typed": {
- "type": "String"
}
}, - "is_locked": true,
- "last_updated_at_state_version": 0
}
], - "address": "string"
}
Returns the total amount of each fungible resource owned by a given global entity. Result can be aggregated globally or per vault. The returned response is in a paginated format, ordered by the resource's first appearance on the ledger.
Entity Fungibles (paginated)
Client-originated request error
{- "address": "<component-entity-address>"
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "aggregation_level": "Global",
- "resource_address": "string",
- "explicit_metadata": {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "key": "string",
- "value": {
- "raw_hex": "string",
- "programmatic_json": { },
- "typed": {
- "type": null
}
}, - "is_locked": true,
- "last_updated_at_state_version": 0
}
]
}
}
], - "address": "string"
}
Returns vaults for fungible resource owned by a given global entity. The returned response is in a paginated format, ordered by the resource's first appearance on the ledger.
Entity Fungibles (paginated)
Client-originated request error
{- "address": "<component-entity-address>",
- "resource_address": "<resource_address>"
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "vault_address": "string",
- "amount": "string",
- "last_updated_at_state_version": 0
}
], - "address": "string",
- "resource_address": "string"
}
Returns the total amount of each non-fungible resource owned by a given global entity. Result can be aggregated globally or per vault. The returned response is in a paginated format, ordered by the resource's first appearance on the ledger.
Entity Non-Fungibles (paginated)
Client-originated request error
{- "address": "<component-entity-address>"
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "aggregation_level": "Global",
- "resource_address": "string",
- "explicit_metadata": {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "key": "string",
- "value": {
- "raw_hex": "string",
- "programmatic_json": { },
- "typed": {
- "type": null
}
}, - "is_locked": true,
- "last_updated_at_state_version": 0
}
]
}
}
], - "address": "string"
}
Returns vaults for non fungible resource owned by a given global entity. The returned response is in a paginated format, ordered by the resource's first appearance on the ledger.
Entity Fungibles (paginated)
Client-originated request error
{- "address": "<component-entity-address>",
- "resource_address": "<resource_address>"
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- "string"
], - "vault_address": "string",
- "last_updated_at_state_version": 0
}
], - "address": "string",
- "resource_address": "string"
}
Returns all non-fungible IDs of a given non-fungible resource owned by a given entity. The returned response is in a paginated format, ordered by the resource's first appearence on the ledger.
Entity Non-Fungible IDs (paginated)
Client-originated request error
{- "address": "<component-entity-address>",
- "resource_address": null,
- "vault_address": null
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "total_count": 0,
- "next_cursor": "string",
- "items": [
- "string"
], - "address": "string",
- "resource_address": "string"
}
Returns the non-fungible IDs of a given non-fungible resource. Returned response is in a paginated format, ordered by their first appearance on the ledger.
Non-Fungible IDs (paginated)
Client-originated request error
{- "resource_address": "<non-fungible-entity-address>"
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "resource_address": "string",
- "non_fungible_ids": {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- "string"
]
}
}
Returns data associated with a given non-fungible ID of a given non-fungible resource.
Non-Fungible ID Data
Client-originated request error
{- "resource_address": "<non-fungible-entity-address>",
- "non_fungible_ids": [
- "#1#"
]
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "resource_address": "string",
- "non_fungible_id_type": "String",
- "non_fungible_ids": [
- {
- "is_burned": true,
- "non_fungible_id": "string",
- "data": {
- "raw_hex": "string",
- "programmatic_json": { }
}, - "last_updated_at_state_version": 0
}
]
}
Returns location of a given non-fungible ID.
Non-Fungible ID Location
Client-originated request error
{- "resource_address": "<non-fungible-entity-address>",
- "non_fungible_ids": [
- "#1#"
]
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "resource_address": "string",
- "non_fungible_ids": [
- {
- "non_fungible_id": "string",
- "owning_vault_address": "string",
- "is_burned": true,
- "last_updated_at_state_version": 0
}
]
}
Returns data (value) associated with a given key of a given key-value store.
Non-Fungible ID Data
Client-originated request error
{- "key_value_store_address": "<key-value-store-address>",
- "keys": [
- {
- "key_hex": "edafaaccee"
}, - {
- "key_hex": "ffbbaa2311"
}
]
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "key_value_store_address": "string",
- "entries": [
- {
- "key": {
- "raw_hex": "string",
- "programmatic_json": { }
}, - "value": {
- "raw_hex": "string",
- "programmatic_json": { }
}, - "last_updated_at_state_version": 0,
- "is_locked": true
}
]
}
Validators List
Client-originated request error
{- "at_ledger_state": null
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "validators": {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "address": "string",
- "stake_vault": {
- "balance": "string",
- "last_changed_at_state_version": 0,
- "address": "string"
}, - "pending_xrd_withdraw_vault": {
- "balance": "string",
- "last_changed_at_state_version": 0,
- "address": "string"
}, - "locked_owner_stake_unit_vault": {
- "balance": "string",
- "last_changed_at_state_version": 0,
- "address": "string"
}, - "pending_owner_stake_unit_unlock_vault": {
- "balance": "string",
- "last_changed_at_state_version": 0,
- "address": "string"
}, - "state": { },
- "active_in_epoch": {
- "stake": "string",
- "stake_percentage": 0,
- "key": {
- "key_type": "EcdsaSecp256k1"
}
}, - "metadata": {
- "total_count": 0,
- "next_cursor": "string",
- "items": [
- {
- "key": "string",
- "value": {
- "raw_hex": null,
- "programmatic_json": { },
- "typed": null
}, - "is_locked": true,
- "last_updated_at_state_version": 0
}
]
}
}
]
}
}
Validators Uptime
Client-originated request error
{- "at_ledger_state": {
- "state_version": 0,
- "timestamp": "2019-08-24T14:15:22Z",
- "epoch": 0,
- "round": 0
}, - "from_ledger_state": {
- "state_version": 0,
- "timestamp": "2019-08-24T14:15:22Z",
- "epoch": 0,
- "round": 0
}, - "validator_addresses": [
- "string"
]
}
{- "ledger_state": {
- "network": "<network-name>",
- "state_version": 0,
- "proposer_round_timestamp": "string",
- "epoch": 0,
- "round": 0
}, - "validators": {
- "items": [
- {
- "address": "string",
- "proposals_made": 0,
- "proposals_missed": 0,
- "epochs_active_in": 0
}
]
}
}