algosdk 1.22.0 → 1.23.2

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 (106) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.map +1 -1
  4. package/dist/cjs/src/boxStorage.js +33 -0
  5. package/dist/cjs/src/boxStorage.js.map +1 -0
  6. package/dist/cjs/src/client/client.js +11 -9
  7. package/dist/cjs/src/client/client.js.map +1 -1
  8. package/dist/cjs/src/client/urlTokenBaseHTTPClient.js +93 -96
  9. package/dist/cjs/src/client/urlTokenBaseHTTPClient.js.map +1 -1
  10. package/dist/cjs/src/client/v2/algod/algod.js +38 -1
  11. package/dist/cjs/src/client/v2/algod/algod.js.map +1 -1
  12. package/dist/cjs/src/client/v2/algod/getApplicationBoxByName.js +44 -0
  13. package/dist/cjs/src/client/v2/algod/getApplicationBoxByName.js.map +1 -0
  14. package/dist/cjs/src/client/v2/algod/getApplicationBoxes.js +60 -0
  15. package/dist/cjs/src/client/v2/algod/getApplicationBoxes.js.map +1 -0
  16. package/dist/cjs/src/client/v2/algod/models/types.js +815 -42
  17. package/dist/cjs/src/client/v2/algod/models/types.js.map +1 -1
  18. package/dist/cjs/src/client/v2/{algod/models/base.js → basemodel.js} +1 -1
  19. package/dist/cjs/src/client/v2/basemodel.js.map +1 -0
  20. package/dist/cjs/src/client/v2/indexer/indexer.js +50 -0
  21. package/dist/cjs/src/client/v2/indexer/indexer.js.map +1 -1
  22. package/dist/cjs/src/client/v2/indexer/lookupApplicationBoxByIDandName.js +45 -0
  23. package/dist/cjs/src/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -0
  24. package/dist/cjs/src/client/v2/indexer/models/types.js +3077 -0
  25. package/dist/cjs/src/client/v2/indexer/models/types.js.map +1 -0
  26. package/dist/cjs/src/client/v2/indexer/searchForApplicationBoxes.js +99 -0
  27. package/dist/cjs/src/client/v2/indexer/searchForApplicationBoxes.js.map +1 -0
  28. package/dist/cjs/src/client/v2/jsonrequest.js +11 -1
  29. package/dist/cjs/src/client/v2/jsonrequest.js.map +1 -1
  30. package/dist/cjs/src/composer.js +4 -1
  31. package/dist/cjs/src/composer.js.map +1 -1
  32. package/dist/cjs/src/dryrun.js +1 -1
  33. package/dist/cjs/src/dryrun.js.map +1 -1
  34. package/dist/cjs/src/main.js +3 -2
  35. package/dist/cjs/src/main.js.map +1 -1
  36. package/dist/cjs/src/makeTxn.js +29 -14
  37. package/dist/cjs/src/makeTxn.js.map +1 -1
  38. package/dist/cjs/src/multisig.js +15 -25
  39. package/dist/cjs/src/multisig.js.map +1 -1
  40. package/dist/cjs/src/transaction.js +30 -0
  41. package/dist/cjs/src/transaction.js.map +1 -1
  42. package/dist/cjs/src/types/transactions/index.js.map +1 -1
  43. package/dist/esm/src/boxStorage.js +29 -0
  44. package/dist/esm/src/boxStorage.js.map +1 -0
  45. package/dist/esm/src/client/client.js +11 -9
  46. package/dist/esm/src/client/client.js.map +1 -1
  47. package/dist/esm/src/client/urlTokenBaseHTTPClient.js +93 -73
  48. package/dist/esm/src/client/urlTokenBaseHTTPClient.js.map +1 -1
  49. package/dist/esm/src/client/v2/algod/algod.js +38 -1
  50. package/dist/esm/src/client/v2/algod/algod.js.map +1 -1
  51. package/dist/esm/src/client/v2/algod/getApplicationBoxByName.js +38 -0
  52. package/dist/esm/src/client/v2/algod/getApplicationBoxByName.js.map +1 -0
  53. package/dist/esm/src/client/v2/algod/getApplicationBoxes.js +54 -0
  54. package/dist/esm/src/client/v2/algod/getApplicationBoxes.js.map +1 -0
  55. package/dist/esm/src/client/v2/algod/models/types.js +771 -2
  56. package/dist/esm/src/client/v2/algod/models/types.js.map +1 -1
  57. package/dist/esm/src/client/v2/{algod/models/base.js → basemodel.js} +1 -1
  58. package/dist/esm/src/client/v2/basemodel.js.map +1 -0
  59. package/dist/esm/src/client/v2/indexer/indexer.js +50 -0
  60. package/dist/esm/src/client/v2/indexer/indexer.js.map +1 -1
  61. package/dist/esm/src/client/v2/indexer/lookupApplicationBoxByIDandName.js +39 -0
  62. package/dist/esm/src/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -0
  63. package/dist/esm/src/client/v2/indexer/models/types.js +3009 -0
  64. package/dist/esm/src/client/v2/indexer/models/types.js.map +1 -0
  65. package/dist/esm/src/client/v2/indexer/searchForApplicationBoxes.js +93 -0
  66. package/dist/esm/src/client/v2/indexer/searchForApplicationBoxes.js.map +1 -0
  67. package/dist/esm/src/client/v2/jsonrequest.js +11 -1
  68. package/dist/esm/src/client/v2/jsonrequest.js.map +1 -1
  69. package/dist/esm/src/composer.js +4 -1
  70. package/dist/esm/src/composer.js.map +1 -1
  71. package/dist/esm/src/dryrun.js +1 -1
  72. package/dist/esm/src/dryrun.js.map +1 -1
  73. package/dist/esm/src/main.js +2 -0
  74. package/dist/esm/src/main.js.map +1 -1
  75. package/dist/esm/src/makeTxn.js +29 -14
  76. package/dist/esm/src/makeTxn.js.map +1 -1
  77. package/dist/esm/src/multisig.js +15 -25
  78. package/dist/esm/src/multisig.js.map +1 -1
  79. package/dist/esm/src/transaction.js +30 -0
  80. package/dist/esm/src/transaction.js.map +1 -1
  81. package/dist/esm/src/types/transactions/index.js +1 -1
  82. package/dist/esm/src/types/transactions/index.js.map +1 -1
  83. package/dist/types/src/boxStorage.d.ts +7 -0
  84. package/dist/types/src/client/client.d.ts +5 -3
  85. package/dist/types/src/client/urlTokenBaseHTTPClient.d.ts +8 -12
  86. package/dist/types/src/client/v2/algod/algod.d.ts +34 -1
  87. package/dist/types/src/client/v2/algod/getApplicationBoxByName.d.ts +28 -0
  88. package/dist/types/src/client/v2/algod/getApplicationBoxes.d.ts +43 -0
  89. package/dist/types/src/client/v2/algod/models/types.d.ts +117 -2
  90. package/dist/types/src/client/v2/{algod/models/base.d.ts → basemodel.d.ts} +0 -0
  91. package/dist/types/src/client/v2/indexer/indexer.d.ts +46 -0
  92. package/dist/types/src/client/v2/indexer/lookupApplicationBoxByIDandName.d.ts +29 -0
  93. package/dist/types/src/client/v2/indexer/models/types.d.ts +2689 -0
  94. package/dist/types/src/client/v2/indexer/searchForApplicationBoxes.d.ts +80 -0
  95. package/dist/types/src/client/v2/jsonrequest.d.ts +8 -1
  96. package/dist/types/src/composer.d.ts +4 -2
  97. package/dist/types/src/main.d.ts +1 -0
  98. package/dist/types/src/makeTxn.d.ts +22 -15
  99. package/dist/types/src/transaction.d.ts +3 -1
  100. package/dist/types/src/types/transactions/application.d.ts +3 -3
  101. package/dist/types/src/types/transactions/base.d.ts +15 -1
  102. package/dist/types/src/types/transactions/encoded.d.ts +12 -1
  103. package/dist/types/src/types/transactions/index.d.ts +1 -1
  104. package/package.json +6 -7
  105. package/dist/cjs/src/client/v2/algod/models/base.js.map +0 -1
  106. package/dist/esm/src/client/v2/algod/models/base.js.map +0 -1
