@algorandfoundation/algokit-utils 8.2.0-beta.1 → 8.2.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/package.json +3 -2
  2. package/types/account-manager.d.ts +33 -18
  3. package/types/account-manager.js +33 -18
  4. package/types/account-manager.js.map +1 -1
  5. package/types/account-manager.mjs +33 -18
  6. package/types/account-manager.mjs.map +1 -1
  7. package/types/account.d.ts +5 -0
  8. package/types/account.js +5 -0
  9. package/types/account.js.map +1 -1
  10. package/types/account.mjs +5 -0
  11. package/types/account.mjs.map +1 -1
  12. package/types/algorand-client-transaction-creator.d.ts +103 -70
  13. package/types/algorand-client-transaction-creator.js +103 -70
  14. package/types/algorand-client-transaction-creator.js.map +1 -1
  15. package/types/algorand-client-transaction-creator.mjs +103 -70
  16. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  17. package/types/algorand-client-transaction-sender.d.ts +107 -20
  18. package/types/algorand-client-transaction-sender.js +107 -21
  19. package/types/algorand-client-transaction-sender.js.map +1 -1
  20. package/types/algorand-client-transaction-sender.mjs +107 -21
  21. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  22. package/types/algorand-client.d.ts +108 -24
  23. package/types/algorand-client.js +107 -23
  24. package/types/algorand-client.js.map +1 -1
  25. package/types/algorand-client.mjs +107 -23
  26. package/types/algorand-client.mjs.map +1 -1
  27. package/types/amount.d.ts +10 -0
  28. package/types/amount.js +10 -0
  29. package/types/amount.js.map +1 -1
  30. package/types/amount.mjs +10 -0
  31. package/types/amount.mjs.map +1 -1
  32. package/types/app-client.d.ts +128 -8
  33. package/types/app-client.js +131 -8
  34. package/types/app-client.js.map +1 -1
  35. package/types/app-client.mjs +131 -8
  36. package/types/app-client.mjs.map +1 -1
  37. package/types/app-deployer.d.ts +33 -1
  38. package/types/app-deployer.js +33 -1
  39. package/types/app-deployer.js.map +1 -1
  40. package/types/app-deployer.mjs +33 -1
  41. package/types/app-deployer.mjs.map +1 -1
  42. package/types/app-factory.d.ts +74 -4
  43. package/types/app-factory.js +74 -4
  44. package/types/app-factory.js.map +1 -1
  45. package/types/app-factory.mjs +74 -4
  46. package/types/app-factory.mjs.map +1 -1
  47. package/types/app-manager.d.ts +64 -0
  48. package/types/app-manager.js +64 -0
  49. package/types/app-manager.js.map +1 -1
  50. package/types/app-manager.mjs +64 -0
  51. package/types/app-manager.mjs.map +1 -1
  52. package/types/app-spec.d.ts +9 -0
  53. package/types/app-spec.js +9 -0
  54. package/types/app-spec.js.map +1 -1
  55. package/types/app-spec.mjs +9 -0
  56. package/types/app-spec.mjs.map +1 -1
  57. package/types/asset-manager.d.ts +5 -5
  58. package/types/asset-manager.js +5 -5
  59. package/types/asset-manager.js.map +1 -1
  60. package/types/asset-manager.mjs +5 -5
  61. package/types/asset-manager.mjs.map +1 -1
  62. package/types/client-manager.d.ts +79 -18
  63. package/types/client-manager.js +79 -18
  64. package/types/client-manager.js.map +1 -1
  65. package/types/client-manager.mjs +79 -18
  66. package/types/client-manager.mjs.map +1 -1
  67. package/types/composer.d.ts +599 -1
  68. package/types/composer.js +575 -1
  69. package/types/composer.js.map +1 -1
  70. package/types/composer.mjs +575 -1
  71. package/types/composer.mjs.map +1 -1
