openapi: 3.0.0 info: version: v1.5.2 title: Radix Gateway API - Babylon license: name: The Radix License, Version 1.0 url: https://www.radixfoundation.org/licenses/license-v1 x-logo: url: https://cdn.document360.io/50e78792-5410-4ac9-aa43-4612b4d33953/Images/Documentation/radix-logo-banner.png href: https://docs.radixdlt.com description: | 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, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using 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](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. servers: - url: https://mainnet.radixdlt.com - url: https://stokenet.radixdlt.com x-tagGroups: - name: Overview tags: - SubAPIs - Concepts - Architecture - Examples - name: Endpoints tags: - Status - Transaction - Stream - State - Statistics tags: - name: SubAPIs x-displayName: Sub-APIs x-traitTag: true description: | The Gateway API is split into 5 sub APIs: - **Status** (`/status/*`) - For status and configuration details for the Gateway / Network. - **Transaction** (`/transaction/*`) - For transaction construction, preview, submission, and monitoring the status of an individual transaction. - **Stream** (`/transaction/*`) - For reading committed transactions. - **State** (`/state/*`) - For reading the current or past ledger state of the network. - **Statistics** (`/statistics/*`) - For calculating particular statistics against the current or past ledger state of the network. - name: Concepts x-displayName: Concepts x-traitTag: true # Don't display endpoints under this tag description: | 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](http://docs.radixdlt.com) for more details on this. ## Transactions and the Gateway 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: - **Permanent Rejection** if it is never possible for it to be committed (eg it's statically invalid, or only valid up until epoch 100 and it's now epoch 101) - **Temporary Rejection** if it still may be possible that the transaction payload could be committed 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": - **Committed Failure** will result in fees being paid up until the failure point, but all other changes will be discarded. - **Committed Success** will result in all changes being committed. 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. ## State Model 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. - name: Architecture x-traitTag: true description: | ## Request-Response Format The API is designed in a JSON-RPC-like style, using HTTP as a transport layer, which means that: - Requests always use the HTTP POST method. - There is no HTTP cache involved. - Client-originated errors result in HTTP 4xx error responses. - Server-originated errors result in HTTP 5xx error responses: - The error object contains an HTTP-like `code` - The error object also contains a structured/typed properties, with a `type` discriminator, allowing for structured error interpretation in client software. ## Pagination Model Many collections have dynamic length, so these are exposed through a pagination model. The Gateway API uses cursor-based pagination model where the existence of the cursor indicates that next chunk (page) of the underlying collection is available, and can be used in a subsequent request to query for it. ``` collection { int64? total_count, string? next_cursor, T[] items } ``` - `total_count` *(optional)* if present indicates 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 underlying collection items. To provide consistent reads when querying for the next pages, it's required to provide the `at_ledger_state` parameter. It will enforce that data returned for all pages is generated using the same ledger state. ## State consistency and versioning Each response from a state endpoint returns data from a single "snapshot" of the ledger. By default, the latest available ledger version is used. All state responses include a `ledger_state` property in their root object, which captures which ledger version was used by the gateway to generate the response. Because the state of entities constantly changes, the `ledger_state` object makes it clear which state was used to generate the response. The `ledger_state` object includes the `state_version` (ie the unique ID of that state version, which can also be used to uniquely identify the last transaction which brought the ledger to that state version), the `timestamp` (which may be shared by neighbouring transactions, but does not decrease) and the epoch and round in that epoch when the transaction was committed (again, the pair `(epoch, round)` may be shared by neighbouring transactions). ## Browsing historical data All endpoints with an `at_ledger_state` parameter allow you to request a particular snapshot is used for generating the response. In this way, you can browse historical state at a given point in time. You can specify one of: - `state_version` - `timestamp` - which will query against the nearest state version before that timestamp - `epoch` - which will query against the result of the first transaction in that epoch - A pair of `epoch` and `round` - which will query against the result of the first transaction in that epoch and round For example, the following request will return the current state (at the current tip of the ledger) for the entity with address: `resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd` (ie XRD). ``` /state/entity/details { "addresses": [ "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd" ] } ``` Whereas the following request will return the state of XRD as it was at state version 1000, near the start of the Babylon ledger: ``` /state/entity/details { "addresses": [ "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd" ], "at_ledger_state": { "state_version": 1000 } } ``` ## Consistent reads As described in [Browsing historical data](#section/Browsing-historical-data) it is possible to specify the exact ledger state by providing the `at_ledger_state` parameter. It can be used to browse historical data but it also allows consistent reads when making multiple requests (either when paginating or when collecting data from multiple endpoints). Imagine a situation when your key value store contains 128 keys. To fetch all the keys and it is data you would need to make at least 4 requests (2 to paginate through all keys and 2 to fetch all the data). Using the same `at_ledger_state` parameter value it is guaranteed that you are fetching all the data from exactly the same ledger state. Example requests: First page of keys: ``` /state/key-value-store/keys { "key_value_store_address": "internal_keyvaluestore_rdx1kprq4hx5892fuezay6tyajyu0gr2jeu8j7alauxen46xu8ufzvecph" } ``` Response: ``` { "ledger_state": { "network": "mainnet", "state_version": 50576725, "proposer_round_timestamp": "2024-02-20T16:46:22.343Z", "epoch": 74324, "round": 84 }, "total_count": 128, "next_cursor": "eyJvIjoxMDB9", "items": [...] } ``` Second page of keys: ``` /state/key-value-store/keys { "key_value_store_address": "internal_keyvaluestore_rdx1kprq4hx5892fuezay6tyajyu0gr2jeu8j7alauxen46xu8ufzvecph", "cursor": "eyJvIjoxMDB9", "at_ledger_state": { "state_version": 50576725 } } ``` Response: ``` { "ledger_state": { "network": "mainnet", "state_version": 50576725, "proposer_round_timestamp": "2024-02-20T16:46:22.343Z", "epoch": 74324, "round": 84 }, "total_count": 128, "items": [] } ``` Get data for one of the keys: ``` /state/key-value-store/data { "key_value_store_address": "internal_keyvaluestore_rdx1kprq4hx5892fuezay6tyajyu0gr2jeu8j7alauxen46xu8ufzvecph", "keys": [ { "key_hex": "5c80c0c72cd2cbca7263e84e9ec83a6c9cee2121d466bf3cc8640d4d06909af6" } ], "at_ledger_state": { "state_version": 50576725 } } ``` Response: ``` { "ledger_state": { "network": "mainnet", "state_version": 50577454, "proposer_round_timestamp": "2024-02-20T16:49:22.861Z", "epoch": 74324, "round": 795 }, "key_value_store_address": "internal_keyvaluestore_rdx1kprq4hx5892fuezay6tyajyu0gr2jeu8j7alauxen46xu8ufzvecph", "entries": [ { "key": { ... } }, "value": { ... }, "last_updated_at_state_version": 1351581, "is_locked": false } ] } ``` All the above requests were executed against exactly the same ledger snapshot (state version `50577454`). ## Using endpoints with opt-in features To reduce bandwith and wasted work, some properties in certain endpoints are optional. Most opt-ins default to `false` if not provided, and you can ask for the supplementary data by explicitly setting the corresponding opt-in property to `true`. Some opt-ins for backwards-compatibility default to `true`. In these cases, explicitly providing a value of `false` will opt out of the data and save bandwidth. Endpoints that currently support opt-ins include the following. Check out the request schemas under the endpoints themselves for more detail on how to request opt-ins: ``` /transaction/committed-details /stream/transactions /state/entity/details /state/entity/page/fungibles/ /state/entity/page/non-fungibles/ /state/entity/page/non-fungible-vaults/ ``` For example, the following request will return a simple, short response with opt-ins disabled: ``` /transaction/committed-details { "intent_hash": "txid_rdx1t44y7lrqtrmn0pq4gxgsmn035lh5glws273h0lsff37jnzj2ylls3aeumn" } ``` ``` // Response { "ledger_state": { "network": "mainnet", "state_version": 5151578, "proposer_round_timestamp": "2023-10-11T07:21:03.167Z", "epoch": 36452, "round": 1060 }, "transaction": { "transaction_status": "CommittedSuccess", "state_version": 5150877, "epoch": 36452, "round": 362, "round_timestamp": "2023-10-11T07:18:30.417Z", "payload_hash": "notarizedtransaction_rdx1hjlstgpadgpyeulp5yahrcz56ymkmsukmrjv42nwzvygfl9nyfhsxccm42", "intent_hash": "txid_rdx1t44y7lrqtrmn0pq4gxgsmn035lh5glws273h0lsff37jnzj2ylls3aeumn", "fee_paid": "0.25417642453", "confirmed_at": "2023-10-11T07:18:30.417Z", "receipt": { "status": "CommittedSuccess", "output": [ { "hex": "5c2100", "programmatic_json": null }, { "hex": "5c90f8ef824eb480c16bbceebcc36d0e263b9ebf287cdcab710332344104f11c", "programmatic_json": null }, { "hex": "5c2100", "programmatic_json": null }, { "hex": "5c2100", "programmatic_json": null } ] } } } ``` Or, if we're interested in the raw transaction payload, we can enable it in the response by requesting the `"raw_hex"` opt-in, which will result in the `raw_hex` property being returned: ``` /transaction/committed-details { "intent_hash": "txid_rdx1t44y7lrqtrmn0pq4gxgsmn035lh5glws273h0lsff37jnzj2ylls3aeumn", "opt_ins": { "raw_hex": true } } ``` ``` // Response { "ledger_state": { "network": "mainnet", "state_version": 5152002, "proposer_round_timestamp": "2023-10-11T07:22:45.886Z", "epoch": 36453, "round": 152 }, "transaction": { "transaction_status": "CommittedSuccess", "state_version": 5150877, "epoch": 36452, "round": 362, "round_timestamp": "2023-10-11T07:18:30.417Z", "payload_hash": "notarizedtransaction_rdx1hjlstgpadgpyeulp5yahrcz56ymkmsukmrjv42nwzvygfl9nyfhsxccm42", "intent_hash": "txid_rdx1t44y7lrqtrmn0pq4gxgsmn035lh5glws273h0lsff37jnzj2ylls3aeumn", "fee_paid": "0.25417642453", "confirmed_at": "2023-10-11T07:18:30.417Z", "raw_hex": "4d22030221022104210707010a648e0000000000000a6e8e000000000000090b86dca62201012007208df9fdf4b8325fffdf300b0c68492ebc0fbe9f17c7fc811c68e6cb16a6eaf5f9010008000020220441038000d1f20f6eaff22df7090ddc21cf738ba70cd700c6e6854ea349ebec4530e80c086c6f636b5f666565210185e08f4fb23e2e21050000000000000000000000000000000041038000d1f20f6eaff22df7090ddc21cf738ba70cd700c6e6854ea349ebec4530e80c087769746864726177210280005da66318c6318c61f5a61b4c6318c6318cf794aa8d295f14e6318c6318c68500003468c609860bac140000000000000000000000000000000280005da66318c6318c61f5a61b4c6318c6318cf794aa8d295f14e6318c6318c68500003468c609860bac14000000000000000000000000000041038000d1f742847eb59027497d466b7404f6b6e3c3f0458c5a7da3eb54858c49ed0c147472795f6465706f7369745f6f725f61626f72742102810000000022000020200022000020220100012101200741017c16c54cf8ba3e3d3487172424b40502404812a7a9ceeda5aa544baa1c2d0f0c1e6cfbb3dd6af5b6aa047231d918e5288e1139d397064326ac4f63283da6686f2201012101200740e82f9e9a002a64cb3dbb2154e7912ef25720c92e0b86a7b0d090ff4c9d9992ef435b5c6d08e577f50423f8a9b831b3fbb9faecf16399a386b8412d2a53f3450f", "receipt": { "status": "CommittedSuccess", "output": [ { "hex": "5c2100", "programmatic_json": null }, { "hex": "5c90f8ef824eb480c16bbceebcc36d0e263b9ebf287cdcab710332344104f11c", "programmatic_json": null }, { "hex": "5c2100", "programmatic_json": null }, { "hex": "5c2100", "programmatic_json": null } ] } } } ``` - name: Examples x-displayName: Examples x-traitTag: true description: | ## Querying for entity data, including fungible and non-fungible resources. The Gateway API has different entry points which can be used to fetch entity data. The `/state/entity/details` is the main endpoint - it takes a list of entity addresses, and returns various details for those entities, which differs per entity type. A detailed specification of the response model for each entity is given in the response schema for the endpoint later in this doc. The endpoint also also supports a number of opt-ins detailed below. Many of these opt-ins return a "first page" of related data for each entity. Further pages can be requested from the `/page/` endpoints. The entity details endpoint is supplemented by various paged endpoints, which return collections: * `/state/entity/page/metadata` → returns entity metadata, and can be used as entry point for further pagination with the cursor returned from `/state/entity/details` * `/state/entity/page/schemas` → returns entity schemas, and can be used as an entry point for further pagination from a cursor returned from `/state/entity/details` * `/state/entity/page/fungibles/` → can be used as an entry point to fetch fungible resources under a given global entity or for further pagination with the cursor returned from `/state/entity/details` * `/state/entity/page/fungible-vaults/` → can be used as an entry point to fetch fungible vaults of a given resource under a given global entity or for further pagination with a cursor returned from `/state/entity/details` * `/state/entity/page/non-fungibles/` → can be used as an entry point to fetch non-fungible resources under a given global entity or for further pagination with a cursor returned from `/state/entity/details` * `/state/entity/page/non-fungible-vaults/` → can be used as an entry point to fetch non-fungible vaults of a given resource under a given global entity or for further pagination with a cursor returned from `/state/entity/details` * `/state/entity/page/non-fungible-vault/ids` → can be used as an entry point to fetch non fungible-ids in a given vault or for further pagination from a cursor returned from `/state/entity/details` * `/state/package/page/blueprints` → can be used as an entry point to fetch blueprints of a given package entity or for further pagination with a cursor returned from `/state/entity/details` * `/state/package/page/codes` → can be used as an entry point to fetch codes of a given package entity or for further pagination with a cursor returned from `/state/entity/details` ### Metadata `/state/entity/details` endpoint returns only the first page of metadata. If the queried entity contains more than one page of metadata items, a `next_cursor` will be returned, which can be used as `cursor` in the `/state/entity/page/metadata` endpoint to fetch further pages. You can also explicitly specify a list of metadata keys which you wish to be included on any returned objects. You can do that by filling the `explicit_metadata` opt-in with the metadata keys you wish to load. For example, the following request will return the regular `metadata` property in the response, but will also contain an `explicit_metadata` section containing `name` and `description` for each returned entity (if they are defined for that entity). ``` /state/entity/details { "addresses": [ "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd" ], "opt_ins": { "explicit_metadata": [ "name", "description" ] } } ``` ``` // Response // ... "explicit_metadata": { "total_count": 2, "items": [ { "key": "name", "value": { "raw_hex": "5c2200010c055261646978", "programmatic_json": { "kind": "Enum", "variant_id": "0", "fields": [ { "kind": "String", "value": "Radix" } ] }, "typed": { "value": "Radix", "type": "String" } }, "is_locked": true, "last_updated_at_state_version": 2 }, { "key": "description", "value": { "raw_hex": "5c2200010c9e01546865205261646978205075626c6963204e6574776f726b2773206e617469766520746f6b656e2c207573656420746f2070617920746865206e6574776f726b2773207265717569726564207472616e73616374696f6e206665657320616e6420746f2073656375726520746865206e6574776f726b207468726f756768207374616b696e6720746f206974732076616c696461746f72206e6f6465732e", "programmatic_json": { "kind": "Enum", "variant_id": "0", "fields": [ { "kind": "String", "value": "The Radix Public Network's native token, used to pay the network's required transaction fees and to secure the network through staking to its validator nodes." } ] }, "typed": { "value": "The Radix Public Network's native token, used to pay the network's required transaction fees and to secure the network through staking to its validator nodes.", "type": "String" } }, "is_locked": true, "last_updated_at_state_version": 2 } ] }, // ... ``` ### Resource aggregation Both fungible and non-fungible resources can be aggregated globally or per vault. This is controlled by the `aggregation_level` request field. * `Global` - If the entity contains multiple vaults of the same resource, or nested components which contains vaults of the same resource, the total balance across all these vaults will be returned. This mode is useful for TVL style calculations. * `Vault` - Each vault is returned separately. This mode is useful for non-fungibles, because you get the vault ids which you can use to paginated ids from a vault. ### Fungible resources opt-in This opt-in returns only the first page of fungible resources under the entity. If the queried entity contains more resources, a `next_cursor` will be returned, which can be used with the `/state/entity/page/fungibles/` endpoint for requesting further pages. If you requested vault aggregation, only the first page of vaults are returned for each resource. If a `next_cursor` is returned, further vaults for that resource can be fetched using that cursor with the `/state/entity/page/fungible-vaults/` endpoint. ### Non-fungible resources opt-in This opt-in returns only the first page of non-fungible resources under the entity. If the queried entity contains more resources, a `next_cursor` will be returned, which can be used with the `/state/entity/page/non-fungibles/` endpoint for requesting further pages. If you requested vault aggregation, only the first page of vaults are returned for each resource . If a `next_cursor` is returned, further vaults for that resource can be fetched using that cursor with the `/state/entity/page/non-fungible-vaults/` endpoint. If the `non_fungible_include_nfids` opt-in is set to true AND vault aggregation was requested, the response will also contain the first page of non-fungible ids in each returned vault. If the vault contains more than one page of ids, a `next_cursor` is returned, which can be used with the `/state/entity/page/non-fungible-vault/ids` endpoint to load further non-fungible ids in the vault. ## Using the /stream/transactions endpoint The transaction stream endpoint can be used to read a filtered stream of transaction results. ### State version You can narrow the range of transactions by specifying ledger state boundaries with the `at_ledger_state` and `from_ledger_state` filters. `at_ledger_state` lets you specify at which state version you want to query. It's same for almost all endpoints where you can basically travel in time on ledger. Let's say it's currently state version 347 062 but for any reason you'd like to check how ledger looked like at state version `100` If not specified it'll always query against current tip of the ledger. For example, the following request will return the transaction stream as it was for state version `100` (by default all user transactions before state version `100`, from latest to oldest) ``` /stream/transactions { "at_ledger_state": {"state_version": 100 } } ``` By contrast, `from_ledger_state` lets you specify a lower boundary of state versions. This can be used to "page forward" through the transaction stream (although by default only user transactions will be returned, and they will be in descending order): ``` /stream/transactions { "from_ledger_state": {"state_version": 50 }, } ``` You can combine these two, for example the following request will return all user transactions with state version `s` between `100` and `300` inclusive (in desceding order). ``` /stream/transactions { "from_ledger_state": {"state_version": 100 }, "at_ledger_state": {"state_version": 300 } } ``` ### Supported filters The transaction stream endpoint allows additional filters. A transaction has to satisfy all filters in order to be returned. The currently supported filters are: * `kind_filter` - one of `User`, `EpochChange`, `All`. You can use that filter to query for certain kinds of transactions. Defaults to `User`. * `manifest_accounts_withdrawn_from_filter` - allows specifying an array of account addresses. If specified, the response will contain only transactions with a manifest containing withdrawals from the given accounts. * `manifest_accounts_deposited_into_filter` - similar to withdrawn, but will return only transactions with a manifest containing deposits to the given accounts. * `manifest_resources_filter` - allows specifying array of resource addresses. If specified, the response will contain only transactions containing the given resources in the manifest (regardless of their usage). * `manifest_badges_presented_filter` - allows specifying array of badge resource addresses. If specified, the response will contain only transactions where the given badges were presented. * `accounts_with_manifest_owner_method_calls` - allows specifying an array of account addresses. If specified, the response will contain only transactions that, for all specified accounts, contain manifest method calls to that account which require the owner role. See the [account docs](https://docs.radixdlt.com/docs/account) for more information. * `accounts_without_manifest_owner_method_calls` - allows specifying an array of account addresses. If specified, the response will contain only transactions that, for all specified accounts, do NOT contain manifest method calls to that account which require owner role. See the [account docs](https://docs.radixdlt.com/docs/account) for more information. * `manifest_class_filter` - allows filtering to transactions which match the given manifest classification. If specified, the response will contain only transactions which have a class that matches the filter. If `match_only_most_specific` set to true, only transactions where the queried class is most specific will be returned. See the [docs on manifest classification](https://docs.radixdlt.com/docs/conforming-transaction-manifest-types) for more information. * `affected_global_entities_filter` - allows specifying an array of global addresses. If specified, the response will contain transactions that affected all of the given global entities. A global entity is marked as "affected" by a transaction if any of its state (or its descendents' state) was modified as a result of the transaction. * `events_filter` - filters the transaction stream to transactions which emitted at least one event matching each filter (each filter can be satisfied by a different event). Currently *only* deposit and withdrawal events emitted by an internal vault entity are tracked. For the purpose of filtering, the emitter address is replaced by the global ancestor of the emitter, for example, the top-level account / component which contains the vault which emitted the event. Each filter is a complex object where you can specify: - `event` (required) - the event tag. Currently only the following tags are supported: * `{"event": "Withdrawal"}` - Filters to "Withdraw" events from fungible and non-fungible vaults * `{"event": "Deposit"}` - Filters to "Deposit" events from fungible and non-fungible vaults - `emitter_address` (optional) - The "global emitter". Adding a global address here filters to matching events which have an emitter entity which is a descendent of the given global address, e.g. using `{"emitter_address" : "account_rdx16y76fepuvxqpv6gp6qswqymwhj5ng6sduugj4z6yysccvdg95g0dtr" }` filters to events emitted by vaults inside that account. - `resource_address` (optional) - Adding a resource address here filters to matching events which concern the given resource, e.g. `{"resource_address" : "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd"}` matches only events which involve XRD. As an example, the following query selects all transactions where the first account withdrew XRD and the second account deposited XRD: ``` { "events_filter": [ { "event": "Withdrawal", "emitter_address": "account_rdx16y76fepuvxqpv6gp6qswqymwhj5ng6sduugj4z6yysccvdg95g0dtr", "resource_address": "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd" }, { "event": "Deposit", "emitter_address": "account_rdx12x5vk07qcez6xj0zt8ve0x2g20mrssk0vrest3vf0qljd76r6zfvsx", "resource_address": "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd" } ] } ``` #### Request Validation The overall number of the applied filters can be limited. In a case of collection-based filters every item counts as a separate filter. By default up to 10 filters can be specified. The sample query below uses 5 filters in total: 1 `kind_filter`, 3 `manifest_resources_filter`s and 1 `events_filter`. ``` { "kind_filter": "All", "manifest_resources_filter": [ "resource_rdx1t5l4s99hpc6vvskktu2uy9egk86tszjnnez62zfu9t7z7tsqqtvpvp", "resource_rdx1t4w8ds79tkdjpq26z9v4w0tnv78jaxmy5vvrumdh3qeqzwqkgj6lvs", "resource_rdx1t5ha0254q4j5t0rxnev9f9vdt8jx6ud6caavrhcvvehg28ny90ku3x", ], "events_filter": [ { "event": "Deposit", "emitter_address": "account_rdx12x5vk07qcez6xj0zt8ve0x2g20mrssk0vrest3vf0qljd76r6zfvsx", "resource_address": "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd" } ] } ``` ### Pagination If the `limit_per_page` request hint parameter is lower than the overall number of transactions to be returned or the internal limiter kick in, a `next_cursor` will be returned. It can be used in subsequent requests as the `cursor` parameter to fetch further pages. For example, the following request will return a cursor: ``` /stream/transactions { "kind_filter": "All", "from_ledger_state": { "state_version": 100 }, "at_ledger_state": { "state_version": 300 }, "limit_per_page": 1 } ``` ``` // Returns { // ... "next_cursor": "eyJ2IjoyOTl9", // ... } ``` Which can be used in the next query to fetch further pages: ``` /stream/transactions { "kind_filter": "All", "from_ledger_state": { "state_version": 100 }, "at_ledger_state": { "state_version": 300 }, "limit_per_page": 1, "cursor": "eyJ2IjoyOTl9" } ``` ### Ordering By default, transactions are returned in **descending** order (highest state version / most recent first). You can change this to **ascending** order by setting the `order` parameter to `Asc` ``` /stream/transactions { // ... "order": "Asc" // ... } ``` Keep in mind that if order is ascending you'll start fetching transactions from the oldest first and with each page you'll fetch newer transactions. ### Reading events to find out what happened in a given dApp Currently the gateway supports filtering by `withdrawal` and `deposit` events only. We wish to support other filters in future. For the time being, if your dApp component always updates state along with emitting events, you can use the `affected` filter to filter to all transactions which affected your component, and extract relevant events from those transactions. For example, to find all transactions which affected `component_rdx1cq4ugccz6pg89w83ujanqlycw566kd9c9vxxuc9r45p7vues2649t4`, (and therefore all events which it emitted), you can use the following request: ``` /stream/transactions { "kind_filter": "All", "affected_global_entities_filter": ["component_rdx1cq4ugccz6pg89w83ujanqlycw566kd9c9vxxuc9r45p7vues2649t4"], "opt_ins": { "receipt_events": true } } ``` This will return the first page of all transactions, including their emitted events (which was enabled by using the `receipt_events` opt-in). These emitted events can be filtered by the client to just events which were emitted by the given component (`component_rdx1cq4ugccz6pg89w83ujanqlycw566kd9c9vxxuc9r45p7vues2649t4` in this case). ``` // Response { "transaction_status": "CommittedSuccess", "state_version": 14614370, "epoch": 44797, "round": 655, "round_timestamp": "2023-11-09T13:29:32.27Z", "payload_hash": "notarizedtransaction_rdx1dmjjaww667cq388hpx4jv895yj42l7ezynqycdr97ht9s4mkhzssejpcxz", "intent_hash": "txid_rdx1l0y5gw45aup7r8ex863s2ahhfwz9vdfv8jktqhcypegcf3vlk6zqhnmj9a", "fee_paid": "0.57054833978", "confirmed_at": "2023-11-09T13:29:32.27Z", "receipt": { "status": "CommittedSuccess", "events": [ { "name": "LockFeeEvent", "emitter": { "type": "Method", "entity": { "is_global": false, "entity_type": "InternalFungibleVault", "entity_address": "internal_vault_rdx1tzst8p8vvagnyyev8eu209h6fhmdvk334vhx0vhk4em02p89hlaluu" }, "object_module_id": "Main" }, "data": { "fields": [ { "value": "0.713902721272999997", "kind": "Decimal", "field_name": "amount" } ], "kind": "Tuple", "type_name": "LockFeeEvent" } }, { "name": "WithdrawEvent", "emitter": { "type": "Method", "entity": { "is_global": false, "entity_type": "InternalFungibleVault", "entity_address": "internal_vault_rdx1tpl4g48ul8tz8agtll35m7f936f2vuj4f8up9wlcgu6lj566vmashl" }, "object_module_id": "Main" }, "data": { "fields": [ { "value": "20", "kind": "Decimal", "field_name": "amount" } ], "kind": "Tuple", "type_name": "WithdrawEvent" } }, // ... ] } }, // ... ``` ## How role assignment works Blueprints define a list of different roles which control access to their features. Global components of a given blueprint provide assignments of access rules to those roles. You can get the roles and role assignments for a blueprint from the `/state/entity/details` endpoint. For example, let's take a look at the XRD resource: ``` /state/entity/details { "addresses": [ "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd" ], } ``` The response will contain two main parts. The definition of the owner role, and a list of all role assignments for that component: ``` "role_assignments": { "owner": { // ... }, "entries": [ // ... ] } ``` Each role assignment conceptually includes: * An assigned `rule` which defines what are the requirements to access that role. * Its `updater` which defines which role is allowed to update the assignment. ### The Owner role The owner role assignment includes the `rule` which specifies the requirements you have to meet to act as the owner of the entity. In the below example you need to have access to a proof of a certain non-fungible id. The `updater` of an owner role assingment is either `None` or specifies the owner can update itself. ``` "owner": { "rule": { "type": "Protected", "access_rule": { "type": "ProofRule", "proof_rule": { "type": "Require", "requirement": { "type": "NonFungible", "non_fungible": { "local_id": { "id_type": "Integer", "sbor_hex": "5cc0010000000000000000", "simple_rep": "#0#" }, "resource_address": "resource_rdx1nfxxxxxxxxxxsystxnxxxxxxxxx002683325037xxxxxxxxxsystxn" } } } } }, "updater": "None" }, ``` ### Role assignment entries Each role assignment contains three fields: * `role_key` - a composite key consisting of the entity module which defines the role and the name of the role inside the module. * `assignment` - the assigned rule. It could be either `Explicit` as in the below example and contain an inline rule, or `Owner` which means the owner role is used. * `updater_roles` - a fixed list of `role_key`s which act as updaters for the role, defined on the blueprint. Access to any of these updater roles permits someone to update the assignment for this role. An example assignment entry is the following. This response indicates that the given resource can be burned by an actor who has access to a proof of a specific global caller badge: ``` "role_key": { "module": "Main", "name": "burner" }, "assignment": { "resolution": "Explicit", "explicit_rule": { "type": "Protected", "access_rule": { "type": "ProofRule", "proof_rule": { "type": "Require", "requirement": { "type": "NonFungible", "non_fungible": { "local_id": { "id_type": "Bytes", "sbor_hex": "5cc0022068c44e9d432e71c51e2a2ac285897b372328d8b31374ff29131bc6b25b6bd070", "simple_rep": "[68c44e9d432e71c51e2a2ac285897b372328d8b31374ff29131bc6b25b6bd070]" }, "resource_address": "resource_rdx1nfxxxxxxxxxxglcllrxxxxxxxxx002350006550xxxxxxxxxglcllr" } } } } } }, "updater_roles": [ { "module": "Main", "name": "burner_updater" } ] ``` ## How to query the content of a key-value store inside a component ### An example component Imagine a component which can store resources into named vaults. To support arbitrary names, it might store these vaults in a `KeyValueStore` as follows. We will use this blueprint for demonstrating some requests. ``` use scrypto::prelude::*; #[blueprint] mod multi_vault { use scrypto::prelude::Vault; struct MultiVault { token_vaults: KeyValueStore } impl MultiVault { pub fn instantiate_multivault() -> Global { Self { token_vaults: KeyValueStore::new() } .instantiate() .prepare_to_globalize(OwnerRole::None) .globalize() } pub fn deposit_to_vault(&mut self, vault_id: String, deposit: Bucket) { let tmp_token_vaults = self.token_vaults.get_mut(&vault_id); match tmp_token_vaults { Some(mut vault) => vault.put(deposit), None => { drop(tmp_token_vaults); self.token_vaults.insert(vault_id, Vault::with_bucket(deposit)) } } } } } ``` ### Querying for `KeyValueStore` address Let's say that after creating a component with the above blueprint, we created 3 vaults "1", "2", "3" and transfered some amount of resource to each of them. If you'd like to look at the content of the `KeyValueStore`, you need to first get its address. You can do that by calling `/state/entity/details` with the instantiated component address: ``` /state/entity/details { "addresses": [ "component_tdx_2_1crmcapqnz2sex9u6tppnagps64lgpfmkupmyrwazeg5qe3x2z3trcr" ] } ``` In the response you'll receive the state of that component which will contain the address of that `KeyValueStore`: ``` // ... "details": { // ... "state": { "kind": "Tuple", "type_name": "MultiVault", "fields": [ { "kind": "Own", "type_name": "KeyValueStore", "field_name": "token_vaults", "value": "internal_keyvaluestore_tdx_2_1kzjd929eqlzd9n02uuj8jd48705vcrpvhv4mgxnaltrgystnca3qxk" } ] } } ``` ### Iterating over all `KeyValueStore` keys You can use the `/state/key-value-store/keys` endpoint to iterate over all the keys in a certain key value store. If the queried key value store contains more than one page of keys, a `next_cursor` will be returned, which can be used as a cursor in the request to fetch further pages. i.e: ``` /state/key-value-store/keys { "key_value_store_address": "internal_keyvaluestore_tdx_2_1kzjd929eqlzd9n02uuj8jd48705vcrpvhv4mgxnaltrgystnca3qxk" } ``` Will respond with a first page of the keys of the current entries of the key value store. This collection is ordered by the entry first appearance on the network, descending. Each item includes the entry's key (in both `hex` and `programmatic_json` form) and the state version when it was last updated. ``` { ... "total_count": 8, "items": [ { "key": { "raw_hex": "5c0c0131", "programmatic_json": { "value": "1", "kind": "String" } }, "last_updated_at_state_version": 4939670 }, ... ], "key_value_store_address": "internal_keyvaluestore_tdx_2_1kzjd929eqlzd9n02uuj8jd48705vcrpvhv4mgxnaltrgystnca3qxk" } ``` ### Querying for the content under specific keys You can either use the keys returned from the `/state/key-value-store/keys` endpoint or construct keys in json form on your own, if you know the key type of the `KeyValueStore`. #### Querying using hex keys Simply grab the `raw_hex` key returned from the `/state/key-value-store/keys` endpoint and call `/state/key-value-store/data` with it as a parameter. i.e: ``` /state/key-value-store/data { "key_value_store_address": "internal_keyvaluestore_tdx_2_1kzjd929eqlzd9n02uuj8jd48705vcrpvhv4mgxnaltrgystnca3qxk", "keys": [ { "key_hex": "5c0c0131" } ] } ``` Will respond with data held under that key: ``` { ... "key_value_store_address": "internal_keyvaluestore_tdx_2_1kzjd929eqlzd9n02uuj8jd48705vcrpvhv4mgxnaltrgystnca3qxk", "entries": [ { "key": { "raw_hex": "5c0c0131", "programmatic_json": { "value": "1", "kind": "String" } }, "value": { "raw_hex": "5c90588c6d59227f64bd7fc68e38bf7c7013cf179a78d5562ce9378b1378e2fa", "programmatic_json": { "value": "internal_vault_tdx_2_1tzxx6kfz0ajt6l7x3cut7lrsz0830xnc64tze6fh3vfh3ch6587c5d", "kind": "Own", "type_name": "Vault" } }, "last_updated_at_state_version": 4939415, "is_locked": false } ] } ``` In our case, we may want to look up information about the vault (for example, the vault's resource address and balance). This can be done with the `/state/entity/details` endpoint. #### Constructing json keys The json keys are specified as programmatic SBOR JSON (which is a recursive data format, with each layer being a discriminated union with the `kind` discriminator). Search for [SBOR on our docs site](https://docs.radixdlt.com) for more information on SBOR and the programmatic SBOR JSON format. In this case, our `KeyValueStore` keys are strings, so each key is identified as programmatic SBOR JSON with two properties: ``` "key_json": { "kind": "String", "value": "{Id}" } ``` And we can use that json in `/state/key-value-store/data` simply replacing {Id} with our vault name, for example, "1": ``` /state/key-value-store/data { "key_value_store_address": "internal_keyvaluestore_tdx_2_1kzjd929eqlzd9n02uuj8jd48705vcrpvhv4mgxnaltrgystnca3qxk", "keys": [ { "key_json": { "kind": "String", "value": "1" } } ] } ``` The API will respond with content which is held under the given key: ``` // Response { // ... "key_value_store_address": "internal_keyvaluestore_tdx_2_1kzjd929eqlzd9n02uuj8jd48705vcrpvhv4mgxnaltrgystnca3qxk", "entries": [ { "key": { "raw_hex": "5c0c0131", "programmatic_json": { "value": "1", "kind": "String" } }, "value": { "raw_hex": "5c90588c6d59227f64bd7fc68e38bf7c7013cf179a78d5562ce9378b1378e2fa", "programmatic_json": { "value": "internal_vault_tdx_2_1tzxx6kfz0ajt6l7x3cut7lrsz0830xnc64tze6fh3vfh3ch6587c5d", "kind": "Own", "type_name": "Vault" } }, // ... } ] } ``` In our case, we may want to look up information about the vault (for example, the vault's resource address and balance). This can be done with the `/state/entity/details` endpoint. - name: Status x-displayName: Status Endpoints description: Query information about the Gateway API status. - name: Transaction x-displayName: Transaction Endpoints description: Query status of, construct, preview and submit transactions. - name: Stream x-displayName: Stream Endpoints description: Browse through the history of transactions. - name: State x-displayName: State Endpoints description: Query information snapshot about state of ledger entities at present or past time. - name: Statistics x-displayName: Statistics Endpoints description: Calculate particular statistics based on current or historic ledger state. paths: "/status/gateway-status": post: operationId: GatewayStatus summary: Get Gateway Status description: | Returns the Gateway API version and current ledger state. tags: - Status responses: "200": description: Network Gateway Information content: application/json: schema: $ref: "#/components/schemas/GatewayStatusResponse" "/status/network-configuration": post: operationId: NetworkConfiguration summary: Get Network Configuration description: | Returns network identifier, network name and well-known network addresses. tags: - Status responses: "200": description: Network Configuration content: application/json: schema: $ref: "#/components/schemas/NetworkConfigurationResponse" "/transaction/construction": post: operationId: TransactionConstruction summary: Get Construction Metadata description: | Returns information needed to construct a new transaction including current `epoch` number. tags: - Transaction responses: "200": description: | Returns information needed to construct transaction. content: application/json: schema: $ref: "#/components/schemas/TransactionConstructionResponse" "/transaction/preview": post: operationId: TransactionPreview summary: Preview Transaction description: | Previews transaction against the network. This endpoint is effectively a proxy towards the Core API `/v0/transaction/preview` endpoint. See the Core API documentation for more details. tags: - Transaction requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/TransactionPreviewRequest" responses: "200": description: Successful Preview content: application/json: schema: $ref: "#/components/schemas/TransactionPreviewResponse" "4XX": $ref: "#/components/responses/ErrorResponse" "/transaction/submit": post: operationId: TransactionSubmit summary: Submit Transaction description: | Submits a signed transaction payload to the network. tags: - Transaction requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/TransactionSubmitRequest" responses: "200": description: Successful Submission content: application/json: schema: $ref: "#/components/schemas/TransactionSubmitResponse" "4XX": $ref: "#/components/responses/ErrorResponse" "/transaction/committed-details": post: operationId: TransactionCommittedDetails summary: Get Committed Transaction Details description: | 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`. tags: - Transaction requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/TransactionCommittedDetailsRequest" responses: "200": description: Transaction Status content: application/json: schema: $ref: "#/components/schemas/TransactionCommittedDetailsResponse" "4XX": $ref: "#/components/responses/ErrorResponse" "/transaction/status": post: operationId: TransactionStatus summary: Get Transaction Status description: | Returns overall transaction status and all of its known payloads based on supplied intent hash. tags: - Transaction requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/TransactionStatusRequest" responses: "200": description: Transaction Status content: application/json: schema: $ref: "#/components/schemas/TransactionStatusResponse" "4XX": $ref: "#/components/responses/ErrorResponse" "/transaction/account-deposit-pre-validation": post: operationId: AccountDepositPreValidation summary: PreValidate deposit of resources to an account description: | Helper endpoint that allows pre-validation if a deposit of certain resources to a given account can succeed or not. It is only meant for pre-validation usage, it does not guarantee that execution will succeed. tags: - Transaction requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AccountDepositPreValidationRequest" responses: "200": description: Pre-validation response, including all deciding factors that were used to generate that response. content: application/json: schema: $ref: "#/components/schemas/AccountDepositPreValidationResponse" "4XX": $ref: "#/components/responses/ErrorResponse" "/stream/transactions": post: operationId: StreamTransactions summary: Get Transactions Stream description: | Returns transactions which have been committed to the ledger. [Check detailed documentation for brief explanation](#section/Using-the-streamtransactions-endpoint) tags: - Stream requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StreamTransactionsRequest" responses: "200": description: Transactions (paginated) content: application/json: schema: $ref: "#/components/schemas/StreamTransactionsResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/entity/details: post: operationId: StateEntityDetails summary: Get Entity Details description: | Returns detailed information for collection of entities. Aggregate resources globally by default. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateEntityDetailsRequest" responses: "200": description: Entity Details content: application/json: schema: $ref: "#/components/schemas/StateEntityDetailsResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/entity/page/metadata: post: operationId: EntityMetadataPage summary: Get Entity Metadata Page description: | 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. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateEntityMetadataPageRequest" responses: "200": description: Entity Metadata (paginated) content: application/json: schema: $ref: "#/components/schemas/StateEntityMetadataPageResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/entity/page/schemas: post: operationId: EntitySchemaPage summary: Get Entity Schema Page description: | Returns all the schemas associated with a given global entity. The returned response is in a paginated format, ordered by first appearance on the ledger. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateEntitySchemaPageRequest" responses: "200": description: Entity Schemas (paginated) content: application/json: schema: $ref: "#/components/schemas/StateEntitySchemaPageResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/entity/page/fungibles/: post: operationId: EntityFungiblesPage summary: Get page of Global Entity Fungible Resource Balances description: | 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. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateEntityFungiblesPageRequest" responses: "200": description: Entity Fungibles (paginated) content: application/json: schema: $ref: "#/components/schemas/StateEntityFungiblesPageResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/entity/page/fungible-vaults/: post: operationId: EntityFungibleResourceVaultPage summary: Get page of Global Entity Fungible Resource Vaults description: | 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. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateEntityFungibleResourceVaultsPageRequest" responses: "200": description: Entity Fungibles (paginated) content: application/json: schema: $ref: "#/components/schemas/StateEntityFungibleResourceVaultsPageResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/entity/page/non-fungibles/: post: operationId: EntityNonFungiblesPage summary: Get page of Global Entity Non-Fungible Resource Balances description: | 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. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateEntityNonFungiblesPageRequest" responses: "200": description: Entity Non-Fungibles (paginated) content: application/json: schema: $ref: "#/components/schemas/StateEntityNonFungiblesPageResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/entity/page/non-fungible-vaults/: post: operationId: EntityNonFungibleResourceVaultPage summary: Get page of Global Entity Non-Fungible Resource Vaults description: | 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. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateEntityNonFungibleResourceVaultsPageRequest" responses: "200": description: Entity Fungibles (paginated) content: application/json: schema: $ref: "#/components/schemas/StateEntityNonFungibleResourceVaultsPageResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/entity/page/non-fungible-vault/ids: post: operationId: EntityNonFungibleIdsPage summary: Get page of Non-Fungibles in Vault description: | 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. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateEntityNonFungibleIdsPageRequest" responses: "200": description: Entity Non-Fungible IDs (paginated) content: application/json: schema: $ref: "#/components/schemas/StateEntityNonFungibleIdsPageResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/non-fungible/ids: post: operationId: NonFungibleIds summary: Get page of Non-Fungible Ids in Resource Collection description: | 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. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateNonFungibleIdsRequest" responses: "200": description: Non-Fungible IDs (paginated) content: application/json: schema: $ref: "#/components/schemas/StateNonFungibleIdsResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/non-fungible/data: post: operationId: NonFungibleData summary: Get Non-Fungible Data description: | Returns data associated with a given non-fungible ID of a given non-fungible resource. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateNonFungibleDataRequest" responses: "200": description: Non-Fungible ID Data content: application/json: schema: $ref: "#/components/schemas/StateNonFungibleDataResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/non-fungible/location: post: operationId: NonFungibleLocation summary: Get Non-Fungible Location description: | Returns location of a given non-fungible ID. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateNonFungibleLocationRequest" responses: "200": description: Non-Fungible ID Location content: application/json: schema: $ref: "#/components/schemas/StateNonFungibleLocationResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/key-value-store/keys: post: operationId: KeyValueStoreKeys summary: Get KeyValueStore Keys description: Allows to iterate over key value store keys. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateKeyValueStoreKeysRequest" responses: "200": description: KeyValueStore keys collection content: application/json: schema: $ref: "#/components/schemas/StateKeyValueStoreKeysResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/key-value-store/data: post: operationId: KeyValueStoreData summary: Get KeyValueStore Data description: | Returns data (value) associated with a given key of a given key-value store. [Check detailed documentation for explanation](#section/How-to-query-the-content-of-a-key-value-store-inside-a-component) tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateKeyValueStoreDataRequest" responses: "200": description: Non-Fungible ID Data content: application/json: schema: $ref: "#/components/schemas/StateKeyValueStoreDataResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/validators/list: post: operationId: StateValidatorsList summary: Get Validators List tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateValidatorsListRequest" responses: "200": description: Validators List content: application/json: schema: $ref: "#/components/schemas/StateValidatorsListResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/account/page/resource-preferences: post: operationId: AccountResourcePreferencesPage summary: Get Account resource preferences description: | Returns paginable collection of resource preference rules for given account. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateAccountResourcePreferencesPageRequest" responses: "200": description: Account resource preferences page content: application/json: schema: $ref: "#/components/schemas/StateAccountResourcePreferencesPageResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/account/page/authorized-depositors: post: operationId: AccountAuthorizedDepositorsPage summary: Get Account authorized depositors description: | Returns paginable collection of authorized depositors for given account. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StateAccountAuthorizedDepositorsPageRequest" responses: "200": description: Account resource preferences page content: application/json: schema: $ref: "#/components/schemas/StateAccountAuthorizedDepositorsPageResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/package/page/blueprints: post: operationId: PackageBlueprintPage summary: Get Package Blueprints Page description: | Returns all the blueprints associated with a given package entity. The returned response is in a paginated format, ordered by first appearance on the ledger. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StatePackageBlueprintPageRequest" responses: "200": description: Package Blueprints (paginated) content: application/json: schema: $ref: "#/components/schemas/StatePackageBlueprintPageResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /state/package/page/codes: post: operationId: PackageCodePage summary: Get Package Codes Page description: | Returns all the codes associated with a given package entity. The returned response is in a paginated format, ordered by first appearance on the ledger. tags: - State requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StatePackageCodePageRequest" responses: "200": description: Package Blueprints (paginated) content: application/json: schema: $ref: "#/components/schemas/StatePackageCodePageResponse" "4XX": $ref: "#/components/responses/ErrorResponse" /statistics/validators/uptime: post: operationId: ValidatorsUptime summary: Get Validators Uptime description: | Returns validators uptime data for time range limited by `from_state_version` and `at_state_version`. tags: - Statistics requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ValidatorsUptimeRequest" responses: "200": description: Validators Uptime content: application/json: schema: $ref: "#/components/schemas/ValidatorsUptimeResponse" "4XX": $ref: "#/components/responses/ErrorResponse" components: responses: ErrorResponse: description: Client-originated request error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" schemas: # # Aliases # NetworkId: description: The logical id of the network type: integer format: int32 minimum: 0 maximum: 255 example: "" NetworkName: description: The logical name of the network type: string example: "" Address: description: Bech32m-encoded human readable version of the address. type: string BigDecimal: description: String-encoded decimal representing the amount of a related fungible resource. type: string NonFungibleId: description: String-encoded non-fungible ID. type: string HashBech32mString: description: Bech32m-encoded hash. type: string HashHexString: description: Hex-encoded SHA-256 hash. type: string HexString: description: Hex-encoded binary blob. type: string NotarizedTransactionHexString: description: Hex-encoded notarized transaction payload which can be submitted. type: string LastUpdatedAtStateVersion: description: The most recent state version underlying object was modified at. type: integer format: int64 minimum: 1 maximum: 100000000000000 # # Keys # PublicKeyType: type: string enum: - EcdsaSecp256k1 - EddsaEd25519 PublicKey: type: object required: - key_type properties: key_type: $ref: "#/components/schemas/PublicKeyType" discriminator: propertyName: key_type mapping: # NOTE: These need to match PublicKeyType EcdsaSecp256k1: "#/components/schemas/PublicKeyEcdsaSecp256k1" EddsaEd25519: "#/components/schemas/PublicKeyEddsaEd25519" PublicKeyEcdsaSecp256k1: allOf: - $ref: "#/components/schemas/PublicKey" - type: object required: - key_hex properties: key_hex: type: string minLength: 66 maxLength: 66 description: The hex-encoded compressed ECDSA Secp256k1 public key (33 bytes) PublicKeyEddsaEd25519: allOf: - $ref: "#/components/schemas/PublicKey" - type: object required: - key_hex properties: key_hex: type: string minLength: 64 maxLength: 64 description: The hex-encoded compressed EdDSA Ed25519 public key (32 bytes) PublicKeyHashType: type: string enum: - EcdsaSecp256k1 - EddsaEd25519 PublicKeyHash: type: object required: - key_hash_type properties: key_hash_type: $ref: "#/components/schemas/PublicKeyHashType" discriminator: propertyName: key_hash_type mapping: # NOTE: These need to match PublicKeyHashType EcdsaSecp256k1: "#/components/schemas/PublicKeyHashEcdsaSecp256k1" EddsaEd25519: "#/components/schemas/PublicKeyHashEddsaEd25519" PublicKeyHashEcdsaSecp256k1: allOf: - $ref: "#/components/schemas/PublicKeyHash" - type: object required: - hash_hex properties: hash_hex: $ref: "#/components/schemas/HashHexString" PublicKeyHashEddsaEd25519: allOf: - $ref: "#/components/schemas/PublicKeyHash" - type: object required: - hash_hex properties: hash_hex: $ref: "#/components/schemas/HashHexString" # # Common Request Types # AtLedgerStateMixin: description: defines upper boundary (inclusive) for queried data. i.e `{ "at_state_version" = {"epoch" = 10} }`, will return data till 10 epoch. type: object properties: at_ledger_state: $ref: "#/components/schemas/LedgerStateSelector" FromLedgerStateMixin: description: defines lower boundary (inclusive) for queried data. i.e `{ "from_state_version" = {"epoch" = 10} }`, will return data from epoch 10 till current max ledger tip. type: object properties: from_ledger_state: $ref: "#/components/schemas/LedgerStateSelector" LedgerStateSelector: description: | Optional. This allows for a request to be made against a historic state. If a constraint is specified, the Gateway will resolve the request against the ledger state at that time. If not specified, requests will be made with respect to the top of the committed ledger. type: object nullable: true properties: state_version: description: If provided, the latest ledger state lower than or equal to the given state version is returned. nullable: true type: integer format: int64 minimum: 1 maximum: 100000000000000 timestamp: description: If provided, the latest ledger state lower than or equal to the given round timestamp is returned. nullable: true type: string format: date-time epoch: description: If provided, the ledger state lower than or equal to the given epoch at round 0 is returned. nullable: true type: integer format: int64 minimum: 0 maximum: 10000000000 round: description: If provided must be accompanied with `epoch`, the ledger state lower than or equal to the given epoch and round is returned. nullable: true type: integer format: int64 minimum: 0 maximum: 10000000000 CursorLimitMixin: type: object properties: cursor: description: This cursor allows forward pagination, by providing the cursor from the previous request. type: string nullable: true limit_per_page: description: The page size requested. type: integer nullable: true # # Common Response Types # ManifestClass: description: | High-level manifest class type: * `General`: A general manifest that involves any amount of arbitrary components and packages where nothing more concrete can be said about the manifest and its nature. * `Transfer`: A manifest of a 1-to-1 transfer to a one-to-many transfer of resources. * `PoolContribution`: A manifest that contributed some amount of resources to a liquidity pool that can be a one-resource pool, two-resource pool, or a multi-resource pool. * `PoolRedemption`: A manifest that redeemed resources from a liquidity pool. Similar to contributions, this can be any of the three pool blueprints available in the pool package. * `ValidatorStake`: A manifest where XRD is staked to one or more validators. * `ValidatorUnstake`: A manifest where XRD is unstaked from one or more validators. * `ValidatorClaim`: A manifest where XRD is claimed from one or more validators. * `AccountDepositSettingsUpdate`: A manifest that updated the deposit settings of the account. type: string enum: - General - Transfer - PoolContribution - PoolRedemption - ValidatorStake - ValidatorUnstake - ValidatorClaim - AccountDepositSettingsUpdate ObjectModuleId: type: string enum: - Main - Metadata - Royalty - RoleAssignment ValidatorVaultItem: type: object required: - balance - last_changed_at_state_version - address properties: balance: $ref: "#/components/schemas/BigDecimal" last_changed_at_state_version: type: integer format: int64 address: $ref: "#/components/schemas/Address" LedgerStateMixin: type: object required: - ledger_state properties: ledger_state: $ref: "#/components/schemas/LedgerState" ResultSetCursorMixin: type: object properties: total_count: description: Total number of items in underlying collection, fragment of which is available in `items` collection. type: integer format: int64 nullable: true next_cursor: description: If specified, contains a cursor to query next page of the `items` collection. type: string nullable: true LedgerState: description: | The ledger state against which the response was generated. Can be used to detect if the Network Gateway is returning up-to-date information. type: object required: - network - state_version - proposer_round_timestamp - epoch - round properties: network: $ref: "#/components/schemas/NetworkName" state_version: description: The state version of the ledger. Each transaction increments the state version by 1. type: integer format: int64 proposer_round_timestamp: description: | The proposer round timestamp of the consensus round when this transaction was committed to ledger. This is not guaranteed to be strictly increasing, as it is computed as an average across the validator set. If this is significantly behind the current timestamp, the Network Gateway is likely reporting out-dated information, or the network has stalled. type: string # TODO add format: date-time once OAS generator get fixed support for required value-types epoch: description: The epoch number of the ledger at this state version. type: integer format: int64 round: description: The consensus round in the epoch that this state version was committed in. type: integer format: int64 ResourceAggregationLevel: type: string enum: - Global - Vault ScryptoSborValue: type: object required: - raw_hex - programmatic_json properties: raw_hex: $ref: "#/components/schemas/HexString" programmatic_json: $ref: "#/components/schemas/ProgrammaticScryptoSborValue" EntityMetadataCollection: description: Entity metadata collection. allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/EntityMetadataItem" EntityMetadataItem: description: Entity metadata key-value pair. type: object required: - key - value - is_locked - last_updated_at_state_version properties: key: description: Entity metadata key. type: string value: $ref: "#/components/schemas/EntityMetadataItemValue" is_locked: type: boolean last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" EntityMetadataItemValue: allOf: - $ref: "#/components/schemas/ScryptoSborValue" - type: object required: - typed properties: typed: $ref: "#/components/schemas/MetadataTypedValue" EntitySchemaCollection: allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/EntitySchemaCollectionItem" EntitySchemaCollectionItem: type: object required: - schema_hash_hex - schema_hex properties: schema_hash_hex: $ref: "#/components/schemas/HexString" schema_hex: $ref: "#/components/schemas/HexString" PackageBlueprintCollection: description: Package blueprint collection. allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/PackageBlueprintCollectionItem" PackageBlueprintCollectionItem: type: object required: - name - version - definition properties: name: type: string version: type: string definition: type: object description: | This type is defined in the Core API as `BlueprintDefinition`. See the Core API documentation for more details. dependant_entities: type: array items: $ref: "#/components/schemas/Address" auth_template: type: object description: | This type is defined in the Core API as `AuthConfig`. See the Core API documentation for more details. auth_template_is_locked: type: boolean nullable: true royalty_config: $ref: "#/components/schemas/BlueprintRoyaltyConfig" royalty_config_is_locked: type: boolean nullable: true PackageCodeCollection: description: Package code collection. allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/PackageCodeCollectionItem" PackageCodeCollectionItem: type: object required: - vm_type - code_hash_hex - code_hex properties: vm_type: $ref: "#/components/schemas/PackageVmType" code_hash_hex: $ref: "#/components/schemas/HexString" code_hex: $ref: "#/components/schemas/HexString" ComponentEntityRoleAssignments: type: object required: - owner - entries properties: owner: type: object description: | This type is defined in the Core API as `OwnerRole`. See the Core API documentation for more details. entries: type: array items: $ref: "#/components/schemas/ComponentEntityRoleAssignmentEntry" ComponentEntityRoleAssignmentEntry: type: object required: - role_key - assignment properties: role_key: $ref: "#/components/schemas/RoleKey" assignment: type: object required: - resolution properties: resolution: $ref: "#/components/schemas/RoleAssignmentResolution" explicit_rule: type: object description: | This type is defined in the Core API as `AccessRule`. See the Core API documentation for more details. updater_roles: type: array items: $ref: "#/components/schemas/RoleKey" RoleAssignmentResolution: type: string enum: - Explicit - Owner RoleKey: type: object required: - module - name properties: name: type: string module: $ref: "#/components/schemas/ObjectModuleId" FungibleResourcesCollection: description: Fungible resources collection. allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/FungibleResourcesCollectionItem" FungibleResourcesCollectionItem: type: object required: - aggregation_level - resource_address properties: aggregation_level: $ref: "#/components/schemas/ResourceAggregationLevel" resource_address: $ref: "#/components/schemas/Address" explicit_metadata: $ref: "#/components/schemas/EntityMetadataCollection" discriminator: propertyName: aggregation_level mapping: # NOTE: These need to match ResourceAggregationLevel Global: "#/components/schemas/FungibleResourcesCollectionItemGloballyAggregated" Vault: "#/components/schemas/FungibleResourcesCollectionItemVaultAggregated" FungibleResourcesCollectionItemGloballyAggregated: allOf: - $ref: "#/components/schemas/FungibleResourcesCollectionItem" - type: object required: - amount - last_updated_at_state_version properties: amount: $ref: "#/components/schemas/BigDecimal" last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" FungibleResourcesCollectionItemVaultAggregated: allOf: - $ref: "#/components/schemas/FungibleResourcesCollectionItem" - type: object required: - vaults properties: vaults: $ref: "#/components/schemas/FungibleResourcesCollectionItemVaultAggregatedVault" FungibleResourcesCollectionItemVaultAggregatedVault: allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/FungibleResourcesCollectionItemVaultAggregatedVaultItem" FungibleResourcesCollectionItemVaultAggregatedVaultItem: type: object required: - vault_address - amount - last_updated_at_state_version properties: vault_address: $ref: "#/components/schemas/Address" amount: $ref: "#/components/schemas/BigDecimal" last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" NonFungibleResourcesCollection: description: Non-fungible resources collection. allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/NonFungibleResourcesCollectionItem" NonFungibleResourcesCollectionItem: type: object required: - aggregation_level - resource_address properties: aggregation_level: $ref: "#/components/schemas/ResourceAggregationLevel" resource_address: $ref: "#/components/schemas/Address" explicit_metadata: $ref: "#/components/schemas/EntityMetadataCollection" discriminator: propertyName: aggregation_level mapping: # NOTE: These need to match ResourceAggregationLevel Global: "#/components/schemas/NonFungibleResourcesCollectionItemGloballyAggregated" Vault: "#/components/schemas/NonFungibleResourcesCollectionItemVaultAggregated" NonFungibleResourcesCollectionItemGloballyAggregated: allOf: - $ref: "#/components/schemas/NonFungibleResourcesCollectionItem" - type: object required: - amount - last_updated_at_state_version properties: amount: description: The total amount of non-fungible IDs across all vaults. type: integer format: int64 last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" NonFungibleResourcesCollectionItemVaultAggregated: allOf: - $ref: "#/components/schemas/NonFungibleResourcesCollectionItem" - type: object required: - vaults properties: vaults: $ref: "#/components/schemas/NonFungibleResourcesCollectionItemVaultAggregatedVault" NonFungibleResourcesCollectionItemVaultAggregatedVault: allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/NonFungibleResourcesCollectionItemVaultAggregatedVaultItem" NonFungibleResourcesCollectionItemVaultAggregatedVaultItem: allOf: - $ref: "#/components/schemas/OptionalNonFungibleIdsCollection" - type: object required: - vault_address - total_count - last_updated_at_state_version properties: vault_address: $ref: "#/components/schemas/Address" total_count: type: integer format: int64 last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" OptionalNonFungibleIdsCollection: description: Non-fungible resource IDs collection. allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object properties: items: type: array items: $ref: "#/components/schemas/NonFungibleId" AccountResourcePreferencesCollection: description: Account resource preferences collection allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/AccountResourcePreferencesResponseItem" AccountResourcePreferenceRule: type: string enum: - Allowed - Disallowed AccountResourcePreferencesResponseItem: type: object required: - resource_address - resource_preference_rule - last_updated_at_state_version properties: resource_address: $ref: "#/components/schemas/Address" resource_preference_rule: $ref: "#/components/schemas/AccountResourcePreferenceRule" last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" AccountAuthorizedDepositorsCollection: description: Account resource preferences collection allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/AccountAuthorizedDepositorsResponseItem" AccountAuthorizedDepositorBadgeType: type: string enum: - ResourceBadge - NonFungibleBadge AccountDefaultDepositRule: type: string description: Default deposit rule set to an account. enum: - Accept - Reject - AllowExisting AccountDepositPreValidationDecidingFactors: description: Deciding factors used to calculate response. type: object required: - default_deposit_rule properties: is_badge_authorized_depositor: description: Whether the input badge belongs to the account's set of authorized depositors. This field will only be present if any badge was passed in the request. type: boolean nullable: true default_deposit_rule: $ref: "#/components/schemas/AccountDefaultDepositRule" resource_specific_details: description: Returns deciding factors for each resource. Contains only information about resources presented in the request, not all resource preference rules for queried account. type: array items: $ref: "#/components/schemas/AccountDepositPreValidationDecidingFactorsResourceSpecificDetailsItem" AccountDepositPreValidationDecidingFactorsResourceSpecificDetailsItem: type: object required: - resource_address - vault_exists - is_xrd properties: resource_address: $ref: "#/components/schemas/Address" vault_exists: type: boolean is_xrd: type: boolean resource_preference_rule: $ref: "#/components/schemas/AccountResourcePreferenceRule" AccountDepositPreValidationResourceSpecificBehaviourItem: type: object required: - resource_address - allows_try_deposit properties: resource_address: $ref: "#/components/schemas/Address" allows_try_deposit: type: boolean TransactionAccountDepositPreValidationAuthorizedDepositorBadge: type: object required: - badge_type - resource_address properties: badge_type: $ref: "#/components/schemas/AccountAuthorizedDepositorBadgeType" resource_address: # That is part of parent type because moving it to child broke OpenAPI generator and removed some other types: # MetadataNonFungibleGlobalIdValueAllOf StateNonFungibleIdsRequestAllOf MetadataNonFungibleGlobalIdArrayValueAllOf and MetadataNonFungibleGlobalIdArrayValue were affected $ref: "#/components/schemas/Address" discriminator: propertyName: badge_type mapping: # Must match AccountDepositPreValidationBadgeType ResourceBadge: "#/components/schemas/AccountDepositPreValidationResourceBadge" NonFungibleBadge: "#/components/schemas/AccountDepositPreValidationNonFungibleBadge" AccountDepositPreValidationResourceBadge: allOf: - $ref: "#/components/schemas/TransactionAccountDepositPreValidationAuthorizedDepositorBadge" - type: object AccountDepositPreValidationNonFungibleBadge: allOf: - $ref: "#/components/schemas/TransactionAccountDepositPreValidationAuthorizedDepositorBadge" - type: object required: - non_fungible_id properties: non_fungible_id: $ref: "#/components/schemas/NonFungibleId" AccountAuthorizedDepositorsResponseItem: type: object required: - badge_type properties: badge_type: $ref: "#/components/schemas/AccountAuthorizedDepositorBadgeType" discriminator: propertyName: badge_type mapping: # Must match AccountAuthorizedDepositorBadgeType ResourceBadge: "#/components/schemas/AccountAuthorizedDepositorsResourceBadge" NonFungibleBadge: "#/components/schemas/AccountAuthorizedDepositorsNonFungibleBadge" AccountAuthorizedDepositorsResourceBadge: allOf: - $ref: "#/components/schemas/AccountAuthorizedDepositorsResponseItem" - type: object required: - resource_address - last_updated_at_state_version properties: resource_address: $ref: "#/components/schemas/Address" last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" AccountAuthorizedDepositorsNonFungibleBadge: allOf: - $ref: "#/components/schemas/AccountAuthorizedDepositorsResponseItem" - type: object required: - resource_address - non_fungible_id - last_updated_at_state_version properties: resource_address: $ref: "#/components/schemas/Address" non_fungible_id: $ref: "#/components/schemas/NonFungibleId" last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" NonFungibleIdsCollection: description: Non-fungible resource IDs collection. allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/NonFungibleId" CommittedTransactionInfo: type: object required: - state_version - epoch - round - round_timestamp - transaction_status properties: state_version: type: integer format: int64 epoch: type: integer format: int64 round: type: integer format: int64 round_timestamp: type: string # TODO add format: date-time once OAS generator get fixed support for required value-types transaction_status: $ref: "#/components/schemas/TransactionStatus" payload_hash: $ref: "#/components/schemas/HashBech32mString" intent_hash: $ref: "#/components/schemas/HashBech32mString" fee_paid: $ref: "#/components/schemas/BigDecimal" affected_global_entities: type: array items: $ref: "#/components/schemas/Address" confirmed_at: nullable: true type: string format: date-time error_message: type: string nullable: true raw_hex: $ref: "#/components/schemas/HexString" receipt: $ref: "#/components/schemas/TransactionReceipt" manifest_instructions: description: | A text-representation of a transaction manifest. This field will be present only for user transactions and when explicitly opted-in using `manifest_instructions` flag. type: string nullable: true manifest_classes: description: | A collection of zero or more manifest classes ordered from the most specific class to the least specific one. This field will be present only for user transactions. type: array nullable: true items: $ref: "#/components/schemas/ManifestClass" message: type: object description: | The optional transaction message. This type is defined in the Core API as `TransactionMessage`. See the Core API documentation for more details. balance_changes: $ref: "#/components/schemas/TransactionBalanceChanges" TransactionStatus: type: string description: | A top-level intent status, left in for backwards compatibility. It doesn't give much information. Rejected means PermanentRejection. enum: - Unknown - CommittedSuccess - CommittedFailure - Pending - Rejected TransactionIntentStatus: type: string description: | A more specific intent status. See the description field for further information. Note that `CommitPendingOutcomeUnknown` can either result in `CommittedSuccess` or `CommittedFailure`. enum: - Unknown - CommittedSuccess - CommittedFailure - CommitPendingOutcomeUnknown - PermanentlyRejected - LikelyButNotCertainRejection - Pending TransactionPayloadStatus: type: string description: | A more specific payload status. See the description field for further information. enum: - Unknown - CommittedSuccess - CommittedFailure - CommitPendingOutcomeUnknown - PermanentlyRejected - TemporarilyRejected - Pending TransactionPayloadGatewayHandlingStatus: type: string description: | A status concerning the Gateway's handling status of this pending transaction. enum: - HandlingSubmission - Concluded TransactionReceipt: type: object properties: status: $ref: "#/components/schemas/TransactionStatus" fee_summary: type: object description: | This type is defined in the Core API as `FeeSummary`. See the Core API documentation for more details. costing_parameters: type: object fee_destination: type: object description: | This type is defined in the Core API as `FeeDestination`. See the Core API documentation for more details. fee_source: type: object description: | This type is defined in the Core API as `FeeSource`. See the Core API documentation for more details. state_updates: type: object description: | This type is defined in the Core API as `StateUpdates`. See the Core API documentation for more details. next_epoch: type: object description: | Information (number and active validator list) about new epoch if occured. This type is defined in the Core API as `NextEpoch`. See the Core API documentation for more details. output: type: object description: | The manifest line-by-line engine return data (only present if `status` is `CommittedSuccess`). This type is defined in the Core API as `SborData`. See the Core API documentation for more details. events: description: Events emitted by a transaction. type: array items: $ref: "#/components/schemas/EventsItem" error_message: description: Error message (only present if status is `Failed` or `Rejected`) type: string nullable: true EventsItem: type: object required: - name - emitter - data properties: name: type: string emitter: type: object description: | This type is defined in the Core API as `EventEmitterIdentifier`. See the Core API documentation for more details. data: $ref: "#/components/schemas/ProgrammaticScryptoSborValue" NonFungibleIdType: type: string enum: - String - Integer - Bytes - Ruid PackageVmType: type: string enum: - Native - ScryptoV1 ValidatorUptimeCollection: type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/ValidatorUptimeCollectionItem" ValidatorUptimeCollectionItem: type: object required: - address - epochs_active_in properties: address: $ref: "#/components/schemas/Address" proposals_made: description: number of proposals made. type: integer format: int64 nullable: true proposals_missed: description: number of proposals missed. type: integer format: int64 nullable: true epochs_active_in: description: number of epochs validator was active in. type: integer format: int64 ValidatorCollection: allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/ValidatorCollectionItem" ValidatorCollectionItem: type: object required: - address - metadata - stake_vault - pending_xrd_withdraw_vault - locked_owner_stake_unit_vault - pending_owner_stake_unit_unlock_vault - state - effective_fee_factor properties: address: $ref: "#/components/schemas/Address" stake_vault: $ref: "#/components/schemas/ValidatorVaultItem" pending_xrd_withdraw_vault: $ref: "#/components/schemas/ValidatorVaultItem" locked_owner_stake_unit_vault: $ref: "#/components/schemas/ValidatorVaultItem" pending_owner_stake_unit_unlock_vault: $ref: "#/components/schemas/ValidatorVaultItem" state: type: object nullable: true description: | Validator inner state representation. This type is defined in the Core API as `ValidatorFieldStateValue`. See the Core API documentation for more details. active_in_epoch: $ref: "#/components/schemas/ValidatorCollectionItemActiveInEpoch" metadata: $ref: "#/components/schemas/EntityMetadataCollection" effective_fee_factor: type: object required: - current properties: current: type: object required: - fee_factor properties: fee_factor: $ref: "#/components/schemas/BigDecimal" pending: type: object nullable: true required: - fee_factor - effective_at_epoch properties: fee_factor: $ref: "#/components/schemas/BigDecimal" effective_at_epoch: type: integer format: int64 minimum: 0 maximum: 10000000000 ValidatorCollectionItemActiveInEpoch: type: object required: - stake - stake_percentage - key properties: stake: $ref: "#/components/schemas/BigDecimal" stake_percentage: type: number format: double key: $ref: "#/components/schemas/PublicKey" # # /status/* Request & Response Types # NetworkConfigurationResponse: type: object required: - network_id - network_name - well_known_addresses properties: network_id: $ref: "#/components/schemas/NetworkId" network_name: $ref: "#/components/schemas/NetworkName" well_known_addresses: type: object required: - xrd - secp256k1_signature_virtual_badge - ed25519_signature_virtual_badge - package_of_direct_caller_virtual_badge - global_caller_virtual_badge - system_transaction_badge - package_owner_badge - validator_owner_badge - account_owner_badge - identity_owner_badge - package_package - resource_package - account_package - identity_package - consensus_manager_package - access_controller_package - transaction_processor_package - metadata_module_package - royalty_module_package - access_rules_package - role_assignment_module_package - genesis_helper_package - faucet_package - consensus_manager - genesis_helper - faucet - pool_package - transaction_tracker properties: xrd: $ref: "#/components/schemas/Address" secp256k1_signature_virtual_badge: $ref: "#/components/schemas/Address" ed25519_signature_virtual_badge: $ref: "#/components/schemas/Address" package_of_direct_caller_virtual_badge: $ref: "#/components/schemas/Address" global_caller_virtual_badge: $ref: "#/components/schemas/Address" system_transaction_badge: $ref: "#/components/schemas/Address" package_owner_badge: $ref: "#/components/schemas/Address" validator_owner_badge: $ref: "#/components/schemas/Address" account_owner_badge: $ref: "#/components/schemas/Address" identity_owner_badge: $ref: "#/components/schemas/Address" package_package: $ref: "#/components/schemas/Address" resource_package: $ref: "#/components/schemas/Address" account_package: $ref: "#/components/schemas/Address" identity_package: $ref: "#/components/schemas/Address" consensus_manager_package: $ref: "#/components/schemas/Address" access_controller_package: $ref: "#/components/schemas/Address" transaction_processor_package: $ref: "#/components/schemas/Address" metadata_module_package: $ref: "#/components/schemas/Address" royalty_module_package: $ref: "#/components/schemas/Address" access_rules_package: description: "**Obsolete!** Use `role_assignment_module_package` instead." deprecated: true $ref: "#/components/schemas/Address" role_assignment_module_package: $ref: "#/components/schemas/Address" genesis_helper_package: $ref: "#/components/schemas/Address" faucet_package: $ref: "#/components/schemas/Address" consensus_manager: $ref: "#/components/schemas/Address" genesis_helper: $ref: "#/components/schemas/Address" faucet: $ref: "#/components/schemas/Address" pool_package: $ref: "#/components/schemas/Address" transaction_tracker: $ref: "#/components/schemas/Address" GatewayStatusResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - type: object required: - release_info properties: release_info: $ref: "#/components/schemas/GatewayInfoResponseReleaseInfo" GatewayInfoResponseKnownTarget: type: object required: - state_version properties: state_version: description: | The latest-seen state version of the tip of the network's ledger. If this is significantly ahead of the current ledger state version, the Network Gateway is possibly behind and may be reporting outdated information. type: integer format: int64 GatewayInfoResponseReleaseInfo: type: object required: - release_version - image_tag - open_api_schema_version properties: release_version: description: The release that is currently deployed to the Gateway API. type: string open_api_schema_version: description: The Open API Schema version that was used to generate the API models. type: string image_tag: description: Image tag that is currently deployed to the Gateway API. type: string # # /transaction/* Request & Response Types # TransactionConstructionResponse: allOf: - type: object - $ref: "#/components/schemas/LedgerStateMixin" TransactionPreviewRequest: type: object required: - manifest - start_epoch_inclusive - end_epoch_exclusive - tip_percentage - nonce - signer_public_keys - flags properties: manifest: description: A text-representation of a transaction manifest type: string blobs_hex: description: An array of hex-encoded blob data (optional) type: array items: type: string start_epoch_inclusive: type: integer format: int64 minimum: 0 maximum: 10000000000 description: An integer between `0` and `10^10`, marking the epoch at which the transaction starts being valid end_epoch_exclusive: type: integer format: int64 minimum: 0 maximum: 10000000000 description: An integer between `0` and `10^10`, marking the epoch at which the transaction is no longer valid notary_public_key: $ref: "#/components/schemas/PublicKey" description: The notary public key to use (optional) notary_is_signatory: type: boolean description: Whether the notary should count as a signatory (optional, default false) tip_percentage: type: integer format: int32 minimum: 0 maximum: 65535 description: An integer between `0` and `65535`, giving the validator tip as a percentage amount. A value of `1` corresponds to 1% of the fee. nonce: type: integer format: int64 minimum: 0 description: A decimal-string-encoded integer between `0` and `2^32 - 1`, used to ensure the transaction intent is unique. signer_public_keys: type: array items: $ref: "#/components/schemas/PublicKey" description: A list of public keys to be used as transaction signers flags: type: object required: - use_free_credit - assume_all_signature_proofs - skip_epoch_check properties: use_free_credit: type: boolean assume_all_signature_proofs: type: boolean skip_epoch_check: type: boolean TransactionPreviewResponse: type: object required: - encoded_receipt - receipt - resource_changes - logs properties: encoded_receipt: $ref: "#/components/schemas/HexString" receipt: type: object description: | This type is defined in the Core API as `TransactionReceipt`. See the Core API documentation for more details. resource_changes: type: array items: type: object description: | This type is defined in the Core API as `InstructionResourceChanges`. See the Core API documentation for more details. logs: type: array items: type: object required: - level - message properties: level: type: string message: type: string TransactionSubmitRequest: type: object required: - notarized_transaction_hex properties: notarized_transaction_hex: $ref: "#/components/schemas/NotarizedTransactionHexString" TransactionSubmitResponse: type: object required: - duplicate properties: duplicate: type: boolean description: Is true if the transaction is a duplicate of an existing pending transaction. AccountDepositPreValidationRequest: allOf: - type: object required: - account_address - resource_addresses properties: account_address: $ref: "#/components/schemas/Address" resource_addresses: type: array items: $ref: "#/components/schemas/Address" badge: $ref: "#/components/schemas/TransactionAccountDepositPreValidationAuthorizedDepositorBadge" example: account_address: "" resource_addresses: [""] AccountDepositPreValidationResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - type: object required: - allows_try_deposit_batch - resource_specific - deciding_factors properties: allows_try_deposit_batch: type: boolean resource_specific_behaviour: description: The fully resolved try_deposit_* ability of each resource (which takes all the inputs into account, including the authorized depositor badge, the default deposit rule and the resource-specific details). type: array items: $ref: "#/components/schemas/AccountDepositPreValidationResourceSpecificBehaviourItem" deciding_factors: $ref: "#/components/schemas/AccountDepositPreValidationDecidingFactors" TransactionStatusRequest: allOf: - type: object required: - intent_hash properties: intent_hash: $ref: "#/components/schemas/HashBech32mString" example: intent_hash: "" TransactionStatusResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - type: object required: - status - intent_status - intent_status_description - known_payloads properties: status: $ref: "#/components/schemas/TransactionStatus" intent_status: $ref: "#/components/schemas/TransactionIntentStatus" intent_status_description: description: | An additional description to clarify the intent status. type: string known_payloads: type: array items: $ref: "#/components/schemas/TransactionStatusResponseKnownPayloadItem" committed_state_version: description: | If the intent was committed, this gives the state version when this intent was committed. type: integer format: int64 nullable: true permanently_rejects_at_epoch: description: The epoch number at which the transaction is guaranteed to get permanently rejected by the Network due to exceeded epoch range defined when submitting transaction. nullable: true type: integer format: int64 minimum: 0 maximum: 10000000000 error_message: description: | The most relevant error message received, due to a rejection or commit as failure. Please note that presence of an error message doesn't imply that the intent will definitely reject or fail. This could represent a temporary error (such as out of fees), or an error with a payload which doesn't end up being committed. type: string nullable: true TransactionStatusResponseKnownPayloadItem: type: object required: - payload_hash - status properties: payload_hash: $ref: "#/components/schemas/HashBech32mString" status: $ref: "#/components/schemas/TransactionStatus" payload_status: $ref: "#/components/schemas/TransactionPayloadStatus" payload_status_description: description: | An additional description to clarify the payload status. type: string error_message: description: | The initial error message received for a rejection or failure during transaction execution. This will typically be the useful error message, explaining the root cause of the issue. Please note that presence of an error message doesn't imply that this payload will definitely reject or fail. This could represent an error during a temporary rejection (such as out of fees) which then gets resolved (e.g. by depositing money to pay the fee), allowing the transaction to be committed. type: string nullable: true latest_error_message: description: | The latest error message received for a rejection or failure during transaction execution, this is only returned if it is different from the initial error message. This is more current than the initial error message, but may be less useful, as it could be a message regarding the expiry of the transaction at the end of its epoch validity window. Please note that presence of an error message doesn't imply that this payload will definitely reject or fail. This could represent an error during a temporary rejection (such as out of fees) which then gets resolved (e.g. by depositing money to pay the fee), allowing the transaction to be committed. type: string nullable: true handling_status: $ref: "#/components/schemas/TransactionPayloadGatewayHandlingStatus" handling_status_reason: description: | Additional reason for why the Gateway has its current handling status. type: string nullable: true submission_error: description: | The most recent error message received when submitting this transaction to the network. Please note that the presence of an error message doesn't imply that this transaction payload will definitely reject or fail. This could be a transient error. type: string nullable: true TransactionCommittedDetailsRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - type: object required: - intent_hash properties: intent_hash: $ref: "#/components/schemas/HashBech32mString" opt_ins: $ref: "#/components/schemas/TransactionDetailsOptIns" example: intent_hash: "" TransactionDetailsOptIns: type: object properties: raw_hex: description: if set to `true`, raw transaction hex is returned. type: boolean default: false receipt_state_changes: description: if set to `true`, state changes inside receipt object are returned. type: boolean default: false receipt_fee_summary: description: if set to `true`, fee summary inside receipt object is returned. type: boolean default: false receipt_fee_source: description: if set to `true`, fee source inside receipt object is returned. type: boolean default: false receipt_fee_destination: description: if set to `true`, fee destination inside receipt object is returned. type: boolean default: false receipt_costing_parameters: description: if set to `true`, costing parameters inside receipt object is returned. type: boolean default: false receipt_events: description: if set to `true`, events inside receipt object is returned. type: boolean default: false receipt_output: description: (true by default) if set to `true`, transaction receipt output is returned. type: boolean default: true affected_global_entities: description: if set to `true`, all affected global entities by given transaction are returned. type: boolean default: false manifest_instructions: description: if set to `true`, manifest instructions for user transactions are returned. type: boolean default: false balance_changes: description: | if set to `true`, returns the fungible and non-fungible balance changes. **Warning!** This opt-in might be missing for recently committed transactions, in that case a `null` value will be returned. Retry the request until non-null value is returned. type: boolean default: false TransactionCommittedDetailsResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - type: object required: - transaction properties: transaction: $ref: "#/components/schemas/CommittedTransactionInfo" TransactionBalanceChanges: type: object nullable: true # TODO make non-nullable once we eliminate CoreAPI-based implementation required: - fungible_fee_balance_changes - fungible_balance_changes - non_fungible_balance_changes properties: fungible_fee_balance_changes: description: | A list of all fee-related fungible balance changes per entity and resource. type: array items: $ref: "#/components/schemas/TransactionFungibleFeeBalanceChanges" fungible_balance_changes: description: | A list of all non-fee-related fungible balance changes per entity and resource. type: array items: $ref: "#/components/schemas/TransactionFungibleBalanceChanges" non_fungible_balance_changes: description: | A list of all non-fungible changes per entity and resource. type: array items: $ref: "#/components/schemas/TransactionNonFungibleBalanceChanges" TransactionFungibleFeeBalanceChangeType: description: | Indicates fee-related balance changes, for example: - payment of the fee including tip and royalty, - distribution of royalties, - distribution of the fee and tip to the consensus-manager, for distributing to the relevant validator/s at end of epoch. See https://www.radixdlt.com/blog/how-fees-work-in-babylon for further information on how fee payment works at Babylon. type: string enum: - FeePayment - FeeDistributed - TipDistributed - RoyaltyDistributed TransactionFungibleFeeBalanceChanges: type: object required: - type - entity_address - resource_address - balance_change properties: type: $ref: "#/components/schemas/TransactionFungibleFeeBalanceChangeType" entity_address: $ref: "#/components/schemas/Address" resource_address: $ref: "#/components/schemas/Address" balance_change: type: string description: | The string-encoded decimal representing the amount of change for the fungible resource. TransactionFungibleBalanceChanges: type: object required: - entity_address - resource_address - balance_change properties: entity_address: $ref: "#/components/schemas/Address" resource_address: $ref: "#/components/schemas/Address" balance_change: type: string description: | The string-encoded decimal representing the amount of change for the fungible resource. TransactionNonFungibleBalanceChanges: type: object required: - entity_address - resource_address - added - removed properties: entity_address: $ref: "#/components/schemas/Address" resource_address: $ref: "#/components/schemas/Address" added: type: array items: $ref: "#/components/schemas/NonFungibleId" removed: type: array items: $ref: "#/components/schemas/NonFungibleId" # # /stream/* Request & Response Types # StreamTransactionsRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/FromLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object properties: kind_filter: description: Limit returned transactions by their kind. Defaults to `user`. type: string enum: - User - EpochChange - All manifest_accounts_withdrawn_from_filter: type: array items: $ref: "#/components/schemas/Address" manifest_accounts_deposited_into_filter: type: array items: $ref: "#/components/schemas/Address" manifest_badges_presented_filter: type: array items: $ref: "#/components/schemas/Address" manifest_resources_filter: type: array items: $ref: "#/components/schemas/Address" affected_global_entities_filter: type: array items: $ref: "#/components/schemas/Address" events_filter: type: array items: $ref: "#/components/schemas/StreamTransactionsRequestEventFilterItem" accounts_with_manifest_owner_method_calls: type: array items: $ref: "#/components/schemas/Address" accounts_without_manifest_owner_method_calls: type: array items: $ref: "#/components/schemas/Address" manifest_class_filter: type: object required: - class properties: class: $ref: "#/components/schemas/ManifestClass" match_only_most_specific: type: boolean default: false order: description: Configures the order of returned result set. Defaults to `desc`. type: string enum: - Asc - Desc opt_ins: $ref: "#/components/schemas/TransactionDetailsOptIns" example: limit_per_page: 5 StreamTransactionsRequestEventFilterItem: type: object required: - event properties: event: type: string enum: - Deposit - Withdrawal emitter_address: $ref: "#/components/schemas/Address" resource_address: $ref: "#/components/schemas/Address" StreamTransactionsResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: description: The page of user transactions. type: array items: $ref: "#/components/schemas/CommittedTransactionInfo" # # /state/entity/* Request & Response Types # StateEntityDetailsRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - type: object required: - addresses properties: opt_ins: $ref: "#/components/schemas/StateEntityDetailsOptIns" addresses: type: array description: limited to max 100 items. items: $ref: "#/components/schemas/Address" aggregation_level: $ref: "#/components/schemas/ResourceAggregationLevel" example: addresses: - "" aggregation_level: "Vault" opt_ins: ancestor_identities: true component_royalty_config: true component_royalty_vault_balance: true package_royalty_vault_balance: true non_fungible_include_nfids: true explicit_metadata: - name - description StateEntityDetailsOptIns: type: object description: Check detailed [OptIns](#section/Using-endpoints-with-opt-in-features) documentation for more details properties: ancestor_identities: description: if set to `true`, ancestor addresses - `parent_address`, `owner_address` and `global_address` for entities are returned. type: boolean default: false component_royalty_config: description: if set to `true`, `royalty_config` for component entities is returned. type: boolean default: false component_royalty_vault_balance: description: if set to `true`, `royalty_vault_balance` for component entities is returned. type: boolean default: false package_royalty_vault_balance: description: if set to `true`, `royalty_vault_balance` for package entities is returned. type: boolean default: false non_fungible_include_nfids: description: if set to `true`, first page of non fungible ids are returned for each non fungible resource, with `next_cursor` which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. type: boolean default: false explicit_metadata: description: allows specifying explicitly metadata properties which should be returned in response. type: array items: type: string StateEntityDetailsResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/StateEntityDetailsResponseItem" StateEntityDetailsResponseItem: type: object required: - address - metadata properties: address: $ref: "#/components/schemas/Address" fungible_resources: $ref: "#/components/schemas/FungibleResourcesCollection" non_fungible_resources: $ref: "#/components/schemas/NonFungibleResourcesCollection" ancestor_identities: $ref: "#/components/schemas/StateEntityDetailsResponseItemAncestorIdentities" metadata: $ref: "#/components/schemas/EntityMetadataCollection" explicit_metadata: $ref: "#/components/schemas/EntityMetadataCollection" details: $ref: "#/components/schemas/StateEntityDetailsResponseItemDetails" StateEntityDetailsResponseItemAncestorIdentities: type: object properties: parent_address: $ref: "#/components/schemas/Address" owner_address: $ref: "#/components/schemas/Address" global_address: $ref: "#/components/schemas/Address" StateEntityDetailsResponseItemDetailsType: type: string enum: - FungibleResource - NonFungibleResource - FungibleVault - NonFungibleVault - Package - Component StateEntityDetailsResponseItemDetails: type: object required: - type properties: type: $ref: "#/components/schemas/StateEntityDetailsResponseItemDetailsType" discriminator: propertyName: type mapping: # Must match StateEntityDetailsResponseDetailsType FungibleResource: "#/components/schemas/StateEntityDetailsResponseFungibleResourceDetails" NonFungibleResource: "#/components/schemas/StateEntityDetailsResponseNonFungibleResourceDetails" FungibleVault: "#/components/schemas/StateEntityDetailsResponseFungibleVaultDetails" NonFungibleVault: "#/components/schemas/StateEntityDetailsResponseNonFungibleVaultDetails" Package: "#/components/schemas/StateEntityDetailsResponsePackageDetails" Component: "#/components/schemas/StateEntityDetailsResponseComponentDetails" StateEntityDetailsResponseFungibleResourceDetails: allOf: - $ref: "#/components/schemas/StateEntityDetailsResponseItemDetails" - type: object required: - role_assignments - divisibility - total_supply - total_minted - total_burned properties: role_assignments: $ref: "#/components/schemas/ComponentEntityRoleAssignments" divisibility: type: integer minimum: 0 total_supply: $ref: "#/components/schemas/BigDecimal" total_minted: $ref: "#/components/schemas/BigDecimal" total_burned: $ref: "#/components/schemas/BigDecimal" StateEntityDetailsResponseNonFungibleResourceDetails: allOf: - $ref: "#/components/schemas/StateEntityDetailsResponseItemDetails" - type: object required: - role_assignments - non_fungible_id_type - total_supply - total_minted - total_burned properties: role_assignments: $ref: "#/components/schemas/ComponentEntityRoleAssignments" non_fungible_id_type: $ref: "#/components/schemas/NonFungibleIdType" total_supply: $ref: "#/components/schemas/BigDecimal" total_minted: $ref: "#/components/schemas/BigDecimal" total_burned: $ref: "#/components/schemas/BigDecimal" StateEntityDetailsResponseFungibleVaultDetails: allOf: - $ref: "#/components/schemas/StateEntityDetailsResponseItemDetails" - type: object required: - resource_address - balance properties: resource_address: $ref: "#/components/schemas/Address" balance: $ref: "#/components/schemas/FungibleResourcesCollectionItemVaultAggregatedVaultItem" StateEntityDetailsResponseNonFungibleVaultDetails: allOf: - $ref: "#/components/schemas/StateEntityDetailsResponseItemDetails" - type: object required: - resource_address - balance properties: resource_address: $ref: "#/components/schemas/Address" balance: $ref: "#/components/schemas/NonFungibleResourcesCollectionItemVaultAggregatedVaultItem" StateEntityDetailsResponsePackageDetails: description: "vm_type, code_hash_hex and code_hex are always going to be empty, use `codes` property which will return collection (it's possible after protocol update that package might have multiple codes)" allOf: - $ref: "#/components/schemas/StateEntityDetailsResponseItemDetails" - type: object required: - codes - vm_type - code_hash_hex - code_hex properties: codes: $ref: "#/components/schemas/PackageCodeCollection" vm_type: description: "**Obsolete!** Use `codes` collection instead." deprecated: true $ref: "#/components/schemas/PackageVmType" code_hash_hex: description: "**Obsolete!** Use `codes` collection instead." deprecated: true $ref: "#/components/schemas/HexString" code_hex: description: "**Obsolete!** Use `codes` collection instead." deprecated: true $ref: "#/components/schemas/HexString" royalty_vault_balance: $ref: "#/components/schemas/BigDecimal" blueprints: $ref: "#/components/schemas/PackageBlueprintCollection" schemas: $ref: "#/components/schemas/EntitySchemaCollection" role_assignments: $ref: "#/components/schemas/ComponentEntityRoleAssignments" StateEntityDetailsResponseComponentDetails: allOf: - $ref: "#/components/schemas/StateEntityDetailsResponseItemDetails" - type: object required: - blueprint_name - blueprint_version properties: package_address: $ref: "#/components/schemas/Address" blueprint_name: type: string blueprint_version: type: string state: type: object description: | A representation of a component's inner state. If this entity is a `GenericComponent`, this field will be in a programmatic JSON structure (you can deserialize it as a `ProgrammaticScryptoSborValue`). Otherwise, for "native" components such as `Account`, `Validator`, `AccessController`, `OneResourcePool`, `TwoResourcePool`, and `MultiResourcePool`, this field will be a custom JSON model defined in the Core API schema. role_assignments: $ref: "#/components/schemas/ComponentEntityRoleAssignments" royalty_vault_balance: $ref: "#/components/schemas/BigDecimal" royalty_config: $ref: "#/components/schemas/ComponentRoyaltyConfig" StateAccountResourcePreferencesPageRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - account_address properties: account_address: $ref: "#/components/schemas/Address" example: account_address: null StateAccountResourcePreferencesPageResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/AccountResourcePreferencesCollection" - type: object required: - account_address properties: account_address: $ref: "#/components/schemas/Address" StateAccountAuthorizedDepositorsPageRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - account_address properties: account_address: $ref: "#/components/schemas/Address" example: account_address: null StateAccountAuthorizedDepositorsPageResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/AccountAuthorizedDepositorsCollection" - type: object required: - account_address properties: account_address: $ref: "#/components/schemas/Address" StatePackageBlueprintPageRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - package_address properties: package_address: $ref: "#/components/schemas/Address" example: package_address: "" StatePackageBlueprintPageResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/PackageBlueprintCollection" - type: object required: - package_address properties: package_address: $ref: "#/components/schemas/Address" StatePackageCodePageRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - package_address properties: package_address: $ref: "#/components/schemas/Address" example: package_address: "" StatePackageCodePageResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/PackageCodeCollection" - type: object required: - package_address properties: package_address: $ref: "#/components/schemas/Address" StateEntityMetadataPageRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - address properties: address: $ref: "#/components/schemas/Address" example: address: "" StateEntityMetadataPageResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/EntityMetadataCollection" - type: object required: - address properties: address: $ref: "#/components/schemas/Address" StateEntitySchemaPageRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - address properties: address: $ref: "#/components/schemas/Address" example: address: "" StateEntitySchemaPageResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/EntitySchemaCollection" - type: object required: - address properties: address: $ref: "#/components/schemas/Address" StateEntityFungiblesPageRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - address properties: address: $ref: "#/components/schemas/Address" aggregation_level: $ref: "#/components/schemas/ResourceAggregationLevel" opt_ins: $ref: "#/components/schemas/StateEntityFungiblesPageRequestOptIns" example: address: "" StateEntityFungiblesPageRequestOptIns: type: object description: Check detailed [OptIns](#section/Using-endpoints-with-opt-in-features) documentation for more details properties: explicit_metadata: description: allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. type: array items: type: string StateEntityFungiblesPageResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/FungibleResourcesCollection" - type: object required: - address properties: address: $ref: "#/components/schemas/Address" StateEntityFungibleResourceVaultsPageRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - address - resource_address properties: address: $ref: "#/components/schemas/Address" resource_address: $ref: "#/components/schemas/Address" example: address: "" resource_address: "" StateEntityFungibleResourceVaultsPageResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/FungibleResourcesCollectionItemVaultAggregatedVault" - type: object required: - address - resource_address properties: address: $ref: "#/components/schemas/Address" resource_address: $ref: "#/components/schemas/Address" StateEntityNonFungiblesPageRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - address properties: address: $ref: "#/components/schemas/Address" aggregation_level: $ref: "#/components/schemas/ResourceAggregationLevel" opt_ins: $ref: "#/components/schemas/StateEntityNonFungiblesPageRequestOptIns" example: address: "" StateEntityNonFungiblesPageRequestOptIns: type: object description: Check detailed [OptIns](#section/Using-endpoints-with-opt-in-features) documentation for more details properties: non_fungible_include_nfids: description: if set to `true`, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. type: boolean default: false explicit_metadata: description: allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. type: array items: type: string StateEntityNonFungiblesPageResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/NonFungibleResourcesCollection" - type: object required: - address properties: address: $ref: "#/components/schemas/Address" StateEntityNonFungibleResourceVaultsPageRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - address - resource_address properties: address: $ref: "#/components/schemas/Address" resource_address: $ref: "#/components/schemas/Address" opt_ins: $ref: "#/components/schemas/StateEntityNonFungibleResourceVaultsPageOptIns" example: address: "" resource_address: "" StateEntityNonFungibleResourceVaultsPageOptIns: type: object description: Check detailed [OptIns](#section/Using-endpoints-with-opt-in-features) documentation for more details properties: non_fungible_include_nfids: description: if set to `true`, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. type: boolean StateEntityNonFungibleResourceVaultsPageResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/NonFungibleResourcesCollectionItemVaultAggregatedVault" - type: object required: - address - resource_address properties: address: $ref: "#/components/schemas/Address" resource_address: $ref: "#/components/schemas/Address" StateEntityNonFungibleIdsPageRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - address - vault_address - resource_address properties: address: $ref: "#/components/schemas/Address" vault_address: $ref: "#/components/schemas/Address" resource_address: $ref: "#/components/schemas/Address" example: address: "" resource_address: null vault_address: null StateEntityNonFungibleIdsPageResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/NonFungibleIdsCollection" - type: object required: - address - resource_address properties: address: $ref: "#/components/schemas/Address" resource_address: $ref: "#/components/schemas/Address" # # /state/non-fungible/* Request & Response Types # StateNonFungibleIdsRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - resource_address properties: resource_address: $ref: "#/components/schemas/Address" example: resource_address: "" StateNonFungibleIdsResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - type: object required: - resource_address - non_fungible_ids properties: resource_address: $ref: "#/components/schemas/Address" non_fungible_ids: $ref: "#/components/schemas/NonFungibleIdsCollection" StateNonFungibleLocationRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - type: object required: - resource_address - non_fungible_ids properties: resource_address: $ref: "#/components/schemas/Address" non_fungible_ids: type: array description: limited to max 100 items. items: $ref: "#/components/schemas/NonFungibleId" example: resource_address: "" non_fungible_ids: ["#1#"] StateNonFungibleLocationResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - type: object required: - resource_address - non_fungible_ids properties: resource_address: $ref: "#/components/schemas/Address" non_fungible_ids: type: array items: $ref: "#/components/schemas/StateNonFungibleLocationResponseItem" StateNonFungibleLocationResponseItem: type: object required: - non_fungible_id - is_burned - last_updated_at_state_version properties: non_fungible_id: $ref: "#/components/schemas/NonFungibleId" owning_vault_address: description: The address of the Vault containing (owning) this NFID. $ref: "#/components/schemas/Address" owning_vault_parent_ancestor_address: description: The address of the parent ancestor of the Vault containing (owning) this NFID. $ref: "#/components/schemas/Address" owning_vault_global_ancestor_address: description: The address of the global ancestor of the Vault containing (owning) this NFID. $ref: "#/components/schemas/Address" is_burned: type: boolean last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" StateNonFungibleDataRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - type: object required: - resource_address - non_fungible_ids properties: resource_address: $ref: "#/components/schemas/Address" non_fungible_ids: type: array description: limited to max 100 items. items: $ref: "#/components/schemas/NonFungibleId" example: resource_address: "" non_fungible_ids: ["#1#"] StateNonFungibleDataResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - type: object required: - resource_address - non_fungible_id_type - non_fungible_ids properties: resource_address: $ref: "#/components/schemas/Address" non_fungible_id_type: $ref: "#/components/schemas/NonFungibleIdType" non_fungible_ids: type: array items: $ref: "#/components/schemas/StateNonFungibleDetailsResponseItem" StateNonFungibleDetailsResponseItem: type: object required: - non_fungible_id - is_burned - last_updated_at_state_version properties: is_burned: type: boolean non_fungible_id: $ref: "#/components/schemas/NonFungibleId" data: $ref: "#/components/schemas/ScryptoSborValue" last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" StateKeyValueStoreKeysRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object required: - key_value_store_address properties: key_value_store_address: $ref: "#/components/schemas/Address" example: key_value_store_address: "" StateKeyValueStoreKeysResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - $ref: "#/components/schemas/StateKeyValueStoreKeysCollection" - type: object required: - key_value_store_address properties: key_value_store_address: $ref: "#/components/schemas/Address" StateKeyValueStoreKeysCollection: description: Key value store items collection. allOf: - $ref: "#/components/schemas/ResultSetCursorMixin" - type: object required: - items properties: items: type: array items: $ref: "#/components/schemas/StateKeyValueStoreKeysResponseItem" StateKeyValueStoreKeysResponseItem: type: object required: - key - last_updated_at_state_version properties: key: $ref: "#/components/schemas/ScryptoSborValue" last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" StateKeyValueStoreDataRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - type: object required: - key_value_store_address - keys properties: key_value_store_address: $ref: "#/components/schemas/Address" keys: type: array description: limited to max 100 items. items: $ref: "#/components/schemas/StateKeyValueStoreDataRequestKeyItem" example: key_value_store_address: "" keys: - key_hex: "5C21010901000000" - key_json: kind: Tuple fields: - kind: "U32" value: "1" StateKeyValueStoreDataRequestKeyItem: type: object properties: key_hex: $ref: "#/components/schemas/HexString" key_json: $ref: "#/components/schemas/ProgrammaticScryptoSborValue" StateKeyValueStoreDataResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - type: object required: - key_value_store_address - entries properties: key_value_store_address: $ref: "#/components/schemas/Address" entries: type: array items: $ref: "#/components/schemas/StateKeyValueStoreDataResponseItem" StateKeyValueStoreDataResponseItem: type: object required: - key - value - last_updated_at_state_version - is_locked properties: key: $ref: "#/components/schemas/ScryptoSborValue" value: $ref: "#/components/schemas/ScryptoSborValue" last_updated_at_state_version: $ref: "#/components/schemas/LastUpdatedAtStateVersion" is_locked: type: boolean # # /state/validators/* Request & Response Types # StateValidatorsListRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - type: object properties: cursor: description: This cursor allows forward pagination, by providing the cursor from the previous request. type: string nullable: true example: at_ledger_state: null StateValidatorsListResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - type: object required: - validators properties: validators: $ref: "#/components/schemas/ValidatorCollection" ValidatorsUptimeRequest: description: | For `at_ledger_state` and `from_ledger_state` you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp`, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ "from_state_version" = { "state_version" = 100 }, "at_state_version" = { "state_version" = 300} }` gateway api will check in which epoch transactions with state version 100 and 300 were and then use that as inclusive boundary for request. allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" - $ref: "#/components/schemas/FromLedgerStateMixin" - type: object properties: validator_addresses: type: array items: $ref: "#/components/schemas/Address" ValidatorsUptimeResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" - type: object required: - validators properties: validators: $ref: "#/components/schemas/ValidatorUptimeCollection" # # Errors # ErrorResponse: type: object required: - message properties: message: description: A human-readable error message. type: string code: description: A numeric code corresponding to the given error type. type: integer details: $ref: "#/components/schemas/GatewayError" trace_id: description: A unique request identifier to be used when reporting errors, to allow correlation with the Gateway API's error logs. type: string GatewayError: type: object required: - type properties: type: description: The type of error. Each subtype may have its own additional structured fields. type: string discriminator: propertyName: type mapping: EntityNotFoundError: "#/components/schemas/EntityNotFoundError" InvalidEntityError: "#/components/schemas/InvalidEntityError" NotSyncedUpError: "#/components/schemas/NotSyncedUpError" InvalidRequestError: "#/components/schemas/InvalidRequestError" InvalidTransactionError: "#/components/schemas/InvalidTransactionError" TransactionNotFoundError: "#/components/schemas/TransactionNotFoundError" InternalServerError: "#/components/schemas/InternalServerError" EntityNotFoundError: allOf: - $ref: "#/components/schemas/GatewayError" - type: object required: - address properties: address: $ref: "#/components/schemas/Address" InvalidEntityError: allOf: - $ref: "#/components/schemas/GatewayError" - type: object required: - address properties: address: $ref: "#/components/schemas/Address" NotSyncedUpError: allOf: - $ref: "#/components/schemas/GatewayError" - type: object required: - request_type - current_sync_delay_seconds - max_allowed_sync_delay_seconds properties: request_type: description: The request type that triggered this exception. type: string current_sync_delay_seconds: description: The current delay between the Gateway DB and the network ledger round timestamp. type: integer format: int64 max_allowed_sync_delay_seconds: description: The maximum allowed delay between the Gateway DB and the network ledger round timestamp for this `request_type`. type: integer format: int64 InvalidRequestError: allOf: - $ref: "#/components/schemas/GatewayError" - type: object required: - validation_errors properties: validation_errors: description: One or more validation errors which occurred when validating the request. type: array items: $ref: "#/components/schemas/ValidationErrorsAtPath" InvalidTransactionError: allOf: - $ref: "#/components/schemas/GatewayError" - type: object TransactionNotFoundError: allOf: - $ref: "#/components/schemas/GatewayError" - type: object required: - intent_hash properties: intent_hash: $ref: "#/components/schemas/HashBech32mString" InternalServerError: allOf: - $ref: "#/components/schemas/GatewayError" - type: object required: - exception - cause properties: exception: description: Gives an error type which occurred within the Gateway API when serving the request. type: string cause: description: Gives a human readable message - likely just a trace ID for reporting the error. type: string ValidationErrorsAtPath: type: object required: - path - errors properties: path: type: string errors: type: array items: type: string # # Metadata Typed Value # MetadataValueType: type: string enum: - String - Bool - U8 - U32 - U64 - I32 - I64 - Decimal - GlobalAddress - PublicKey - NonFungibleGlobalId - NonFungibleLocalId - Instant - Url - Origin - PublicKeyHash - StringArray - BoolArray - U8Array - U32Array - U64Array - I32Array - I64Array - DecimalArray - GlobalAddressArray - PublicKeyArray - NonFungibleGlobalIdArray - NonFungibleLocalIdArray - InstantArray - UrlArray - OriginArray - PublicKeyHashArray MetadataTypedValue: type: object discriminator: propertyName: type mapping: String: "#/components/schemas/MetadataStringValue" Bool: "#/components/schemas/MetadataBoolValue" U8: "#/components/schemas/MetadataU8Value" U32: "#/components/schemas/MetadataU32Value" U64: "#/components/schemas/MetadataU64Value" I32: "#/components/schemas/MetadataI32Value" I64: "#/components/schemas/MetadataI64Value" Decimal: "#/components/schemas/MetadataDecimalValue" GlobalAddress: "#/components/schemas/MetadataGlobalAddressValue" PublicKey: "#/components/schemas/MetadataPublicKeyValue" NonFungibleGlobalId: "#/components/schemas/MetadataNonFungibleGlobalIdValue" NonFungibleLocalId: "#/components/schemas/MetadataNonFungibleLocalIdValue" Instant: "#/components/schemas/MetadataInstantValue" Url: "#/components/schemas/MetadataUrlValue" Origin: "#/components/schemas/MetadataOriginValue" PublicKeyHash: "#/components/schemas/MetadataPublicKeyHashValue" StringArray: "#/components/schemas/MetadataStringArrayValue" BoolArray: "#/components/schemas/MetadataBoolArrayValue" U8Array: "#/components/schemas/MetadataU8ArrayValue" U32Array: "#/components/schemas/MetadataU32ArrayValue" U64Array: "#/components/schemas/MetadataU64ArrayValue" I32Array: "#/components/schemas/MetadataI32ArrayValue" I64Array: "#/components/schemas/MetadataI64ArrayValue" DecimalArray: "#/components/schemas/MetadataDecimalArrayValue" GlobalAddressArray: "#/components/schemas/MetadataGlobalAddressArrayValue" PublicKeyArray: "#/components/schemas/MetadataPublicKeyArrayValue" NonFungibleGlobalIdArray: "#/components/schemas/MetadataNonFungibleGlobalIdArrayValue" NonFungibleLocalIdArray: "#/components/schemas/MetadataNonFungibleLocalIdArrayValue" InstantArray: "#/components/schemas/MetadataInstantArrayValue" UrlArray: "#/components/schemas/MetadataUrlArrayValue" OriginArray: "#/components/schemas/MetadataOriginArrayValue" PublicKeyHashArray: "#/components/schemas/MetadataPublicKeyHashArrayValue" required: - type properties: type: $ref: "#/components/schemas/MetadataValueType" MetadataStringValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: string MetadataBoolValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: boolean MetadataU8Value: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: string MetadataU32Value: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: string MetadataU64Value: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: string MetadataI32Value: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: string MetadataI64Value: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: string MetadataDecimalValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: string MetadataGlobalAddressValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: string MetadataPublicKeyValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: $ref: "#/components/schemas/PublicKey" MetadataNonFungibleGlobalIdValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - resource_address - non_fungible_id properties: resource_address: $ref: "#/components/schemas/Address" non_fungible_id: $ref: "#/components/schemas/NonFungibleId" MetadataNonFungibleLocalIdValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: string MetadataInstantValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value - unix_timestamp_seconds properties: value: type: string description: | The RFC 3339 / ISO 8601 string representation of the timestamp. Will always use "Z" (denoting UTC) and omits milliseconds. E.g.: `2023-01-26T18:30:09Z`. Note: This field will return clamped value if the actual on-ledger `unix_timestamp_seconds` value is outside the basic range supported by the RFC 3339 / ISO 8601 standard, which starts at year 1583 (i.e. the beginning of the Gregorian calendar) and ends at year 9999 (inclusive). unix_timestamp_seconds: type: string description: | A decimal string-encoded 64-bit signed integer, marking the unix timestamp in seconds. Note: this field accurately represents the full range of possible on-ledger values (i.e. `-2^63 <= seconds < 2^63`). MetadataUrlValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: string MetadataOriginValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: type: string MetadataPublicKeyHashValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value properties: value: $ref: "#/components/schemas/PublicKeyHash" MetadataStringArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: string MetadataBoolArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: boolean MetadataU8ArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - value_hex properties: value_hex: type: string MetadataU32ArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: string MetadataU64ArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: string MetadataI32ArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: string MetadataI64ArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: string MetadataDecimalArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: string MetadataGlobalAddressArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: string MetadataPublicKeyArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: $ref: "#/components/schemas/PublicKey" MetadataNonFungibleGlobalIdArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: object required: - resource_address - non_fungible_id properties: resource_address: $ref: "#/components/schemas/Address" non_fungible_id: $ref: "#/components/schemas/NonFungibleId" MetadataNonFungibleLocalIdArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: string MetadataInstantArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object description: | See documentation of `MetadataInstantValue` for detailed description of `values` vs `values_unix_timestamp_seconds`. required: - values - values_unix_timestamp_seconds properties: values: type: array items: type: string values_unix_timestamp_seconds: type: array items: type: string MetadataUrlArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: string MetadataOriginArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: type: string MetadataPublicKeyHashArrayValue: allOf: - $ref: "#/components/schemas/MetadataTypedValue" - type: object required: - values properties: values: type: array items: $ref: "#/components/schemas/PublicKeyHash" # # Programmatic Scrypto SBOR Values # ProgrammaticScryptoSborValueKind: description: | These are the Scrypto SBOR `ValueKind`s, but with `Bytes` added as an alias for `Vec`, to display such values as hex-encoded strings. type: string enum: - Bool - I8 - I16 - I32 - I64 - I128 - U8 - U16 - U32 - U64 - U128 - String - Enum - Array - Bytes - Map - Tuple - Reference - Own - Decimal - PreciseDecimal - NonFungibleLocalId ProgrammaticScryptoSborValue: description: | Arbitrary SBOR value represented as programmatic JSON with optional property name annotations. All scalar types (`Bool`, `I*`, `U*`, `String`, `Reference`, `Own`, `Decimal`, `PreciseDecimal`, `NonFungibleLocalId`) convey their value via `value` string property with notable exception of `Bool` type that uses regular JSON boolean type. Numeric values as string-encoded to preserve accuracy and simplify implementation on platforms with no native support for 64-bit long numerical values. Common properties represented as nullable strings: * `type_name` is only output when a schema is present and the type has a name, * `field_name` is only output when the value is a child of a `Tuple` or `Enum`, which has a type with named fields, * `variant_name` is only output when a schema is present and the type is an `Enum`. The following is a non-normative example annotated `Tuple` value with `String` and `U32` fields: ``` { "kind": "Tuple", "type_name": "CustomStructure", "fields": [ { "kind": "String", "field_name": "favorite_color", "value": "Blue" }, { "kind": "U32", "field_name": "usage_counter", "value": "462231" } ] } ``` type: object required: - kind properties: kind: $ref: "#/components/schemas/ProgrammaticScryptoSborValueKind" type_name: description: | The name of the type of this value. This is only output when a schema is present and the type has a name. This property is ignored when the value is used as an input to the API. type: string nullable: true field_name: description: | The name of the field which hosts this value. This property is only included if this value is a child of a `Tuple` or `Enum` with named fields. This property is ignored when the value is used as an input to the API. type: string nullable: true discriminator: propertyName: kind mapping: Bool: "#/components/schemas/ProgrammaticScryptoSborValueBool" I8: "#/components/schemas/ProgrammaticScryptoSborValueI8" I16: "#/components/schemas/ProgrammaticScryptoSborValueI16" I32: "#/components/schemas/ProgrammaticScryptoSborValueI32" I64: "#/components/schemas/ProgrammaticScryptoSborValueI64" I128: "#/components/schemas/ProgrammaticScryptoSborValueI128" U8: "#/components/schemas/ProgrammaticScryptoSborValueU8" U16: "#/components/schemas/ProgrammaticScryptoSborValueU16" U32: "#/components/schemas/ProgrammaticScryptoSborValueU32" U64: "#/components/schemas/ProgrammaticScryptoSborValueU64" U128: "#/components/schemas/ProgrammaticScryptoSborValueU128" String: "#/components/schemas/ProgrammaticScryptoSborValueString" Enum: "#/components/schemas/ProgrammaticScryptoSborValueEnum" Array: "#/components/schemas/ProgrammaticScryptoSborValueArray" Bytes: "#/components/schemas/ProgrammaticScryptoSborValueBytes" Map: "#/components/schemas/ProgrammaticScryptoSborValueMap" Tuple: "#/components/schemas/ProgrammaticScryptoSborValueTuple" Reference: "#/components/schemas/ProgrammaticScryptoSborValueReference" Own: "#/components/schemas/ProgrammaticScryptoSborValueOwn" Decimal: "#/components/schemas/ProgrammaticScryptoSborValueDecimal" PreciseDecimal: "#/components/schemas/ProgrammaticScryptoSborValuePreciseDecimal" NonFungibleLocalId: "#/components/schemas/ProgrammaticScryptoSborValueNonFungibleLocalId" ProgrammaticScryptoSborValueBool: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: boolean ProgrammaticScryptoSborValueI8: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueI16: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueI32: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueI64: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueI128: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueU8: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueU16: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueU32: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueU64: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueU128: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueString: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueEnum: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - variant_id - fields properties: variant_id: type: integer minimum: 0 maximum: 255 variant_name: type: string fields: type: array items: $ref: "#/components/schemas/ProgrammaticScryptoSborValue" ProgrammaticScryptoSborValueArray: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - element_kind - elements properties: element_kind: $ref: "#/components/schemas/ProgrammaticScryptoSborValueKind" element_type_name: type: string elements: type: array items: $ref: "#/components/schemas/ProgrammaticScryptoSborValue" ProgrammaticScryptoSborValueBytes: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - element_kind - elements - hex properties: element_kind: $ref: "#/components/schemas/ProgrammaticScryptoSborValueKind" element_type_name: type: string hex: $ref: "#/components/schemas/HexString" ProgrammaticScryptoSborValueMap: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - key_kind - value_kind - entries properties: key_kind: $ref: "#/components/schemas/ProgrammaticScryptoSborValueKind" key_type_name: type: string value_kind: $ref: "#/components/schemas/ProgrammaticScryptoSborValueKind" value_type_name: type: string entries: type: array items: $ref: "#/components/schemas/ProgrammaticScryptoSborValueMapEntry" ProgrammaticScryptoSborValueMapEntry: type: object required: - key - value properties: key: $ref: "#/components/schemas/ProgrammaticScryptoSborValue" value: $ref: "#/components/schemas/ProgrammaticScryptoSborValue" ProgrammaticScryptoSborValueTuple: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - fields properties: fields: type: array items: $ref: "#/components/schemas/ProgrammaticScryptoSborValue" ProgrammaticScryptoSborValueReference: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueOwn: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueDecimal: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValuePreciseDecimal: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string ProgrammaticScryptoSborValueNonFungibleLocalId: allOf: - $ref: "#/components/schemas/ProgrammaticScryptoSborValue" - type: object required: - value properties: value: type: string # # Royalties (partially copied from Core API) # BlueprintRoyaltyConfig: type: object required: - is_enabled properties: is_enabled: type: boolean method_rules: description: The royalty rules by method. The array is only present if royalties are enabled. type: array items: $ref: "#/components/schemas/BlueprintMethodRoyalty" BlueprintMethodRoyalty: type: object required: - method_name properties: method_name: type: string royalty_amount: description: The due royalty; missing field denotes a free method. $ref: "#/components/schemas/RoyaltyAmount" ComponentRoyaltyConfig: type: object required: - is_enabled properties: is_enabled: type: boolean method_rules: description: The royalty rules by method. The array is only present if royalties are enabled. type: array items: $ref: "#/components/schemas/ComponentMethodRoyalty" ComponentMethodRoyalty: type: object required: - method_name properties: method_name: type: string royalty_amount: description: The due royalty; missing field denotes a free method. $ref: "#/components/schemas/RoyaltyAmount" RoyaltyAmount: type: object required: - amount - unit properties: amount: $ref: "#/components/schemas/BigDecimal" unit: type: string enum: - XRD - USD