@@ -1,4 +1,4 @@
1
1
  // Utilities
2
- export { TransactionType } from './base';
2
+ export { TransactionType, } from './base';
3
3
  export * from './encoded';
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/transactions/index.ts"],"names":[],"mappings":"AAoBA,YAAY;AACZ,OAAO,EAAqB,eAAe,EAAmB,MAAM,QAAQ,CAAC;AAK7E,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/transactions/index.ts"],"names":[],"mappings":"AAoBA,YAAY;AACZ,OAAO,EAEL,eAAe,GAGhB,MAAM,QAAQ,CAAC;AAKhB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { EncodedBoxReference } from './types';
2
+ import { BoxReference } from './types/transactions/base';
3
+ /**
4
+ * translateBoxReferences translates an array of BoxReferences with app IDs
5
+ * into an array of EncodedBoxReferences with foreign indices.
6
+ */
7
+ export declare function translateBoxReferences(references: BoxReference[] | undefined, foreignApps: number[], appIndex: number): EncodedBoxReference[];
@@ -63,19 +63,21 @@ export default class HTTPClient {
63
63
  * @param requestHeaders - An object containing additional request headers to use.
64
64
  * @param jsonOptions - Options object to use to decode JSON responses. See
65
65
  * utils.parseJSON for the options available.
66
+ * @param parseBody - An optional boolean indicating whether the response body should be parsed
67
+ * or not.
66
68
  * @returns Response object.
67
69
  */
68
- get(relativePath: string, query?: Query<any>, requestHeaders?: Record<string, string>, jsonOptions?: utils.JSONOptions): Promise<HTTPClientResponse>;
70
+ get(relativePath: string, query?: Query<any>, requestHeaders?: Record<string, string>, jsonOptions?: utils.JSONOptions, parseBody?: boolean): Promise<HTTPClientResponse>;
69
71
  /**
70
72
  * Send a POST request.
71
73
  * If no content-type present, adds the header "content-type: application/json"
72
74
  * and data is serialized in JSON (if not empty)
73
75
  */
74
- post(relativePath: string, data: any, requestHeaders?: Record<string, string>, query?: Query<any>): Promise<HTTPClientResponse>;
76
+ post(relativePath: string, data: any, requestHeaders?: Record<string, string>, query?: Query<any>, parseBody?: boolean): Promise<HTTPClientResponse>;
75
77
  /**
76
78
  * Send a DELETE request.
77
79
  * If no content-type present, adds the header "content-type: application/json"
78
80
  * and data is serialized in JSON (if not empty)
79
81
  */
80
- delete(relativePath: string, data: any, requestHeaders?: Record<string, string>): Promise<HTTPClientResponse>;
82
+ delete(relativePath: string, data: any, requestHeaders?: Record<string, string>, parseBody?: boolean): Promise<HTTPClientResponse>;
81
83
  }
