add get_interchain: trace a transaction/block to validator blocks + interchain anchors

New transaction.get_interchain and block.get_interchain call the prime-node
/api/v1/{transaction,block}/{id}/interchain endpoints, returning an
InterchainTrace {block_id, validator_blocks, interchain_transactions}. Adds
VerificationBlock / InterchainTransaction / InterchainTrace dataclasses with
from_dict, exports them, and a from_dict test.
This commit is contained in:
2026-06-02 14:12:59 -04:00
parent 8b007dcbab
commit e4e49218d0
5 changed files with 148 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
from .client import CONTENT_TYPE_JSON, Client
from .models import (
InterchainTrace,
ListTransactionsResponse,
Transaction,
TransactionBulkRequest,
@@ -39,5 +40,14 @@ class TransactionClient:
def get(self, transaction_id: str) -> Transaction:
return self._client.get(f"/api/v1/transaction/{transaction_id}", Transaction)
def get_interchain(self, transaction_id: str) -> InterchainTrace:
"""Trace a transaction to the validator (verification) blocks that
validated its prime block and the public-chain interchain anchors those
validator blocks were bundled into. If the transaction is still pending
(not yet in a block) the trace's lists are empty."""
return self._client.get(
f"/api/v1/transaction/{transaction_id}/interchain", InterchainTrace
)
def list(self) -> ListTransactionsResponse:
return self._client.get("/api/v1/transaction/", ListTransactionsResponse)