algosdk 2.7.0 → 2.9.0

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 (40) 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/abi/contract.js +2 -0
  5. package/dist/cjs/abi/contract.js.map +1 -1
  6. package/dist/cjs/abi/event.js +3 -0
  7. package/dist/cjs/abi/event.js.map +1 -0
  8. package/dist/cjs/abi/method.js +4 -0
  9. package/dist/cjs/abi/method.js.map +1 -1
  10. package/dist/cjs/client/v2/algod/models/types.js +194 -7
  11. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  12. package/dist/cjs/client/v2/indexer/models/types.js +110 -67
  13. package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
  14. package/dist/cjs/makeTxn.js +26 -0
  15. package/dist/cjs/makeTxn.js.map +1 -1
  16. package/dist/esm/abi/contract.js +2 -0
  17. package/dist/esm/abi/contract.js.map +1 -1
  18. package/dist/esm/abi/event.js +2 -0
  19. package/dist/esm/abi/event.js.map +1 -0
  20. package/dist/esm/abi/method.js +4 -0
  21. package/dist/esm/abi/method.js.map +1 -1
  22. package/dist/esm/client/v2/algod/models/types.js +188 -5
  23. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  24. package/dist/esm/client/v2/indexer/models/types.js +110 -67
  25. package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
  26. package/dist/esm/makeTxn.js +26 -0
  27. package/dist/esm/makeTxn.js.map +1 -1
  28. package/dist/types/abi/contract.d.ts +4 -0
  29. package/dist/types/abi/event.d.ts +16 -0
  30. package/dist/types/abi/method.d.ts +7 -0
  31. package/dist/types/client/v2/algod/models/types.d.ts +175 -5
  32. package/dist/types/client/v2/indexer/models/types.d.ts +189 -131
  33. package/dist/types/makeTxn.d.ts +29 -1
  34. package/package.json +2 -2
  35. package/src/abi/contract.ts +6 -0
  36. package/src/abi/event.ts +16 -0
  37. package/src/abi/method.ts +12 -0
  38. package/src/client/v2/algod/models/types.ts +337 -0
  39. package/src/client/v2/indexer/models/types.ts +241 -127
  40. package/src/makeTxn.ts +29 -1