@@ -14,7 +14,7 @@ export interface CustomTokenHeader {
14
14
  export declare type TokenHeader = AlgodTokenHeader | IndexerTokenHeader | KMDTokenHeader | CustomTokenHeader;
15
15
  /**
16
16
  * Implementation of BaseHTTPClient that uses a URL and a token
17
- * and make the REST queries using superagent.
17
+ * and make the REST queries using fetch.
18
18
  * This is the default implementation of BaseHTTPClient.
19
19
  */
20
20
  export declare class URLTokenBaseHTTPClient implements BaseHTTPClient {
@@ -25,19 +25,15 @@ export declare class URLTokenBaseHTTPClient implements BaseHTTPClient {
25
25
  /**
26
26
  * Compute the URL for a path relative to the instance's address
27
27
  * @param relativePath - A path string
28
+ * @param query - An optional key-value object of query parameters to add to the URL. If the
29
+ * relativePath already has query parameters on it, the additional parameters defined here will
30
+ * be added to the URL without modifying those (unless a key collision occurs).
28
31
  * @returns A URL string
29
32
  */
30
- private addressWithPath;
31
- /**
32
- * Convert a superagent response to a valid BaseHTTPClientResponse
33
- * Modify the superagent response
34
- * @private
35
- */
36
- private static superagentToHTTPClientResponse;
37
- /**
38
- * Make a superagent error more readable. For more info, see https://github.com/visionmedia/superagent/issues/1074
39
- */
40
- private static formatSuperagentError;
33
+ private getURL;
34
+ private static formatFetchResponseHeaders;
35
+ private static checkHttpError;
36
+ private static formatFetchResponse;
41
37
  get(relativePath: string, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
42
38
  post(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
43
39
  delete(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
@@ -10,6 +10,8 @@ import Genesis from './genesis';
10
10
  import GetAssetByID from './getAssetByID';
11
11
  import GetApplicationByID from './getApplicationByID';
12
12
  import GetBlockHash from './getBlockHash';
13
+ import GetApplicationBoxByName from './getApplicationBoxByName';
14
+ import GetApplicationBoxes from './getApplicationBoxes';
13
15
  import HealthCheck from './healthCheck';
14
16
  import PendingTransactionInformation from './pendingTransactionInformation';
15
17
  import PendingTransactions from './pendingTransactions';
@@ -136,7 +138,7 @@ export default class AlgodClient extends ServiceClient {
136
138
  * ```typescript
137
139
  * const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
138
140
  * const index = 60553466;
139
- * const accountInfo = await algodClient.accountApplicationInformation(address).do();
141
+ * const accountInfo = await algodClient.accountApplicationInformation(address, index).do();
140
142
  * ```
141
143
  *
142
144
  * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2accountsaddress)
@@ -366,6 +368,37 @@ export default class AlgodClient extends ServiceClient {
366
368
  * @category GET
367
369
  */
368
370
  getApplicationByID(index: number): GetApplicationByID;
371
+ /**
372
+ * Given an application ID and the box name (key), return the value stored in the box.
373
+ *
374
+ * #### Example
375
+ * ```typescript
376
+ * const index = 60553466;
377
+ * const boxName = Buffer.from("foo");
378
+ * const boxResponse = await algodClient.getApplicationBoxByName(index, boxName).do();
379
+ * const boxValue = boxResponse.value;
380
+ * ```
381
+ *
382
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2applicationsapplication-idbox)
383
+ * @param index - The application ID to look up.
384
+ * @category GET
385
+ */
386
+ getApplicationBoxByName(index: number, boxName: Uint8Array): GetApplicationBoxByName;
387
+ /**
388
+ * Given an application ID, return all the box names associated with the app.
389
+ *
390
+ * #### Example
391
+ * ```typescript
392
+ * const index = 60553466;
393
+ * const boxesResponse = await algodClient.getApplicationBoxes(index).max(3).do();
394
+ * const boxNames = boxesResponse.boxes.map(box => box.name);
395
+ * ```
396
+ *
397
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2applicationsapplication-idboxes)
398
+ * @param index - The application ID to look up.
399
+ * @category GET
400
+ */
401
+ getApplicationBoxes(index: number): GetApplicationBoxes;
369
402
  /**
370
403
  * Returns the entire genesis file.
371
404
  *
@@ -0,0 +1,28 @@
1
+ import JSONRequest from '../jsonrequest';
2
+ import HTTPClient from '../../client';
3
+ import IntDecoding from '../../../types/intDecoding';
4
+ import { Box } from './models/types';
5
+ /**
6
+ * Given an application ID and the box name (key), return the value stored in the box.
7
+ *
8
+ * #### Example
9
+ * ```typescript
10
+ * const index = 60553466;
11
+ * const boxName = Buffer.from("foo");
12
+ * const boxResponse = await algodClient.getApplicationBoxByName(index, boxName).do();
13
+ * const boxValue = boxResponse.value;
14
+ * ```
15
+ *
16
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2applicationsapplication-idbox)
17
+ * @param index - The application ID to look up.
18
+ * @category GET
19
+ */
20
+ export default class GetApplicationBoxByName extends JSONRequest<Box, Record<string, any>> {
21
+ private index;
22
+ constructor(c: HTTPClient, intDecoding: IntDecoding, index: number, name: Uint8Array);
23
+ /**
24
+ * @returns `/v2/applications/${index}/box`
25
+ */
26
+ path(): string;
27
+ prepare(body: Record<string, any>): Box;
28
+ }
@@ -0,0 +1,43 @@
1
+ import JSONRequest from '../jsonrequest';
2
+ import HTTPClient from '../../client';
3
+ import IntDecoding from '../../../types/intDecoding';
4
+ import { BoxesResponse } from './models/types';
5
+ /**
6
+ * Given an application ID, return all the box names associated with the app.
7
+ *
8
+ * #### Example
9
+ * ```typescript
10
+ * const index = 60553466;
11
+ * const boxesResponse = await algodClient.getApplicationBoxes(index).max(3).do();
12
+ * const boxNames = boxesResponse.boxes.map(box => box.name);
13
+ * ```
14
+ *
15
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/v2/#get-v2applicationsapplication-idboxes)
16
+ * @param index - The application ID to look up.
17
+ * @category GET
18
+ */
19
+ export default class GetApplicationBoxes extends JSONRequest<BoxesResponse, Record<string, any>> {
20
+ private index;
21
+ constructor(c: HTTPClient, intDecoding: IntDecoding, index: number);
22
+ /**
23
+ * @returns `/v2/applications/${index}/boxes`
24
+ */
25
+ path(): string;
26
+ /**
27
+ * Limit results for pagination.
28
+ *
29
+ * #### Example
30
+ * ```typescript
31
+ * const maxResults = 20;
32
+ * const boxesResult = await algodClient
33
+ * .GetApplicationBoxes(1234)
34
+ * .limit(maxResults)
35
+ * .do();
36
+ * ```
37
+ *
38
+ * @param limit - maximum number of results to return.
39
+ * @category query
40
+ */
41
+ max(max: number): this;
42
+ prepare(body: Record<string, any>): BoxesResponse;
43
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * NOTICE: This file was generated. Editing this file manually is not recommended.
3
3
  */
4
- import BaseModel from './base';
4
+ import BaseModel from '../../basemodel';
5
5
  import { EncodedSignedTransaction } from '../../../../types/transactions/encoded';
6
6
  import BlockHeader from '../../../../types/blockHeader';
7
7
  /**
@@ -121,6 +121,15 @@ export declare class Account extends BaseModel {
121
121
  * * lsig
122
122
  */
123
123
  sigType?: string;
124
+ /**
125
+ * (tbxb) The total number of bytes used by this account's app's box keys and
126
+ * values.
127
+ */
128
+ totalBoxBytes?: number | bigint;
129
+ /**
130
+ * (tbx) The number of existing boxes created by this account's app.
131
+ */
132
+ totalBoxes?: number | bigint;
124
133
  /**
125
134
  * Creates a new `Account` object.
126
135
  * @param address - the account public key
@@ -168,8 +177,11 @@ export declare class Account extends BaseModel {
168
177
  * * sig
169
178
  * * msig
170
179
  * * lsig
180
+ * @param totalBoxBytes - (tbxb) The total number of bytes used by this account's app's box keys and
181
+ * values.
182
+ * @param totalBoxes - (tbx) The number of existing boxes created by this account's app.
171
183
  */
172
- constructor({ address, amount, amountWithoutPendingRewards, minBalance, pendingRewards, rewards, round, status, totalAppsOptedIn, totalAssetsOptedIn, totalCreatedApps, totalCreatedAssets, appsLocalState, appsTotalExtraPages, appsTotalSchema, assets, authAddr, createdApps, createdAssets, participation, rewardBase, sigType, }: {
184
+ constructor({ address, amount, amountWithoutPendingRewards, minBalance, pendingRewards, rewards, round, status, totalAppsOptedIn, totalAssetsOptedIn, totalCreatedApps, totalCreatedAssets, appsLocalState, appsTotalExtraPages, appsTotalSchema, assets, authAddr, createdApps, createdAssets, participation, rewardBase, sigType, totalBoxBytes, totalBoxes, }: {
173
185
  address: string;
174
186
  amount: number | bigint;
175
187
  amountWithoutPendingRewards: number | bigint;
@@ -192,7 +204,10 @@ export declare class Account extends BaseModel {
192
204
  participation?: AccountParticipation;
193
205
  rewardBase?: number | bigint;
194
206
  sigType?: string;
207
+ totalBoxBytes?: number | bigint;
208
+ totalBoxes?: number | bigint;
195
209
  });
210
+ static from_obj_for_encoding(data: Record<string, any>): Account;
196
211
  }
197
212
  /**
198
213
  * AccountApplicationResponse describes the account's application local state and
@@ -226,6 +241,7 @@ export declare class AccountApplicationResponse extends BaseModel {
226
241
  * The raw account uses `AppParams` for this type.
227
242
  */
228
243
  constructor(round: number | bigint, appLocalState?: ApplicationLocalState, createdApp?: ApplicationParams);
244
+ static from_obj_for_encoding(data: Record<string, any>): AccountApplicationResponse;
229
245
  }
230
246
  /**
231
247
  * AccountAssetResponse describes the account's asset holding and asset parameters
@@ -256,6 +272,7 @@ export declare class AccountAssetResponse extends BaseModel {
256
272
  * The raw account uses `AssetParams` for this type.
257
273
  */
258
274
  constructor(round: number | bigint, assetHolding?: AssetHolding, createdAsset?: AssetParams);
275
+ static from_obj_for_encoding(data: Record<string, any>): AccountAssetResponse;
259
276
  }
260
277
  /**
261
278
  * AccountParticipation describes the parameters used by this account in consensus
@@ -305,6 +322,7 @@ export declare class AccountParticipation extends BaseModel {
305
322
  voteParticipationKey: string | Uint8Array;
306
323
  stateProofKey?: string | Uint8Array;
307
324
  });
325
+ static from_obj_for_encoding(data: Record<string, any>): AccountParticipation;
308
326
  }
309
327
  /**
310
328
  * Application state delta.
@@ -321,6 +339,7 @@ export declare class AccountStateDelta extends BaseModel {
321
339
  * @param delta - Application state delta.
322
340
  */
323
341
  constructor(address: string, delta: EvalDeltaKeyValue[]);
342
+ static from_obj_for_encoding(data: Record<string, any>): AccountStateDelta;
324
343
  }
325
344
  /**
326
345
  * Application index and its parameters
@@ -340,6 +359,7 @@ export declare class Application extends BaseModel {
340
359
  * @param params - (appparams) application parameters.
341
360
  */
342
361
  constructor(id: number | bigint, params: ApplicationParams);
362
+ static from_obj_for_encoding(data: Record<string, any>): Application;
343
363
  }
344
364
  /**
345
365
  * Stores local state associated with an application.
@@ -364,6 +384,7 @@ export declare class ApplicationLocalState extends BaseModel {
364
384
  * @param keyValue - (tkv) storage.
365
385
  */
366
386
  constructor(id: number | bigint, schema: ApplicationStateSchema, keyValue?: TealKeyValue[]);
387
+ static from_obj_for_encoding(data: Record<string, any>): ApplicationLocalState;
367
388
  }
368
389
  /**
369
390
  * Stores the global information associated with an application.
@@ -418,6 +439,7 @@ export declare class ApplicationParams extends BaseModel {
418
439
  globalStateSchema?: ApplicationStateSchema;
419
440
  localStateSchema?: ApplicationStateSchema;
420
441
  });
442
+ static from_obj_for_encoding(data: Record<string, any>): ApplicationParams;
421
443
  }
422
444
  /**
423
445
  * Specifies maximums on the number of each type that may be stored.
@@ -437,6 +459,7 @@ export declare class ApplicationStateSchema extends BaseModel {
437
459
  * @param numByteSlice - (nbs) num of byte slices.
438
460
  */
439
461
  constructor(numUint: number | bigint, numByteSlice: number | bigint);
462
+ static from_obj_for_encoding(data: Record<string, any>): ApplicationStateSchema;
440
463
  }
441
464
  /**
442
465
  * Specifies both the unique identifier and the parameters for an asset
@@ -462,6 +485,7 @@ export declare class Asset extends BaseModel {
462
485
  * data/transactions/asset.go : AssetParams
463
486
  */
464
487
  constructor(index: number | bigint, params: AssetParams);
488
+ static from_obj_for_encoding(data: Record<string, any>): Asset;
465
489
  }
466
490
  /**
467
491
  * Describes an asset held by an account.
@@ -488,6 +512,7 @@ export declare class AssetHolding extends BaseModel {
488
512
  * @param isFrozen - (f) whether or not the holding is frozen.
489
513
  */
490
514
  constructor(amount: number | bigint, assetId: number | bigint, isFrozen: boolean);
515
+ static from_obj_for_encoding(data: Record<string, any>): AssetHolding;
491
516
  }
492
517
  /**
493
518
  * AssetParams specifies the parameters for an asset.
@@ -613,6 +638,22 @@ export declare class AssetParams extends BaseModel {
613
638
  url?: string;
614
639
  urlB64?: string | Uint8Array;
615
640
  });
641
+ static from_obj_for_encoding(data: Record<string, any>): AssetParams;
642
+ }
643
+ /**
644
+ * Hash of a block header.
645
+ */
646
+ export declare class BlockHashResponse extends BaseModel {
647
+ /**
648
+ * Block header hash.
649
+ */
650
+ blockhash: string;
651
+ /**
652
+ * Creates a new `BlockHashResponse` object.
653
+ * @param blockhash - Block header hash.
654
+ */
655
+ constructor(blockhash: string);
656
+ static from_obj_for_encoding(data: Record<string, any>): BlockHashResponse;
616
657
  }
617
658
  /**
618
659
  * Encoded block object.
@@ -634,6 +675,54 @@ export declare class BlockResponse extends BaseModel {
634
675
  * message pack.
635
676
  */
636
677
  constructor(block: BlockHeader, cert?: Record<string, any>);
678
+ static from_obj_for_encoding(data: Record<string, any>): BlockResponse;
679
+ }
680
+ /**
681
+ * Box name and its content.
682
+ */
683
+ export declare class Box extends BaseModel {
684
+ /**
685
+ * (name) box name, base64 encoded
686
+ */
687
+ name: Uint8Array;
688
+ /**
689
+ * (value) box value, base64 encoded.
690
+ */
691
+ value: Uint8Array;
692
+ /**
693
+ * Creates a new `Box` object.
694
+ * @param name - (name) box name, base64 encoded
695
+ * @param value - (value) box value, base64 encoded.
696
+ */
697
+ constructor(name: string | Uint8Array, value: string | Uint8Array);
698
+ static from_obj_for_encoding(data: Record<string, any>): Box;
699
+ }
700
+ /**
701
+ * Box descriptor describes a Box.
702
+ */
703
+ export declare class BoxDescriptor extends BaseModel {
704
+ /**
705
+ * Base64 encoded box name
706
+ */
707
+ name: Uint8Array;
708
+ /**
709
+ * Creates a new `BoxDescriptor` object.
710
+ * @param name - Base64 encoded box name
711
+ */
712
+ constructor(name: string | Uint8Array);
713
+ static from_obj_for_encoding(data: Record<string, any>): BoxDescriptor;
714
+ }
715
+ /**
716
+ * Box names of an application
717
+ */
718
+ export declare class BoxesResponse extends BaseModel {
719
+ boxes: BoxDescriptor[];
720
+ /**
721
+ * Creates a new `BoxesResponse` object.
722
+ * @param boxes -
723
+ */
724
+ constructor(boxes: BoxDescriptor[]);
725
+ static from_obj_for_encoding(data: Record<string, any>): BoxesResponse;
637
726
  }
638
727
  export declare class BuildVersion extends BaseModel {
639
728
  branch: string;
@@ -659,6 +748,7 @@ export declare class BuildVersion extends BaseModel {
659
748
  major: number | bigint;
660
749
  minor: number | bigint;
661
750
  });
751
+ static from_obj_for_encoding(data: Record<string, any>): BuildVersion;
662
752
  }
