{
"openrpc": "1.3.2",
"info": {
"title": "Transaction Resolver Protocol",
"version": "1.0.0",
"description": "OpenRPC schema for the Transaction Resolver Protocol (TRP). TRP is a backend for tx3.",
"contact": {
"url": "https://txpipe.io"
}
},
"servers": [
{
"name": "default",
"url": "http://localhost:8545"
},
{
"name": "Demeter Preview",
"description": "Free Demeter TRP",
"url": "https://cardano-preview.trp-m1.demeter.run",
"variables": {
"dmtr-api-key": {
"default": "trp1ffyf88ugcyg6j6n3yuh"
}
}
}
],
"methods": [
{
"name": "trp.resolve",
"summary": "Resolve a proto transaction into a signed transaction envelope.",
"params": {
"name": "ResolveParams",
"schema": {
"$ref": "#/components/schemas/ResolveParams"
}
},
"result": {
"name": "TxEnvelope",
"schema": {
"$ref": "#/components/schemas/TxEnvelope"
}
},
"errors": [
{
"code": -32000,
"message": "Unsupported TIR",
"data": {
"$ref": "#/components/schemas/UnsupportedTirDiagnostic"
}
},
{
"code": -32001,
"message": "Missing transaction argument",
"data": {
"$ref": "#/components/schemas/MissingTxArgDiagnostic"
}
},
{
"code": -32002,
"message": "Input not resolved",
"data": {
"$ref": "#/components/schemas/InputNotResolvedDiagnostic"
}
},
{
"code": -32003,
"message": "Tx script failure",
"data": {
"$ref": "#/components/schemas/TxScriptFailureDiagnostic"
}
}
]
},
{
"name": "trp.submit",
"summary": "Submit a resolved transaction with witnesses.",
"params": {
"name": "SubmitParams",
"schema": {
"$ref": "#/components/schemas/SubmitParams"
}
},
"result": {
"name": "SubmitResponse",
"schema": {
"$ref": "#/components/schemas/SubmitResponse"
}
}
},
{
"name": "trp.checkStatus",
"summary": "Check the status of transactions in the mempool.",
"params": {
"name": "CheckStatusParams",
"schema": {
"type": "object",
"properties": {
"hashes": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["hashes"]
}
},
"result": {
"name": "CheckStatusResponse",
"schema": {
"$ref": "#/components/schemas/CheckStatusResponse"
}
}
},
{
"name": "trp.dumpLogs",
"summary": "Dump finalized transaction logs with pagination.",
"params": {
"name": "DumpLogsParams",
"schema": {
"type": "object",
"properties": {
"cursor": {
"type": "integer"
},
"limit": {
"type": "integer"
},
"includePayload": {
"type": "boolean"
}
}
}
},
"result": {
"name": "DumpLogsResponse",
"schema": {
"$ref": "#/components/schemas/DumpLogsResponse"
}
}
},
{
"name": "trp.peekPending",
"summary": "Peek at pending transactions in the mempool.",
"params": {
"name": "PeekPendingParams",
"schema": {
"type": "object",
"properties": {
"includePayload": {
"type": "boolean"
}
}
}
},
"result": {
"name": "PeekPendingResponse",
"schema": {
"$ref": "#/components/schemas/PeekPendingResponse"
}
}
},
{
"name": "trp.peekInflight",
"summary": "Peek at inflight transactions (propagated/acknowledged) in the mempool.",
"params": {
"name": "PeekInflightParams",
"schema": {
"type": "object",
"properties": {
"includePayload": {
"type": "boolean"
}
}
}
},
"result": {
"name": "PeekInflightResponse",
"schema": {
"$ref": "#/components/schemas/PeekInflightResponse"
}
}
}
],
"components": {
"schemas": {
"TirEnvelope": {
"title": "TirEnvelope",
"type": "object",
"required": ["encoding", "content", "version"],
"properties": {
"encoding": {
"type": "string",
"enum": ["hex", "base64"]
},
"content": {
"type": "string",
"description": "The encoded TIR bytes in the selected encoding"
},
"version": {
"type": "string",
"description": "The TIR version of the encoded content"
}
},
"additionalProperties": false
},
"ArgMap": {
"title": "ArgMap",
"type": "object",
"description": "Flexible key-value arguments for transaction execution",
"additionalProperties": true
},
"EnvMap": {
"title": "EnvMap",
"type": "object",
"description": "Environment variables for transaction execution context",
"additionalProperties": true
},
"BytesEnvelope": {
"title": "BytesEnvelope",
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "The encoded byte content"
},
"contentType": {
"type": "string",
"description": "MIME type or format identifier for the content"
}
},
"required": ["content", "contentType"]
},
"SubmitResponse": {
"title": "SubmitResponse",
"type": "object",
"properties": {
"hash": {
"type": "string",
"description": "Transaction hash"
}
},
"required": ["hash"]
},
"TxEnvelope": {
"title": "TxEnvelope",
"type": "object",
"properties": {
"tx": {
"type": "string",
"description": "Hex-encoded transaction bytes"
},
"hash": {
"type": "string",
"description": "Transaction hash"
}
},
"required": ["tx", "hash"]
},
"TxSignature": {
"title": "TxSignature",
"type": "object",
"properties": {
"key": {
"$ref": "#/components/schemas/BytesEnvelope"
},
"signature": {
"$ref": "#/components/schemas/BytesEnvelope"
},
"type": {
"type": "string"
}
},
"required": ["key", "signature", "type"]
},
"TxWitness": {
"title": "TxWitness",
"oneOf": [
{
"$ref": "#/components/schemas/TxSignature"
},
{
"$ref": "#/components/schemas/BytesEnvelope"
}
]
},
"UnsupportedTirDiagnostic": {
"title": "UnsupportedTirDiagnostic",
"type": "object",
"properties": {
"provided": {
"type": "string"
},
"expected": {
"type": "string"
}
},
"required": ["provided", "expected"]
},
"MissingTxArgDiagnostic": {
"title": "MissingTxArgDiagnostic",
"type": "object",
"properties": {
"key": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": ["key", "type"]
},
"SearchSpaceDiagnostic": {
"title": "SearchSpaceDiagnostic",
"type": "object",
"properties": {
"matched": {
"type": "array",
"items": {
"type": "string"
}
},
"by_address_count": {
"type": ["integer", "null"]
},
"by_asset_class_count": {
"type": ["integer", "null"]
},
"by_ref_count": {
"type": ["integer", "null"]
}
},
"required": ["matched"]
},
"InputQueryDiagnostic": {
"title": "InputQueryDiagnostic",
"type": "object",
"properties": {
"address": {
"type": ["string", "null"]
},
"min_amount": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"refs": {
"type": "array",
"items": {
"type": "string"
}
},
"support_many": {
"type": "boolean"
},
"collateral": {
"type": "boolean"
}
},
"required": ["min_amount", "refs", "support_many", "collateral"]
},
"InputNotResolvedDiagnostic": {
"title": "InputNotResolvedDiagnostic",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"query": {
"$ref": "#/components/schemas/InputQueryDiagnostic"
},
"search_space": {
"$ref": "#/components/schemas/SearchSpaceDiagnostic"
}
},
"required": ["name", "query", "search_space"]
},
"TxScriptFailureDiagnostic": {
"title": "TxScriptFailureDiagnostic",
"type": "object",
"properties": {
"logs": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["logs"]
},
"SubmitParams": {
"title": "SubmitParams",
"type": "object",
"properties": {
"tx": {
"$ref": "#/components/schemas/BytesEnvelope"
},
"witnesses": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TxWitness"
}
}
},
"required": ["tx", "witnesses"]
},
"ResolveParams": {
"title": "ResolveParams",
"type": "object",
"properties": {
"tir": {
"$ref": "#/components/schemas/TirEnvelope"
},
"args": {
"$ref": "#/components/schemas/ArgMap"
},
"env": {
"$ref": "#/components/schemas/EnvMap"
}
},
"required": ["tir", "args"]
},
"ChainPoint": {
"type": "object",
"required": ["slot", "blockHash"],
"properties": {
"slot": {
"type": "integer",
"title": "Slot",
"description": "Slot number when transaction was confirmed"
},
"blockHash": {
"type": "string",
"title": "Block hash",
"description": "Hash of the block containing the transaction"
}
}
},
"TxStatus": {
"type": "object",
"required": ["stage", "confirmations", "nonConfirmations"],
"properties": {
"stage": {
"type": "string",
"title": "Transaction stage",
"description": "Current stage in the mempool lifecycle",
"enum": [
"pending",
"propagated",
"acknowledged",
"confirmed",
"finalized",
"dropped",
"rolled_back",
"unknown"
]
},
"confirmations": {
"type": "integer",
"title": "Number of confirmations"
},
"nonConfirmations": {
"type": "integer",
"title": "Number of non-confirmations"
},
"confirmedAt": {
"$ref": "#/components/schemas/ChainPoint"
}
}
},
"CheckStatusResponse": {
"type": "object",
"required": ["statuses"],
"properties": {
"statuses": {
"$ref": "#/components/schemas/TxStatusMap"
}
}
},
"TxStatusMap": {
"type": "object",
"description": "Map of transaction hashes to their status information",
"additionalProperties": {
"$ref": "#/components/schemas/TxStatus"
}
},
"TxLog": {
"type": "object",
"required": ["hash", "stage", "confirmations", "nonConfirmations"],
"properties": {
"hash": {
"type": "string",
"title": "Transaction hash"
},
"stage": {
"type": "string",
"title": "Transaction stage",
"enum": [
"pending",
"propagated",
"acknowledged",
"confirmed",
"finalized",
"dropped",
"rolled_back",
"unknown"
]
},
"payload": {
"type": "string",
"title": "Transaction payload",
"description": "Hex-encoded transaction CBOR"
},
"confirmations": {
"type": "integer",
"title": "Number of confirmations"
},
"nonConfirmations": {
"type": "integer",
"title": "Number of non-confirmations"
},
"confirmedAt": {
"$ref": "#/components/schemas/ChainPoint"
}
}
},
"DumpLogsResponse": {
"type": "object",
"required": ["entries"],
"properties": {
"entries": {
"type": "array",
"title": "Log entries",
"items": {
"$ref": "#/components/schemas/TxLog"
}
},
"nextCursor": {
"type": "integer",
"title": "Next cursor",
"description": "Cursor for pagination"
}
}
},
"PendingTx": {
"type": "object",
"required": ["hash"],
"properties": {
"hash": {
"type": "string",
"title": "Transaction hash"
},
"payload": {
"type": "string",
"title": "Transaction payload",
"description": "Hex-encoded transaction CBOR"
}
}
},
"PeekPendingResponse": {
"type": "object",
"required": ["entries"],
"properties": {
"entries": {
"type": "array",
"title": "Pending transactions",
"items": {
"$ref": "#/components/schemas/PendingTx"
}
}
}
},
"InflightTx": {
"type": "object",
"required": ["hash", "stage", "confirmations", "nonConfirmations"],
"properties": {
"hash": {
"type": "string",
"title": "Transaction hash"
},
"stage": {
"type": "string",
"title": "Transaction stage",
"enum": [
"pending",
"propagated",
"acknowledged",
"confirmed",
"finalized",
"dropped",
"rolled_back",
"unknown"
]
},
"confirmations": {
"type": "integer",
"title": "Number of confirmations"
},
"nonConfirmations": {
"type": "integer",
"title": "Number of non-confirmations"
},
"confirmedAt": {
"$ref": "#/components/schemas/ChainPoint"
},
"payload": {
"type": "string",
"title": "Transaction payload",
"description": "Hex-encoded transaction CBOR"
}
}
},
"PeekInflightResponse": {
"type": "object",
"required": ["entries"],
"properties": {
"entries": {
"type": "array",
"title": "Inflight transactions",
"items": {
"$ref": "#/components/schemas/InflightTx"
}
}
}
}
},
"examples": {
"tir": {
"name": "tir",
"value": {
"content": "ab6466656573a169457...",
"encoding": "hex",
"version": "v1alpha3"
}
},
"args": {
"name": "args",
"value": {
"sender": "addr_test1qqxfzzm8cl05gssccyt3dtcp25fgrcfw6akjp9r4wtx09ujl8vdgga5pvrmprvd67asp7tr6vrwwnjku5l7ly4xhq9esagp6ag",
"receiver": "addr_test1qqxfzzm8cl05gssccyt3dtcp25fgrcfw6akjp9r4wtx09ujl8vdgga5pvrmprvd67asp7tr6vrwwnjku5l7ly4xhq9esagp6ag",
"quantity": 5000000
}
},
"env": {
"name": "env",
"value": {}
},
"tx": {
"name": "tx",
"value": {
"payload": "84a600d90102818258205663c3e28539f4b847043cf2b1d87e5e4bd3e070a76dcfb3fd8170218486eff1000181a200581d607d2c43c7a0f627eef2ea856a32d511d016b8ea91b060b4644a894ec4011a02f56480021a00058c0109a1581c4471174f9a61d7de7e9e2e3f6bb6e490796a84cc4143ccb98262759ea1474d79546f6b656e010b5820003511b2fd5ed61f48885d63bcbff79a06446d216d40bcc3045fd1e24b9a02b00f00a200d90102818258201c38965e73acce4b27c2b86fcfb389329ae62240d84d0531fe93f806fba69f7a58406541739e86340b3a20ad5a9f9e3347e4eefca1aa5bb888d5649961fe64e0cdc95dabb6602e99a6771c3fe60d7ea0b5d4346cfd4f6ca137be7ba7af3b8784ba0c0581840100d87980821907d01a00030d40f5f6",
"encoding": "hex",
"version": "v1alpha1"
}
},
"witness": {
"name": "witness",
"value": {
"Signature": {
"key": {
"payload": "aabbccdd...",
"encoding": "hex",
"version": "v1"
},
"signature": {
"payload": "11223344...",
"encoding": "hex",
"version": "v1"
},
"type": "vkey"
}
}
}
}
}
}