diff --git a/scripts/fetch-openapi-specs.mts b/scripts/fetch-openapi-specs.mts index 14c7224c0..094c9bb24 100644 --- a/scripts/fetch-openapi-specs.mts +++ b/scripts/fetch-openapi-specs.mts @@ -22,10 +22,22 @@ interface GitHubApiSpec { filePath: string; } -const API_SPECS: ApiSpec[] = [ +const API_SPECS: ApiSpec[] = []; + +// Specs that can't be fetched at build time (private source / no public URL) are +// vendored in the repo and copied into the generated `openapi/` dir before markdown +// generation. The Chainhooks API spec lives in the private repo stx-labs/chainhooks +// (packages/api/openapi.yaml); to refresh it, regenerate the JSON below from that +// repo's openapi.yaml. +interface VendoredSpec { + name: string; + file: string; +} + +const VENDORED_SPECS: VendoredSpec[] = [ { name: 'chainhook', - url: 'https://chainhooks-api.vercel.app/openapi.json', + file: 'vendored-specs/chainhook-api.json', }, ]; @@ -34,7 +46,7 @@ const GITHUB_API_SPECS: GitHubApiSpec[] = [ name: 'stacks-node-rpc', type: 'github', repo: 'stacks-network/stacks-core', - branch: 'develop', + branch: 'main', filePath: 'docs/rpc/openapi.yaml', }, { @@ -1117,6 +1129,20 @@ async function generateAllMarkdown(): Promise { console.log('\n✔️ Markdown generation complete!'); } +async function copyVendoredSpec(spec: VendoredSpec): Promise { + try { + const openApiDir = path.join(process.cwd(), 'openapi'); + await fs.mkdir(openApiDir, { recursive: true }); + + const source = path.join(import.meta.dirname, spec.file); + const dest = path.join(openApiDir, `${spec.name}-api.json`); + + await fs.copyFile(source, dest); + } catch (error) { + console.error(`❌ Failed to copy vendored spec ${spec.name}:`, error); + } +} + async function fetchAllSpecs(): Promise { console.log('Fetching OpenAPI specs...'); @@ -1125,6 +1151,7 @@ async function fetchAllSpecs(): Promise { generatePlatformApiSpec(), ...API_SPECS.map((spec) => fetchApiSpec(spec)), ...GITHUB_API_SPECS.map((spec) => fetchGitHubApiSpec(spec)), + ...VENDORED_SPECS.map((spec) => copyVendoredSpec(spec)), ]; await Promise.all(allPromises); diff --git a/scripts/vendored-specs/chainhook-api.json b/scripts/vendored-specs/chainhook-api.json new file mode 100644 index 000000000..38338bb3e --- /dev/null +++ b/scripts/vendored-specs/chainhook-api.json @@ -0,0 +1,4831 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Chainhooks API", + "description": "HTTP API for managing Chainhooks.", + "version": "2.2.0" + }, + "components": { + "schemas": {} + }, + "paths": { + "/": { + "get": { + "operationId": "getApiStatus", + "summary": "API Status", + "tags": [ + "Status" + ], + "description": "Displays the status of the API and its current workload", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "server_version", + "status" + ], + "properties": { + "server_version": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ready" + ] + } + } + } + } + } + } + } + } + }, + "/me/": { + "post": { + "operationId": "registerChainhook", + "tags": [ + "Chainhooks" + ], + "description": "Allows users to register a new Chainhook", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name", + "version", + "chain", + "network", + "filters", + "action" + ], + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string", + "enum": [ + "1" + ] + }, + "chain": { + "type": "string", + "enum": [ + "stacks" + ] + }, + "network": { + "anyOf": [ + { + "type": "string", + "enum": [ + "mainnet" + ] + }, + { + "type": "string", + "enum": [ + "testnet" + ] + } + ] + }, + "filters": { + "type": "object", + "required": [ + "events" + ], + "properties": { + "events": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "type", + "principal" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "balance_change" + ] + }, + "principal": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_event" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_mint" + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_burn" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_transfer" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_deploy" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_call" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "function_name": { + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_log" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "coinbase" + ] + } + } + }, + { + "type": "object", + "required": [ + "type", + "cause" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "tenure_change" + ] + }, + "cause": { + "anyOf": [ + { + "type": "string", + "enum": [ + "block_found" + ] + }, + { + "type": "string", + "enum": [ + "extended" + ] + } + ] + } + } + } + ] + } + } + } + }, + "options": { + "anyOf": [ + { + "additionalProperties": false, + "type": "object", + "properties": { + "enable_on_registration": { + "type": "boolean" + }, + "expire_after_evaluations": { + "type": "integer" + }, + "expire_after_occurrences": { + "type": "integer" + }, + "decode_clarity_values": { + "type": "boolean" + }, + "include_contract_abi": { + "type": "boolean" + }, + "include_contract_source_code": { + "type": "boolean" + }, + "include_post_conditions": { + "type": "boolean" + }, + "include_raw_transactions": { + "type": "boolean" + }, + "include_block_signatures": { + "type": "boolean" + }, + "include_block_metadata": { + "type": "boolean" + } + } + }, + { + "type": "null" + } + ] + }, + "action": { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "http_post" + ] + }, + "url": { + "format": "uri", + "type": "string" + } + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "uuid", + "definition", + "status" + ], + "properties": { + "uuid": { + "format": "uuid", + "type": "string" + }, + "definition": { + "type": "object", + "required": [ + "name", + "version", + "chain", + "network", + "filters", + "action" + ], + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string", + "enum": [ + "1" + ] + }, + "chain": { + "type": "string", + "enum": [ + "stacks" + ] + }, + "network": { + "anyOf": [ + { + "type": "string", + "enum": [ + "mainnet" + ] + }, + { + "type": "string", + "enum": [ + "testnet" + ] + } + ] + }, + "filters": { + "type": "object", + "required": [ + "events" + ], + "properties": { + "events": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "type", + "principal" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "balance_change" + ] + }, + "principal": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_event" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_mint" + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_burn" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_transfer" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_deploy" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_call" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "function_name": { + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_log" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "coinbase" + ] + } + } + }, + { + "type": "object", + "required": [ + "type", + "cause" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "tenure_change" + ] + }, + "cause": { + "anyOf": [ + { + "type": "string", + "enum": [ + "block_found" + ] + }, + { + "type": "string", + "enum": [ + "extended" + ] + } + ] + } + } + } + ] + } + } + } + }, + "options": { + "anyOf": [ + { + "additionalProperties": false, + "type": "object", + "properties": { + "enable_on_registration": { + "type": "boolean" + }, + "expire_after_evaluations": { + "type": "integer" + }, + "expire_after_occurrences": { + "type": "integer" + }, + "decode_clarity_values": { + "type": "boolean" + }, + "include_contract_abi": { + "type": "boolean" + }, + "include_contract_source_code": { + "type": "boolean" + }, + "include_post_conditions": { + "type": "boolean" + }, + "include_raw_transactions": { + "type": "boolean" + }, + "include_block_signatures": { + "type": "boolean" + }, + "include_block_metadata": { + "type": "boolean" + } + } + }, + { + "type": "null" + } + ] + }, + "action": { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "http_post" + ] + }, + "url": { + "format": "uri", + "type": "string" + } + } + } + } + }, + "status": { + "type": "object", + "required": [ + "status", + "enabled", + "created_at", + "last_evaluated_at", + "last_evaluated_block_height", + "last_occurrence_at", + "last_occurrence_block_height", + "evaluated_block_count", + "occurrence_count" + ], + "properties": { + "status": { + "description": "Valid chainhook status values: new, streaming, expired, or interrupted", + "anyOf": [ + { + "type": "string", + "enum": [ + "new" + ] + }, + { + "type": "string", + "enum": [ + "streaming" + ] + }, + { + "type": "string", + "enum": [ + "expired" + ] + }, + { + "type": "string", + "enum": [ + "interrupted" + ] + } + ] + }, + "enabled": { + "type": "boolean" + }, + "created_at": { + "type": "number" + }, + "last_evaluated_at": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_evaluated_block_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_occurrence_at": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_occurrence_block_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "evaluated_block_count": { + "type": "number" + }, + "occurrence_count": { + "type": "number" + } + } + } + } + } + } + } + } + } + }, + "get": { + "operationId": "getChainhooks", + "tags": [ + "Chainhooks" + ], + "description": "Returns all chainhooks registered by the current user", + "parameters": [ + { + "schema": { + "minimum": 0, + "title": "Offset", + "type": "integer" + }, + "in": "query", + "name": "offset", + "required": false, + "description": "Result offset" + }, + { + "schema": { + "minimum": 1, + "maximum": 60, + "title": "Limit", + "type": "integer" + }, + "in": "query", + "name": "limit", + "required": false, + "description": "Results per page" + } + ], + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "title": "Paginated Chainhooks response", + "type": "object", + "required": [ + "limit", + "offset", + "total", + "results" + ], + "properties": { + "limit": { + "type": "integer", + "example": 20 + }, + "offset": { + "type": "integer", + "example": 0 + }, + "total": { + "type": "integer", + "example": 1 + }, + "results": { + "type": "array", + "items": { + "type": "object", + "required": [ + "uuid", + "definition", + "status" + ], + "properties": { + "uuid": { + "format": "uuid", + "type": "string" + }, + "definition": { + "type": "object", + "required": [ + "name", + "version", + "chain", + "network", + "filters", + "action" + ], + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string", + "enum": [ + "1" + ] + }, + "chain": { + "type": "string", + "enum": [ + "stacks" + ] + }, + "network": { + "anyOf": [ + { + "type": "string", + "enum": [ + "mainnet" + ] + }, + { + "type": "string", + "enum": [ + "testnet" + ] + } + ] + }, + "filters": { + "type": "object", + "required": [ + "events" + ], + "properties": { + "events": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "type", + "principal" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "balance_change" + ] + }, + "principal": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_event" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_mint" + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_burn" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_transfer" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_deploy" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_call" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "function_name": { + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_log" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "coinbase" + ] + } + } + }, + { + "type": "object", + "required": [ + "type", + "cause" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "tenure_change" + ] + }, + "cause": { + "anyOf": [ + { + "type": "string", + "enum": [ + "block_found" + ] + }, + { + "type": "string", + "enum": [ + "extended" + ] + } + ] + } + } + } + ] + } + } + } + }, + "options": { + "anyOf": [ + { + "additionalProperties": false, + "type": "object", + "properties": { + "enable_on_registration": { + "type": "boolean" + }, + "expire_after_evaluations": { + "type": "integer" + }, + "expire_after_occurrences": { + "type": "integer" + }, + "decode_clarity_values": { + "type": "boolean" + }, + "include_contract_abi": { + "type": "boolean" + }, + "include_contract_source_code": { + "type": "boolean" + }, + "include_post_conditions": { + "type": "boolean" + }, + "include_raw_transactions": { + "type": "boolean" + }, + "include_block_signatures": { + "type": "boolean" + }, + "include_block_metadata": { + "type": "boolean" + } + } + }, + { + "type": "null" + } + ] + }, + "action": { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "http_post" + ] + }, + "url": { + "format": "uri", + "type": "string" + } + } + } + } + }, + "status": { + "type": "object", + "required": [ + "status", + "enabled", + "created_at", + "last_evaluated_at", + "last_evaluated_block_height", + "last_occurrence_at", + "last_occurrence_block_height", + "evaluated_block_count", + "occurrence_count" + ], + "properties": { + "status": { + "description": "Valid chainhook status values: new, streaming, expired, or interrupted", + "anyOf": [ + { + "type": "string", + "enum": [ + "new" + ] + }, + { + "type": "string", + "enum": [ + "streaming" + ] + }, + { + "type": "string", + "enum": [ + "expired" + ] + }, + { + "type": "string", + "enum": [ + "interrupted" + ] + } + ] + }, + "enabled": { + "type": "boolean" + }, + "created_at": { + "type": "number" + }, + "last_evaluated_at": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_evaluated_block_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_occurrence_at": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_occurrence_block_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "evaluated_block_count": { + "type": "number" + }, + "occurrence_count": { + "type": "number" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/me/{uuid}/evaluate": { + "post": { + "operationId": "evaluateChainhook", + "tags": [ + "Chainhooks" + ], + "description": "Queues an on-demand evaluation job for a specific block", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "minProperties": 1, + "type": "object", + "properties": { + "index_block_hash": { + "minLength": 1, + "description": "Stacks index block hash", + "type": "string" + }, + "block_height": { + "minimum": 0, + "description": "Stacks block height", + "type": "integer" + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "format": "uuid", + "type": "string" + }, + "in": "path", + "name": "uuid", + "required": true + } + ], + "responses": { + "204": { + "description": "Default Response" + } + } + } + }, + "/me/{uuid}": { + "patch": { + "operationId": "updateChainhook", + "tags": [ + "Chainhooks" + ], + "description": "Updates a chainhook by its UUID", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string", + "enum": [ + "1" + ] + }, + "chain": { + "type": "string", + "enum": [ + "stacks" + ] + }, + "network": { + "anyOf": [ + { + "type": "string", + "enum": [ + "mainnet" + ] + }, + { + "type": "string", + "enum": [ + "testnet" + ] + } + ] + }, + "filters": { + "type": "object", + "required": [ + "events" + ], + "properties": { + "events": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "type", + "principal" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "balance_change" + ] + }, + "principal": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_event" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_mint" + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_burn" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_transfer" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_deploy" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_call" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "function_name": { + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_log" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "coinbase" + ] + } + } + }, + { + "type": "object", + "required": [ + "type", + "cause" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "tenure_change" + ] + }, + "cause": { + "anyOf": [ + { + "type": "string", + "enum": [ + "block_found" + ] + }, + { + "type": "string", + "enum": [ + "extended" + ] + } + ] + } + } + } + ] + } + } + } + }, + "options": { + "anyOf": [ + { + "additionalProperties": false, + "type": "object", + "properties": { + "enable_on_registration": { + "type": "boolean" + }, + "expire_after_evaluations": { + "type": "integer" + }, + "expire_after_occurrences": { + "type": "integer" + }, + "decode_clarity_values": { + "type": "boolean" + }, + "include_contract_abi": { + "type": "boolean" + }, + "include_contract_source_code": { + "type": "boolean" + }, + "include_post_conditions": { + "type": "boolean" + }, + "include_raw_transactions": { + "type": "boolean" + }, + "include_block_signatures": { + "type": "boolean" + }, + "include_block_metadata": { + "type": "boolean" + } + } + }, + { + "type": "null" + } + ] + }, + "action": { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "http_post" + ] + }, + "url": { + "format": "uri", + "type": "string" + } + } + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "format": "uuid", + "type": "string" + }, + "in": "path", + "name": "uuid", + "required": true + } + ], + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "uuid", + "definition", + "status" + ], + "properties": { + "uuid": { + "format": "uuid", + "type": "string" + }, + "definition": { + "type": "object", + "required": [ + "name", + "version", + "chain", + "network", + "filters", + "action" + ], + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string", + "enum": [ + "1" + ] + }, + "chain": { + "type": "string", + "enum": [ + "stacks" + ] + }, + "network": { + "anyOf": [ + { + "type": "string", + "enum": [ + "mainnet" + ] + }, + { + "type": "string", + "enum": [ + "testnet" + ] + } + ] + }, + "filters": { + "type": "object", + "required": [ + "events" + ], + "properties": { + "events": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "type", + "principal" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "balance_change" + ] + }, + "principal": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_event" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_mint" + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_burn" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_transfer" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_deploy" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_call" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "function_name": { + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_log" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "coinbase" + ] + } + } + }, + { + "type": "object", + "required": [ + "type", + "cause" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "tenure_change" + ] + }, + "cause": { + "anyOf": [ + { + "type": "string", + "enum": [ + "block_found" + ] + }, + { + "type": "string", + "enum": [ + "extended" + ] + } + ] + } + } + } + ] + } + } + } + }, + "options": { + "anyOf": [ + { + "additionalProperties": false, + "type": "object", + "properties": { + "enable_on_registration": { + "type": "boolean" + }, + "expire_after_evaluations": { + "type": "integer" + }, + "expire_after_occurrences": { + "type": "integer" + }, + "decode_clarity_values": { + "type": "boolean" + }, + "include_contract_abi": { + "type": "boolean" + }, + "include_contract_source_code": { + "type": "boolean" + }, + "include_post_conditions": { + "type": "boolean" + }, + "include_raw_transactions": { + "type": "boolean" + }, + "include_block_signatures": { + "type": "boolean" + }, + "include_block_metadata": { + "type": "boolean" + } + } + }, + { + "type": "null" + } + ] + }, + "action": { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "http_post" + ] + }, + "url": { + "format": "uri", + "type": "string" + } + } + } + } + }, + "status": { + "type": "object", + "required": [ + "status", + "enabled", + "created_at", + "last_evaluated_at", + "last_evaluated_block_height", + "last_occurrence_at", + "last_occurrence_block_height", + "evaluated_block_count", + "occurrence_count" + ], + "properties": { + "status": { + "description": "Valid chainhook status values: new, streaming, expired, or interrupted", + "anyOf": [ + { + "type": "string", + "enum": [ + "new" + ] + }, + { + "type": "string", + "enum": [ + "streaming" + ] + }, + { + "type": "string", + "enum": [ + "expired" + ] + }, + { + "type": "string", + "enum": [ + "interrupted" + ] + } + ] + }, + "enabled": { + "type": "boolean" + }, + "created_at": { + "type": "number" + }, + "last_evaluated_at": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_evaluated_block_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_occurrence_at": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_occurrence_block_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "evaluated_block_count": { + "type": "number" + }, + "occurrence_count": { + "type": "number" + } + } + } + } + } + } + } + } + } + }, + "get": { + "operationId": "getChainhook", + "tags": [ + "Chainhooks" + ], + "description": "Returns a chainhook by its UUID", + "parameters": [ + { + "schema": { + "format": "uuid", + "type": "string" + }, + "in": "path", + "name": "uuid", + "required": true + } + ], + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "uuid", + "definition", + "status" + ], + "properties": { + "uuid": { + "format": "uuid", + "type": "string" + }, + "definition": { + "type": "object", + "required": [ + "name", + "version", + "chain", + "network", + "filters", + "action" + ], + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string", + "enum": [ + "1" + ] + }, + "chain": { + "type": "string", + "enum": [ + "stacks" + ] + }, + "network": { + "anyOf": [ + { + "type": "string", + "enum": [ + "mainnet" + ] + }, + { + "type": "string", + "enum": [ + "testnet" + ] + } + ] + }, + "filters": { + "type": "object", + "required": [ + "events" + ], + "properties": { + "events": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "type", + "principal" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "balance_change" + ] + }, + "principal": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "ft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_event" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_mint" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_burn" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "nft_transfer" + ] + }, + "asset_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}::[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "value": { + "type": "integer" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_event" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_mint" + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_burn" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stx_transfer" + ] + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + }, + "receiver": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_deploy" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_call" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "function_name": { + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "contract_log" + ] + }, + "contract_identifier": { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + "sender": { + "anyOf": [ + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,39}$", + "type": "string" + }, + { + "pattern": "^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}$", + "type": "string" + } + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "coinbase" + ] + } + } + }, + { + "type": "object", + "required": [ + "type", + "cause" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "tenure_change" + ] + }, + "cause": { + "anyOf": [ + { + "type": "string", + "enum": [ + "block_found" + ] + }, + { + "type": "string", + "enum": [ + "extended" + ] + } + ] + } + } + } + ] + } + } + } + }, + "options": { + "anyOf": [ + { + "additionalProperties": false, + "type": "object", + "properties": { + "enable_on_registration": { + "type": "boolean" + }, + "expire_after_evaluations": { + "type": "integer" + }, + "expire_after_occurrences": { + "type": "integer" + }, + "decode_clarity_values": { + "type": "boolean" + }, + "include_contract_abi": { + "type": "boolean" + }, + "include_contract_source_code": { + "type": "boolean" + }, + "include_post_conditions": { + "type": "boolean" + }, + "include_raw_transactions": { + "type": "boolean" + }, + "include_block_signatures": { + "type": "boolean" + }, + "include_block_metadata": { + "type": "boolean" + } + } + }, + { + "type": "null" + } + ] + }, + "action": { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "http_post" + ] + }, + "url": { + "format": "uri", + "type": "string" + } + } + } + } + }, + "status": { + "type": "object", + "required": [ + "status", + "enabled", + "created_at", + "last_evaluated_at", + "last_evaluated_block_height", + "last_occurrence_at", + "last_occurrence_block_height", + "evaluated_block_count", + "occurrence_count" + ], + "properties": { + "status": { + "description": "Valid chainhook status values: new, streaming, expired, or interrupted", + "anyOf": [ + { + "type": "string", + "enum": [ + "new" + ] + }, + { + "type": "string", + "enum": [ + "streaming" + ] + }, + { + "type": "string", + "enum": [ + "expired" + ] + }, + { + "type": "string", + "enum": [ + "interrupted" + ] + } + ] + }, + "enabled": { + "type": "boolean" + }, + "created_at": { + "type": "number" + }, + "last_evaluated_at": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_evaluated_block_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_occurrence_at": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "last_occurrence_block_height": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "evaluated_block_count": { + "type": "number" + }, + "occurrence_count": { + "type": "number" + } + } + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "deleteChainhook", + "tags": [ + "Chainhooks" + ], + "description": "Deletes a chainhook by its UUID", + "parameters": [ + { + "schema": { + "format": "uuid", + "type": "string" + }, + "in": "path", + "name": "uuid", + "required": true + } + ], + "responses": { + "204": { + "description": "Default Response" + } + } + } + }, + "/me/enabled": { + "patch": { + "operationId": "bulkEnableChainhooks", + "tags": [ + "Chainhooks" + ], + "description": "Updates the enabled status of chainhooks that match the provided filters", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "description": "Enabled status to apply to the matching chainhooks", + "type": "boolean" + }, + "filters": { + "additionalProperties": false, + "minProperties": 1, + "type": "object", + "properties": { + "uuids": { + "minItems": 1, + "maxItems": 200, + "uniqueItems": true, + "description": "Explicit chainhook UUIDs to enable or disable (maximum of 200 unique entries)", + "type": "array", + "items": { + "format": "uuid", + "type": "string" + } + }, + "webhook_url": { + "format": "uri", + "description": "Matches chainhooks registered with the given webhook URL", + "type": "string" + }, + "statuses": { + "minItems": 1, + "uniqueItems": true, + "description": "Filters chainhooks whose current status matches any provided value", + "type": "array", + "items": { + "description": "Valid chainhook status values: new, streaming, expired, or interrupted", + "anyOf": [ + { + "type": "string", + "enum": [ + "new" + ] + }, + { + "type": "string", + "enum": [ + "streaming" + ] + }, + { + "type": "string", + "enum": [ + "expired" + ] + }, + { + "type": "string", + "enum": [ + "interrupted" + ] + } + ] + } + } + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "updated_uuids" + ], + "properties": { + "updated_uuids": { + "description": "UUIDs of chainhooks that were successfully enabled", + "type": "array", + "items": { + "format": "uuid", + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/me/{uuid}/enabled": { + "patch": { + "operationId": "updateChainhookEnabled", + "tags": [ + "Chainhooks" + ], + "description": "Changes the enabled status of a chainhook by its UUID", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "description": "The enabled status of the chainhook", + "type": "boolean" + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "format": "uuid", + "type": "string" + }, + "in": "path", + "name": "uuid", + "required": true + } + ], + "responses": { + "204": { + "description": "Default Response" + } + } + } + }, + "/me/secret": { + "get": { + "operationId": "getConsumerSecret", + "tags": [ + "Secrets" + ], + "description": "Retrieves the current Chainhooks event payload consumer secret when available", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "secret" + ], + "properties": { + "secret": { + "description": "Consumer secret value, null when no secret exists", + "anyOf": [ + { + "format": "hex", + "description": "The current secret for the consumer", + "type": "string" + }, + { + "description": "No consumer secret is currently configured", + "type": "null" + } + ] + } + } + } + } + } + } + } + }, + "post": { + "operationId": "rotateConsumerSecret", + "tags": [ + "Secrets" + ], + "description": "Generates and returns a new Chainhooks event payload consumer secret", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "secret" + ], + "properties": { + "secret": { + "description": "Consumer secret value, null when no secret exists", + "anyOf": [ + { + "format": "hex", + "description": "The current secret for the consumer", + "type": "string" + }, + { + "description": "No consumer secret is currently configured", + "type": "null" + } + ] + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "deleteConsumerSecret", + "tags": [ + "Secrets" + ], + "description": "Deletes the Chainhooks event payload consumer secret", + "responses": { + "200": { + "description": "Default Response" + } + } + } + } + }, + "servers": [ + { + "url": "https://api.mainnet.hiro.so/chainhooks/v1", + "description": "Mainnet API" + }, + { + "url": "https://api.testnet.hiro.so/chainhooks/v1", + "description": "Testnet API" + } + ], + "tags": [ + { + "name": "Chainhooks", + "description": "Operations for managing Chainhooks." + }, + { + "name": "Status", + "description": "Health and readiness probes." + } + ] +} \ No newline at end of file