663
753
  /**
664
754
  *
@@ -673,6 +763,7 @@ export declare class CatchpointAbortResponse extends BaseModel {
673
763
  * @param catchupMessage - Catchup abort response string
674
764
  */
675
765
  constructor(catchupMessage: string);
766
+ static from_obj_for_encoding(data: Record<string, any>): CatchpointAbortResponse;
676
767
  }
677
768
  /**
678
769
  *
@@ -687,6 +778,7 @@ export declare class CatchpointStartResponse extends BaseModel {
687
778
  * @param catchupMessage - Catchup start response string
688
779
  */
689
780
  constructor(catchupMessage: string);
781
+ static from_obj_for_encoding(data: Record<string, any>): CatchpointStartResponse;
690
782
  }
691
783
  /**
692
784
  * Teal compile Result
@@ -711,6 +803,7 @@ export declare class CompileResponse extends BaseModel {
711
803
  * @param sourcemap - JSON of the source map
712
804
  */
713
805
  constructor(hash: string, result: string, sourcemap?: Record<string, any>);
806
+ static from_obj_for_encoding(data: Record<string, any>): CompileResponse;
714
807
  }
715
808
  /**
716
809
  * Teal disassembly Result
@@ -725,6 +818,7 @@ export declare class DisassembleResponse extends BaseModel {
725
818
  * @param result - disassembled Teal code
726
819
  */
