Skip to content

Commit

Permalink
chore: minor typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Aug 25, 2023
1 parent b305e2a commit e6ab854
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 19 deletions.
37 changes: 27 additions & 10 deletions docs/code/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1016,17 +1016,34 @@ Create a new ApplicationClient instance
**`Example`**

```ts
const client = algokit.getAppClientById(
Resolve by creator and name
const client = algokit.getAppClient(
{
resolveBy: 'creatorAndName',
app: {appSpec},
sender: {account},
id: {id},
resolveBy: 'id'
creatorAddress: {creator},
findExistingUsing: indexerClient,
},
algod,
algodClient,
)
```

**`Example`**

```ts
Resolve by id:
const client = algokit.getAppClient(
{
resolveBy: 'id',
app: {appSpec},
sender: {account},
id: {id},
},
algodClient,
)
```

#### Parameters

| Name | Type | Description |
Expand All @@ -1042,7 +1059,7 @@ The application client

#### Defined in

[src/app-client.ts:20](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L20)
[src/app-client.ts:34](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L34)

___

Expand All @@ -1060,9 +1077,9 @@ const client = algokit.getAppClientByCreatorAndName(
app: {appSpec},
sender: {account},
creatorAddress: {account.addr},
findExistingUsing: {indexer},
findExistingUsing: {indexerClient},
},
algod,
algodClient,
)
```

Expand All @@ -1081,7 +1098,7 @@ The application client

#### Defined in

[src/app-client.ts:63](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L63)
[src/app-client.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L77)

___

Expand All @@ -1100,7 +1117,7 @@ const client = algokit.getAppClientById(
sender: {account},
id: {id},
},
algod,
algodClient,
)
```

Expand All @@ -1119,7 +1136,7 @@ The application client

#### Defined in

[src/app-client.ts:41](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L41)
[src/app-client.ts:55](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L55)

___

Expand Down
32 changes: 23 additions & 9 deletions src/app-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,31 @@ import { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetails
* Create a new ApplicationClient instance
* @param appDetails The details of the app
* @param algod An algod instance
* @returns The application client
* @example
* const client = algokit.getAppClientById(
*
* @example Resolve by creator and name
* const client = algokit.getAppClient(
* {
* resolveBy: 'creatorAndName',
* app: {appSpec},
* sender: {account},
* id: {id},
* resolveBy: 'id'
* creatorAddress: {creator},
* findExistingUsing: indexerClient,
* },
* algod,
* algodClient,
* )
*
* @example Resolve by id:
* const client = algokit.getAppClient(
* {
* resolveBy: 'id',
* app: {appSpec},
* sender: {account},
* id: {id},
* },
* algodClient,
* )
*
* @returns The application client
*/
export function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) {
return new ApplicationClient(appDetails, algod)
Expand All @@ -33,7 +47,7 @@ export function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) {
* sender: {account},
* id: {id},
* },
* algod,
* algodClient,
* )
*
* @returns The application client
Expand All @@ -53,9 +67,9 @@ export function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algod
* app: {appSpec},
* sender: {account},
* creatorAddress: {account.addr},
* findExistingUsing: {indexer},
* findExistingUsing: {indexerClient},
* },
* algod,
* algodClient,
* )
*
* @returns The application client
Expand Down

0 comments on commit e6ab854

Please sign in to comment.