@@ -60,13 +60,27 @@ export declare class ClientManager {
60
60
  * ```
61
61
  */
62
62
  constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClientInterface);
63
- /** Returns an algosdk Algod API client. */
63
+ /**
64
+ * Returns an algosdk Algod API client.
65
+ * @returns The Algod client
66
+ */
64
67
  get algod(): algosdk.Algodv2;
65
- /** Returns an algosdk Indexer API client or throws an error if it's not been provided. */
68
+ /**
69
+ * Returns an algosdk Indexer API client or throws an error if it's not been provided.
70
+ * @returns The Indexer client
71
+ * @throws Error if no Indexer client is configured
72
+ */
66
73
  get indexer(): algosdk.Indexer;
67
- /** Returns an algosdk Indexer API client or `undefined` if it's not been provided. */
74
+ /**
75
+ * Returns an algosdk Indexer API client or `undefined` if it's not been provided.
76
+ * @returns The Indexer client or `undefined`
77
+ */
68
78
  get indexerIfPresent(): algosdk.Indexer | undefined;
69
- /** Returns an algosdk KMD API client or throws an error if it's not been provided. */
79
+ /**
80
+ * Returns an algosdk KMD API client or throws an error if it's not been provided.
81
+ * @returns The KMD client
82
+ * @throws Error if no KMD client is configured
83
+ */
70
84
  get kmd(): algosdk.Kmd;
71
85
  private _getNetworkPromise;
72
86
  /**
@@ -83,21 +97,37 @@ export declare class ClientManager {
83
97
  * Returns true if the given network genesisId is associated with a LocalNet network.
84
98
  * @param genesisId The network genesis ID
85
99
  * @returns Whether the given genesis ID is associated with a LocalNet network
100
+ * @example
101
+ * ```typescript
102
+ * const isLocalNet = ClientManager.genesisIdIsLocalNet('testnet-v1.0')
103
+ * ```
86
104
  */
87
105
  static genesisIdIsLocalNet(genesisId: string): boolean;
88
106
  /**
89
107
  * Returns true if the current network is LocalNet.
90
108
  * @returns True if the current network is LocalNet.
109
+ * @example
110
+ * ```typescript
111
+ * const isLocalNet = await clientManager.isLocalNet()
112
+ * ```
91
113
  */
92
114
  isLocalNet(): Promise<boolean>;
93
115
  /**
94
116
  * Returns true if the current network is TestNet.
95
117
  * @returns True if the current network is TestNet.
118
+ * @example
119
+ * ```typescript
120
+ * const isTestNet = await clientManager.isTestNet()
121
+ * ```
96
122
  */
97
123
  isTestNet(): Promise<boolean>;
98
124
  /**
99
125
  * Returns true if the current network is MainNet.
100
126
  * @returns True if the current network is MainNet.
127
+ * @example
128
+ * ```typescript
129
+ * const isMainNet = await clientManager.isMainNet()
130
+ * ```
101
131
  */
102
132
  isMainNet(): Promise<boolean>;
103
133
  /**
@@ -135,15 +165,16 @@ export declare class ClientManager {
135
165
  getTestNetDispenserFromEnvironment(params?: Omit<TestNetDispenserApiClientParams, 'authToken'>): TestNetDispenserApiClient;
136
166
  /**
137
167
  * Returns a new `AppFactory` client
168
+ * @param params The parameters to create the app factory
138
169
  * @example Basic example
139
170
  * ```typescript
140
- * const factory = algorand.client.getAppFactory({
171
+ * const factory = clientManager.getAppFactory({
141
172
  * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\/}',
142
173
  * })
143
174
  * ```
144
175
  * @example Advanced example
145
176
  * ```typescript
146
- * const factory = algorand.client.getAppFactory({
177
+ * const factory = clientManager.getAppFactory({
147
178
  * appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,
148
179
  * defaultSender: "SENDERADDRESS",
149
180
  * appName: "OverriddenAppName",
@@ -153,6 +184,7 @@ export declare class ClientManager {
153
184
  * deployTimeParams: { ONE: 1, TWO: 'value' }
154
185
  * })
155
186
  * ```
187
+ * @returns The `AppFactory` instance
156
188
  */
157
189
  getAppFactory(params: ClientAppFactoryParams): AppFactory;
158
190
  /**
@@ -162,13 +194,13 @@ export declare class ClientManager {
162
194
  * @param params The parameters to create the app client
163
195
  * @example Basic
164
196
  * ```typescript
165
- * const appClient = algorand.client.getAppClientByCreatorAndName({
197
+ * const appClient = clientManager.getAppClientByCreatorAndName({
166
198
  * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
167
199
  * // appId resolved by looking for app ID of named app by this creator
168
200
  * creatorAddress: 'CREATORADDRESS',
169
201
  * })
170
202
  * ```
171
- * @returns The `AppClient`
203
+ * @returns The `AppClient` instance
172
204
  */
173
205
  getAppClientByCreatorAndName(params: ClientResolveAppClientByCreatorAndNameParams): Promise<AppClient>;
174
206
  /**
@@ -176,12 +208,12 @@ export declare class ClientManager {
176
208
  * @param params The parameters to create the app client
177
209
  * @example Basic
178
210
  * ```typescript
179
- * const appClient = algorand.client.getAppClientById({
211
+ * const appClient = clientManager.getAppClientById({
180
212
  * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
181
213
  * appId: 12345n,
182
214
  * })
183
215
  * ```
184
- * @returns The `AppClient`
216
+ * @returns The `AppClient` instance
185
217
  */
186
218
  getAppClientById(params: ClientAppClientParams): AppClient;
187
219
  /**
@@ -193,12 +225,12 @@ export declare class ClientManager {
193
225
  * @param params The parameters to create the app client
194
226
  * @example Basic
195
227
  * ```typescript
196
- * const appClient = algorand.client.getAppClientByNetwork({
228
+ * const appClient = clientManager.getAppClientByNetwork({
197
229
  * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
198
230
  * // appId resolved by using ARC-56 spec to find app ID for current network
199
231
  * })
200
232
  * ```
201
- * @returns The `AppClient`
233
+ * @returns The `AppClient` instance
202
234
  */
203
235
  getAppClientByNetwork(params: ClientAppClientByNetworkParams): Promise<AppClient>;
204
236
  /**
@@ -207,14 +239,14 @@ export declare class ClientManager {
207
239
  * @param params The params to resolve the app by creator address and name
208
240
  * @example Use name in ARC-32 / ARC-56 app spec
209
241
  * ```typescript
210
- * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
242
+ * const appClient = clientManager.getTypedAppClientByCreatorAndName(MyContractClient, {
211
243
  * creatorAddress: "CREATORADDRESS",
212
244
  * defaultSender: alice,
213
245
  * })
214
246
  * ```
215
247
  * @example Specify name
216
248
  * ```typescript
217
- * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
249
+ * const appClient = clientManager.getTypedAppClientByCreatorAndName(MyContractClient, {
218
250
  * creatorAddress: "CREATORADDRESS",
219
251
  * name: "contract-name",
220
252
  * defaultSender: alice,
@@ -229,7 +261,7 @@ export declare class ClientManager {
229
261
  * @param params The params to resolve the app by ID
230
262
  * @example
231
263
  * ```typescript
232
- * const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
264
+ * const appClient = clientManager.getTypedAppClientById(MyContractClient, {
233
265
  * appId: 12345n,
234
266
  * defaultSender: alice,
235
267
  * })
@@ -246,7 +278,7 @@ export declare class ClientManager {
246
278
  * @param params The params to resolve the app by network
247
279
  * @example
248
280
  * ```typescript
249
- * const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {
281
+ * const appClient = clientManager.getTypedAppClientByNetwork(MyContractClient, {
250
282
  * defaultSender: alice,
251
283
  * })
252
284
  * ```
@@ -259,7 +291,7 @@ export declare class ClientManager {
259
291
  * @param params The params to resolve the factory by
260
292
  * @example
261
293
  * ```typescript
262
- * const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {
294
+ * const appFactory = clientManager.getTypedAppFactory(MyContractClient, {
263
295
  * sender: alice,
264
296
  * })
265
297
  * ```
@@ -284,32 +316,56 @@ export declare class ClientManager {
284
316
  * @returns The config for algod, indexer and kmd
285
317
  */
286
318
  static getConfigFromEnvironmentOrLocalNet(): AlgoConfig;
287
- /** Retrieve the algod configuration from environment variables (expects to be called from a Node.js environment)
319
+ /**
320
+ * Retrieve the algod configuration from environment variables (expects to be called from a Node.js environment)
288
321
  *
289
322
  * Expects `process.env.ALGOD_SERVER` to be defined, and you can also specify `process.env.ALGOD_PORT` and `process.env.ALGOD_TOKEN`.
323
+ * @returns The Algod client configuration
324
+ * @throws Error if `process.env.ALGOD_SERVER` is not defined
325
+ * @example
326
+ * ```typescript
327
+ * const config = ClientManager.getAlgodConfigFromEnvironment()
328
+ * ```
290
329
  */
291
330
  static getAlgodConfigFromEnvironment(): AlgoClientConfig;
292
331
  /**
293
332
  * Retrieve the indexer configuration from environment variables (expects to be called from a Node.js environment).
294
333
  *
295
334
  * Expects `process.env.INDEXER_SERVER` to be defined, and you can also specify `process.env.INDEXER_PORT` and `process.env.INDEXER_TOKEN`.
335
+ * @returns The Indexer client configuration
336
+ * @throws Error if `process.env.INDEXER_SERVER` is not defined
337
+ * @example
338
+ * ```typescript
339
+ * const config = ClientManager.getIndexerConfigFromEnvironment()
340
+ * ```
296
341
  */
297
342
  static getIndexerConfigFromEnvironment(): AlgoClientConfig;
298
343
  /** Returns the Algorand configuration to point to the free tier of the AlgoNode service.
299
344
  *
300
345
  * @param network Which network to connect to - TestNet or MainNet
301
346
  * @param config Which algod config to return - Algod or Indexer
347
+ * @returns The AlgoNode client configuration
348
+ * @example
349
+ * ```typescript
350
+ * const config = ClientManager.getAlgoNodeConfig('testnet', 'algod')
351
+ * ```
302
352
  */
303
353
  static getAlgoNodeConfig(network: 'testnet' | 'mainnet', config: 'algod' | 'indexer'): AlgoClientConfig;
304
354
  /** Returns the Algorand configuration to point to the default LocalNet.
305
355
  *
306
356
  * @param configOrPort Which algod config to return - algod, kmd, or indexer OR a port number
357
+ * @returns The LocalNet client configuration
358
+ * @example
359
+ * ```typescript
360
+ * const config = ClientManager.getDefaultLocalNetConfig('algod')
361
+ * ```
307
362
  */
308
363
  static getDefaultLocalNetConfig(configOrPort: 'algod' | 'indexer' | 'kmd' | number): AlgoClientConfig;
309
364
  /**
310
365
  * Returns an algod SDK client that automatically retries on idempotent calls.
311
366
  *
312
367
  * @param config The config of the client
368
+ * @returns The Algod client
313
369
  * @example AlgoNode (testnet)
314
370
  * ```typescript
315
371
  * const algod = ClientManager.getAlgodClient(ClientManager.getAlgoNodeConfig('testnet', 'algod'))
@@ -330,6 +386,7 @@ export declare class ClientManager {
330
386
  /**
331
387
  * Returns an algod SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
332
388
  *
389
+ * @returns The Algod client
333
390
  * @example
334
391
  * ```typescript
335
392
  * // Uses process.env.ALGOD_SERVER, process.env.ALGOD_PORT and process.env.ALGOD_TOKEN
@@ -342,6 +399,7 @@ export declare class ClientManager {
342
399
  * Returns an indexer SDK client that automatically retries on idempotent calls
343
400
  *
344
401
  * @param config The config of the client
402
+ * @returns The Indexer client
345
403
  * @example AlgoNode (testnet)
346
404
  * ```typescript
347
405
  * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('testnet', 'indexer'))
@@ -362,6 +420,7 @@ export declare class ClientManager {
362
420
  /**
363
421
  * Returns an indexer SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
364
422
  *
423
+ * @returns The Indexer client
365
424
  * @example
366
425
  *
367
426
  * ```typescript
@@ -377,6 +436,7 @@ export declare class ClientManager {
377
436
  * KMD client allows you to export private keys, which is useful to (for instance) get the default account in a LocalNet network.
378
437
  *
379
438
  * @param config The config for the client
439
+ * @returns The KMD client
380
440
  * @example Custom (e.g. default LocalNet, although we recommend loading this into a .env and using the Default option instead)
381
441
  * ```typescript
382
442
  * const kmd = ClientManager.getKmdClient({server: 'http://localhost', port: '4002', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})
@@ -386,6 +446,7 @@ export declare class ClientManager {
386
446
  /**
387
447
  * Returns a KMD SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
388
448
  *
449
+ * @returns The KMD client
389
450
  * @example
390
451
  * ```typescript
391
452
  * // Uses process.env.ALGOD_SERVER, process.env.KMD_PORT (or if not specified: port 4002) and process.env.ALGOD_TOKEN
@@ -44,21 +44,35 @@ class ClientManager {
44
44
  this._kmd = _clients.kmd;
45
45
  this._algorand = algorandClient;
46
46
  }
47
- /** Returns an algosdk Algod API client. */
47
+ /**
48
+ * Returns an algosdk Algod API client.
49
+ * @returns The Algod client
50
+ */
48
51
  get algod() {
49
52
  return this._algod;
50
53
  }
51
- /** Returns an algosdk Indexer API client or throws an error if it's not been provided. */
54
+ /**
55
+ * Returns an algosdk Indexer API client or throws an error if it's not been provided.
56
+ * @returns The Indexer client
57
+ * @throws Error if no Indexer client is configured
58
+ */
52
59
  get indexer() {
53
60
  if (!this._indexer)
54
61
  throw new Error('Attempt to use Indexer client in AlgoKit instance with no Indexer configured');
55
62
  return this._indexer;
56
63
  }
57
- /** Returns an algosdk Indexer API client or `undefined` if it's not been provided. */
64
+ /**
65
+ * Returns an algosdk Indexer API client or `undefined` if it's not been provided.
66
+ * @returns The Indexer client or `undefined`
67
+ */
58
68
  get indexerIfPresent() {
59
69
  return this._indexer;
60
70
  }
61
- /** Returns an algosdk KMD API client or throws an error if it's not been provided. */
71
+ /**
72
+ * Returns an algosdk KMD API client or throws an error if it's not been provided.
73
+ * @returns The KMD client
74
+ * @throws Error if no KMD client is configured
75
+ */
62
76
  get kmd() {
63
77
  if (!this._kmd)
64
78
  throw new Error('Attempt to use Kmd client in AlgoKit instance with no Kmd configured');
@@ -90,6 +104,10 @@ class ClientManager {
90
104
  * Returns true if the given network genesisId is associated with a LocalNet network.
91
105
  * @param genesisId The network genesis ID
92
106
  * @returns Whether the given genesis ID is associated with a LocalNet network
107
+ * @example
108
+ * ```typescript
109
+ * const isLocalNet = ClientManager.genesisIdIsLocalNet('testnet-v1.0')
110
+ * ```
93
111
  */
94
112
  static genesisIdIsLocalNet(genesisId) {
95
113
  return types_networkClient.genesisIdIsLocalNet(genesisId);
@@ -97,6 +115,10 @@ class ClientManager {
97
115
  /**
98
116
  * Returns true if the current network is LocalNet.
99
117
  * @returns True if the current network is LocalNet.
118
+ * @example
119
+ * ```typescript
120
+ * const isLocalNet = await clientManager.isLocalNet()
121
+ * ```
100
122
  */
101
123
  async isLocalNet() {
102
124
  return (await this.network()).isLocalNet;
@@ -104,6 +126,10 @@ class ClientManager {
104
126
  /**
105
127
  * Returns true if the current network is TestNet.
106
128
  * @returns True if the current network is TestNet.
129
+ * @example
130
+ * ```typescript
131
+ * const isTestNet = await clientManager.isTestNet()
132
+ * ```
107
133
  */
108
134
  async isTestNet() {
109
135
  return (await this.network()).isTestNet;
@@ -111,6 +137,10 @@ class ClientManager {
111
137
  /**
112
138
  * Returns true if the current network is MainNet.
113
139
  * @returns True if the current network is MainNet.
140
+ * @example
141
+ * ```typescript
142
+ * const isMainNet = await clientManager.isMainNet()
143
+ * ```
114
144
  */
115
145
  async isMainNet() {
116
146
  return (await this.network()).isMainNet;
@@ -154,15 +184,16 @@ class ClientManager {
154
184
  }
155
185
  /**
156
186
  * Returns a new `AppFactory` client
187
+ * @param params The parameters to create the app factory
157
188
  * @example Basic example
158
189
  * ```typescript
159
- * const factory = algorand.client.getAppFactory({
190
+ * const factory = clientManager.getAppFactory({
160
191
  * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\/}',
161
192
  * })
162
193
  * ```
163
194
  * @example Advanced example
164
195
  * ```typescript
165
- * const factory = algorand.client.getAppFactory({
196
+ * const factory = clientManager.getAppFactory({
166
197
  * appSpec: parsedAppSpec_AppSpec_or_Arc56Contract,
167
198
  * defaultSender: "SENDERADDRESS",
168
199
  * appName: "OverriddenAppName",
@@ -172,6 +203,7 @@ class ClientManager {
172
203
  * deployTimeParams: { ONE: 1, TWO: 'value' }
173
204
  * })
174
205
  * ```
206
+ * @returns The `AppFactory` instance
175
207
  */
176
208
  getAppFactory(params) {
177
209
  if (!this._algorand) {
@@ -186,13 +218,13 @@ class ClientManager {
186
218
  * @param params The parameters to create the app client
187
219
  * @example Basic
188
220
  * ```typescript
189
- * const appClient = algorand.client.getAppClientByCreatorAndName({
221
+ * const appClient = clientManager.getAppClientByCreatorAndName({
190
222
  * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
191
223
  * // appId resolved by looking for app ID of named app by this creator
192
224
  * creatorAddress: 'CREATORADDRESS',
193
225
  * })
194
226
  * ```
195
- * @returns The `AppClient`
227
+ * @returns The `AppClient` instance
196
228
  */
197
229
  getAppClientByCreatorAndName(params) {
198
230
  if (!this._algorand) {
@@ -208,12 +240,12 @@ class ClientManager {
208
240
  * @param params The parameters to create the app client
209
241
  * @example Basic
210
242
  * ```typescript
211
- * const appClient = algorand.client.getAppClientById({
243
+ * const appClient = clientManager.getAppClientById({
212
244
  * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
213
245
  * appId: 12345n,
214
246
  * })
215
247
  * ```
216
- * @returns The `AppClient`
248
+ * @returns The `AppClient` instance
217
249
  */
218
250
  getAppClientById(params) {
219
251
  if (!this._algorand) {
@@ -230,12 +262,12 @@ class ClientManager {
230
262
  * @param params The parameters to create the app client
231
263
  * @example Basic
232
264
  * ```typescript
233
- * const appClient = algorand.client.getAppClientByNetwork({
265
+ * const appClient = clientManager.getAppClientByNetwork({
234
266
  * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}',
235
267
  * // appId resolved by using ARC-56 spec to find app ID for current network
236
268
  * })
237
269
  * ```
238
- * @returns The `AppClient`
270
+ * @returns The `AppClient` instance
239
271
  */
240
272
  async getAppClientByNetwork(params) {
241
273
  if (!this._algorand) {
@@ -249,14 +281,14 @@ class ClientManager {
249
281
  * @param params The params to resolve the app by creator address and name
250
282
  * @example Use name in ARC-32 / ARC-56 app spec
251
283
  * ```typescript
252
- * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
284
+ * const appClient = clientManager.getTypedAppClientByCreatorAndName(MyContractClient, {
253
285
  * creatorAddress: "CREATORADDRESS",
254
286
  * defaultSender: alice,
255
287
  * })
256
288
  * ```
257
289
  * @example Specify name
258
290
  * ```typescript
259
- * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
291
+ * const appClient = clientManager.getTypedAppClientByCreatorAndName(MyContractClient, {
260
292
  * creatorAddress: "CREATORADDRESS",
261
293
  * name: "contract-name",
262
294
  * defaultSender: alice,
@@ -276,7 +308,7 @@ class ClientManager {
276
308
  * @param params The params to resolve the app by ID
277
309
  * @example
278
310
  * ```typescript
279
- * const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
311
+ * const appClient = clientManager.getTypedAppClientById(MyContractClient, {
280
312
  * appId: 12345n,
281
313
  * defaultSender: alice,
282
314
  * })
@@ -298,7 +330,7 @@ class ClientManager {
298
330
  * @param params The params to resolve the app by network
299
331
  * @example
300
332
  * ```typescript
301
- * const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, {
333
+ * const appClient = clientManager.getTypedAppClientByNetwork(MyContractClient, {
302
334
  * defaultSender: alice,
303
335
  * })
304
336
  * ```
@@ -316,7 +348,7 @@ class ClientManager {
316
348
  * @param params The params to resolve the factory by
317
349
  * @example
318
350
  * ```typescript
319
- * const appFactory = algorand.client.getTypedAppFactory(MyContractClient, {
351
+ * const appFactory = clientManager.getTypedAppFactory(MyContractClient, {
320
352
  * sender: alice,
321
353
  * })
322
354
  * ```
@@ -368,9 +400,16 @@ class ClientManager {
368
400
  kmdConfig,
369
401
  };
370
402
  }
371
- /** Retrieve the algod configuration from environment variables (expects to be called from a Node.js environment)
403
+ /**
404
+ * Retrieve the algod configuration from environment variables (expects to be called from a Node.js environment)
372
405
  *
373
406
  * Expects `process.env.ALGOD_SERVER` to be defined, and you can also specify `process.env.ALGOD_PORT` and `process.env.ALGOD_TOKEN`.
407
+ * @returns The Algod client configuration
408
+ * @throws Error if `process.env.ALGOD_SERVER` is not defined
409
+ * @example
410
+ * ```typescript
411
+ * const config = ClientManager.getAlgodConfigFromEnvironment()
412
+ * ```
374
413
  */
375
414
  static getAlgodConfigFromEnvironment() {
376
415
  if (!process || !process.env) {
@@ -389,6 +428,12 @@ class ClientManager {
389
428
  * Retrieve the indexer configuration from environment variables (expects to be called from a Node.js environment).
390
429
  *
391
430
  * Expects `process.env.INDEXER_SERVER` to be defined, and you can also specify `process.env.INDEXER_PORT` and `process.env.INDEXER_TOKEN`.
431
+ * @returns The Indexer client configuration
432
+ * @throws Error if `process.env.INDEXER_SERVER` is not defined
433
+ * @example
434
+ * ```typescript
435
+ * const config = ClientManager.getIndexerConfigFromEnvironment()
436
+ * ```
392
437
  */
393
438
  static getIndexerConfigFromEnvironment() {
394
439
  if (!process || !process.env) {
@@ -407,6 +452,11 @@ class ClientManager {
407
452
  *
408
453
  * @param network Which network to connect to - TestNet or MainNet
409
454
  * @param config Which algod config to return - Algod or Indexer
455
+ * @returns The AlgoNode client configuration
456
+ * @example
457
+ * ```typescript
458
+ * const config = ClientManager.getAlgoNodeConfig('testnet', 'algod')
459
+ * ```
410
460
  */
411
461
  static getAlgoNodeConfig(network, config) {
412
462
  return {
@@ -417,6 +467,11 @@ class ClientManager {
417
467
  /** Returns the Algorand configuration to point to the default LocalNet.
418
468
  *
419
469
  * @param configOrPort Which algod config to return - algod, kmd, or indexer OR a port number
470
+ * @returns The LocalNet client configuration
471
+ * @example
472
+ * ```typescript
473
+ * const config = ClientManager.getDefaultLocalNetConfig('algod')
474
+ * ```
420
475
  */
421
476
  static getDefaultLocalNetConfig(configOrPort) {
422
477
  return {
@@ -429,6 +484,7 @@ class ClientManager {
429
484
  * Returns an algod SDK client that automatically retries on idempotent calls.
430
485
  *
431
486
  * @param config The config of the client
487
+ * @returns The Algod client
432
488
  * @example AlgoNode (testnet)
433
489
  * ```typescript
434
490
  * const algod = ClientManager.getAlgodClient(ClientManager.getAlgoNodeConfig('testnet', 'algod'))
@@ -454,6 +510,7 @@ class ClientManager {
454
510
  /**
455
511
  * Returns an algod SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
456
512
  *
513
+ * @returns The Algod client
457
514
  * @example
458
515
  * ```typescript
459
516
  * // Uses process.env.ALGOD_SERVER, process.env.ALGOD_PORT and process.env.ALGOD_TOKEN
@@ -468,6 +525,7 @@ class ClientManager {
468
525
  * Returns an indexer SDK client that automatically retries on idempotent calls
469
526
  *
470
527
  * @param config The config of the client
528
+ * @returns The Indexer client
471
529
  * @example AlgoNode (testnet)
472
530
  * ```typescript
473
531
  * const indexer = ClientManager.getIndexerClient(ClientManager.getAlgoNodeConfig('testnet', 'indexer'))
@@ -493,6 +551,7 @@ class ClientManager {
493
551
  /**
494
552
  * Returns an indexer SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
495
553
  *
554
+ * @returns The Indexer client
496
555
  * @example
497
556
  *
498
557
  * ```typescript
@@ -510,6 +569,7 @@ class ClientManager {
510
569
  * KMD client allows you to export private keys, which is useful to (for instance) get the default account in a LocalNet network.
511
570
  *
512
571
  * @param config The config for the client
572
+ * @returns The KMD client
513
573
  * @example Custom (e.g. default LocalNet, although we recommend loading this into a .env and using the Default option instead)
514
574
  * ```typescript
515
575
  * const kmd = ClientManager.getKmdClient({server: 'http://localhost', port: '4002', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})
@@ -522,6 +582,7 @@ class ClientManager {
522
582
  /**
523
583
  * Returns a KMD SDK client that automatically retries on idempotent calls loaded from environment variables (expects to be called from a Node.js environment).
524
584
  *
585
+ * @returns The KMD client
525
586
  * @example
526
587
  * ```typescript
527
588
  * // Uses process.env.ALGOD_SERVER, process.env.KMD_PORT (or if not specified: port 4002) and process.env.ALGOD_TOKEN