727
820
  constructor(result: string);
821
+ static from_obj_for_encoding(data: Record<string, any>): DisassembleResponse;
728
822
  }
729
823
  /**
730
824
  * Request data type for dryrun endpoint. Given the Transactions and simulated
@@ -772,6 +866,7 @@ export declare class DryrunRequest extends BaseModel {
772
866
  sources: DryrunSource[];
773
867
  txns: EncodedSignedTransaction[];
774
868
  });
869
+ static from_obj_for_encoding(data: Record<string, any>): DryrunRequest;
775
870
  }
776
871
  /**
777
872
  * DryrunResponse contains per-txn debug information from a dryrun.
@@ -790,6 +885,7 @@ export declare class DryrunResponse extends BaseModel {
790
885
  * @param txns -
791
886
  */
792
887
  constructor(error: string, protocolVersion: string, txns: DryrunTxnResult[]);
888
+ static from_obj_for_encoding(data: Record<string, any>): DryrunResponse;
793
889
  }
794
890
  /**
795
891
  * DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into
@@ -815,6 +911,7 @@ export declare class DryrunSource extends BaseModel {
815
911
  * @param appIndex -
816
912
  */
817
913
  constructor(fieldName: string, source: string, txnIndex: number | bigint, appIndex: number | bigint);
