diff --git a/docs/code/classes/types_app_manager.AppManager.md b/docs/code/classes/types_app_manager.AppManager.md index 886bf0e4..9ac12e2a 100644 --- a/docs/code/classes/types_app_manager.AppManager.md +++ b/docs/code/classes/types_app_manager.AppManager.md @@ -179,7 +179,7 @@ Returns the value of the given box name for the given app. | Name | Type | Description | | :------ | :------ | :------ | | `appId` | `bigint` | The ID of the app return box names for | -| `boxName` | [`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) | The name of the box to return either as a string, binary array or `BoxName` | +| `boxName` | [`BoxName`](../interfaces/types_app.BoxName.md) \| [`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) | The name of the box to return either as a string, binary array or `BoxName` | #### Returns @@ -213,7 +213,7 @@ The current box value as an ABI value #### Defined in -[src/types/app-manager.ts:277](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L277) +[src/types/app-manager.ts:278](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L278) ___ @@ -228,7 +228,7 @@ Returns the value of the given box names for the given app. | Name | Type | Description | | :------ | :------ | :------ | | `appId` | `bigint` | The ID of the app return box names for | -| `boxNames` | [`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier)[] | The names of the boxes to return either as a string, binary array or `BoxName` | +| `boxNames` | ([`BoxName`](../interfaces/types_app.BoxName.md) \| [`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier))[] | The names of the boxes to return either as a string, binary array or `BoxName` | #### Returns @@ -238,7 +238,7 @@ The current box values as a byte array in the same order as the passed in box na #### Defined in -[src/types/app-manager.ts:268](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L268) +[src/types/app-manager.ts:269](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L269) ___ @@ -262,7 +262,7 @@ The current box values as an ABI value in the same order as the passed in box na #### Defined in -[src/types/app-manager.ts:288](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L288) +[src/types/app-manager.ts:289](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L289) ___ @@ -391,7 +391,7 @@ An object keyeed by the UTF-8 representation of the key with various parsings of #### Defined in -[src/types/app-manager.ts:312](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L312) +[src/types/app-manager.ts:313](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L313) ___ @@ -416,7 +416,7 @@ The return value for the method call #### Defined in -[src/types/app-manager.ts:361](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L361) +[src/types/app-manager.ts:362](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L362) ___ @@ -440,7 +440,7 @@ The box reference ready to pass into a `algosdk.Transaction` #### Defined in -[src/types/app-manager.ts:298](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L298) +[src/types/app-manager.ts:299](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L299) ___ @@ -473,7 +473,7 @@ The replaced TEAL code #### Defined in -[src/types/app-manager.ts:391](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L391) +[src/types/app-manager.ts:392](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L392) ___ @@ -500,7 +500,7 @@ The TEAL code with replacements #### Defined in -[src/types/app-manager.ts:422](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L422) +[src/types/app-manager.ts:423](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L423) ___ @@ -524,4 +524,4 @@ The TEAL without comments #### Defined in -[src/types/app-manager.ts:457](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L457) +[src/types/app-manager.ts:458](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L458) diff --git a/package-lock.json b/package-lock.json index defde9e9..4be06dc8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6652,9 +6652,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { diff --git a/src/types/app-manager.ts b/src/types/app-manager.ts index 11eb493a..673d090c 100644 --- a/src/types/app-manager.ts +++ b/src/types/app-manager.ts @@ -253,8 +253,9 @@ export class AppManager { * @param boxName The name of the box to return either as a string, binary array or `BoxName` * @returns The current box value as a byte array */ - public async getBoxValue(appId: bigint, boxName: BoxIdentifier): Promise { - const name = AppManager.getBoxReference(boxName).name + public async getBoxValue(appId: bigint, boxName: BoxIdentifier | BoxName): Promise { + const boxId = typeof boxName === 'object' && 'nameRaw' in boxName ? boxName.nameRaw : boxName + const name = AppManager.getBoxReference(boxId).name const boxResult = await this._algod.getApplicationBoxByName(Number(appId), name).do() return boxResult.value } @@ -265,7 +266,7 @@ export class AppManager { * @param boxNames The names of the boxes to return either as a string, binary array or `BoxName` * @returns The current box values as a byte array in the same order as the passed in box names */ - public async getBoxValues(appId: bigint, boxNames: BoxIdentifier[]): Promise { + public async getBoxValues(appId: bigint, boxNames: (BoxIdentifier | BoxName)[]): Promise { return await Promise.all(boxNames.map(async (boxName) => await this.getBoxValue(appId, boxName))) }