Skip to content

Instantly share code, notes, and snippets.

@tunnckoCore
Created March 29, 2025 08:07
Show Gist options
  • Save tunnckoCore/5bc411f3b21621ef60d06c267ec5116d to your computer and use it in GitHub Desktop.
Save tunnckoCore/5bc411f3b21621ef60d06c267ec5116d to your computer and use it in GitHub Desktop.
Ethscriptions OpenAPI spec - json format
{
"openapi": "3.0.1",
"info": {
"title": "Ethscriptions API V2",
"version": "v2",
"description": "## Overview\n\nWelcome to the Ethscriptions Indexer API docs!\n\nThis API enables you to learn everything about the ethscriptions protocol. All instances of the open source [Ethscriptions Indexer](https://github.com/0xFacet/ethscriptions-indexer) expose this API.\n\nIf you don't want to run your own instance of the indexer you can use ours for free using the base URL `https://api.ethscriptions.com/v2`.\n\n## Community and Support\n \nJoin our community on [GitHub](https://github.com/0xFacet/ethscriptions-indexer) and [Discord](https://discord.gg/ethscriptions) to contribute, get support, and share your experiences with the Ethscriptions Indexer.\n\n"
},
"paths": {
"/ethscription_transfers": {
"get": {
"summary": "List Ethscription Transfers",
"tags": [
"Ethscription Transfers"
],
"operationId": "listEthscriptionTransfers",
"description": "Retrieves a list of Ethscription transfers based on filter criteria such as from address, to address, and transaction hash. Supports filtering by token characteristics (tick and protocol) and address involvement (to or from).\n",
"parameters": [
{
"name": "from_address",
"in": "query",
"description": "Filter transfers by the sender’s address.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "to_address",
"in": "query",
"description": "Filter transfers by the recipient’s address.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "transaction_hash",
"in": "query",
"description": "Filter transfers by the Ethscription transaction hash.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "to_or_from",
"in": "query",
"items": {
"type": "string"
},
"description": "Filter transfers by addresses involved either as sender or recipient.",
"required": false,
"schema": {
"type": "array"
}
},
{
"name": "ethscription_token_tick",
"in": "query",
"description": "Filter transfers by the Ethscription token tick.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "ethscription_token_protocol",
"in": "query",
"description": "Filter transfers by the Ethscription token protocol.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "sort_by",
"in": "query",
"description": "Defines the order of the records to be returned. Can be either \"newest_first\" (default) or \"oldest_first\".",
"enum": [
"newest_first",
"oldest_first"
],
"required": false,
"default": "newest_first",
"schema": {
"type": "string"
}
},
{
"name": "reverse",
"in": "query",
"description": "When set to true, reverses the sort order specified by the `sort_by` parameter.",
"required": false,
"example": "false",
"schema": {
"type": "boolean"
}
},
{
"name": "max_results",
"in": "query",
"description": "Limits the number of results returned. Default value is 25, maximum value is 50.",
"required": false,
"maximum": 50,
"default": 25,
"example": 25,
"schema": {
"type": "integer"
}
},
{
"name": "page_key",
"in": "query",
"description": "Pagination key from the previous response. Used for fetching the next set of results.",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Transfers retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EthscriptionTransfer"
}
},
"pagination": {
"$ref": "#/components/schemas/PaginationObject"
}
},
"description": "A list of Ethscription transfers that match the filter criteria."
}
}
}
}
}
}
},
"/ethscriptions": {
"get": {
"summary": "List Ethscriptions",
"tags": [
"Ethscriptions"
],
"operationId": "listEthscriptions",
"description": "Retrieves a list of ethscriptions, supporting various filters. \nBy default, the results limit is set to 100.\n\n- If `transaction_hash_only` is set to true, the results limit increases to 1000.\n- If `include_latest_transfer` is set to true, the results limit is reduced to 50.\n\nThe filter parameters below can be either individual values or arrays of values.\n",
"parameters": [
{
"name": "current_owner",
"in": "query",
"description": "Filter by current owner address",
"schema": {
"type": "string"
}
},
{
"name": "creator",
"in": "query",
"description": "Filter by creator address",
"schema": {
"type": "string"
}
},
{
"name": "initial_owner",
"in": "query",
"description": "Filter by initial owner address",
"schema": {
"type": "string"
}
},
{
"name": "previous_owner",
"in": "query",
"description": "Filter by previous owner address",
"schema": {
"type": "string"
}
},
{
"name": "mimetype",
"in": "query",
"description": "Filter by MIME type",
"schema": {
"type": "string"
}
},
{
"name": "media_type",
"in": "query",
"description": "Filter by media type",
"schema": {
"type": "string"
}
},
{
"name": "mime_subtype",
"in": "query",
"description": "Filter by MIME subtype",
"schema": {
"type": "string"
}
},
{
"name": "content_sha",
"in": "query",
"description": "Filter by content SHA hash",
"schema": {
"type": "string"
}
},
{
"name": "transaction_hash",
"in": "query",
"description": "Filter by Ethereum transaction hash",
"schema": {
"type": "string"
}
},
{
"name": "block_number",
"in": "query",
"description": "Filter by block number",
"schema": {
"type": "string"
}
},
{
"name": "block_timestamp",
"in": "query",
"description": "Filter by block timestamp",
"schema": {
"type": "string"
}
},
{
"name": "block_blockhash",
"in": "query",
"description": "Filter by block hash",
"schema": {
"type": "string"
}
},
{
"name": "ethscription_number",
"in": "query",
"description": "Filter by ethscription number",
"schema": {
"type": "string"
}
},
{
"name": "attachment_sha",
"in": "query",
"description": "Filter by attachment SHA hash",
"schema": {
"type": "string"
}
},
{
"name": "attachment_content_type",
"in": "query",
"description": "Filter by attachment content type",
"schema": {
"type": "string"
}
},
{
"name": "attachment_present",
"in": "query",
"description": "Filter by presence of an attachment",
"enum": [
"true",
"false"
],
"schema": {
"type": "string"
}
},
{
"name": "token_tick",
"in": "query",
"description": "Filter by token tick",
"example": "eths",
"schema": {
"type": "string"
}
},
{
"name": "token_protocol",
"in": "query",
"description": "Filter by token protocol",
"example": "erc-20",
"schema": {
"type": "string"
}
},
{
"name": "transferred_in_tx",
"in": "query",
"description": "Filter by transfer transaction hash",
"schema": {
"type": "string"
}
},
{
"name": "after_block",
"in": "query",
"description": "Filter by block number, returning only ethscriptions after the specified block.",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "before_block",
"in": "query",
"description": "Filter by block number, returning only ethscriptions before the specified block.",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "transaction_hash_only",
"in": "query",
"description": "Return only transaction hashes. When set to true, increases results limit to 1000.",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "include_latest_transfer",
"in": "query",
"description": "Include latest transfer information. When set to true, reduces results limit to 50.",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "sort_by",
"in": "query",
"description": "Defines the order of the records to be returned. Can be either \"newest_first\" (default) or \"oldest_first\".",
"enum": [
"newest_first",
"oldest_first"
],
"required": false,
"default": "newest_first",
"schema": {
"type": "string"
}
},
{
"name": "reverse",
"in": "query",
"description": "When set to true, reverses the sort order specified by the `sort_by` parameter.",
"required": false,
"example": "false",
"schema": {
"type": "boolean"
}
},
{
"name": "max_results",
"in": "query",
"description": "Limits the number of results returned. Default value is 25, maximum value is 50.",
"required": false,
"maximum": 50,
"default": 25,
"example": 25,
"schema": {
"type": "integer"
}
},
{
"name": "page_key",
"in": "query",
"description": "Pagination key from the previous response. Used for fetching the next set of results.",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "ethscriptions list",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Ethscription"
}
},
"pagination": {
"$ref": "#/components/schemas/PaginationObject"
}
},
"description": "A list of ethscriptions based on filter criteria."
}
}
}
}
}
}
},
"/ethscriptions/{tx_hash_or_ethscription_number}": {
"get": {
"summary": "Show Ethscription",
"tags": [
"Ethscriptions"
],
"operationId": "getEthscriptionByTransactionHash",
"description": "Retrieves an ethscription, including its transfers, by its transaction hash.",
"parameters": [
{
"name": "tx_hash_or_ethscription_number",
"in": "path",
"description": "Transaction hash or ethscription number of the ethscription",
"example": "0x0ef100873db4e3b7446e9a3be0432ab8bc92119d009aa200f70c210ac9dcd4a6",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Ethscription retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"$ref": "#/components/schemas/EthscriptionWithTransfers"
}
},
"description": "The ethscription's details"
}
}
}
},
"404": {
"description": "Ethscription not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Record not found"
}
},
"description": "Error message indicating the ethscription was not found"
}
}
}
}
}
}
},
"/ethscriptions/{tx_hash_or_ethscription_number}/data": {
"get": {
"summary": "Show Ethscription Data",
"tags": [
"Ethscriptions"
],
"operationId": "getEthscriptionData",
"description": "Retrieves the raw content data of an ethscription and serves it according to its content type.",
"parameters": [
{
"name": "tx_hash_or_ethscription_number",
"in": "path",
"description": "The ethscription number or transaction hash to retrieve data for.",
"required": true,
"example": "0",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Data retrieved successfully",
"headers": {
"Content-Type": {
"description": "The MIME type of the data.",
"schema": {
"type": "string"
}
}
},
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary",
"description": "Returns the raw data of an ethscription as indicated by the content type of the stored data URI. The content type in the response depends on the ethscription’s data.",
"example": "\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\a\\b\\t\\n\\v\\f\\r\\u000E\\u000F"
}
},
"image/png": {
"schema": {
"type": "string",
"format": "binary",
"description": "Returns the raw data of an ethscription as indicated by the content type of the stored data URI. The content type in the response depends on the ethscription’s data.",
"example": "\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\a\\b\\t\\n\\v\\f\\r\\u000E\\u000F"
}
},
"text/plain": {
"schema": {
"type": "string",
"format": "binary",
"description": "Returns the raw data of an ethscription as indicated by the content type of the stored data URI. The content type in the response depends on the ethscription’s data.",
"example": "\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\a\\b\\t\\n\\v\\f\\r\\u000E\\u000F"
}
}
}
},
"404": {
"description": "Ethscription not found",
"content": {
"application/octet-stream": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Record not found"
}
},
"description": "Error message indicating the ethscription was not found"
}
},
"image/png": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Record not found"
}
},
"description": "Error message indicating the ethscription was not found"
}
},
"text/plain": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Record not found"
}
},
"description": "Error message indicating the ethscription was not found"
}
}
}
}
}
}
},
"/ethscriptions/{tx_hash_or_ethscription_number}/attachment": {
"get": {
"summary": "Show Ethscription Attachment Data",
"tags": [
"Ethscriptions"
],
"operationId": "getEthscriptionAttachment",
"description": "Retrieves the raw attachment of an ethscription and serves it according to its content type. Only available when an attachment is present. Attachments are created via blobs per esip-8.\n",
"parameters": [
{
"name": "tx_hash_or_ethscription_number",
"in": "path",
"required": true,
"description": "The ethscription number or transaction hash to retrieve the attachment for.",
"example": "0xcf23d640184114e9d870a95f0fdc3aa65e436c5457d5b6ee2e3c6e104420abd1",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Attachment retrieved successfully",
"headers": {
"Content-Type": {
"description": "The MIME type of the attachment.",
"schema": {
"type": "string"
}
}
},
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary",
"description": "Returns the raw attachment data of an ethscription. The content type in the response depends on the ethscription’s attachment content type.",
"example": "\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\a\\b\\t\\n\\v\\f\\r\\u000E\\u000F"
}
},
"image/png": {
"schema": {
"type": "string",
"format": "binary",
"description": "Returns the raw attachment data of an ethscription. The content type in the response depends on the ethscription’s attachment content type.",
"example": "\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\a\\b\\t\\n\\v\\f\\r\\u000E\\u000F"
}
},
"text/plain": {
"schema": {
"type": "string",
"format": "binary",
"description": "Returns the raw attachment data of an ethscription. The content type in the response depends on the ethscription’s attachment content type.",
"example": "\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\a\\b\\t\\n\\v\\f\\r\\u000E\\u000F"
}
}
}
},
"404": {
"description": "Attachment not found",
"content": {
"application/octet-stream": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Attachment not found"
}
},
"description": "Indicates that no attachment was found for the provided ID or transaction hash."
}
},
"image/png": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Attachment not found"
}
},
"description": "Indicates that no attachment was found for the provided ID or transaction hash."
}
},
"text/plain": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Attachment not found"
}
},
"description": "Indicates that no attachment was found for the provided ID or transaction hash."
}
}
}
}
}
}
},
"/ethscriptions/exists/{sha}": {
"get": {
"summary": "Check if Ethscription Exists",
"tags": [
"Ethscriptions"
],
"operationId": "checkEthscriptionExists",
"description": "Checks if an Ethscription exists by its content SHA hash. Returns a boolean indicating existence and, if present, the ethscription itself.\n",
"parameters": [
{
"name": "sha",
"in": "path",
"required": true,
"description": "The SHA hash of the ethscription content to check for existence.",
"example": "0x2817fd9cf901e4435253881550731a5edc5e519c19de46b08e2b19a18e95143e",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Check performed successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "object",
"properties": {
"exists": {
"type": "boolean",
"example": true
},
"ethscription": {
"$ref": "#/components/schemas/Ethscription"
}
}
}
},
"description": "A boolean indicating whether the Ethscription exists, and the Ethscription itself if it does."
}
}
}
}
}
}
},
"/ethscriptions/exists_multi": {
"post": {
"summary": "Check Multiple Ethscriptions Existence",
"tags": [
"Ethscriptions"
],
"operationId": "checkMultipleEthscriptionsExistence",
"description": "Accepts a list of SHA hashes and checks for the existence of Ethscriptions corresponding to each SHA. Returns a mapping from SHA hashes to their corresponding Ethscription transaction hashes, if found; otherwise maps to `null`. Max input: 100 shas.\n",
"parameters": [],
"responses": {
"200": {
"description": "Existence check performed successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "object",
"additionalProperties": {
"type": "string",
"nullable": true,
"description": "Transaction hash associated with the SHA. Null if the SHA does not correspond to an existing Ethscription."
},
"description": "Mapping from SHA hashes to Ethscription transaction hashes or null if the Ethscription does not exist."
}
},
"description": "Successfully returns a mapping from provided SHA hashes to their corresponding Ethscription transaction hashes or null if not found.",
"example": {
"result": {
"0x2817fd9cf901e4435253881550731a5edc5e519c19de46b08e2b19a18e95143e": "0xcf23d640184114e9d870a95f0fdc3aa65e436c5457d5b6ee2e3c6e104420abd1",
"0xdcb130d85be00f8fd735ddafcba1cc83f99ba8dab0fc79c833401827b615c92b": null
}
}
}
}
}
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"shas": {
"type": "array",
"items": {
"type": "string"
},
"description": "An array of SHA hashes to check for Ethscription existence.",
"example": [
"0x2817fd9cf901e4435253881550731a5edc5e519c19de46b08e2b19a18e95143e",
"0xdcb130d85be00f8fd735ddafcba1cc83f99ba8dab0fc79c833401827b615c92b"
]
}
},
"required": [
"shas"
]
}
}
}
}
}
},
"/ethscriptions/newer": {
"get": {
"summary": "List Newer Ethscriptions",
"tags": [
"Ethscriptions"
],
"operationId": "getNewerEthscriptions",
"description": "Retrieves Ethscriptions that are newer than a specified block number, optionally filtered by mimetype, initial owner, and other criteria. Returns Ethscriptions grouped by block, including block metadata and a count of total future Ethscriptions. The Facet VM relies on this endpoint to retrieve new Ethscriptions.\n",
"parameters": [
{
"name": "mimetypes",
"in": "query",
"items": {
"type": "string"
},
"description": "Optional list of mimetypes to filter Ethscriptions by.",
"required": false,
"schema": {
"type": "array"
}
},
{
"name": "initial_owner",
"in": "query",
"description": "Optional initial owner to filter Ethscriptions by.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "block_number",
"in": "query",
"description": "Block number to start retrieving newer Ethscriptions from.",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "past_ethscriptions_count",
"in": "query",
"description": "Optional count of past Ethscriptions for checksum validation.",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "past_ethscriptions_checksum",
"in": "query",
"description": "Optional checksum of past Ethscriptions for validation.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "max_ethscriptions",
"in": "query",
"description": "Maximum number of Ethscriptions to return.",
"required": false,
"example": 50,
"schema": {
"type": "integer"
}
},
{
"name": "max_blocks",
"in": "query",
"description": "Maximum number of blocks to include in the response.",
"required": false,
"example": 500,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Newer Ethscriptions retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"total_future_ethscriptions": {
"type": "integer",
"example": 100
},
"blocks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"blockhash": {
"type": "string",
"example": "0x0204cb..."
},
"parent_blockhash": {
"type": "string",
"example": "0x0204cb..."
},
"block_number": {
"type": "integer",
"example": 123456789
},
"timestamp": {
"type": "integer",
"example": 1678900000
},
"ethscriptions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Ethscription"
}
}
}
},
"description": "List of blocks with their Ethscriptions."
}
},
"description": "A list of newer Ethscriptions grouped by block, including metadata about each block and a count of total future Ethscriptions."
}
}
}
},
"422": {
"description": "Unprocessable entity",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"resolution": {
"type": "string"
}
}
}
},
"description": "Error response for various failure scenarios, such as block not yet imported or checksum mismatch."
}
}
}
}
}
}
},
"/status": {
"get": {
"summary": "Show Indexer Status",
"tags": [
"Status"
],
"operationId": "getIndexerStatus",
"description": "Retrieves the current status of the blockchain indexer, including the latest block number known, the last block number imported into the system, and the number of blocks the indexer is behind.",
"responses": {
"200": {
"description": "Indexer status retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"current_block_number": {
"type": "integer",
"example": 19620494,
"description": "The most recent block number known to the global blockchain network."
},
"last_imported_block": {
"type": "integer",
"example": 19620494,
"description": "The last block number that was successfully imported into the system."
},
"blocks_behind": {
"type": "integer",
"example": 0,
"description": "The number of blocks the indexer is behind the current block number."
}
},
"required": [
"current_block_number",
"last_imported_block",
"blocks_behind"
],
"description": "Response body containing the current status of the blockchain indexer."
}
}
}
},
"500": {
"description": "Error retrieving indexer status",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Internal Server Error"
}
},
"description": "Error message indicating a failure to retrieve the indexer status."
}
}
}
}
}
}
},
"/tokens": {
"get": {
"summary": "List Tokens",
"tags": [
"Tokens"
],
"operationId": "listTokens",
"description": "Retrieves a list of tokens based on specified criteria such as protocol and tick.",
"parameters": [
{
"name": "protocol",
"in": "query",
"description": "Filter tokens by protocol (e.g., \"erc-20\"). Optional.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "tick",
"in": "query",
"description": "Filter tokens by tick (symbol). Optional.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "sort_by",
"in": "query",
"description": "Defines the order of the records to be returned. Can be either \"newest_first\" (default) or \"oldest_first\".",
"enum": [
"newest_first",
"oldest_first"
],
"required": false,
"default": "newest_first",
"schema": {
"type": "string"
}
},
{
"name": "reverse",
"in": "query",
"description": "When set to true, reverses the sort order specified by the `sort_by` parameter.",
"required": false,
"example": "false",
"schema": {
"type": "boolean"
}
},
{
"name": "max_results",
"in": "query",
"description": "Limits the number of results returned. Default value is 25, maximum value is 50.",
"required": false,
"maximum": 50,
"default": 25,
"example": 25,
"schema": {
"type": "integer"
}
},
{
"name": "page_key",
"in": "query",
"description": "Pagination key from the previous response. Used for fetching the next set of results.",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Tokens retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Token"
}
},
"pagination": {
"$ref": "#/components/schemas/PaginationObject"
}
},
"description": "A list of tokens that match the query criteria, along with pagination details."
}
}
}
},
"400": {
"description": "Invalid request parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Invalid parameters"
}
},
"description": "Error message indicating that the request parameters were invalid."
}
}
}
}
}
}
},
"/tokens/{protocol}/{tick}": {
"get": {
"summary": "Show Token Details",
"tags": [
"Tokens"
],
"operationId": "showTokenDetails",
"description": "Retrieves detailed information about a specific token, identified by its protocol and tick, including its balances.",
"parameters": [
{
"name": "protocol",
"in": "path",
"description": "The protocol of the token to retrieve (e.g., \"erc-20\").",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "tick",
"in": "path",
"description": "The tick (symbol) of the token to retrieve.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Token details retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"$ref": "#/components/schemas/TokenWithBalances"
}
},
"description": "Detailed information about the requested token, including its balances."
}
}
}
},
"404": {
"description": "Token not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Token not found"
}
},
"description": "Error message indicating that the requested token was not found."
}
}
}
}
}
}
},
"/tokens/{protocol}/{tick}/historical_state": {
"get": {
"summary": "Get Token Historical State",
"tags": [
"Tokens"
],
"operationId": "getTokenHistoricalState",
"description": "Retrieves the state of a specific token, identified by its protocol and tick, at a given block number.",
"parameters": [
{
"name": "protocol",
"in": "path",
"description": "The protocol of the token for which historical state is being requested (e.g., \"erc-20\").",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "tick",
"in": "path",
"description": "The tick (symbol) of the token for which historical state is being requested.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "as_of_block",
"in": "query",
"description": "The block number at which the token state is requested.",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Token historical state retrieved successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"$ref": "#/components/schemas/TokenWithBalances"
}
},
"description": "The state of the requested token at the specified block number, including its balances."
}
}
}
},
"404": {
"description": "Token or state not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Token or state not found at the specified block number"
}
},
"description": "Error message indicating that either the token or its state at the specified block number was not found."
}
}
}
}
}
}
},
"/tokens/{protocol}/{tick}/validate_token_items": {
"get": {
"summary": "Validate Token Items",
"tags": [
"Tokens"
],
"operationId": "validateTokenItems",
"description": "Validates a list of transaction hashes against the token items of a specified token. Returns arrays of valid and invalid transaction hashes along with a checksum for the token items.\n",
"parameters": [
{
"name": "protocol",
"in": "path",
"description": "The protocol of the token for which items are being validated (e.g., \"erc-20\").",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "tick",
"in": "path",
"description": "The tick (symbol) of the token for which items are being validated.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "transaction_hashes",
"in": "query",
"items": {
"type": "string",
"description": "A transaction hash."
},
"collectionFormat": "multi",
"description": "An array of transaction hashes to validate against the token's items.",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "Token items validated successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "object",
"properties": {
"valid": {
"type": "array",
"items": {
"type": "string"
},
"description": "Valid transaction hashes."
},
"invalid": {
"type": "array",
"items": {
"type": "string"
},
"description": "Invalid transaction hashes."
},
"token_items_checksum": {
"type": "string",
"description": "A checksum for the token items."
}
}
}
},
"description": "Returns arrays of valid and invalid transaction hashes along with a checksum for the token items."
}
}
}
},
"404": {
"description": "Token not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Requested token not found"
}
},
"description": "Error message indicating the token was not found."
}
}
}
}
}
}
}
},
"tags": [
{
"name": "Ethscriptions",
"description": "Endpoints for querying ethscriptions."
},
{
"name": "Ethscription Transfers",
"description": "Endpoints for querying ethscription transfers."
},
{
"name": "Tokens",
"description": "Endpoints for querying tokens. Note: token indexing is an optional feature and different indexers might index different tokens."
},
{
"name": "Status",
"description": "Endpoints for querying indexer status."
}
],
"components": {
"schemas": {
"Ethscription": {
"type": "object",
"properties": {
"transaction_hash": {
"type": "string",
"example": "0x0ef100873db4e3b7446e9a3be0432ab8bc92119d009aa200f70c210ac9dcd4a6",
"description": "Hash of the Ethereum transaction."
},
"block_number": {
"type": "string",
"example": "19619510",
"description": "Block number where the transaction was included."
},
"transaction_index": {
"type": "string",
"example": "88",
"description": "Transaction index within the block."
},
"block_timestamp": {
"type": "string",
"example": "1712682959",
"description": "Timestamp for when the block was mined."
},
"block_blockhash": {
"type": "string",
"example": "0xa44323fa6404b446665037ec61a09fc8526144154cb3742bcd254c7ef054ab0c",
"description": "Hash of the block."
},
"ethscription_number": {
"type": "string",
"example": "5853618",
"description": "Unique identifier for the ethscription."
},
"creator": {
"type": "string",
"example": "0xc27b42d010c1e0f80c6c0c82a1a7170976adb340",
"description": "Address of the ethscription creator."
},
"initial_owner": {
"type": "string",
"example": "0x00000000000000000000000000000000000face7",
"description": "Initial owner of the ethscription."
},
"current_owner": {
"type": "string",
"example": "0x00000000000000000000000000000000000face7",
"description": "Current owner of the ethscription."
},
"previous_owner": {
"type": "string",
"example": "0xc27b42d010c1e0f80c6c0c82a1a7170976adb340",
"description": "Previous owner of the ethscription before the current owner."
},
"content_uri": {
"type": "string",
"example": "data:application/vnd.facet.tx+json;rule=esip6,{...}",
"description": "URI encoding the data and rule for the ethscription."
},
"content_sha": {
"type": "string",
"example": "0xda6dce30c4c09885ed8538c9e33ae43cfb392f5f6d42a62189a446093929e115",
"description": "SHA hash of the content."
},
"esip6": {
"type": "boolean",
"example": true,
"description": "Indicator of whether the ethscription conforms to ESIP-6."
},
"mimetype": {
"type": "string",
"example": "application/vnd.facet.tx+json",
"description": "MIME type of the ethscription."
},
"gas_price": {
"type": "string",
"example": "37806857216",
"description": "Gas price used for the transaction."
},
"gas_used": {
"type": "string",
"example": "27688",
"description": "Amount of gas used by the transaction."
},
"transaction_fee": {
"type": "string",
"example": "1046796262596608",
"description": "Total fee of the transaction."
},
"value": {
"type": "string",
"example": "0",
"description": "Value transferred in the transaction."
},
"attachment_sha": {
"type": "string",
"nullable": true,
"example": "0x0ef100873db4e3b7446e9a3be0432ab8bc92119d009aa200f70c210ac9dcd4a6",
"description": "SHA hash of the attachment."
},
"attachment_content_type": {
"type": "string",
"nullable": true,
"example": "text/plain",
"description": "MIME type of the attachment."
}
}
},
"EthscriptionTransfer": {
"type": "object",
"properties": {
"ethscription_transaction_hash": {
"type": "string",
"example": "0x4c5d41...",
"description": "Hash of the ethscription associated with the transfer."
},
"transaction_hash": {
"type": "string",
"example": "0x707bb3...",
"description": "Hash of the Ethereum transaction that performed the transfer."
},
"from_address": {
"type": "string",
"example": "0xfb833c...",
"description": "Address of the sender in the transfer."
},
"to_address": {
"type": "string",
"example": "0x1f1edb...",
"description": "Address of the recipient in the transfer."
},
"block_number": {
"type": "integer",
"example": 19619724,
"description": "Block number where the transfer was recorded."
},
"block_timestamp": {
"type": "integer",
"example": 1712685539,
"description": "Timestamp for when the block containing the transfer was mined."
},
"block_blockhash": {
"type": "string",
"example": "0x0204cb...",
"description": "Hash of the block containing the transfer."
},
"event_log_index": {
"type": "integer",
"example": null,
"description": "Index of the event log that recorded the transfer.",
"nullable": true
},
"transfer_index": {
"type": "string",
"example": "51",
"description": "Index of the transfer in the transaction."
},
"transaction_index": {
"type": "integer",
"example": 95,
"description": "Transaction index within the block."
},
"enforced_previous_owner": {
"type": "string",
"example": null,
"description": "Enforced previous owner of the ethscription, if applicable.",
"nullable": true
}
}
},
"Token": {
"type": "object",
"properties": {
"deploy_ethscription_transaction_hash": {
"type": "string",
"example": "0xc8115ff794c6a077bdca1be18408e45394083debe026e9136ed26355b52f6d0d",
"description": "The transaction hash of the Ethscription that deployed the token."
},
"deploy_block_number": {
"type": "string",
"example": "18997063",
"description": "The block number in which the token was deployed."
},
"deploy_transaction_index": {
"type": "string",
"example": "67",
"description": "The index of the transaction in the block in which the token was deployed."
},
"protocol": {
"type": "string",
"example": "erc-20",
"description": "The protocol of the token."
},
"tick": {
"type": "string",
"example": "nodes",
"description": "The tick (symbol) of the token."
},
"max_supply": {
"type": "string",
"example": "10000000000",
"description": "The maximum supply of the token."
},
"total_supply": {
"type": "string",
"example": "10000000000",
"description": "The current total supply of the token."
},
"mint_amount": {
"type": "string",
"example": "10000",
"description": "The amount of tokens minted."
}
},
"description": "Represents a token, including its deployment information, protocol, and supply details."
},
"PaginationObject": {
"type": "object",
"properties": {
"page_key": {
"type": "string",
"example": "18680069-4-1",
"description": "Key for the next page of results. Supply this in the page_key query parameter to retrieve the next set of items."
},
"has_more": {
"type": "boolean",
"example": true,
"description": "Indicates if more items are available beyond the current page."
}
},
"description": "Contains pagination details to navigate through the list of records."
},
"EthscriptionWithTransfers": {
"type": "object",
"properties": {
"transaction_hash": {
"type": "string",
"example": "0x0ef100873db4e3b7446e9a3be0432ab8bc92119d009aa200f70c210ac9dcd4a6",
"description": "Hash of the Ethereum transaction."
},
"block_number": {
"type": "string",
"example": "19619510",
"description": "Block number where the transaction was included."
},
"transaction_index": {
"type": "string",
"example": "88",
"description": "Transaction index within the block."
},
"block_timestamp": {
"type": "string",
"example": "1712682959",
"description": "Timestamp for when the block was mined."
},
"block_blockhash": {
"type": "string",
"example": "0xa44323fa6404b446665037ec61a09fc8526144154cb3742bcd254c7ef054ab0c",
"description": "Hash of the block."
},
"ethscription_number": {
"type": "string",
"example": "5853618",
"description": "Unique identifier for the ethscription."
},
"creator": {
"type": "string",
"example": "0xc27b42d010c1e0f80c6c0c82a1a7170976adb340",
"description": "Address of the ethscription creator."
},
"initial_owner": {
"type": "string",
"example": "0x00000000000000000000000000000000000face7",
"description": "Initial owner of the ethscription."
},
"current_owner": {
"type": "string",
"example": "0x00000000000000000000000000000000000face7",
"description": "Current owner of the ethscription."
},
"previous_owner": {
"type": "string",
"example": "0xc27b42d010c1e0f80c6c0c82a1a7170976adb340",
"description": "Previous owner of the ethscription before the current owner."
},
"content_uri": {
"type": "string",
"example": "data:application/vnd.facet.tx+json;rule=esip6,{...}",
"description": "URI encoding the data and rule for the ethscription."
},
"content_sha": {
"type": "string",
"example": "0xda6dce30c4c09885ed8538c9e33ae43cfb392f5f6d42a62189a446093929e115",
"description": "SHA hash of the content."
},
"esip6": {
"type": "boolean",
"example": true,
"description": "Indicator of whether the ethscription conforms to ESIP-6."
},
"mimetype": {
"type": "string",
"example": "application/vnd.facet.tx+json",
"description": "MIME type of the ethscription."
},
"gas_price": {
"type": "string",
"example": "37806857216",
"description": "Gas price used for the transaction."
},
"gas_used": {
"type": "string",
"example": "27688",
"description": "Amount of gas used by the transaction."
},
"transaction_fee": {
"type": "string",
"example": "1046796262596608",
"description": "Total fee of the transaction."
},
"value": {
"type": "string",
"example": "0",
"description": "Value transferred in the transaction."
},
"attachment_sha": {
"type": "string",
"nullable": true,
"example": "0x0ef100873db4e3b7446e9a3be0432ab8bc92119d009aa200f70c210ac9dcd4a6",
"description": "SHA hash of the attachment."
},
"attachment_content_type": {
"type": "string",
"nullable": true,
"example": "text/plain",
"description": "MIME type of the attachment."
},
"transfers": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EthscriptionTransfer"
},
"description": "Array of transfers associated with the ethscription."
}
}
},
"TokenWithBalances": {
"type": "object",
"properties": {
"deploy_ethscription_transaction_hash": {
"type": "string",
"example": "0xc8115ff794c6a077bdca1be18408e45394083debe026e9136ed26355b52f6d0d",
"description": "The transaction hash of the Ethscription that deployed the token."
},
"deploy_block_number": {
"type": "string",
"example": "18997063",
"description": "The block number in which the token was deployed."
},
"deploy_transaction_index": {
"type": "string",
"example": "67",
"description": "The index of the transaction in the block in which the token was deployed."
},
"protocol": {
"type": "string",
"example": "erc-20",
"description": "The protocol of the token."
},
"tick": {
"type": "string",
"example": "nodes",
"description": "The tick (symbol) of the token."
},
"max_supply": {
"type": "string",
"example": "10000000000",
"description": "The maximum supply of the token."
},
"total_supply": {
"type": "string",
"example": "10000000000",
"description": "The current total supply of the token."
},
"mint_amount": {
"type": "string",
"example": "10000",
"description": "The amount of tokens minted."
},
"balances": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "A mapping of wallet addresses to their respective token balances.",
"example": {
"0x000000000006f291b587f39b6960dd32e31400bf": "5595650000",
"0x0000000a0705080fae54fd5cd2041a996a1d59ed": "5660000",
"0x00007fd644a03bc613b222a5c2e661861d71c424": "10000",
"0x000112a490277649e5d4d02ffd8a58bb002d0ed4": "690000"
}
}
},
"description": "Represents a token, including its deployment information, protocol, and supply details."
}
}
},
"servers": [
{
"url": "https://api.ethscriptions.com/v2"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment