From 8d1b5ab1edb02c74b9e43ca5a8d9f5646f20a8fb Mon Sep 17 00:00:00 2001 From: nelsonksh Date: Fri, 14 Feb 2025 12:17:34 +0530 Subject: [PATCH] feat(query): support ReadTxs --- proto/utxorpc/v1alpha/query/query.proto | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/proto/utxorpc/v1alpha/query/query.proto b/proto/utxorpc/v1alpha/query/query.proto index 2d2dfcb..21a3779 100644 --- a/proto/utxorpc/v1alpha/query/query.proto +++ b/proto/utxorpc/v1alpha/query/query.proto @@ -109,15 +109,34 @@ message ReadDataResponse { ChainPoint ledger_tip = 2; // The chain point that represent the ledger current position. } +// Request to get a transaction by hash +message GetTxRequest { + bytes hash = 1; // The hash of the transaction. + google.protobuf.FieldMask field_mask = 2; // Field mask to selectively return fields in the response. +} + +// Represents a transaction from any supported blockchain. +message AnyChainTx { + oneof chain { + utxorpc.v1alpha.cardano.Tx cardano = 1; // A Cardano transaction. + } +} + +// Response containing the transaction associated with the requested hash. +message GetTxResponse { + AnyChainTx tx = 1; // The transaction. + ChainPoint ledger_tip = 2; // The chain point that represent the ledger current position. +} + // Service definition for querying the state of the chain. service QueryService { rpc ReadParams(ReadParamsRequest) returns (ReadParamsResponse); // Get overall chain state. rpc ReadUtxos(ReadUtxosRequest) returns (ReadUtxosResponse); // Read specific UTxOs by reference. rpc SearchUtxos(SearchUtxosRequest) returns (SearchUtxosResponse); // Search for UTxO based on a pattern. rpc ReadData(ReadDataRequest) returns (ReadDataResponse); // Read specific datum by hash + rpc ReadTxs(GetTxRequest) returns (GetTxResponse); // Get Txs by by chain-specific criteria. // TODO: decide if we want to expand the scope // rpc DumpUtxos(ReadUtxosRequest) returns (stream ReadUtxosResponse); // Dump all available utxos // rpc ReadAccount(ReadAccountRequest) returns (ReadAccountReponse); // Get state of a particular account - // rpc ReadTxs(GetTxRequest) returns (GetTxResponse); // Get Txs by by chain-specific criteria. }