914
+ static from_obj_for_encoding(data: Record<string, any>): DryrunSource;
818
915
  }
819
916
  /**
820
917
  * Stores the TEAL eval step data
@@ -849,6 +946,7 @@ export declare class DryrunState extends BaseModel {
849
946
  error?: string;
850
947
  scratch?: TealValue[];
851
948
  });
949
+ static from_obj_for_encoding(data: Record<string, any>): DryrunState;
852
950
  }
853
951
  /**
854
952
  * DryrunTxnResult contains any LogicSig or ApplicationCall program debug
@@ -916,6 +1014,7 @@ export declare class DryrunTxnResult extends BaseModel {
916
1014
  logicSigTrace?: DryrunState[];
917
1015
  logs?: Uint8Array[];
918
1016
  });
1017
+ static from_obj_for_encoding(data: Record<string, any>): DryrunTxnResult;
919
1018
  }
920
1019
  /**
921
1020
  * An error response with optional data field.
@@ -929,6 +1028,7 @@ export declare class ErrorResponse extends BaseModel {
929
1028
  * @param data -
930
1029
  */
931
1030
  constructor(message: string, data?: Record<string, any>);
1031
+ static from_obj_for_encoding(data: Record<string, any>): ErrorResponse;
932
1032
  }
933
1033
  /**
934
1034
  * Represents a TEAL value delta.
@@ -953,6 +1053,7 @@ export declare class EvalDelta extends BaseModel {
953
1053
  * @param uint - (ui) uint value.
954
1054
  */
