Skip to content

Instantly share code, notes, and snippets.

@stwiname
Created August 11, 2023 03:42
Show Gist options
  • Save stwiname/5259fa04f2dbde5d56dd6ac366ae23e0 to your computer and use it in GitHub Desktop.
Save stwiname/5259fa04f2dbde5d56dd6ac366ae23e0 to your computer and use it in GitHub Desktop.
Rough Subquery Manifest JSON Schema
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/SubQuery",
"definitions": {
"SubQuery": {
"type": "object",
"additionalProperties": false,
"properties": {
"specVersion": {
"type": "string",
"description": "The specification version of this document"
},
"name": {
"type": "string",
"description": "The name of your project"
},
"version": {
"type": "string",
"description": "The version of your SubQuery project"
},
"runner": {
"$ref": "#/definitions/Runner",
"description": "Information about the Node and Query services to run the project"
},
"description": {
"type": "string",
"description": "A short description about how to run your project"
},
"repository": {
"type": "string",
"format": "uri",
"qt-uri-protocols": [
"https"
],
"qt-uri-extensions": [
".git"
]
},
"schema": {
"$ref": "#/definitions/Schema",
"description": "The relative path to the projects graphql schema"
},
"network": {
"$ref": "#/definitions/Network",
"description": "Configuration about the blockchain network that this project will index"
},
"dataSources": {
"type": "array",
"items": {
"$ref": "#/definitions/DataSource"
}
},
"x-ethereum": {
"$ref": "#/definitions/XEthereum"
}
},
"required": [
"dataSources",
"description",
"name",
"network",
"repository",
"runner",
"schema",
"specVersion",
"version"
],
"title": "SubQuery"
},
"DataSource": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string"
},
"startBlock": {
"type": "integer"
},
"processor": {
"$ref": "#/definitions/Processor"
},
"assets": {
"$ref": "#/definitions/DataSourceAssets"
},
"mapping": {
"$ref": "#/definitions/Mapping"
},
"options": {
"$ref": "#/definitions/Options"
}
},
"required": [
"kind",
"mapping",
"startBlock"
],
"title": "DataSource"
},
"DataSourceAssets": {
"type": "object",
"additionalProperties": false,
"properties": {
"erc20": {
"$ref": "#/definitions/Schema"
},
"permissionedExchange": {
"$ref": "#/definitions/Schema"
}
},
"required": [],
"title": "DataSourceAssets"
},
"Schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"file": {
"type": "string"
}
},
"required": [
"file"
],
"title": "Schema"
},
"Mapping": {
"type": "object",
"additionalProperties": false,
"properties": {
"file": {
"type": "string"
},
"handlers": {
"type": "array",
"items": {
"$ref": "#/definitions/Handler"
}
}
},
"required": [
"file",
"handlers"
],
"title": "Mapping"
},
"Handler": {
"type": "object",
"additionalProperties": false,
"properties": {
"handler": {
"type": "string"
},
"kind": {
"type": "string"
},
"filter": {
"$ref": "#/definitions/Filter"
}
},
"required": [
"filter",
"handler",
"kind"
],
"title": "Handler"
},
"Filter": {
"type": "object",
"additionalProperties": false,
"properties": {
"topics": {
"type": "array",
"items": {
"anyOf": [
{
"type": "null"
},
{
"type": "string"
}
]
}
},
"function": {
"type": "string"
},
"module": {
"type": "string"
},
"method": {
"type": "string"
}
},
"required": [],
"title": "Filter"
},
"Options": {
"type": "object",
"additionalProperties": false,
"properties": {
"abi": {
"type": "string"
},
"address": {
"type": "string"
}
},
"required": [
"abi",
"address"
],
"title": "Options"
},
"Processor": {
"type": "object",
"additionalProperties": false,
"properties": {
"file": {
"type": "string"
},
"options": {
"$ref": "#/definitions/Options"
}
},
"required": [
"file",
"options"
],
"title": "Processor"
},
"Network": {
"type": "object",
"additionalProperties": false,
"properties": {
"chainId": {
"type": "string"
},
"endpoint": {
"$ref": "#/definitions/Endpoint"
},
"dictionary": {
"type": "string",
"format": "uri",
"qt-uri-protocols": [
"https"
]
},
"chaintypes": {
"$ref": "#/definitions/Schema"
}
},
"required": [
"chainId",
"endpoint"
],
"title": "Network"
},
"Runner": {
"type": "object",
"additionalProperties": false,
"properties": {
"node": {
"$ref": "#/definitions/Node"
},
"query": {
"$ref": "#/definitions/Node"
}
},
"required": [
"node",
"query"
],
"title": "Runner"
},
"Node": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
}
},
"required": [
"name",
"version"
],
"title": "Node"
},
"XEthereum": {
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string"
},
"startBlock": {
"type": "integer"
},
"assets": {
"$ref": "#/definitions/XEthereumAssets"
}
},
"required": [
"assets",
"kind",
"startBlock"
],
"title": "XEthereum"
},
"XEthereumAssets": {
"type": "object",
"additionalProperties": false,
"properties": {
"permissionedExchange": {
"$ref": "#/definitions/Schema"
}
},
"required": [
"permissionedExchange"
],
"title": "XEthereumAssets"
},
"Endpoint": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string",
"qt-uri-protocols": [
"https"
]
}
},
{
"type": "string",
"format": "uri",
"qt-uri-protocols": [
"https"
]
}
],
"title": "Endpoint"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment