From cc49c243f629c8b52fb87d0276ab8b211246ee54 Mon Sep 17 00:00:00 2001 From: "Rob Moore (MakerX)" Date: Sat, 20 Apr 2024 21:27:57 +0800 Subject: [PATCH] fix: Resolving incorrect lack of `return` in some methods within `AccountManager` --- .../types_account_manager.AccountManager.md | 20 +++++++++---------- src/types/account-manager.ts | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/code/classes/types_account_manager.AccountManager.md b/docs/code/classes/types_account_manager.AccountManager.md index ac2800fe..7fd66991 100644 --- a/docs/code/classes/types_account_manager.AccountManager.md +++ b/docs/code/classes/types_account_manager.AccountManager.md @@ -97,13 +97,13 @@ ___ ### dispenser -▸ **dispenser**(): `Promise`\<`void`\> +▸ **dispenser**(): `Promise`\<[`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) & \{ `account`: `default` \| [`SigningAccount`](types_account.SigningAccount.md) }\> Returns an account (with private key loaded) that can act as a dispenser. #### Returns -`Promise`\<`void`\> +`Promise`\<[`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) & \{ `account`: `default` \| [`SigningAccount`](types_account.SigningAccount.md) }\> The account @@ -123,7 +123,7 @@ ___ ### fromEnvironment -▸ **fromEnvironment**(`name`, `fundWith?`): `Promise`\<`void`\> +▸ **fromEnvironment**(`name`, `fundWith?`): `Promise`\<[`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) & \{ `account`: `default` \| [`SigningAccount`](types_account.SigningAccount.md) }\> Tracks and returns an Algorand account with private key loaded by convention from environment variables based on the given name identifier. @@ -146,7 +146,7 @@ This allows you to write code that will work seamlessly in production and local #### Returns -`Promise`\<`void`\> +`Promise`\<[`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) & \{ `account`: `default` \| [`SigningAccount`](types_account.SigningAccount.md) }\> The account @@ -352,13 +352,13 @@ ___ ### localNetDispenser -▸ **localNetDispenser**(): `Promise`\<`void`\> +▸ **localNetDispenser**(): `Promise`\<[`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) & \{ `account`: `default` }\> Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts). #### Returns -`Promise`\<`void`\> +`Promise`\<[`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) & \{ `account`: `default` }\> The account @@ -376,7 +376,7 @@ ___ ### logicsig -▸ **logicsig**(`program`, `args?`): `void` +▸ **logicsig**(`program`, `args?`): [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) & \{ `account`: `LogicSigAccount` } Tracks and returns an account that represents a logic signature. @@ -389,7 +389,7 @@ Tracks and returns an account that represents a logic signature. #### Returns -`void` +[`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) & \{ `account`: `LogicSigAccount` } A logic signature account wrapper @@ -439,13 +439,13 @@ ___ ### random -▸ **random**(): `void` +▸ **random**(): [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) & \{ `account`: `default` } Tracks and returns a new, random Algorand account with secret key loaded. #### Returns -`void` +[`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) & \{ `account`: `default` } The account diff --git a/src/types/account-manager.ts b/src/types/account-manager.ts index 9e385056..a8b6ac9b 100644 --- a/src/types/account-manager.ts +++ b/src/types/account-manager.ts @@ -187,7 +187,7 @@ export class AccountManager { * @returns The account */ public async fromEnvironment(name: string, fundWith?: AlgoAmount) { - this.signerAccount(await mnemonicAccountFromEnvironment({ name, fundWith }, this._clientManager.algod, this._clientManager.kmd)) + return this.signerAccount(await mnemonicAccountFromEnvironment({ name, fundWith }, this._clientManager.algod, this._clientManager.kmd)) } /** @@ -244,7 +244,7 @@ export class AccountManager { * @returns A logic signature account wrapper */ public logicsig(program: Uint8Array, args?: Array) { - this.signerAccount(new LogicSigAccount(program, args)) + return this.signerAccount(new LogicSigAccount(program, args)) } /** @@ -257,7 +257,7 @@ export class AccountManager { * @returns The account */ public random() { - this.signerAccount(randomAccount()) + return this.signerAccount(randomAccount()) } /** @@ -272,7 +272,7 @@ export class AccountManager { * @returns The account */ public async dispenser() { - this.signerAccount(await getDispenserAccount(this._clientManager.algod, this._clientManager.kmd)) + return this.signerAccount(await getDispenserAccount(this._clientManager.algod, this._clientManager.kmd)) } /** @@ -285,6 +285,6 @@ export class AccountManager { * @returns The account */ public async localNetDispenser() { - this.signerAccount(await getLocalNetDispenserAccount(this._clientManager.algod, this._clientManager.kmd)) + return this.signerAccount(await getLocalNetDispenserAccount(this._clientManager.algod, this._clientManager.kmd)) } }