955
1055
  constructor(action: number | bigint, bytes?: string, uint?: number | bigint);
1056
+ static from_obj_for_encoding(data: Record<string, any>): EvalDelta;
956
1057
  }
957
1058
  /**
958
1059
  * Key-value pairs for StateDelta.
@@ -969,6 +1070,7 @@ export declare class EvalDeltaKeyValue extends BaseModel {
969
1070
  * @param value - Represents a TEAL value delta.
970
1071
  */
971
1072
  constructor(key: string, value: EvalDelta);
1073
+ static from_obj_for_encoding(data: Record<string, any>): EvalDeltaKeyValue;
972
1074
  }
973
1075
  /**
974
1076
  * Proof of membership and position of a light block header.
@@ -995,6 +1097,7 @@ export declare class LightBlockHeaderProof extends BaseModel {
995
1097
  * from a leaf to the root.
996
1098
  */
997
1099
  constructor(index: number | bigint, proof: string | Uint8Array, treedepth: number | bigint);
1100
+ static from_obj_for_encoding(data: Record<string, any>): LightBlockHeaderProof;
998
1101
  }
999
1102
  /**
1000
1103
  *
@@ -1107,6 +1210,7 @@ export declare class NodeStatusResponse extends BaseModel {
1107
1210
  catchpointVerifiedAccounts?: number | bigint;
1108
1211
  lastCatchpoint?: string;
1109
1212
  });
1213
+ static from_obj_for_encoding(data: Record<string, any>): NodeStatusResponse;
1110
1214
  }
1111
1215
  /**
1112
1216
  * Details about a pending transaction. If the transaction was recently confirmed,
@@ -1212,6 +1316,7 @@ export declare class PendingTransactionResponse extends BaseModel {
1212
1316
  receiverRewards?: number | bigint;
1213
1317
  senderRewards?: number | bigint;
1214
1318
  });
1319
+ static from_obj_for_encoding(data: Record<string, any>): PendingTransactionResponse;
1215
1320
  }
1216
1321
  /**
1217
1322
  * A potentially truncated list of transactions currently in the node's transaction
@@ -1233,6 +1338,7 @@ export declare class PendingTransactionsResponse extends BaseModel {
1233
1338
  * @param totalTransactions - Total number of transactions in the pool.
1234
1339
  */
1235
1340
  constructor(topTransactions: EncodedSignedTransaction[], totalTransactions: number | bigint);
1341
+ static from_obj_for_encoding(data: Record<string, any>): PendingTransactionsResponse;
1236
1342
  }
1237
1343
  /**
1238
1344
  * Transaction ID of the submission.
@@ -1247,6 +1353,7 @@ export declare class PostTransactionsResponse extends BaseModel {
1247
1353
  * @param txid - encoding of the transaction hash.
1248
1354
  */
1249
1355
  constructor(txid: string);
1356
+ static from_obj_for_encoding(data: Record<string, any>): PostTransactionsResponse;
1250
1357
  }
1251
1358
  /**
1252
1359
  * Represents a state proof and its corresponding message
@@ -1266,6 +1373,7 @@ export declare class StateProof extends BaseModel {
1266
1373
  * @param stateproof - The encoded StateProof for the message.
1267
1374
  */
1268
1375
  constructor(message: StateProofMessage, stateproof: string | Uint8Array);
1376
+ static from_obj_for_encoding(data: Record<string, any>): StateProof;
1269
1377
  }
1270
1378
  /**
1271
1379
  * Represents the message that the state proofs are attesting to.
@@ -1310,6 +1418,7 @@ export declare class StateProofMessage extends BaseModel {
1310
1418
  lnprovenweight: number | bigint;
1311
1419
  voterscommitment: string | Uint8Array;
1312
1420
  });
1421
+ static from_obj_for_encoding(data: Record<string, any>): StateProofMessage;
1313
1422
  }
1314
1423
  /**
1315
1424
  * Supply represents the current supply of MicroAlgos in the system.
@@ -1334,6 +1443,7 @@ export declare class SupplyResponse extends BaseModel {
1334
1443
  * @param totalMoney - TotalMoney
1335
1444
  */
