algosdk 2.8.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.
@@ -1983,6 +1983,11 @@ export declare class SimulateRequest extends BaseModel {
1983
1983
  * Applies extra opcode budget during simulation for each transaction group.
1984
1984
  */
1985
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;
1986
1991
  /**
1987
1992
  * If provided, specifies the round preceding the simulation. State changes through
1988
1993
  * this round will be used to run this simulation. Usually only the 4 most recent
@@ -1999,18 +2004,21 @@ export declare class SimulateRequest extends BaseModel {
1999
2004
  * @param allowUnnamedResources - Allows access to unnamed resources during simulation.
2000
2005
  * @param execTraceConfig - An object that configures simulation execution trace.
2001
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.
2002
2009
  * @param round - If provided, specifies the round preceding the simulation. State changes through
2003
2010
  * this round will be used to run this simulation. Usually only the 4 most recent
2004
2011
  * rounds will be available (controlled by the node config value MaxAcctLookback).
2005
2012
  * If not specified, defaults to the latest available round.
2006
2013
  */
2007
- constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, allowUnnamedResources, execTraceConfig, extraOpcodeBudget, round, }: {
2014
+ constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, allowUnnamedResources, execTraceConfig, extraOpcodeBudget, fixSigners, round, }: {
2008
2015
  txnGroups: SimulateRequestTransactionGroup[];
2009
2016
  allowEmptySignatures?: boolean;
2010
2017
  allowMoreLogging?: boolean;
2011
2018
  allowUnnamedResources?: boolean;
2012
2019
  execTraceConfig?: SimulateTraceConfig;
2013
2020
  extraOpcodeBudget?: number | bigint;
2021
+ fixSigners?: boolean;
2014
2022
  round?: number | bigint;
2015
2023
  });
2016
2024
  static from_obj_for_encoding(data: Record<string, any>): SimulateRequest;