@@ -104,6 +104,20 @@ export declare class Account extends BaseModel {
104
104
  * Note: the raw account uses `map[int] -> Asset` for this type.
105
105
  */
106
106
  createdAssets?: Asset[];
107
+ /**
108
+ * Whether or not the account can receive block incentives if its balance is in
109
+ * range at proposal time.
110
+ */
111
+ incentiveEligible?: boolean;
112
+ /**
113
+ * The round in which this account last went online, or explicitly renewed their
114
+ * online status.
115
+ */
116
+ lastHeartbeat?: number | bigint;
117
+ /**
118
+ * The round in which this account last proposed the block.
119
+ */
120
+ lastProposed?: number | bigint;
107
121
  /**
108
122
  * AccountParticipation describes the parameters used by this account in consensus
109
123
  * protocol.
@@ -169,6 +183,11 @@ export declare class Account extends BaseModel {
169
183
  * Note: the raw account uses `map[int] -> AppParams` for this type.
170
184
  * @param createdAssets - (apar) parameters of assets created by this account.
171
185
  * Note: the raw account uses `map[int] -> Asset` for this type.
186
+ * @param incentiveEligible - Whether or not the account can receive block incentives if its balance is in
187
+ * range at proposal time.
188
+ * @param lastHeartbeat - The round in which this account last went online, or explicitly renewed their
189
+ * online status.
190
+ * @param lastProposed - The round in which this account last proposed the block.
172
191
  * @param participation - AccountParticipation describes the parameters used by this account in consensus
173
192
  * protocol.
174
193
  * @param rewardBase - (ebase) used as part of the rewards computation. Only applicable to accounts
@@ -181,7 +200,7 @@ export declare class Account extends BaseModel {
181
200
  * values.
182
201
  * @param totalBoxes - (tbx) The number of existing boxes created by this account's app.
183
202
  */
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, }: {
203
+ constructor({ address, amount, amountWithoutPendingRewards, minBalance, pendingRewards, rewards, round, status, totalAppsOptedIn, totalAssetsOptedIn, totalCreatedApps, totalCreatedAssets, appsLocalState, appsTotalExtraPages, appsTotalSchema, assets, authAddr, createdApps, createdAssets, incentiveEligible, lastHeartbeat, lastProposed, participation, rewardBase, sigType, totalBoxBytes, totalBoxes, }: {
185
204
  address: string;
186
205
  amount: number | bigint;
187
206
  amountWithoutPendingRewards: number | bigint;
@@ -201,6 +220,9 @@ export declare class Account extends BaseModel {
201
220
  authAddr?: string;
202
221
  createdApps?: Application[];
203
222
  createdAssets?: Asset[];
223
+ incentiveEligible?: boolean;
224
+ lastHeartbeat?: number | bigint;
225
+ lastProposed?: number | bigint;
204
226
  participation?: AccountParticipation;
205
227
  rewardBase?: number | bigint;
206
228
  sigType?: string;
@@ -247,6 +269,34 @@ export declare class AccountApplicationResponse extends BaseModel {
247
269
  });
248
270
  static from_obj_for_encoding(data: Record<string, any>): AccountApplicationResponse;
249
271
  }
272
+ /**
273
+ * AccountAssetHolding describes the account's asset holding and asset parameters
274
+ * (if either exist) for a specific asset ID.
275
+ */
276
+ export declare class AccountAssetHolding extends BaseModel {
277
+ /**
278
+ * (asset) Details about the asset held by this account.
279
+ * The raw account uses `AssetHolding` for this type.
280
+ */
281
+ assetHolding: AssetHolding;
282
+ /**
283
+ * (apar) parameters of the asset held by this account.
284
+ * The raw account uses `AssetParams` for this type.
285
+ */
286
+ assetParams?: AssetParams;
287
+ /**
288
+ * Creates a new `AccountAssetHolding` object.
289
+ * @param assetHolding - (asset) Details about the asset held by this account.
290
+ * The raw account uses `AssetHolding` for this type.
291
+ * @param assetParams - (apar) parameters of the asset held by this account.
292
+ * The raw account uses `AssetParams` for this type.
293
+ */
294
+ constructor({ assetHolding, assetParams, }: {
295
+ assetHolding: AssetHolding;
296
+ assetParams?: AssetParams;
297
+ });
298
+ static from_obj_for_encoding(data: Record<string, any>): AccountAssetHolding;
299
+ }
250
300
  /**
251
301
  * AccountAssetResponse describes the account's asset holding and asset parameters
252
302
  * (if either exist) for a specific asset ID. Asset parameters will only be
@@ -282,6 +332,34 @@ export declare class AccountAssetResponse extends BaseModel {
282
332
  });
283
333
  static from_obj_for_encoding(data: Record<string, any>): AccountAssetResponse;
284
334
  }
335
+ /**
336
+ * AccountAssetsInformationResponse contains a list of assets held by an account.
337
+ */
338
+ export declare class AccountAssetsInformationResponse extends BaseModel {
339
+ /**
340
+ * The round for which this information is relevant.
341
+ */
342
+ round: number | bigint;
343
+ assetHoldings?: AccountAssetHolding[];
344
+ /**
345
+ * Used for pagination, when making another request provide this token with the
346
+ * next parameter.
347
+ */
348
+ nextToken?: string;
349
+ /**
350
+ * Creates a new `AccountAssetsInformationResponse` object.
351
+ * @param round - The round for which this information is relevant.
352
+ * @param assetHoldings -
353
+ * @param nextToken - Used for pagination, when making another request provide this token with the
354
+ * next parameter.
355
+ */
356
+ constructor({ round, assetHoldings, nextToken, }: {
357
+ round: number | bigint;
358
+ assetHoldings?: AccountAssetHolding[];
359
+ nextToken?: string;
360
+ });
361
+ static from_obj_for_encoding(data: Record<string, any>): AccountAssetsInformationResponse;
362
+ }
285
363
  /**
286
364
  * AccountParticipation describes the parameters used by this account in consensus
287
365
  * protocol.
@@ -352,6 +430,36 @@ export declare class AccountStateDelta extends BaseModel {
352
430
  });
353
431
  static from_obj_for_encoding(data: Record<string, any>): AccountStateDelta;
354
432
  }
433
+ /**
434
+ * The logged messages from an app call along with the app ID and outer transaction
435
+ * ID. Logs appear in the same order that they were emitted.
436
+ */
437
+ export declare class AppCallLogs extends BaseModel {
438
+ /**
439
+ * The application from which the logs were generated
440
+ */
441
+ applicationIndex: number | bigint;
442
+ /**
443
+ * An array of logs
444
+ */
445
+ logs: Uint8Array[];
446
+ /**
447
+ * The transaction ID of the outer app call that lead to these logs
448
+ */
449
+ txid: string;
450
+ /**
451
+ * Creates a new `AppCallLogs` object.
452
+ * @param applicationIndex - The application from which the logs were generated
453
+ * @param logs - An array of logs
454
+ * @param txid - The transaction ID of the outer app call that lead to these logs
455
+ */
456
+ constructor({ applicationIndex, logs, txid, }: {
457
+ applicationIndex: number | bigint;
458
+ logs: Uint8Array[];
459
+ txid: string;
460
+ });
461
+ static from_obj_for_encoding(data: Record<string, any>): AppCallLogs;
462
+ }
355
463
  /**
356
464
  * Application index and its parameters
357
465
  */
@@ -884,6 +992,26 @@ export declare class BlockHashResponse extends BaseModel {
884
992
  });
885
993
  static from_obj_for_encoding(data: Record<string, any>): BlockHashResponse;
886
994
  }
