From 0931e5d5da254477e3e67c18a98728d9853c84ef Mon Sep 17 00:00:00 2001 From: Negar Abbasi Date: Thu, 31 Aug 2023 12:37:43 +1000 Subject: [PATCH] docs: adding generated docs --- docs/code/classes/testing.TestLogger.md | 18 +- .../classes/types_logic_error.LogicError.md | 8 +- .../types_testing.AlgorandFixture.md | 8 +- docs/code/modules/index.md | 266 +++++++++--------- docs/code/modules/testing.md | 74 ++--- src/account.ts | 3 +- 6 files changed, 188 insertions(+), 189 deletions(-) diff --git a/docs/code/classes/testing.TestLogger.md b/docs/code/classes/testing.TestLogger.md index 6f7817bf..26e1e887 100644 --- a/docs/code/classes/testing.TestLogger.md +++ b/docs/code/classes/testing.TestLogger.md @@ -168,6 +168,15 @@ This helps ensure that the provided configuration items won't appear https://jestjs.io/docs/snapshot-testing#2-tests-should-be-deterministic +**`Example`** + +Jest Example +```typescript +const logger = new TestLogger() +... +expect(logger.getLogSnapshot()).toMatchSnapshot() +``` + #### Parameters | Name | Type | Description | @@ -180,15 +189,6 @@ https://jestjs.io/docs/snapshot-testing#2-tests-should-be-deterministic The snapshotted logs. -**`Example`** - -Jest Example -```typescript -const logger = new TestLogger() -... -expect(logger.getLogSnapshot()).toMatchSnapshot() -``` - #### Defined in [src/testing/test-logger.ts:47](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L47) diff --git a/docs/code/classes/types_logic_error.LogicError.md b/docs/code/classes/types_logic_error.LogicError.md index c2328832..189b15b3 100644 --- a/docs/code/classes/types_logic_error.LogicError.md +++ b/docs/code/classes/types_logic_error.LogicError.md @@ -153,6 +153,10 @@ ___ Optional override for formatting stack traces +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + ##### Parameters | Name | Type | @@ -164,10 +168,6 @@ Optional override for formatting stack traces `any` -**`See`** - -https://v8.dev/docs/stack-trace-api#customizing-stack-traces - #### Inherited from Error.prepareStackTrace diff --git a/docs/code/interfaces/types_testing.AlgorandFixture.md b/docs/code/interfaces/types_testing.AlgorandFixture.md index d86eceef..5b458549 100644 --- a/docs/code/interfaces/types_testing.AlgorandFixture.md +++ b/docs/code/interfaces/types_testing.AlgorandFixture.md @@ -45,10 +45,6 @@ Testing framework agnostic handler method to run before each test to prepare the Retrieve the current context. Useful with destructuring. -#### Returns - -[`AlgorandTestAutomationContext`](types_testing.AlgorandTestAutomationContext.md) - **`Example`** ```typescript @@ -57,6 +53,10 @@ test('My test', () => { }) ``` +#### Returns + +[`AlgorandTestAutomationContext`](types_testing.AlgorandTestAutomationContext.md) + #### Defined in [src/types/testing.ts:63](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/testing.ts#L63) diff --git a/docs/code/modules/index.md b/docs/code/modules/index.md index 33b1f11e..ab16118e 100644 --- a/docs/code/modules/index.md +++ b/docs/code/modules/index.md @@ -456,20 +456,6 @@ ___ ▸ **getAccount**(`account`, `algod`, `kmdClient?`): `Promise`<`Account` \| [`SigningAccount`](../classes/types_account.SigningAccount.md)\> -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `account` | `string` \| { `fundWith?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `name`: `string` } | The details of the account to get, either the name identifier (string) or an object with: * `name`: The name identifier of the account * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 Algos will be funded from the dispenser account | -| `algod` | `default` | An algod client | -| `kmdClient?` | `default` | An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables | - -#### Returns - -`Promise`<`Account` \| [`SigningAccount`](../classes/types_account.SigningAccount.md)\> - -The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account) - **`Deprecated`** use mnemonicAccountFromEnvironment instead @@ -497,19 +483,11 @@ const account = await getAccount('ACCOUNT', algod) If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGOs from the default LocalNet dispenser. -#### Defined in - -[src/account.ts:92](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L92) - -▸ **getAccount**(`account`, `algod`, `kmdClient?`): `Promise`<`Account` \| [`SigningAccount`](../classes/types_account.SigningAccount.md)\> - #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `account` | `Object` | The details of the account to get, an object with: * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName) * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 Algos will be funded from the dispenser account | -| `account.config` | [`AccountConfig`](../interfaces/types_account.AccountConfig.md) | - | -| `account.fundWith?` | [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) | - | +| `account` | `string` \| { `fundWith?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `name`: `string` } | The details of the account to get, either the name identifier (string) or an object with: * `name`: The name identifier of the account * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 Algos will be funded from the dispenser account | | `algod` | `default` | An algod client | | `kmdClient?` | `default` | An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables | @@ -519,6 +497,12 @@ If that code runs against LocalNet then a wallet called `ACCOUNT` will automatic The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account) +#### Defined in + +[src/account.ts:92](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L92) + +▸ **getAccount**(`account`, `algod`, `kmdClient?`): `Promise`<`Account` \| [`SigningAccount`](../classes/types_account.SigningAccount.md)\> + **`Deprecated`** use mnemonicAccountFromEnvironment instead @@ -537,6 +521,22 @@ const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOU If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGOs from the default LocalNet dispenser. +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `account` | `Object` | The details of the account to get, an object with: * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName) * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 Algos will be funded from the dispenser account | +| `account.config` | [`AccountConfig`](../interfaces/types_account.AccountConfig.md) | - | +| `account.fundWith?` | [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) | - | +| `algod` | `default` | An algod client | +| `kmdClient?` | `default` | An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables | + +#### Returns + +`Promise`<`Account` \| [`SigningAccount`](../classes/types_account.SigningAccount.md)\> + +The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account) + #### Defined in [src/account.ts:119](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L119) @@ -561,7 +561,7 @@ Returns the string address of an Algorand account from a base64 encoded version #### Defined in -[src/account.ts:271](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L271) +[src/account.ts:270](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L270) ___ @@ -583,7 +583,7 @@ Returns an account's address as a byte array #### Defined in -[src/account.ts:263](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L263) +[src/account.ts:262](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L262) ___ @@ -591,16 +591,6 @@ ___ ▸ **getAccountConfigFromEnvironment**(`accountName`): [`AccountConfig`](../interfaces/types_account.AccountConfig.md) -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `accountName` | `string` | account name | - -#### Returns - -[`AccountConfig`](../interfaces/types_account.AccountConfig.md) - **`Deprecated`** Use algokit.mnemonicAccountFromEnvironment, which doesn't need this function @@ -614,9 +604,19 @@ environment variables {accountName}_SENDER ``` +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountName` | `string` | account name | + +#### Returns + +[`AccountConfig`](../interfaces/types_account.AccountConfig.md) + #### Defined in -[src/account.ts:299](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L299) +[src/account.ts:298](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L298) ___ @@ -626,16 +626,6 @@ ___ Returns an algod SDK client that automatically retries on idempotent calls -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) | - -#### Returns - -`Algodv2` - **`Example`** Default (load from environment variables) @@ -671,6 +661,16 @@ Custom (e.g. default LocalNet, although we recommend loading this into a .env an await algod.healthCheck().do() ``` +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) | + +#### Returns + +`Algodv2` + #### Defined in [src/network-client.ts:126](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/network-client.ts#L126) @@ -683,16 +683,6 @@ ___ Returns an indexer SDK client that automatically retries on idempotent calls -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) | - -#### Returns - -`Indexer` - **`Example`** Default (load from environment variables) @@ -728,6 +718,16 @@ Custom (e.g. default LocalNet, although we recommend loading this into a .env an await indexer.makeHealthCheck().do() ``` +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) | + +#### Returns + +`Indexer` + #### Defined in [src/network-client.ts:159](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/network-client.ts#L159) @@ -742,16 +742,6 @@ Returns a KMD SDK client that automatically retries on idempotent calls KMD client allows you to export private keys, which is useful to get the default account in a LocalNet network. -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) | - -#### Returns - -`Kmd` - **`Example`** Default (load from environment variables) @@ -768,6 +758,16 @@ Custom (e.g. default LocalNet, although we recommend loading this into a .env an const kmd = getAlgoKmdClient({server: 'http://localhost', port: '4002', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}) ``` +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) | + +#### Returns + +`Kmd` + #### Defined in [src/network-client.ts:182](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/network-client.ts#L182) @@ -1020,19 +1020,6 @@ ___ Create a new ApplicationClient instance -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `appDetails` | [`AppSpecAppDetails`](types_app_client.md#appspecappdetails) | The details of the app | -| `algod` | `default` | An algod instance | - -#### Returns - -[`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) - -The application client - **`Example`** ```ts @@ -1064,23 +1051,11 @@ const client = algokit.getAppClient( ) ``` -#### Defined in - -[src/app-client.ts:34](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L34) - -___ - -### getAppClientByCreatorAndName - -▸ **getAppClientByCreatorAndName**(`appDetails`, `algod`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) - -Create a new ApplicationClient instance by creator and name - #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `appDetails` | [`AppSpecAppDetailsByCreatorAndName`](types_app_client.md#appspecappdetailsbycreatorandname) | The details of the app by creator and name | +| `appDetails` | [`AppSpecAppDetails`](types_app_client.md#appspecappdetails) | The details of the app | | `algod` | `default` | An algod instance | #### Returns @@ -1089,6 +1064,18 @@ Create a new ApplicationClient instance by creator and name The application client +#### Defined in + +[src/app-client.ts:34](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L34) + +___ + +### getAppClientByCreatorAndName + +▸ **getAppClientByCreatorAndName**(`appDetails`, `algod`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) + +Create a new ApplicationClient instance by creator and name + **`Example`** ```ts @@ -1103,23 +1090,11 @@ const client = algokit.getAppClientByCreatorAndName( ) ``` -#### Defined in - -[src/app-client.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L77) - -___ - -### getAppClientById - -▸ **getAppClientById**(`appDetails`, `algod`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) - -Create a new ApplicationClient instance by id - #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `appDetails` | [`AppSpecAppDetailsById`](types_app_client.md#appspecappdetailsbyid) | The details of the app | +| `appDetails` | [`AppSpecAppDetailsByCreatorAndName`](types_app_client.md#appspecappdetailsbycreatorandname) | The details of the app by creator and name | | `algod` | `default` | An algod instance | #### Returns @@ -1128,6 +1103,18 @@ Create a new ApplicationClient instance by id The application client +#### Defined in + +[src/app-client.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L77) + +___ + +### getAppClientById + +▸ **getAppClientById**(`appDetails`, `algod`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) + +Create a new ApplicationClient instance by id + **`Example`** ```ts @@ -1141,6 +1128,19 @@ const client = algokit.getAppClientById( ) ``` +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `appDetails` | [`AppSpecAppDetailsById`](types_app_client.md#appspecappdetailsbyid) | The details of the app | +| `algod` | `default` | An algod instance | + +#### Returns + +[`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) + +The application client + #### Defined in [src/app-client.ts:55](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L55) @@ -1385,7 +1385,7 @@ If running on LocalNet then it will return the default dispenser account automat #### Defined in -[src/account.ts:283](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L283) +[src/account.ts:282](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L282) ___ @@ -1411,6 +1411,17 @@ ___ Returns an Algorand account with private key loaded from the given KMD wallet (identified by name). +**`Example`** + +Get default funded account in a LocalNet + +```typescript +const defaultDispenserAccount = await getKmdWalletAccount(algod, + 'unencrypted-default-wallet', + a => a.status !== 'Offline' && a.amount > 1_000_000_000 +) +``` + #### Parameters | Name | Type | Description | @@ -1425,17 +1436,6 @@ Returns an Algorand account with private key loaded from the given KMD wallet (i `Promise`<`Account` \| `undefined`\> -**`Example`** - -Get default funded account in a LocalNet - -```typescript -const defaultDispenserAccount = await getKmdWalletAccount(algod, - 'unencrypted-default-wallet', - a => a.status !== 'Offline' && a.amount > 1_000_000_000 -) -``` - #### Defined in [src/localnet.ts:90](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/localnet.ts#L90) @@ -1827,6 +1827,18 @@ Note: This function expects to run in a Node.js environment. This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet). +**`Example`** + +Default + +If you have a mnemonic secret loaded into `process.env.MY_ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object: +```typescript +const account = await mnemonicAccountFromEnvironment('MY_ACCOUNT', algod) +``` + +If that code runs against LocalNet then a wallet called `MY_ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGOs from the default LocalNet dispenser. +If not running against LocalNet then it will use proces.env.MY_ACCOUNT_MNEMONIC as the private key and (if present) process.env.MY_ACCOUNT_SENDER as the sender address. + #### Parameters | Name | Type | Description | @@ -1841,18 +1853,6 @@ This allows you to write code that will work seamlessly in production and local The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account) -**`Example`** - -Default - -If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object: -```typescript -const account = await mnemonicAccountFromEnvironment('MY_ACCOUNT', algod) -``` - -If that code runs against LocalNet then a wallet called `MY_ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGOs from the default LocalNet dispenser. -If not running against LocalNet then it will use proces.env.MY_ACCOUNT_MNEMONIC as the private key and (if present) process.env.MY_ACCOUNT_SENDER as the sender address. - #### Defined in [src/account.ts:230](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L230) @@ -2299,6 +2299,10 @@ ___ Wait until the transaction is confirmed or rejected, or until `timeout` number of rounds have passed. +**`Throws`** + +Throws an error if the transaction is not confirmed or rejected in the next `timeout` rounds + #### Parameters | Name | Type | Description | @@ -2313,10 +2317,6 @@ number of rounds have passed. Pending transaction information -**`Throws`** - -Throws an error if the transaction is not confirmed or rejected in the next `timeout` rounds - #### Defined in [src/transaction.ts:340](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L340) diff --git a/docs/code/modules/testing.md b/docs/code/modules/testing.md index 0ca713a2..d7be3e1d 100644 --- a/docs/code/modules/testing.md +++ b/docs/code/modules/testing.md @@ -24,12 +24,6 @@ Creates a test fixture for capturing AlgoKit logs. -#### Returns - -[`AlgoKitLogCaptureFixture`](../interfaces/types_testing.AlgoKitLogCaptureFixture.md) - -The fixture - **`Example`** ```typescript @@ -43,6 +37,12 @@ test('My test', () => { }) ``` +#### Returns + +[`AlgoKitLogCaptureFixture`](../interfaces/types_testing.AlgoKitLogCaptureFixture.md) + +The fixture + #### Defined in [src/testing/fixtures/algokit-log-capture-fixture.ts:21](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/fixtures/algokit-log-capture-fixture.ts#L21) @@ -59,18 +59,6 @@ By default it tests against an environment variable specified client a default LocalNet instance, but you can pass in an algod, indexer and/or kmd if you want to test against an explicitly defined network. -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `fixtureConfig?` | [`AlgorandFixtureConfig`](../interfaces/types_testing.AlgorandFixtureConfig.md) | The fixture configuration | - -#### Returns - -[`AlgorandFixture`](../interfaces/types_testing.AlgorandFixture.md) - -The fixture - **`Example`** ```typescript @@ -84,6 +72,18 @@ test('My test', async () => { }) ``` +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `fixtureConfig?` | [`AlgorandFixtureConfig`](../interfaces/types_testing.AlgorandFixtureConfig.md) | The fixture configuration | + +#### Returns + +[`AlgorandFixture`](../interfaces/types_testing.AlgorandFixture.md) + +The fixture + #### Defined in [src/testing/fixtures/algorand-fixture.ts:35](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/fixtures/algorand-fixture.ts#L35) @@ -96,19 +96,6 @@ By default it tests against an environment variable specified client a default LocalNet instance, but you can pass in an algod, indexer and/or kmd if you want to test against an explicitly defined network. -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `fixtureConfig` | `undefined` \| [`AlgorandFixtureConfig`](../interfaces/types_testing.AlgorandFixtureConfig.md) | The fixture configuration | -| `config` | [`AlgoConfig`](../interfaces/types_network_client.AlgoConfig.md) | The algo configuration | - -#### Returns - -[`AlgorandFixture`](../interfaces/types_testing.AlgorandFixture.md) - -The fixture - **`Example`** ```typescript @@ -122,6 +109,19 @@ test('My test', async () => { }) ``` +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `fixtureConfig` | `undefined` \| [`AlgorandFixtureConfig`](../interfaces/types_testing.AlgorandFixtureConfig.md) | The fixture configuration | +| `config` | [`AlgoConfig`](../interfaces/types_network_client.AlgoConfig.md) | The algo configuration | + +#### Returns + +[`AlgorandFixture`](../interfaces/types_testing.AlgorandFixture.md) + +The fixture + #### Defined in [src/testing/fixtures/algorand-fixture.ts:59](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/fixtures/algorand-fixture.ts#L59) @@ -165,6 +165,12 @@ Runs the given indexer call until a 404 error is no longer returned. Tried every 200ms up to 20 times. Very rudimentary implementation designed for automated testing. +**`Example`** + +```typescript +const transaction = await runWhenIndexerCaughtUp(() => indexer.lookupTransactionByID(txnId).do()) +``` + #### Type parameters | Name | @@ -183,12 +189,6 @@ Very rudimentary implementation designed for automated testing. The result (as a promise), or throws if the indexer didn't catch up in time -**`Example`** - -```typescript -const transaction = await runWhenIndexerCaughtUp(() => indexer.lookupTransactionByID(txnId).do()) -``` - #### Defined in [src/testing/indexer.ts:11](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/indexer.ts#L11) diff --git a/src/account.ts b/src/account.ts index b09685d6..5b949665 100644 --- a/src/account.ts +++ b/src/account.ts @@ -232,8 +232,7 @@ export async function mnemonicAccountFromEnvironment( algod: Algodv2, kmdClient?: Kmd, ): Promise { - const { name, fundWith } = - typeof account === 'string' ? { name: account, fundWith: undefined } : { name: account.name, fundWith: account.fundWith } + const { name, fundWith } = typeof account === 'string' ? { name: account, fundWith: undefined } : account // todo: When eventually removing this method, inline it here const config = getAccountConfigFromEnvironment(name)