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
VerificationBlock / InterchainTransaction / InterchainTrace interfaces and
method-existence assertions.
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
TransactionBulkResponse,
|
||||
Transaction,
|
||||
ListTransactionsResponse,
|
||||
InterchainTrace,
|
||||
} from './types';
|
||||
|
||||
export class TransactionClient {
|
||||
@@ -49,6 +50,16 @@ export class TransactionClient {
|
||||
return this.client.get<Transaction>(`/api/v1/transaction/${transactionId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Traces 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 arrays are empty.
|
||||
*/
|
||||
async getInterchain(transactionId: string): Promise<InterchainTrace> {
|
||||
return this.client.get<InterchainTrace>(`/api/v1/transaction/${transactionId}/interchain`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all transactions
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user