995
+ /**
996
+ * All logs emitted in the given round. Each app call, whether top-level or inner,
997
+ * that contains logs results in a separate AppCallLogs object. Therefore there may
998
+ * be multiple AppCallLogs with the same application ID and outer transaction ID in
999
+ * the event of multiple inner app calls to the same app. App calls with no logs
1000
+ * are not included in the response. AppCallLogs are returned in the same order
1001
+ * that their corresponding app call appeared in the block (pre-order traversal of
1002
+ * inner app calls)
1003
+ */
1004
+ export declare class BlockLogsResponse extends BaseModel {
1005
+ logs: AppCallLogs[];
1006
+ /**
1007
+ * Creates a new `BlockLogsResponse` object.
1008
+ * @param logs -
1009
+ */
1010
+ constructor({ logs }: {
1011
+ logs: AppCallLogs[];
1012
+ });
1013
+ static from_obj_for_encoding(data: Record<string, any>): BlockLogsResponse;
1014
+ }
887
1015
  /**
888
1016
  * Encoded block object.
889
1017
  */
@@ -1855,6 +1983,11 @@ export declare class SimulateRequest extends BaseModel {
1855
1983
  * Applies extra opcode budget during simulation for each transaction group.
1856
1984
  */
1857
1985
  extraOpcodeBudget?: number | bigint;
1986
+ /**
1987
+ * If true, signers for transactions that are missing signatures will be fixed
1988
+ * during evaluation.
1989
+ */
1990
+ fixSigners?: boolean;
1858
1991
  /**
1859
1992
  * If provided, specifies the round preceding the simulation. State changes through
1860
1993
  * this round will be used to run this simulation. Usually only the 4 most recent
@@ -1871,18 +2004,21 @@ export declare class SimulateRequest extends BaseModel {
1871
2004
  * @param allowUnnamedResources - Allows access to unnamed resources during simulation.
1872
2005
  * @param execTraceConfig - An object that configures simulation execution trace.
1873
2006
  * @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
2007
+ * @param fixSigners - If true, signers for transactions that are missing signatures will be fixed
2008
+ * during evaluation.
1874
2009
  * @param round - If provided, specifies the round preceding the simulation. State changes through
1875
2010
  * this round will be used to run this simulation. Usually only the 4 most recent
1876
2011
  * rounds will be available (controlled by the node config value MaxAcctLookback).
1877
2012
  * If not specified, defaults to the latest available round.
1878
2013
  */
1879
- constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, allowUnnamedResources, execTraceConfig, extraOpcodeBudget, round, }: {
2014
+ constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, allowUnnamedResources, execTraceConfig, extraOpcodeBudget, fixSigners, round, }: {
1880
2015
  txnGroups: SimulateRequestTransactionGroup[];
1881
2016
  allowEmptySignatures?: boolean;
1882
2017
  allowMoreLogging?: boolean;
1883
2018
  allowUnnamedResources?: boolean;
1884
2019
  execTraceConfig?: SimulateTraceConfig;
1885
2020
  extraOpcodeBudget?: number | bigint;
2021
+ fixSigners?: boolean;
1886
2022
  round?: number | bigint;
1887
2023
  });
