Skip to content

Commit dea6e27

Browse files
committed
solution: get transaction by txId
1 parent a9053f1 commit dea6e27

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

proto/transaction.message.proto

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,23 @@ message Change {
103103
// index of address in xpub if detected (optional)
104104
google.protobuf.UInt32Value xpub_index = 6;
105105
}
106+
107+
message GetTransactionRequest {
108+
ChainRef chain = 1;
109+
string tx_id = 2;
110+
}
111+
112+
message Transaction {
113+
ChainRef chain = 1;
114+
string tx_id = 2;
115+
// block info if transaction is in block, empty for mempool transaction
116+
BlockInfo block = 3;
117+
// true if transaction is in mempool, false if transaction is in block
118+
bool mempool = 4;
119+
// transaction index in block
120+
uint32 tx_index_in_block = 5;
121+
// true if transaction is failed
122+
bool failed = 6;
123+
// all changes in transaction
124+
repeated Change changes = 7;
125+
}

proto/transaction.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ service Transaction {
1414
rpc GetTransactions (transaction.GetTransactionsRequest) returns (stream transaction.AddressTransaction) {}
1515
// Subscribe to new transactions in blocks and all transaction in mempool for address
1616
rpc SubscribeTransactions (transaction.SubscribeTransactionsRequest) returns (stream transaction.AddressTransaction) {}
17+
18+
// Get transaction by txId
19+
rpc GetTransaction (transaction.GetTransactionRequest) returns (transaction.Transaction) {}
20+
1721
}

0 commit comments

Comments
 (0)