1336
1445
  constructor(currentRound: number | bigint, onlineMoney: number | bigint, totalMoney: number | bigint);
1446
+ static from_obj_for_encoding(data: Record<string, any>): SupplyResponse;
1337
1447
  }
1338
1448
  /**
1339
1449
  * Represents a key-value pair in an application store.
@@ -1350,6 +1460,7 @@ export declare class TealKeyValue extends BaseModel {
1350
1460
  * @param value - Represents a TEAL value.
1351
1461
  */
1352
1462
  constructor(key: string, value: TealValue);
1463
+ static from_obj_for_encoding(data: Record<string, any>): TealKeyValue;
1353
1464
  }
1354
1465
  /**
1355
1466
  * Represents a TEAL value.
@@ -1374,6 +1485,7 @@ export declare class TealValue extends BaseModel {
1374
1485
  * @param uint - (ui) uint value.
1375
1486
  */
1376
1487
  constructor(type: number | bigint, bytes: string, uint: number | bigint);
1488
+ static from_obj_for_encoding(data: Record<string, any>): TealValue;
1377
1489
  }
1378
1490
  /**
1379
1491
  * TransactionParams contains the parameters that help a client construct a new
@@ -1431,6 +1543,7 @@ export declare class TransactionParametersResponse extends BaseModel {
1431
1543
  lastRound: number | bigint;
1432
1544
  minFee: number | bigint;
1433
1545
  });
1546
+ static from_obj_for_encoding(data: Record<string, any>): TransactionParametersResponse;
1434
1547
  }
1435
1548
  /**
1436
1549
  * Proof of transaction in a block.
@@ -1477,6 +1590,7 @@ export declare class TransactionProofResponse extends BaseModel {
1477
1590
  treedepth: number | bigint;
1478
1591
  hashtype?: string;
1479
1592
  });
1593
+ static from_obj_for_encoding(data: Record<string, any>): TransactionProofResponse;
1480
1594
  }
1481
1595
  /**
1482
1596
  * algod version information.
@@ -1494,4 +1608,5 @@ export declare class Version extends BaseModel {
1494
1608
  * @param versions -
1495
1609
  */
1496
1610
  constructor(build: BuildVersion, genesisHashB64: string | Uint8Array, genesisId: string, versions: string[]);
1611
+ static from_obj_for_encoding(data: Record<string, any>): Version;
1497
1612
  }
@@ -13,10 +13,12 @@ import LookupAccountCreatedApplications from './lookupAccountCreatedApplications
13
13
  import LookupAssetByID from './lookupAssetByID';
14
14
  import LookupApplications from './lookupApplications';
15
15
  import LookupApplicationLogs from './lookupApplicationLogs';
16
+ import LookupApplicationBoxByIDandName from './lookupApplicationBoxByIDandName';
16
17
  import SearchAccounts from './searchAccounts';
17
18
  import SearchForTransactions from './searchForTransactions';
18
19
  import SearchForAssets from './searchForAssets';
19
20
  import SearchForApplications from './searchForApplications';
21
+ import SearchForApplicationBoxes from './searchForApplicationBoxes';
20
22
  import { BaseHTTPClient } from '../../baseHTTPClient';
21
23
  import { CustomTokenHeader, IndexerTokenHeader } from '../../urlTokenBaseHTTPClient';
22
24
  /**
@@ -299,4 +301,48 @@ export default class IndexerClient extends ServiceClient {
299
301
  * @category GET
300
302
  */
301
303
  searchForApplications(): SearchForApplications;
304
+ /**
305
+ * Returns information about indexed application boxes.
306
+ *
307
+ * #### Example
308
+ * ```typescript
309
+ * const maxResults = 20;
310
+ * const appID = 1234;
311
+ *
312
+ * const responsePage1 = await indexerClient
313
+ * .searchForApplicationBoxes(appID)
314
+ * .limit(maxResults)
315
+ * .do();
316
+ * const boxNamesPage1 = responsePage1.boxes.map(box => box.name);
317
+ *
318
+ * const responsePage2 = await indexerClient
319
+ * .searchForApplicationBoxes(appID)
320
+ * .limit(maxResults)
321
+ * .nextToken(responsePage1.nextToken)
322
+ * .do();
323
+ * const boxNamesPage2 = responsePage2.boxes.map(box => box.name);
324
+ * ```
325
+ *
326
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-idboxes)
327
+ * @param appID - The ID of the application with boxes.
328
+ * @category GET
329
+ */
330
+ searchForApplicationBoxes(appID: number): SearchForApplicationBoxes;
331
+ /**
332
+ * Returns information about the application box given its name.
333
+ *
334
+ * #### Example
335
+ * ```typescript
336
+ * const boxName = Buffer.from("foo");
337
+ * const boxResponse = await indexerClient
338
+ * .LookupApplicationBoxByIDandName(1234, boxName)
339
+ * .do();
340
+ * const boxValue = boxResponse.value;
341
+ * ```
342
+ *
343
+ * [Response data schema details](https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-idbox)
344
+ * @param appID - The ID of the application with boxes.
345
+ * @category GET
346
+ */
347
+ lookupApplicationBoxByIDandName(appID: number, boxName: Uint8Array): LookupApplicationBoxByIDandName;
302
348
  }