@algorandfoundation/algokit-utils / testing / TransactionLogger
testing.TransactionLogger
Allows you to keep track of Algorand transaction IDs by wrapping an Algodv2 in a proxy.
Useful for automated tests.
• new TransactionLogger(): TransactionLogger
• Private _sentTransactionIds: string[] = []
src/testing/transaction-logger.ts:12
• get sentTransactionIds(): readonly string[]
The list of transaction IDs that has been logged thus far.
readonly string[]
src/testing/transaction-logger.ts:17
▸ capture(algod): AlgodClient
Return a proxy that wraps the given Algodv2 with this transaction logger.
| Name | Type | Description |
|---|---|---|
algod |
AlgodClient |
The Algodv2 to wrap |
AlgodClient
The wrapped Algodv2, any transactions sent using this algod instance will be logged by this transaction logger
src/testing/transaction-logger.ts:48
▸ clear(): void
Clear all logged IDs.
void
src/testing/transaction-logger.ts:24
▸ logRawTransaction(signedTransactions): void
The method that captures raw transactions and stores the transaction IDs.
| Name | Type |
|---|---|
signedTransactions |
Uint8Array | Uint8Array[] |
void
src/testing/transaction-logger.ts:31
▸ waitForIndexer(algod, indexer): Promise<void>
Wait until indexer has the last round from algod.
| Name | Type |
|---|---|
algod |
AlgodClient |
indexer |
IndexerClient |
Promise<void>