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

New Transaction.GetInterchain and Block.GetInterchain call the prime-node
/api/v1/{transaction,block}/{id}/interchain endpoints, returning an
InterchainTrace {blockId, validatorBlocks, interchainTransactions}. Adds local
VerificationBlock / InterchainTransaction / InterchainTrace model types.
This commit is contained in:
2026-06-02 14:12:49 -04:00
parent 621e359817
commit d945029f33
3 changed files with 63 additions and 0 deletions

View File

@@ -25,3 +25,16 @@ func (bc *BlockClient) Get(ctx context.Context, blockID string) (*models.Block,
}
return &resp, nil
}
// GetInterchain traces a block to the validator (verification) blocks that
// validated it and the public-chain interchain anchors those validator blocks
// were bundled into.
func (bc *BlockClient) GetInterchain(ctx context.Context, blockID string) (*models.InterchainTrace, error) {
var resp models.InterchainTrace
path := fmt.Sprintf("/api/v1/block/%s/interchain", blockID)
err := bc.client.Get(ctx, path, &resp)
if err != nil {
return nil, err
}
return &resp, nil
}