TransactionLogger
@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.
Table of contents
Section titled “Table of contents”Constructors
Section titled “Constructors”Properties
Section titled “Properties”Accessors
Section titled “Accessors”Methods
Section titled “Methods”Constructors
Section titled “Constructors”constructor
Section titled “constructor”• new TransactionLogger(): TransactionLogger
Returns
Section titled “Returns”Properties
Section titled “Properties”_latestLastValidRound
Section titled “_latestLastValidRound”• Private Optional _latestLastValidRound: bigint
Defined in
Section titled “Defined in”src/testing/transaction-logger.ts:14
_sentTransactionIds
Section titled “_sentTransactionIds”• Private _sentTransactionIds: string[] = []
Defined in
Section titled “Defined in”src/testing/transaction-logger.ts:13
Accessors
Section titled “Accessors”sentTransactionIds
Section titled “sentTransactionIds”• get sentTransactionIds(): readonly string[]
The list of transaction IDs that has been logged thus far.
Returns
Section titled “Returns”readonly string[]
Defined in
Section titled “Defined in”src/testing/transaction-logger.ts:27
Methods
Section titled “Methods”_pushTxn
Section titled “_pushTxn”▸ _pushTxn(stxn): void
Parameters
Section titled “Parameters”| Name | Type |
|---|---|
stxn | Uint8Array |
Returns
Section titled “Returns”void
Defined in
Section titled “Defined in”src/testing/transaction-logger.ts:16
capture
Section titled “capture”▸ capture(algod): AlgodClient
Return a proxy that wraps the given Algodv2 with this transaction logger.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
algod | AlgodClient | The Algodv2 to wrap |
Returns
Section titled “Returns”AlgodClient
The wrapped Algodv2, any transactions sent using this algod instance will be logged by this transaction logger
Defined in
Section titled “Defined in”src/testing/transaction-logger.ts:54
▸ clear(): void
Clear all logged IDs.
Returns
Section titled “Returns”void
Defined in
Section titled “Defined in”src/testing/transaction-logger.ts:34
logRawTransaction
Section titled “logRawTransaction”▸ logRawTransaction(signedTransactions): void
The method that captures raw transactions and stores the transaction IDs.
Parameters
Section titled “Parameters”| Name | Type |
|---|---|
signedTransactions | Uint8Array | Uint8Array[] |
Returns
Section titled “Returns”void
Defined in
Section titled “Defined in”src/testing/transaction-logger.ts:41
waitForIndexer
Section titled “waitForIndexer”▸ waitForIndexer(indexer): Promise<void>
Wait until all logged transactions IDs appear in the given Indexer.
Parameters
Section titled “Parameters”| Name | Type |
|---|---|
indexer | IndexerClient |
Returns
Section titled “Returns”Promise<void>