1888
2024
  static from_obj_for_encoding(data: Record<string, any>): SimulateRequest;
@@ -2088,6 +2224,11 @@ export declare class SimulateTransactionResult extends BaseModel {
2088
2224
  * call trace in a recursive way.
2089
2225
  */
2090
2226
  execTrace?: SimulationTransactionExecTrace;
2227
+ /**
2228
+ * The account that needed to sign this transaction when no signature was provided
2229
+ * and the provided signer was incorrect.
2230
+ */
2231
+ fixedSigner?: string;
2091
2232
  /**
2092
2233
  * Budget used during execution of a logic sig transaction.
2093
2234
  */
@@ -2112,6 +2253,8 @@ export declare class SimulateTransactionResult extends BaseModel {
2112
2253
  * budged used by inner app calls spawned by this transaction.
2113
2254
  * @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
2114
2255
  * call trace in a recursive way.
2256
+ * @param fixedSigner - The account that needed to sign this transaction when no signature was provided
2257
+ * and the provided signer was incorrect.
2115
2258
  * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
2116
2259
  * @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
2117
2260
  * caused failure, but were allowed in simulation. Depending on where this object
@@ -2123,10 +2266,11 @@ export declare class SimulateTransactionResult extends BaseModel {
2123
2266
  * transaction of the group; otherwise, resources must be placed in the same
2124
2267
  * transaction which accessed them.
2125
2268
  */
2126
- constructor({ txnResult, appBudgetConsumed, execTrace, logicSigBudgetConsumed, unnamedResourcesAccessed, }: {
2269
+ constructor({ txnResult, appBudgetConsumed, execTrace, fixedSigner, logicSigBudgetConsumed, unnamedResourcesAccessed, }: {
2127
2270
  txnResult: PendingTransactionResponse;
2128
2271
  appBudgetConsumed?: number | bigint;
2129
2272
  execTrace?: SimulationTransactionExecTrace;
2273
+ fixedSigner?: string;
2130
2274
  logicSigBudgetConsumed?: number | bigint;
2131
2275
  unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
2132
2276
  });
@@ -2222,6 +2366,11 @@ export declare class SimulationEvalOverrides extends BaseModel {
2222
2366
  * The extra opcode budget added to each transaction group during simulation
2223
2367
  */
2224
2368
  extraOpcodeBudget?: number | bigint;
2369
+ /**
2370
+ * If true, signers for transactions that are missing signatures will be fixed
2371
+ * during evaluation.
2372
+ */
2373
+ fixSigners?: boolean;
2225
2374
  /**
2226
2375
  * The maximum log calls one can make during simulation
2227
2376
  */
@@ -2236,13 +2385,16 @@ export declare class SimulationEvalOverrides extends BaseModel {
2236
2385
  * were properly signed.
2237
2386
  * @param allowUnnamedResources - If true, allows access to unnamed resources during simulation.
2238
2387
  * @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
2388
+ * @param fixSigners - If true, signers for transactions that are missing signatures will be fixed
2389
+ * during evaluation.
2239
2390
  * @param maxLogCalls - The maximum log calls one can make during simulation
2240
2391
  * @param maxLogSize - The maximum byte number to log during simulation
2241
2392
  */
2242
- constructor({ allowEmptySignatures, allowUnnamedResources, extraOpcodeBudget, maxLogCalls, maxLogSize, }: {
2393
+ constructor({ allowEmptySignatures, allowUnnamedResources, extraOpcodeBudget, fixSigners, maxLogCalls, maxLogSize, }: {
2243
2394
  allowEmptySignatures?: boolean;
2244
2395
  allowUnnamedResources?: boolean;
2245
2396
  extraOpcodeBudget?: number | bigint;
2397
+ fixSigners?: boolean;
2246
2398
  maxLogCalls?: number | bigint;
2247
2399
  maxLogSize?: number | bigint;
2248
2400
  });
@@ -2316,6 +2468,17 @@ export declare class SimulationTransactionExecTrace extends BaseModel {
2316
2468
  * Program trace that contains a trace of opcode effects in a clear state program.
2317
2469
  */
2318
2470
  clearStateProgramTrace?: SimulationOpcodeTraceUnit[];
2471
+ /**
2472
+ * If true, indicates that the clear state program failed and any persistent state
2473
+ * changes it produced should be reverted once the program exits.
2474
+ */
2475
+ clearStateRollback?: boolean;
2476
+ /**
2477
+ * The error message explaining why the clear state program failed. This field will
2478
+ * only be populated if clear-state-rollback is true and the failure was due to an
2479
+ * execution error.
2480
+ */
2481
+ clearStateRollbackError?: string;
2319
2482
  /**
2320
2483
  * An array of SimulationTransactionExecTrace representing the execution trace of
2321
2484
  * any inner transactions executed.
@@ -2335,16 +2498,23 @@ export declare class SimulationTransactionExecTrace extends BaseModel {
2335
2498
  * @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program.
2336
2499
  * @param clearStateProgramHash - SHA512_256 hash digest of the clear state program executed in transaction.
2337
2500
  * @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program.
2501
+ * @param clearStateRollback - If true, indicates that the clear state program failed and any persistent state
2502
+ * changes it produced should be reverted once the program exits.
2503
+ * @param clearStateRollbackError - The error message explaining why the clear state program failed. This field will
2504
+ * only be populated if clear-state-rollback is true and the failure was due to an
2505
+ * execution error.
2338
2506
  * @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of
2339
2507
  * any inner transactions executed.
2340
2508
  * @param logicSigHash - SHA512_256 hash digest of the logic sig executed in transaction.
2341
2509
  * @param logicSigTrace - Program trace that contains a trace of opcode effects in a logic sig.
2342
2510
  */
2343
- constructor({ approvalProgramHash, approvalProgramTrace, clearStateProgramHash, clearStateProgramTrace, innerTrace, logicSigHash, logicSigTrace, }: {
2511
+ constructor({ approvalProgramHash, approvalProgramTrace, clearStateProgramHash, clearStateProgramTrace, clearStateRollback, clearStateRollbackError, innerTrace, logicSigHash, logicSigTrace, }: {
2344
2512
  approvalProgramHash?: string | Uint8Array;
2345
2513
  approvalProgramTrace?: SimulationOpcodeTraceUnit[];
2346
2514
  clearStateProgramHash?: string | Uint8Array;
2347
2515
  clearStateProgramTrace?: SimulationOpcodeTraceUnit[];
2516
+ clearStateRollback?: boolean;
2517
+ clearStateRollbackError?: string;
2348
2518
  innerTrace?: SimulationTransactionExecTrace[];
2349
2519
  logicSigHash?: string | Uint8Array;
2350
2520
  logicSigTrace?: SimulationOpcodeTraceUnit[];