@@ -2216,6 +2224,11 @@ export declare class SimulateTransactionResult extends BaseModel {
2216
2224
  * call trace in a recursive way.
2217
2225
  */
2218
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;
2219
2232
  /**
2220
2233
  * Budget used during execution of a logic sig transaction.
2221
2234
  */
@@ -2240,6 +2253,8 @@ export declare class SimulateTransactionResult extends BaseModel {
2240
2253
  * budged used by inner app calls spawned by this transaction.
2241
2254
  * @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
2242
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.
2243
2258
  * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
2244
2259
  * @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
2245
2260
  * caused failure, but were allowed in simulation. Depending on where this object
@@ -2251,10 +2266,11 @@ export declare class SimulateTransactionResult extends BaseModel {
2251
2266
  * transaction of the group; otherwise, resources must be placed in the same
2252
2267
  * transaction which accessed them.
2253
2268
  */
2254
- constructor({ txnResult, appBudgetConsumed, execTrace, logicSigBudgetConsumed, unnamedResourcesAccessed, }: {
2269
+ constructor({ txnResult, appBudgetConsumed, execTrace, fixedSigner, logicSigBudgetConsumed, unnamedResourcesAccessed, }: {
2255
2270
  txnResult: PendingTransactionResponse;
2256
2271
  appBudgetConsumed?: number | bigint;
2257
2272
  execTrace?: SimulationTransactionExecTrace;
2273
+ fixedSigner?: string;
2258
2274
  logicSigBudgetConsumed?: number | bigint;
2259
2275
  unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
2260
2276
  });
@@ -2350,6 +2366,11 @@ export declare class SimulationEvalOverrides extends BaseModel {
2350
2366
  * The extra opcode budget added to each transaction group during simulation
2351
2367
  */
2352
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;
2353
2374
  /**
2354
2375
  * The maximum log calls one can make during simulation
2355
2376
  */
@@ -2364,13 +2385,16 @@ export declare class SimulationEvalOverrides extends BaseModel {
2364
2385
  * were properly signed.
2365
2386
  * @param allowUnnamedResources - If true, allows access to unnamed resources during simulation.
2366
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.
2367
2390
  * @param maxLogCalls - The maximum log calls one can make during simulation
2368
2391
  * @param maxLogSize - The maximum byte number to log during simulation
2369
2392
  */
2370
- constructor({ allowEmptySignatures, allowUnnamedResources, extraOpcodeBudget, maxLogCalls, maxLogSize, }: {
2393
+ constructor({ allowEmptySignatures, allowUnnamedResources, extraOpcodeBudget, fixSigners, maxLogCalls, maxLogSize, }: {
2371
2394
  allowEmptySignatures?: boolean;
2372
2395
  allowUnnamedResources?: boolean;
2373
2396
  extraOpcodeBudget?: number | bigint;
2397
+ fixSigners?: boolean;
2374
2398
  maxLogCalls?: number | bigint;
2375
2399
  maxLogSize?: number | bigint;
2376
2400
  });
@@ -17,6 +17,8 @@ import { RenameProperties, RenameProperty, Expand } from './types/utils';
17
17
  * genesisHash - string specifies hash genesis block of network in use
18
18
  * genesisID - string specifies genesis ID of network in use
19
19
  * @param rekeyTo - rekeyTo address, optional
20
+ *
21
+ * @deprecated This function will be removed in v3 in favor of {@link makePaymentTxnWithSuggestedParamsFromObject}
20
22
  */
21
23
  export declare function makePaymentTxnWithSuggestedParams(from: PaymentTxn['from'], to: PaymentTxn['to'], amount: PaymentTxn['amount'], closeRemainderTo: PaymentTxn['closeRemainderTo'], note: PaymentTxn['note'], suggestedParams: MustHaveSuggestedParams<PaymentTxn>['suggestedParams'], rekeyTo?: PaymentTxn['reKeyTo']): txnBuilder.Transaction;
22
24
  export declare function makePaymentTxnWithSuggestedParamsFromObject(o: Expand<Pick<RenameProperty<MustHaveSuggestedParams<PaymentTxn>, 'reKeyTo', 'rekeyTo'>, 'from' | 'to' | 'amount' | 'closeRemainderTo' | 'note' | 'suggestedParams' | 'rekeyTo'>>): txnBuilder.Transaction;
@@ -43,6 +45,8 @@ export declare function makePaymentTxnWithSuggestedParamsFromObject(o: Expand<Pi
43
45
  * @param nonParticipation - configure whether the address wants to stop participating. If true,
44
46
  * voteKey, selectionKey, voteFirst, voteLast, and voteKeyDilution must be undefined.
45
47
  * @param stateProofKey - state proof key. for key deregistration, leave undefined
48
+ *
49
+ * @deprecated This function will be removed in v3 in favor of {@link makeKeyRegistrationTxnWithSuggestedParamsFromObject}
46
50
  */
47
51
  export declare function makeKeyRegistrationTxnWithSuggestedParams(from: KeyRegistrationTxn['from'], note: KeyRegistrationTxn['note'], voteKey: KeyRegistrationTxn['voteKey'], selectionKey: KeyRegistrationTxn['selectionKey'], voteFirst: KeyRegistrationTxn['voteFirst'], voteLast: KeyRegistrationTxn['voteLast'], voteKeyDilution: KeyRegistrationTxn['voteKeyDilution'], suggestedParams: MustHaveSuggestedParams<KeyRegistrationTxn>['suggestedParams'], rekeyTo?: KeyRegistrationTxn['reKeyTo'], nonParticipation?: false, stateProofKey?: KeyRegistrationTxn['stateProofKey']): txnBuilder.Transaction;
48
52
  export declare function makeKeyRegistrationTxnWithSuggestedParams(from: KeyRegistrationTxn['from'], note: KeyRegistrationTxn['note'], voteKey: undefined, selectionKey: undefined, voteFirst: undefined, voteLast: undefined, voteKeyDilution: undefined, suggestedParams: MustHaveSuggestedParams<KeyRegistrationTxn>['suggestedParams'], rekeyTo?: KeyRegistrationTxn['reKeyTo'], nonParticipation?: boolean, stateProofKey?: undefined): txnBuilder.Transaction;
@@ -75,6 +79,8 @@ export declare function makeKeyRegistrationTxnWithSuggestedParamsFromObject(o: E
75
79
  * genesisHash - string specifies hash genesis block of network in use
76
80
  * genesisID - string specifies genesis ID of network in use
77
81
  * @param rekeyTo - rekeyTo address, optional
82
+ *
83
+ * @deprecated This function will be removed in v3 in favor of {@link makeAssetCreateTxnWithSuggestedParamsFromObject}
78
84
  */
79
85
  export declare function makeAssetCreateTxnWithSuggestedParams(from: AssetCreateTxn['from'], note: AssetCreateTxn['note'], total: AssetCreateTxn['assetTotal'], decimals: AssetCreateTxn['assetDecimals'], defaultFrozen: AssetCreateTxn['assetDefaultFrozen'], manager: AssetCreateTxn['assetManager'], reserve: AssetCreateTxn['assetReserve'], freeze: AssetCreateTxn['assetFreeze'], clawback: AssetCreateTxn['assetClawback'], unitName: AssetCreateTxn['assetUnitName'], assetName: AssetCreateTxn['assetName'], assetURL: AssetCreateTxn['assetURL'], assetMetadataHash: AssetCreateTxn['assetMetadataHash'] | undefined, suggestedParams: MustHaveSuggestedParams<AssetCreateTxn>['suggestedParams'], rekeyTo?: AssetCreateTxn['reKeyTo']): txnBuilder.Transaction;
80
86
  export declare function makeAssetCreateTxnWithSuggestedParamsFromObject(o: Expand<Pick<RenameProperties<MustHaveSuggestedParams<AssetCreateTxn>, {
@@ -109,6 +115,8 @@ export declare function makeAssetCreateTxnWithSuggestedParamsFromObject(o: Expan
109
115
  * genesisHash - string specifies hash genesis block of network in use
110
116
  * genesisID - string specifies genesis ID of network in use
111
117
  * @param rekeyTo - rekeyTo address, optional
118
+ *
119
+ * @deprecated This function will be removed in v3 in favor of {@link makeAssetConfigTxnWithSuggestedParamsFromObject}
112
120
  */
113
121
  export declare function makeAssetConfigTxnWithSuggestedParams(from: AssetConfigTxn['from'], note: AssetConfigTxn['note'], assetIndex: AssetConfigTxn['assetIndex'], manager: AssetConfigTxn['assetManager'], reserve: AssetConfigTxn['assetReserve'], freeze: AssetConfigTxn['assetFreeze'], clawback: AssetConfigTxn['assetClawback'], suggestedParams: MustHaveSuggestedParams<AssetConfigTxn>['suggestedParams'], strictEmptyAddressChecking?: boolean, rekeyTo?: AssetConfigTxn['reKeyTo']): txnBuilder.Transaction;
114
122
  export declare function makeAssetConfigTxnWithSuggestedParamsFromObject(o: Expand<Pick<RenameProperties<MustHaveSuggestedParams<AssetConfigTxn>, {
@@ -135,6 +143,8 @@ export declare function makeAssetConfigTxnWithSuggestedParamsFromObject(o: Expan
135
143
  * genesisHash - string specifies hash genesis block of network in use
136
144
  * genesisID - string specifies genesis ID of network in use
137
145
  * @param rekeyTo - rekeyTo address, optional
146
+ *
147
+ * @deprecated This function will be removed in v3 in favor of {@link makeAssetDestroyTxnWithSuggestedParamsFromObject}
138
148
  */
139
149
  export declare function makeAssetDestroyTxnWithSuggestedParams(from: AssetDestroyTxn['from'], note: AssetDestroyTxn['note'], assetIndex: AssetDestroyTxn['assetIndex'], suggestedParams: MustHaveSuggestedParams<AssetDestroyTxn>['suggestedParams'], rekeyTo?: AssetDestroyTxn['reKeyTo']): txnBuilder.Transaction;
140
150
  export declare function makeAssetDestroyTxnWithSuggestedParamsFromObject(o: Expand<Pick<RenameProperty<MustHaveSuggestedParams<AssetDestroyTxn>, 'reKeyTo', 'rekeyTo'>, 'from' | 'note' | 'assetIndex' | 'suggestedParams' | 'rekeyTo'>>): txnBuilder.Transaction;
@@ -155,6 +165,8 @@ export declare function makeAssetDestroyTxnWithSuggestedParamsFromObject(o: Expa
155
165
  * genesisHash - string specifies hash genesis block of network in use
156
166
  * genesisID - string specifies genesis ID of network in use
157
167
  * @param rekeyTo - rekeyTo address, optional
168
+ *
169
+ * @deprecated This function will be removed in v3 in favor of {@link makeAssetFreezeTxnWithSuggestedParamsFromObject}
158
170
  */
159
171
  export declare function makeAssetFreezeTxnWithSuggestedParams(from: AssetFreezeTxn['from'], note: AssetFreezeTxn['note'], assetIndex: AssetFreezeTxn['assetIndex'], freezeTarget: AssetFreezeTxn['freezeAccount'], freezeState: AssetFreezeTxn['freezeState'], suggestedParams: MustHaveSuggestedParams<AssetFreezeTxn>['suggestedParams'], rekeyTo?: AssetFreezeTxn['reKeyTo']): txnBuilder.Transaction;
160
172
  export declare function makeAssetFreezeTxnWithSuggestedParamsFromObject(o: Expand<Pick<RenameProperties<MustHaveSuggestedParams<AssetFreezeTxn>, {
@@ -184,6 +196,8 @@ export declare function makeAssetFreezeTxnWithSuggestedParamsFromObject(o: Expan
184
196
  * genesisHash - string specifies hash genesis block of network in use
185
197
  * genesisID - string specifies genesis ID of network in use
186
198
  * @param rekeyTo - rekeyTo address, optional
199
+ *
200
+ * @deprecated This function will be removed in v3 in favor of {@link makeAssetTransferTxnWithSuggestedParamsFromObject}
187
201
  */
188
202
  export declare function makeAssetTransferTxnWithSuggestedParams(from: AssetTransferTxn['from'], to: AssetTransferTxn['to'], closeRemainderTo: AssetTransferTxn['closeRemainderTo'], revocationTarget: AssetTransferTxn['assetRevocationTarget'], amount: AssetTransferTxn['amount'], note: AssetTransferTxn['note'], assetIndex: AssetTransferTxn['assetIndex'], suggestedParams: MustHaveSuggestedParams<AssetTransferTxn>['suggestedParams'], rekeyTo?: AssetTransferTxn['reKeyTo']): txnBuilder.Transaction;
189
203
  export declare function makeAssetTransferTxnWithSuggestedParamsFromObject(o: Expand<Pick<RenameProperties<MustHaveSuggestedParams<AssetTransferTxn>, {
@@ -217,6 +231,8 @@ export declare function makeAssetTransferTxnWithSuggestedParamsFromObject(o: Exp
217
231
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
218
232
  * @param extraPages - integer extra pages of memory to rent on creation of application
219
233
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
234
+ *
235
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationCreateTxnFromObject}
220
236
  */
221
237
  export declare function makeApplicationCreateTxn(from: AppCreateTxn['from'], suggestedParams: MustHaveSuggestedParams<AppCreateTxn>['suggestedParams'], onComplete: AppCreateTxn['appOnComplete'], approvalProgram: AppCreateTxn['appApprovalProgram'], clearProgram: AppCreateTxn['appClearProgram'], numLocalInts: AppCreateTxn['appLocalInts'], numLocalByteSlices: AppCreateTxn['appLocalByteSlices'], numGlobalInts: AppCreateTxn['appGlobalInts'], numGlobalByteSlices: AppCreateTxn['appGlobalByteSlices'], appArgs?: AppCreateTxn['appArgs'], accounts?: AppCreateTxn['appAccounts'], foreignApps?: AppCreateTxn['appForeignApps'], foreignAssets?: AppCreateTxn['appForeignAssets'], note?: AppCreateTxn['note'], lease?: AppCreateTxn['lease'], rekeyTo?: AppCreateTxn['reKeyTo'], extraPages?: AppCreateTxn['extraPages'], boxes?: AppCreateTxn['boxes']): txnBuilder.Transaction;
222
238
  export declare function makeApplicationCreateTxnFromObject(o: Expand<Pick<RenameProperties<MustHaveSuggestedParams<AppCreateTxn>, {
@@ -254,6 +270,8 @@ export declare function makeApplicationCreateTxnFromObject(o: Expand<Pick<Rename
254
270
  * @param lease - Lease a transaction
255
271
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
256
272
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
273
+ *
274
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationUpdateTxnFromObject}
257
275
  */
258
276
  export declare function makeApplicationUpdateTxn(from: AppUpdateTxn['from'], suggestedParams: MustHaveSuggestedParams<AppUpdateTxn>['suggestedParams'], appIndex: AppUpdateTxn['appIndex'], approvalProgram: AppUpdateTxn['appApprovalProgram'], clearProgram: AppUpdateTxn['appClearProgram'], appArgs?: AppUpdateTxn['appArgs'], accounts?: AppUpdateTxn['appAccounts'], foreignApps?: AppUpdateTxn['appForeignApps'], foreignAssets?: AppUpdateTxn['appForeignAssets'], note?: AppUpdateTxn['note'], lease?: AppUpdateTxn['lease'], rekeyTo?: AppUpdateTxn['reKeyTo'], boxes?: AppUpdateTxn['boxes']): txnBuilder.Transaction;
259
277
  export declare function makeApplicationUpdateTxnFromObject(o: Expand<Pick<RenameProperties<MustHaveSuggestedParams<AppUpdateTxn>, {
@@ -284,6 +302,8 @@ export declare function makeApplicationUpdateTxnFromObject(o: Expand<Pick<Rename
284
302
  * @param lease - Lease a transaction
285
303
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
286
304
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
305
+ *
306
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationDeleteTxnFromObject}
287
307
  */
288
308
  export declare function makeApplicationDeleteTxn(from: AppDeleteTxn['from'], suggestedParams: MustHaveSuggestedParams<AppDeleteTxn>['suggestedParams'], appIndex: AppDeleteTxn['appIndex'], appArgs?: AppDeleteTxn['appArgs'], accounts?: AppDeleteTxn['appAccounts'], foreignApps?: AppDeleteTxn['appForeignApps'], foreignAssets?: AppDeleteTxn['appForeignAssets'], note?: AppDeleteTxn['note'], lease?: AppDeleteTxn['lease'], rekeyTo?: AppDeleteTxn['reKeyTo'], boxes?: AppDeleteTxn['boxes']): txnBuilder.Transaction;
289
309
  export declare function makeApplicationDeleteTxnFromObject(o: Expand<Pick<RenameProperties<MustHaveSuggestedParams<AppDeleteTxn>, {
@@ -312,6 +332,8 @@ export declare function makeApplicationDeleteTxnFromObject(o: Expand<Pick<Rename
312
332
  * @param lease - Lease a transaction
313
333
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
314
334
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
335
+ *
336
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationOptInTxnFromObject}
315
337
  */
316
338
  export declare function makeApplicationOptInTxn(from: AppOptInTxn['from'], suggestedParams: MustHaveSuggestedParams<AppOptInTxn>['suggestedParams'], appIndex: AppOptInTxn['appIndex'], appArgs?: AppOptInTxn['appArgs'], accounts?: AppOptInTxn['appAccounts'], foreignApps?: AppOptInTxn['appForeignApps'], foreignAssets?: AppOptInTxn['appForeignAssets'], note?: AppOptInTxn['note'], lease?: AppOptInTxn['lease'], rekeyTo?: AppOptInTxn['reKeyTo'], boxes?: AppOptInTxn['boxes']): txnBuilder.Transaction;
317
339
  export declare function makeApplicationOptInTxnFromObject(o: Expand<Pick<RenameProperties<MustHaveSuggestedParams<AppOptInTxn>, {
@@ -340,6 +362,8 @@ export declare function makeApplicationOptInTxnFromObject(o: Expand<Pick<RenameP
340
362
  * @param lease - Lease a transaction
341
363
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
342
364
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
365
+ *
366
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationCloseOutTxnFromObject}
343
367
  */
344
368
  export declare function makeApplicationCloseOutTxn(from: AppCloseOutTxn['from'], suggestedParams: MustHaveSuggestedParams<AppCloseOutTxn>['suggestedParams'], appIndex: AppCloseOutTxn['appIndex'], appArgs?: AppCloseOutTxn['appArgs'], accounts?: AppCloseOutTxn['appAccounts'], foreignApps?: AppCloseOutTxn['appForeignApps'], foreignAssets?: AppCloseOutTxn['appForeignAssets'], note?: AppCloseOutTxn['note'], lease?: AppCloseOutTxn['lease'], rekeyTo?: AppCloseOutTxn['reKeyTo'], boxes?: AppCloseOutTxn['boxes']): txnBuilder.Transaction;
345
369
  export declare function makeApplicationCloseOutTxnFromObject(o: Expand<Pick<RenameProperties<MustHaveSuggestedParams<AppOptInTxn>, {
@@ -368,6 +392,8 @@ export declare function makeApplicationCloseOutTxnFromObject(o: Expand<Pick<Rena
368
392
  * @param lease - Lease a transaction
369
393
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
370
394
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
395
+ *
396
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationClearStateTxnFromObject}
371
397
  */
372
398
  export declare function makeApplicationClearStateTxn(from: AppClearStateTxn['from'], suggestedParams: MustHaveSuggestedParams<AppClearStateTxn>['suggestedParams'], appIndex: AppClearStateTxn['appIndex'], appArgs?: AppClearStateTxn['appArgs'], accounts?: AppClearStateTxn['appAccounts'], foreignApps?: AppClearStateTxn['appForeignApps'], foreignAssets?: AppClearStateTxn['appForeignAssets'], note?: AppClearStateTxn['note'], lease?: AppClearStateTxn['lease'], rekeyTo?: AppClearStateTxn['reKeyTo'], boxes?: AppClearStateTxn['boxes']): txnBuilder.Transaction;
373
399
  export declare function makeApplicationClearStateTxnFromObject(o: Expand<Pick<RenameProperties<MustHaveSuggestedParams<AppOptInTxn>, {
@@ -396,6 +422,8 @@ export declare function makeApplicationClearStateTxnFromObject(o: Expand<Pick<Re
396
422
  * @param lease - Lease a transaction
397
423
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
398
424
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
425
+ *
426
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationNoOpTxnFromObject}
399
427
  */
400
428
  export declare function makeApplicationNoOpTxn(from: AppNoOpTxn['from'], suggestedParams: MustHaveSuggestedParams<AppNoOpTxn>['suggestedParams'], appIndex: AppNoOpTxn['appIndex'], appArgs?: AppNoOpTxn['appArgs'], accounts?: AppNoOpTxn['appAccounts'], foreignApps?: AppNoOpTxn['appForeignApps'], foreignAssets?: AppNoOpTxn['appForeignAssets'], note?: AppNoOpTxn['note'], lease?: AppNoOpTxn['lease'], rekeyTo?: AppNoOpTxn['reKeyTo'], boxes?: AppNoOpTxn['boxes']): txnBuilder.Transaction;
401
429
  export declare function makeApplicationNoOpTxnFromObject(o: Expand<Pick<RenameProperties<MustHaveSuggestedParams<AppOptInTxn>, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "algosdk",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "description": "The official JavaScript SDK for Algorand",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,4 +1,5 @@
1
1
  import { ABIMethod, ABIMethodParams, getMethodByName } from './method';
2
+ import { ARC28Event } from './event';
2
3
 
3
4
  export interface ABIContractNetworkInfo {
4
5
  appID: number;
@@ -13,6 +14,7 @@ export interface ABIContractParams {
13
14
  desc?: string;
14
15
  networks?: ABIContractNetworks;
15
16
  methods: ABIMethodParams[];
17
+ events?: ARC28Event[];
16
18
  }
17
19
 
18
20
  export class ABIContract {
@@ -20,6 +22,8 @@ export class ABIContract {
20
22
  public readonly description?: string;
21
23
  public readonly networks: ABIContractNetworks;
22
24
  public readonly methods: ABIMethod[];
25
+ /** [ARC-28](https://arc.algorand.foundation/ARCs/arc-0028) events that MAY be emitted by this contract */
26
+ public readonly events?: ARC28Event[];
23
27
 
24
28
  constructor(params: ABIContractParams) {
25
29
  if (
@@ -34,6 +38,7 @@ export class ABIContract {
34
38
  this.description = params.desc;
35
39
  this.networks = params.networks ? { ...params.networks } : {};
36
40
  this.methods = params.methods.map((method) => new ABIMethod(method));
41
+ this.events = params.events;
37
42
  }
38
43
 
39
44
  toJSON(): ABIContractParams {
@@ -42,6 +47,7 @@ export class ABIContract {
42
47
  desc: this.description,
43
48
  networks: this.networks,
44
49
  methods: this.methods.map((method) => method.toJSON()),
50
+ events: this.events,
45
51
  };
46
52
  }
47
53
 
@@ -0,0 +1,16 @@
1
+ /** [ARC-28](https://arc.algorand.foundation/ARCs/arc-0028) event description */
2
+ export interface ARC28Event {
3
+ /** The name of the event */
4
+ name: string;
5
+ /** Optional, user-friendly description for the event */
6
+ desc?: string;
7
+ /** The arguments of the event, in order */
8
+ args: Array<{
9
+ /** The type of the argument */
10
+ type: string;
11
+ /** Optional, user-friendly name for the argument */
12
+ name?: string;
13
+ /** Optional, user-friendly description for the argument */
14
+ desc?: string;
15
+ }>;
16
+ }
package/src/abi/method.ts CHANGED
@@ -2,6 +2,7 @@ import { genericHash } from '../nacl/naclWrappers';
2
2
  import { ABIType, ABITupleType } from './abi_type';
3
3
  import { ABITransactionType, abiTypeIsTransaction } from './transaction';
4
4
  import { ABIReferenceType, abiTypeIsReference } from './reference';
5
+ import { ARC28Event } from './event';
5
6
 
6
7
  function parseMethodSignature(
7
8
  signature: string
@@ -61,6 +62,10 @@ export interface ABIMethodParams {
61
62
  desc?: string;
62
63
  args: ABIMethodArgParams[];
63
64
  returns: ABIMethodReturnParams;
65
+ /** Optional, is it a read-only method (according to [ARC-22](https://arc.algorand.foundation/ARCs/arc-0022)) */
66
+ readonly?: boolean;
67
+ /** [ARC-28](https://arc.algorand.foundation/ARCs/arc-0028) events that MAY be emitted by this method */
68
+ events?: ARC28Event[];
64
69
  }
65
70
 
66
71
  export type ABIArgumentType = ABIType | ABITransactionType | ABIReferenceType;
@@ -77,6 +82,8 @@ export class ABIMethod {
77
82
  }>;
78
83
 
79
84
  public readonly returns: { type: ABIReturnType; description?: string };
85
+ public readonly events?: ARC28Event[];
86
+ public readonly readonly?: boolean;
80
87
 
81
88
  constructor(params: ABIMethodParams) {
82
89
  if (
@@ -111,6 +118,9 @@ export class ABIMethod {
111
118
  : ABIType.from(params.returns.type),
112
119
  description: params.returns.desc,
113
120
  };
121
+
122
+ this.events = params.events;
123
+ this.readonly = params.readonly;
114
124
  }
115
125
 
116
126
  getSignature(): string {
@@ -147,6 +157,8 @@ export class ABIMethod {
147
157
  type: this.returns.type.toString(),
148
158
  desc: this.returns.description,
149
159
  },
160
+ events: this.events,
161
+ readonly: this.readonly,
150
162
  };
151
163
  }
152
164
 
@@ -4284,6 +4284,12 @@ export class SimulateRequest extends BaseModel {
4284
4284
  */
4285
4285
  public extraOpcodeBudget?: number | bigint;
4286
4286
 
4287
+ /**
4288
+ * If true, signers for transactions that are missing signatures will be fixed
4289
+ * during evaluation.
4290
+ */
4291
+ public fixSigners?: boolean;
4292
+
4287
4293
  /**
4288
4294
  * If provided, specifies the round preceding the simulation. State changes through
4289
4295
  * this round will be used to run this simulation. Usually only the 4 most recent
@@ -4301,6 +4307,8 @@ export class SimulateRequest extends BaseModel {
4301
4307
  * @param allowUnnamedResources - Allows access to unnamed resources during simulation.
4302
4308
  * @param execTraceConfig - An object that configures simulation execution trace.
4303
4309
  * @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
4310
+ * @param fixSigners - If true, signers for transactions that are missing signatures will be fixed
4311
+ * during evaluation.
4304
4312
  * @param round - If provided, specifies the round preceding the simulation. State changes through
4305
4313
  * this round will be used to run this simulation. Usually only the 4 most recent
4306
4314
  * rounds will be available (controlled by the node config value MaxAcctLookback).
@@ -4313,6 +4321,7 @@ export class SimulateRequest extends BaseModel {
4313
4321
  allowUnnamedResources,
4314
4322
  execTraceConfig,
4315
4323
  extraOpcodeBudget,
4324
+ fixSigners,
4316
4325
  round,
4317
4326
  }: {
4318
4327
  txnGroups: SimulateRequestTransactionGroup[];
@@ -4321,6 +4330,7 @@ export class SimulateRequest extends BaseModel {
4321
4330
  allowUnnamedResources?: boolean;
4322
4331
  execTraceConfig?: SimulateTraceConfig;
4323
4332
  extraOpcodeBudget?: number | bigint;
4333
+ fixSigners?: boolean;
4324
4334
  round?: number | bigint;
4325
4335
  }) {
4326
4336
  super();
@@ -4330,6 +4340,7 @@ export class SimulateRequest extends BaseModel {
4330
4340
  this.allowUnnamedResources = allowUnnamedResources;
4331
4341
  this.execTraceConfig = execTraceConfig;
4332
4342
  this.extraOpcodeBudget = extraOpcodeBudget;
4343
+ this.fixSigners = fixSigners;
4333
4344
  this.round = round;
4334
4345
 
4335
4346
  this.attribute_map = {
@@ -4339,6 +4350,7 @@ export class SimulateRequest extends BaseModel {
4339
4350
  allowUnnamedResources: 'allow-unnamed-resources',
4340
4351
  execTraceConfig: 'exec-trace-config',
4341
4352
  extraOpcodeBudget: 'extra-opcode-budget',
4353
+ fixSigners: 'fix-signers',
4342
4354
  round: 'round',
4343
4355
  };
4344
4356
  }
@@ -4362,6 +4374,7 @@ export class SimulateRequest extends BaseModel {
4362
4374
  ? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
4363
4375
  : undefined,
4364
4376
  extraOpcodeBudget: data['extra-opcode-budget'],
4377
+ fixSigners: data['fix-signers'],
4365
4378
  round: data['round'],
4366
4379
  });
4367
4380
  /* eslint-enable dot-notation */
@@ -4751,6 +4764,12 @@ export class SimulateTransactionResult extends BaseModel {
4751
4764
  */
4752
4765
  public execTrace?: SimulationTransactionExecTrace;
4753
4766
 
4767
+ /**
4768
+ * The account that needed to sign this transaction when no signature was provided
4769
+ * and the provided signer was incorrect.
4770
+ */
4771
+ public fixedSigner?: string;
4772
+
4754
4773
  /**
4755
4774
  * Budget used during execution of a logic sig transaction.
4756
4775
  */
@@ -4777,6 +4796,8 @@ export class SimulateTransactionResult extends BaseModel {
4777
4796
  * budged used by inner app calls spawned by this transaction.
4778
4797
  * @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
4779
4798
  * call trace in a recursive way.
4799
+ * @param fixedSigner - The account that needed to sign this transaction when no signature was provided
4800
+ * and the provided signer was incorrect.
4780
4801
  * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
4781
4802
  * @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
4782
4803
  * caused failure, but were allowed in simulation. Depending on where this object
@@ -4792,12 +4813,14 @@ export class SimulateTransactionResult extends BaseModel {
4792
4813
  txnResult,
4793
4814
  appBudgetConsumed,
4794
4815
  execTrace,
4816
+ fixedSigner,
4795
4817
  logicSigBudgetConsumed,
4796
4818
  unnamedResourcesAccessed,
4797
4819
  }: {
4798
4820
  txnResult: PendingTransactionResponse;
4799
4821
  appBudgetConsumed?: number | bigint;
4800
4822
  execTrace?: SimulationTransactionExecTrace;
4823
+ fixedSigner?: string;
4801
4824
  logicSigBudgetConsumed?: number | bigint;
4802
4825
  unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
4803
4826
  }) {
@@ -4805,6 +4828,7 @@ export class SimulateTransactionResult extends BaseModel {
4805
4828
  this.txnResult = txnResult;
4806
4829
  this.appBudgetConsumed = appBudgetConsumed;
4807
4830
  this.execTrace = execTrace;
4831
+ this.fixedSigner = fixedSigner;
4808
4832
  this.logicSigBudgetConsumed = logicSigBudgetConsumed;
4809
4833
  this.unnamedResourcesAccessed = unnamedResourcesAccessed;
4810
4834
 
@@ -4812,6 +4836,7 @@ export class SimulateTransactionResult extends BaseModel {
4812
4836
  txnResult: 'txn-result',
4813
4837
  appBudgetConsumed: 'app-budget-consumed',
4814
4838
  execTrace: 'exec-trace',
4839
+ fixedSigner: 'fixed-signer',
4815
4840
  logicSigBudgetConsumed: 'logic-sig-budget-consumed',
4816
4841
  unnamedResourcesAccessed: 'unnamed-resources-accessed',
4817
4842
  };
@@ -4837,6 +4862,7 @@ export class SimulateTransactionResult extends BaseModel {
4837
4862
  data['exec-trace']
4838
4863
  )
4839
4864
  : undefined,
4865
+ fixedSigner: data['fixed-signer'],
4840
4866
  logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
4841
4867
  unnamedResourcesAccessed:
4842
4868
  typeof data['unnamed-resources-accessed'] !== 'undefined'
@@ -5006,6 +5032,12 @@ export class SimulationEvalOverrides extends BaseModel {
5006
5032
  */
5007
5033
  public extraOpcodeBudget?: number | bigint;
5008
5034
 
5035
+ /**
5036
+ * If true, signers for transactions that are missing signatures will be fixed
5037
+ * during evaluation.
5038
+ */
5039
+ public fixSigners?: boolean;
5040
+
5009
5041
  /**
5010
5042
  * The maximum log calls one can make during simulation
5011
5043
  */
@@ -5022,6 +5054,8 @@ export class SimulationEvalOverrides extends BaseModel {
5022
5054
  * were properly signed.
5023
5055
  * @param allowUnnamedResources - If true, allows access to unnamed resources during simulation.
5024
5056
  * @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
5057
+ * @param fixSigners - If true, signers for transactions that are missing signatures will be fixed
5058
+ * during evaluation.
5025
5059
  * @param maxLogCalls - The maximum log calls one can make during simulation
5026
5060
  * @param maxLogSize - The maximum byte number to log during simulation
5027
5061
  */
@@ -5029,12 +5063,14 @@ export class SimulationEvalOverrides extends BaseModel {
5029
5063
  allowEmptySignatures,
5030
5064
  allowUnnamedResources,
5031
5065
  extraOpcodeBudget,
5066
+ fixSigners,
5032
5067
  maxLogCalls,
5033
5068
  maxLogSize,
5034
5069
  }: {
5035
5070
  allowEmptySignatures?: boolean;
5036
5071
  allowUnnamedResources?: boolean;
5037
5072
  extraOpcodeBudget?: number | bigint;
5073
+ fixSigners?: boolean;
5038
5074
  maxLogCalls?: number | bigint;
5039
5075
  maxLogSize?: number | bigint;
5040
5076
  }) {
@@ -5042,6 +5078,7 @@ export class SimulationEvalOverrides extends BaseModel {
5042
5078
  this.allowEmptySignatures = allowEmptySignatures;
5043
5079
  this.allowUnnamedResources = allowUnnamedResources;
5044
5080
  this.extraOpcodeBudget = extraOpcodeBudget;
5081
+ this.fixSigners = fixSigners;
5045
5082
  this.maxLogCalls = maxLogCalls;
5046
5083
  this.maxLogSize = maxLogSize;
5047
5084
 
@@ -5049,6 +5086,7 @@ export class SimulationEvalOverrides extends BaseModel {
5049
5086
  allowEmptySignatures: 'allow-empty-signatures',
5050
5087
  allowUnnamedResources: 'allow-unnamed-resources',
5051
5088
  extraOpcodeBudget: 'extra-opcode-budget',
5089
+ fixSigners: 'fix-signers',
5052
5090
  maxLogCalls: 'max-log-calls',
5053
5091
  maxLogSize: 'max-log-size',
5054
5092
  };
@@ -5063,6 +5101,7 @@ export class SimulationEvalOverrides extends BaseModel {
5063
5101
  allowEmptySignatures: data['allow-empty-signatures'],
5064
5102
  allowUnnamedResources: data['allow-unnamed-resources'],
5065
5103
  extraOpcodeBudget: data['extra-opcode-budget'],
5104
+ fixSigners: data['fix-signers'],
5066
5105
  maxLogCalls: data['max-log-calls'],
5067
5106
  maxLogSize: data['max-log-size'],
5068
5107
  });
package/src/makeTxn.ts CHANGED
@@ -39,6 +39,8 @@ import { RenameProperties, RenameProperty, Expand } from './types/utils';
39
39
  * genesisHash - string specifies hash genesis block of network in use
40
40
  * genesisID - string specifies genesis ID of network in use
41
41
  * @param rekeyTo - rekeyTo address, optional
42
+ *
43
+ * @deprecated This function will be removed in v3 in favor of {@link makePaymentTxnWithSuggestedParamsFromObject}
42
44
  */
43
45
  export function makePaymentTxnWithSuggestedParams(
44
46
  from: PaymentTxn['from'],
@@ -111,6 +113,8 @@ export function makePaymentTxnWithSuggestedParamsFromObject(
111
113
  * @param nonParticipation - configure whether the address wants to stop participating. If true,
112
114
  * voteKey, selectionKey, voteFirst, voteLast, and voteKeyDilution must be undefined.
113
115
  * @param stateProofKey - state proof key. for key deregistration, leave undefined
116
+ *
117
+ * @deprecated This function will be removed in v3 in favor of {@link makeKeyRegistrationTxnWithSuggestedParamsFromObject}
114
118
  */
115
119
  export function makeKeyRegistrationTxnWithSuggestedParams(
116
120
  from: KeyRegistrationTxn['from'],
@@ -245,6 +249,8 @@ export function makeKeyRegistrationTxnWithSuggestedParamsFromObject(o: any) {
245
249
  * genesisHash - string specifies hash genesis block of network in use
246
250
  * genesisID - string specifies genesis ID of network in use
247
251
  * @param rekeyTo - rekeyTo address, optional
252
+ *
253
+ * @deprecated This function will be removed in v3 in favor of {@link makeAssetCreateTxnWithSuggestedParamsFromObject}
248
254
  */
249
255
  export function makeAssetCreateTxnWithSuggestedParams(
250
256
  from: AssetCreateTxn['from'],
@@ -360,6 +366,8 @@ export function makeAssetCreateTxnWithSuggestedParamsFromObject(
360
366
  * genesisHash - string specifies hash genesis block of network in use
361
367
  * genesisID - string specifies genesis ID of network in use
362
368
  * @param rekeyTo - rekeyTo address, optional
369
+ *
370
+ * @deprecated This function will be removed in v3 in favor of {@link makeAssetConfigTxnWithSuggestedParamsFromObject}
363
371
  */
364
372
  export function makeAssetConfigTxnWithSuggestedParams(
365
373
  from: AssetConfigTxn['from'],
@@ -456,6 +464,8 @@ export function makeAssetConfigTxnWithSuggestedParamsFromObject(
456
464
  * genesisHash - string specifies hash genesis block of network in use
457
465
  * genesisID - string specifies genesis ID of network in use
458
466
  * @param rekeyTo - rekeyTo address, optional
467
+ *
468
+ * @deprecated This function will be removed in v3 in favor of {@link makeAssetDestroyTxnWithSuggestedParamsFromObject}
459
469
  */
460
470
  export function makeAssetDestroyTxnWithSuggestedParams(
461
471
  from: AssetDestroyTxn['from'],
@@ -514,6 +524,8 @@ export function makeAssetDestroyTxnWithSuggestedParamsFromObject(
514
524
  * genesisHash - string specifies hash genesis block of network in use
515
525
  * genesisID - string specifies genesis ID of network in use
516
526
  * @param rekeyTo - rekeyTo address, optional
527
+ *
528
+ * @deprecated This function will be removed in v3 in favor of {@link makeAssetFreezeTxnWithSuggestedParamsFromObject}
517
529
  */
518
530
  export function makeAssetFreezeTxnWithSuggestedParams(
519
531
  from: AssetFreezeTxn['from'],
@@ -592,6 +604,8 @@ export function makeAssetFreezeTxnWithSuggestedParamsFromObject(
592
604
  * genesisHash - string specifies hash genesis block of network in use
593
605
  * genesisID - string specifies genesis ID of network in use
594
606
  * @param rekeyTo - rekeyTo address, optional
607
+ *
608
+ * @deprecated This function will be removed in v3 in favor of {@link makeAssetTransferTxnWithSuggestedParamsFromObject}
595
609
  */
596
610
  export function makeAssetTransferTxnWithSuggestedParams(
597
611
  from: AssetTransferTxn['from'],
@@ -682,6 +696,8 @@ export function makeAssetTransferTxnWithSuggestedParamsFromObject(
682
696
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
683
697
  * @param extraPages - integer extra pages of memory to rent on creation of application
684
698
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
699
+ *
700
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationCreateTxnFromObject}
685
701
  */
686
702
  export function makeApplicationCreateTxn(
687
703
  from: AppCreateTxn['from'],
@@ -813,6 +829,8 @@ export function makeApplicationCreateTxnFromObject(
813
829
  * @param lease - Lease a transaction
814
830
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
815
831
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
832
+ *
833
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationUpdateTxnFromObject}
816
834
  */
817
835
  export function makeApplicationUpdateTxn(
818
836
  from: AppUpdateTxn['from'],
@@ -917,6 +935,8 @@ export function makeApplicationUpdateTxnFromObject(
917
935
  * @param lease - Lease a transaction
918
936
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
919
937
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
938
+ *
939
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationDeleteTxnFromObject}
920
940
  */
921
941
  export function makeApplicationDeleteTxn(
922
942
  from: AppDeleteTxn['from'],
@@ -1011,6 +1031,8 @@ export function makeApplicationDeleteTxnFromObject(
1011
1031
  * @param lease - Lease a transaction
1012
1032
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
1013
1033
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
1034
+ *
1035
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationOptInTxnFromObject}
1014
1036
  */
1015
1037
  export function makeApplicationOptInTxn(
1016
1038
  from: AppOptInTxn['from'],
@@ -1105,6 +1127,8 @@ export function makeApplicationOptInTxnFromObject(
1105
1127
  * @param lease - Lease a transaction
1106
1128
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
1107
1129
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
1130
+ *
1131
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationCloseOutTxnFromObject}
1108
1132
  */
1109
1133
  export function makeApplicationCloseOutTxn(
1110
1134
  from: AppCloseOutTxn['from'],
@@ -1199,6 +1223,8 @@ export function makeApplicationCloseOutTxnFromObject(
1199
1223
  * @param lease - Lease a transaction
1200
1224
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
1201
1225
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
1226
+ *
1227
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationClearStateTxnFromObject}
1202
1228
  */
1203
1229
  export function makeApplicationClearStateTxn(
1204
1230
  from: AppClearStateTxn['from'],
@@ -1293,6 +1319,8 @@ export function makeApplicationClearStateTxnFromObject(
1293
1319
  * @param lease - Lease a transaction
1294
1320
  * @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
1295
1321
  * @param boxes - Array of BoxReference, app ID and name of box to be accessed
1322
+ *
1323
+ * @deprecated This function will be removed in v3 in favor of {@link makeApplicationNoOpTxnFromObject}
1296
1324
  */
1297
1325
  export function makeApplicationNoOpTxn(
1298
1326
  from: AppNoOpTxn['from'],