@algorandfoundation/algokit-utils 7.0.0-beta.6 → 7.0.0-beta.7

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 (98) hide show
  1. package/app.d.ts +6 -6
  2. package/app.js +6 -6
  3. package/app.js.map +1 -1
  4. package/app.mjs +6 -6
  5. package/app.mjs.map +1 -1
  6. package/asset.d.ts +3 -3
  7. package/asset.js +3 -3
  8. package/asset.js.map +1 -1
  9. package/asset.mjs +3 -3
  10. package/asset.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/testing/fixtures/algorand-fixture.js +1 -1
  13. package/testing/fixtures/algorand-fixture.js.map +1 -1
  14. package/testing/fixtures/algorand-fixture.mjs +1 -1
  15. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  16. package/transaction/legacy-bridge.d.ts +3 -3
  17. package/transaction/legacy-bridge.js.map +1 -1
  18. package/transaction/legacy-bridge.mjs.map +1 -1
  19. package/transaction/transaction.d.ts +1 -3
  20. package/transaction/transaction.js +17 -11
  21. package/transaction/transaction.js.map +1 -1
  22. package/transaction/transaction.mjs +17 -11
  23. package/transaction/transaction.mjs.map +1 -1
  24. package/transfer/transfer-algos.d.ts +1 -1
  25. package/transfer/transfer-algos.js +1 -1
  26. package/transfer/transfer-algos.js.map +1 -1
  27. package/transfer/transfer-algos.mjs +1 -1
  28. package/transfer/transfer-algos.mjs.map +1 -1
  29. package/transfer/transfer.d.ts +1 -1
  30. package/transfer/transfer.js +1 -1
  31. package/transfer/transfer.js.map +1 -1
  32. package/transfer/transfer.mjs +1 -1
  33. package/transfer/transfer.mjs.map +1 -1
  34. package/types/account-manager.d.ts +13 -4
  35. package/types/account-manager.js +17 -3
  36. package/types/account-manager.js.map +1 -1
  37. package/types/account-manager.mjs +17 -3
  38. package/types/account-manager.mjs.map +1 -1
  39. package/types/algorand-client-interface.d.ts +1 -1
  40. package/types/algorand-client-transaction-creator.d.ts +30 -30
  41. package/types/algorand-client-transaction-creator.js +30 -30
  42. package/types/algorand-client-transaction-creator.js.map +1 -1
  43. package/types/algorand-client-transaction-creator.mjs +30 -30
  44. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  45. package/types/algorand-client-transaction-sender.d.ts +18 -18
  46. package/types/algorand-client-transaction-sender.js +1 -1
  47. package/types/algorand-client-transaction-sender.js.map +1 -1
  48. package/types/algorand-client-transaction-sender.mjs +1 -1
  49. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  50. package/types/algorand-client.d.ts +8 -8
  51. package/types/algorand-client.js +8 -8
  52. package/types/algorand-client.js.map +1 -1
  53. package/types/algorand-client.mjs +8 -8
  54. package/types/algorand-client.mjs.map +1 -1
  55. package/types/app-arc56.d.ts +60 -37
  56. package/types/app-arc56.js +37 -16
  57. package/types/app-arc56.js.map +1 -1
  58. package/types/app-arc56.mjs +37 -16
  59. package/types/app-arc56.mjs.map +1 -1
  60. package/types/app-client.d.ts +101 -78
  61. package/types/app-client.js +145 -84
  62. package/types/app-client.js.map +1 -1
  63. package/types/app-client.mjs +145 -84
  64. package/types/app-client.mjs.map +1 -1
  65. package/types/app-deployer.d.ts +2 -2
  66. package/types/app-deployer.js +24 -24
  67. package/types/app-deployer.js.map +1 -1
  68. package/types/app-deployer.mjs +24 -24
  69. package/types/app-deployer.mjs.map +1 -1
  70. package/types/app-factory.d.ts +141 -86
  71. package/types/app-factory.js +106 -34
  72. package/types/app-factory.js.map +1 -1
  73. package/types/app-factory.mjs +107 -35
  74. package/types/app-factory.mjs.map +1 -1
  75. package/types/app-spec.js +15 -9
  76. package/types/app-spec.js.map +1 -1
  77. package/types/app-spec.mjs +15 -9
  78. package/types/app-spec.mjs.map +1 -1
  79. package/types/asset-manager.d.ts +3 -3
  80. package/types/asset-manager.js +2 -2
  81. package/types/asset-manager.js.map +1 -1
  82. package/types/asset-manager.mjs +2 -2
  83. package/types/asset-manager.mjs.map +1 -1
  84. package/types/client-manager.d.ts +30 -8
  85. package/types/client-manager.js +6 -0
  86. package/types/client-manager.js.map +1 -1
  87. package/types/client-manager.mjs +6 -0
  88. package/types/client-manager.mjs.map +1 -1
  89. package/types/composer.d.ts +29 -4
  90. package/types/composer.js +24 -7
  91. package/types/composer.js.map +1 -1
  92. package/types/composer.mjs +24 -7
  93. package/types/composer.mjs.map +1 -1
  94. package/types/kmd-account-manager.js +1 -1
  95. package/types/kmd-account-manager.js.map +1 -1
  96. package/types/kmd-account-manager.mjs +1 -1
  97. package/types/kmd-account-manager.mjs.map +1 -1
  98. package/types/transaction.d.ts +4 -6
@@ -57,10 +57,19 @@ class AppClient {
57
57
  this._boxStateMethods = this.getBoxMethods();
58
58
  this._paramsMethods = {
59
59
  ...this.getMethodCallParamsMethods(),
60
+ /** Get parameters to define bare (raw) transactions to the current app */
60
61
  bare: this.getBareParamsMethods(),
61
62
  };
62
- this._transactionsMethods = { ...this.getMethodCallTransactionsMethods(), bare: this.getBareTransactionsMethods() };
63
- this._sendMethods = { ...this.getMethodCallSendMethods(), bare: this.getBareSendMethods() };
63
+ this._createTransactionsMethods = {
64
+ ...this.getMethodCallCreateTransactionMethods(),
65
+ /** Get transactions for bare (raw) calls to the current app */
66
+ bare: this.getBareCreateTransactionMethods(),
67
+ };
68
+ this._sendMethods = {
69
+ ...this.getMethodCallSendMethods(),
70
+ /** Send bare (raw) transactions to the current app */
71
+ bare: this.getBareSendMethods(),
72
+ };
64
73
  }
65
74
  /** Start a new `AlgoKitComposer` transaction group */
66
75
  newGroup() {
@@ -136,18 +145,33 @@ class AppClient {
136
145
  get appSpec() {
137
146
  return this._appSpec;
138
147
  }
139
- /** Get parameters to define transactions to the current app */
148
+ /** Get parameters to create transactions for the current app.
149
+ *
150
+ * A good mental model for this is that these parameters represent a deferred transaction creation.
151
+ * @example Create a transaction in the future using Algorand Client
152
+ * ```typescript
153
+ * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})
154
+ * // ...
155
+ * await algorand.send.AppMethodCall(myMethodCall)
156
+ * ```
157
+ * @example Define a nested transaction as an ABI argument
158
+ * ```typescript
159
+ * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})
160
+ * await appClient.send.call({method: 'my_method2', args: [myMethodCall]})
161
+ * ```
162
+ */
140
163
  get params() {
141
164
  return this._paramsMethods;
142
165
  }
143
- /** Get transactions for the current app */
144
- get transactions() {
145
- return this._transactionsMethods;
166
+ /** Create transactions for the current app */
167
+ get createTransaction() {
168
+ return this._createTransactionsMethods;
146
169
  }
147
- /** Send calls to the current app */
170
+ /** Send transactions to the current app */
148
171
  get send() {
149
172
  return this._sendMethods;
150
173
  }
174
+ /** Get state (local, global, box) from the current app */
151
175
  get state() {
152
176
  return {
153
177
  /**
@@ -167,6 +191,8 @@ class AppClient {
167
191
  }
168
192
  /**
169
193
  * Funds Algo into the app account for this app.
194
+ *
195
+ * An alias for `appClient.send.fundAppAccount(params)`.
170
196
  * @param params The parameters for the funding transaction
171
197
  * @returns The result of the funding
172
198
  */
@@ -279,7 +305,7 @@ class AppClient {
279
305
  this._clearSourceMap = new SourceMap(sourceMaps.clearSourceMap);
280
306
  }
281
307
  /**
282
- * Returns the ABI Method for the given method name string for the app represented by this application client instance
308
+ * Returns the ABI Method spec for the given method string for the app represented by this application client instance
283
309
  * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.
284
310
  * e.g. `my_method` or `my_method(unit64,string)bytes`
285
311
  * @returns A tuple with: [ARC-56 `Method`, algosdk `ABIMethod`]
@@ -289,18 +315,37 @@ class AppClient {
289
315
  }
290
316
  /**
291
317
  * Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type
292
- * on the ARC-56 method.
318
+ * on the ARC-56 method, replacing the `return` property with the decoded type.
293
319
  *
294
- * If the return type is a struct then the struct will be returned.
320
+ * If the return type is an ARC-56 struct then the struct will be returned.
295
321
  *
296
322
  * @param result The SendAppTransactionResult to be mapped
297
323
  * @param method The method that was called
298
324
  * @returns The smart contract response with an updated return value
299
325
  */
300
- async parseMethodCallReturn(result, method) {
326
+ async processMethodCallReturn(result, method) {
301
327
  const resultValue = await result;
302
328
  return { ...resultValue, return: getArc56ReturnValue(resultValue.return, method, this._appSpec.structs) };
303
329
  }
330
+ /**
331
+ * Compiles the approval and clear state programs (if TEAL templates provided),
332
+ * performing any provided deploy-time parameter replacement and stores
333
+ * the source maps.
334
+ *
335
+ * If no TEAL templates provided it will use any byte code provided in the app spec.
336
+ *
337
+ * Will store any generated source maps for later use in debugging.
338
+ */
339
+ async compile(compilation) {
340
+ const result = await AppClient.compile(this._appSpec, this._algorand.app, compilation);
341
+ if (result.compiledApproval) {
342
+ this._approvalSourceMap = result.compiledApproval.sourceMap;
343
+ }
344
+ if (result.compiledClear) {
345
+ this._clearSourceMap = result.compiledClear.sourceMap;
346
+ }
347
+ return result;
348
+ }
304
349
  /**
305
350
  * Takes an error that may include a logic error from a call to the current app and re-exposes the
306
351
  * error to include source code information via the source map and ARC-56 spec.
@@ -349,7 +394,9 @@ class AppClient {
349
394
  }
350
395
  return {
351
396
  approvalProgram: Buffer.from(appSpec.byteCode.approval, 'base64'),
397
+ compiledApproval: undefined,
352
398
  clearStateProgram: Buffer.from(appSpec.byteCode.clear, 'base64'),
399
+ compiledClear: undefined,
353
400
  };
354
401
  }
355
402
  const approvalTemplate = Buffer.from(appSpec.source.approval, 'base64').toString('utf-8');
@@ -382,24 +429,53 @@ class AppClient {
382
429
  * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.
383
430
  * e.g. `my_method` or `my_method(unit64,string)bytes`
384
431
  * @param args The arguments to the method with `undefined` for any that should be populated with a default value
385
- * @param appSpec The app spec for the app
386
432
  */
387
- static getABIArgsWithDefaultValues(methodNameOrSignature, args, appSpec) {
388
- const m = getArc56Method(methodNameOrSignature, appSpec);
389
- return args?.map((a, i) => {
433
+ async getABIArgsWithDefaultValues(methodNameOrSignature, args, sender) {
434
+ const m = getArc56Method(methodNameOrSignature, this._appSpec);
435
+ return await Promise.all(args?.map(async (a, i) => {
390
436
  const arg = m.args[i];
391
437
  if (a !== undefined) {
392
438
  // If a struct then convert to tuple for the underlying call
393
439
  return arg.struct && typeof a === 'object' && !Array.isArray(a)
394
- ? getABITupleFromABIStruct(a, appSpec.structs[arg.struct])
440
+ ? getABITupleFromABIStruct(a, this._appSpec.structs[arg.struct], this._appSpec.structs)
395
441
  : a;
396
442
  }
397
- // todo: expand this to match previous ApplicationClient implementation when ARC-56 spec is updated to support other default value options
398
443
  const defaultValue = arg.defaultValue;
399
- if (defaultValue)
400
- return getABIDecodedValue(Buffer.from(defaultValue, 'base64'), m.method.args[i].type, {});
444
+ if (defaultValue) {
445
+ switch (defaultValue.source) {
446
+ case 'literal':
447
+ if (typeof defaultValue.data === 'number')
448
+ return defaultValue.data;
449
+ return getABIDecodedValue(Buffer.from(defaultValue.data, 'base64'), m.method.args[i].defaultValue?.type ?? m.method.args[i].type, this._appSpec.structs);
450
+ // todo: When ARC-56 supports ABI calls as default args
451
+ // case 'abi': {
452
+ // const method = this.getABIMethod(defaultValue.data as string)
453
+ // const result = await this.send.call({
454
+ // method: defaultValue.data as string,
455
+ // methodArgs: method.args.map(() => undefined),
456
+ // sender,
457
+ // })
458
+ // return result.return!
459
+ // }
460
+ case 'local':
461
+ case 'global': {
462
+ const state = defaultValue.source === 'global' ? await this.getGlobalState() : await this.getLocalState(sender);
463
+ const value = Object.values(state).find((s) => s.keyBase64 === defaultValue.data);
464
+ if (!value) {
465
+ throw new Error(`Preparing default value for argument ${arg.name ?? `arg${i + 1}`} resulted in the failure: The key '${defaultValue.data}' could not be found in ${defaultValue.source} storage`);
466
+ }
467
+ return 'valueRaw' in value
468
+ ? getABIDecodedValue(value.valueRaw, m.method.args[i].defaultValue?.type ?? m.method.args[i].type, this._appSpec.structs)
469
+ : value.value;
470
+ }
471
+ case 'box': {
472
+ const value = await this.getBoxValue(Buffer.from(defaultValue.data, 'base64'));
473
+ return getABIDecodedValue(value, m.method.args[i].defaultValue?.type ?? m.method.args[i].type, this._appSpec.structs);
474
+ }
475
+ }
476
+ }
401
477
  throw new Error(`No value provided for required argument ${arg.name ?? `arg${i + 1}`} in call to method ${m.name}`);
402
- });
478
+ }) ?? []);
403
479
  }
404
480
  getBareParamsMethods() {
405
481
  return {
@@ -432,31 +508,31 @@ class AppClient {
432
508
  },
433
509
  };
434
510
  }
435
- getBareTransactionsMethods() {
511
+ getBareCreateTransactionMethods() {
436
512
  return {
437
513
  /** Returns a transaction for an update call, including deploy-time TEAL template replacements and compilation if provided */
438
514
  update: async (params) => {
439
- return this._algorand.transactions.appUpdate(await this.params.bare.update(params));
515
+ return this._algorand.createTransaction.appUpdate(await this.params.bare.update(params));
440
516
  },
441
517
  /** Returns a transaction for an opt-in call */
442
518
  optIn: (params) => {
443
- return this._algorand.transactions.appCall(this.params.bare.optIn(params));
519
+ return this._algorand.createTransaction.appCall(this.params.bare.optIn(params));
444
520
  },
445
521
  /** Returns a transaction for a delete call */
446
522
  delete: (params) => {
447
- return this._algorand.transactions.appDelete(this.params.bare.delete(params));
523
+ return this._algorand.createTransaction.appDelete(this.params.bare.delete(params));
448
524
  },
449
525
  /** Returns a transaction for a clear state call */
450
526
  clearState: (params) => {
451
- return this._algorand.transactions.appCall(this.params.bare.clearState(params));
527
+ return this._algorand.createTransaction.appCall(this.params.bare.clearState(params));
452
528
  },
453
529
  /** Returns a transaction for a close out call */
454
530
  closeOut: (params) => {
455
- return this._algorand.transactions.appCall(this.params.bare.closeOut(params));
531
+ return this._algorand.createTransaction.appCall(this.params.bare.closeOut(params));
456
532
  },
457
533
  /** Returns a transaction for a call (defaults to no-op) */
458
534
  call: (params) => {
459
- return this._algorand.transactions.appCall(this.params.bare.call(params));
535
+ return this._algorand.createTransaction.appCall(this.params.bare.call(params));
460
536
  },
461
537
  };
462
538
  }
@@ -500,26 +576,26 @@ class AppClient {
500
576
  },
501
577
  /** Return params for an update ABI call, including deploy-time TEAL template replacements and compilation if provided */
502
578
  update: async (params) => {
503
- return this.getABIParams({
579
+ return (await this.getABIParams({
504
580
  ...params,
505
581
  ...(await this.compile(params)),
506
- }, OnApplicationComplete.UpdateApplicationOC);
582
+ }, OnApplicationComplete.UpdateApplicationOC));
507
583
  },
508
584
  /** Return params for an opt-in ABI call */
509
- optIn: (params) => {
510
- return this.getABIParams(params, OnApplicationComplete.OptInOC);
585
+ optIn: async (params) => {
586
+ return (await this.getABIParams(params, OnApplicationComplete.OptInOC));
511
587
  },
512
588
  /** Return params for an delete ABI call */
513
- delete: (params) => {
514
- return this.getABIParams(params, OnApplicationComplete.DeleteApplicationOC);
589
+ delete: async (params) => {
590
+ return (await this.getABIParams(params, OnApplicationComplete.DeleteApplicationOC));
515
591
  },
516
592
  /** Return params for an close out ABI call */
517
- closeOut: (params) => {
518
- return this.getABIParams(params, OnApplicationComplete.CloseOutOC);
593
+ closeOut: async (params) => {
594
+ return (await this.getABIParams(params, OnApplicationComplete.CloseOutOC));
519
595
  },
520
596
  /** Return params for an ABI call */
521
- call: (params) => {
522
- return this.getABIParams(params, params.onComplete ?? OnApplicationComplete.NoOpOC);
597
+ call: async (params) => {
598
+ return (await this.getABIParams(params, params.onComplete ?? OnApplicationComplete.NoOpOC));
523
599
  },
524
600
  };
525
601
  }
@@ -535,7 +611,7 @@ class AppClient {
535
611
  update: async (params) => {
536
612
  const compiled = await this.compile(params);
537
613
  return {
538
- ...(await this.handleCallErrors(async () => this.parseMethodCallReturn(this._algorand.send.appUpdateMethodCall(await this.params.update({ ...params })), getArc56Method(params.method, this._appSpec)))),
614
+ ...(await this.handleCallErrors(async () => this.processMethodCallReturn(this._algorand.send.appUpdateMethodCall(await this.params.update({ ...params })), getArc56Method(params.method, this._appSpec)))),
539
615
  ...compiled,
540
616
  };
541
617
  },
@@ -543,19 +619,19 @@ class AppClient {
543
619
  * Sign and send transactions for an opt-in ABI call
544
620
  */
545
621
  optIn: (params) => {
546
- return this.handleCallErrors(() => this.parseMethodCallReturn(this._algorand.send.appCallMethodCall(this.params.optIn(params)), getArc56Method(params.method, this._appSpec)));
622
+ return this.handleCallErrors(async () => this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.optIn(params)), getArc56Method(params.method, this._appSpec)));
547
623
  },
548
624
  /**
549
625
  * Sign and send transactions for a delete ABI call
550
626
  */
551
627
  delete: (params) => {
552
- return this.handleCallErrors(() => this.parseMethodCallReturn(this._algorand.send.appDeleteMethodCall(this.params.delete(params)), getArc56Method(params.method, this._appSpec)));
628
+ return this.handleCallErrors(async () => this.processMethodCallReturn(this._algorand.send.appDeleteMethodCall(await this.params.delete(params)), getArc56Method(params.method, this._appSpec)));
553
629
  },
554
630
  /**
555
631
  * Sign and send transactions for a close out ABI call
556
632
  */
557
633
  closeOut: (params) => {
558
- return this.handleCallErrors(() => this.parseMethodCallReturn(this._algorand.send.appCallMethodCall(this.params.closeOut(params)), getArc56Method(params.method, this._appSpec)));
634
+ return this.handleCallErrors(async () => this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.closeOut(params)), getArc56Method(params.method, this._appSpec)));
559
635
  },
560
636
  /**
561
637
  * Sign and send transactions for a call (defaults to no-op)
@@ -564,8 +640,11 @@ class AppClient {
564
640
  // Read-only call - do it via simulate
565
641
  if (params.onComplete === OnApplicationComplete.NoOpOC ||
566
642
  (!params.onComplete && getArc56Method(params.method, this._appSpec).method.readonly)) {
567
- const result = await this._algorand.newGroup().addAppCallMethodCall(this.params.call(params)).simulate();
568
- return this.parseMethodCallReturn({
643
+ const result = await this._algorand
644
+ .newGroup()
645
+ .addAppCallMethodCall(await this.params.call(params))
646
+ .simulate();
647
+ return this.processMethodCallReturn({
569
648
  ...result,
570
649
  transaction: result.transactions.at(-1),
571
650
  confirmation: result.confirmations.at(-1),
@@ -573,67 +652,48 @@ class AppClient {
573
652
  return: (result.returns?.length ?? 0 > 0) ? result.returns?.at(-1) : undefined,
574
653
  }, getArc56Method(params.method, this._appSpec));
575
654
  }
576
- return this.handleCallErrors(() => this.parseMethodCallReturn(this._algorand.send.appCallMethodCall(this.params.call(params)), getArc56Method(params.method, this._appSpec)));
655
+ return this.handleCallErrors(async () => this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.call(params)), getArc56Method(params.method, this._appSpec)));
577
656
  },
578
657
  };
579
658
  }
580
- getMethodCallTransactionsMethods() {
659
+ getMethodCallCreateTransactionMethods() {
581
660
  return {
582
661
  /** Return transaction for a payment transaction to fund the app account */
583
662
  fundAppAccount: (params) => {
584
- return this._algorand.transactions.payment(this.params.fundAppAccount(params));
663
+ return this._algorand.createTransaction.payment(this.params.fundAppAccount(params));
585
664
  },
586
665
  /**
587
666
  * Return transactions for an update ABI call, including deploy-time TEAL template replacements and compilation if provided
588
667
  */
589
668
  update: async (params) => {
590
- return this._algorand.transactions.appUpdateMethodCall(await this.params.update(params));
669
+ return this._algorand.createTransaction.appUpdateMethodCall(await this.params.update(params));
591
670
  },
592
671
  /**
593
672
  * Return transactions for an opt-in ABI call
594
673
  */
595
- optIn: (params) => {
596
- return this._algorand.transactions.appCallMethodCall(this.params.optIn(params));
674
+ optIn: async (params) => {
675
+ return this._algorand.createTransaction.appCallMethodCall(await this.params.optIn(params));
597
676
  },
598
677
  /**
599
678
  * Return transactions for a delete ABI call
600
679
  */
601
- delete: (params) => {
602
- return this._algorand.transactions.appDeleteMethodCall(this.params.delete(params));
680
+ delete: async (params) => {
681
+ return this._algorand.createTransaction.appDeleteMethodCall(await this.params.delete(params));
603
682
  },
604
683
  /**
605
684
  * Return transactions for a close out ABI call
606
685
  */
607
- closeOut: (params) => {
608
- return this._algorand.transactions.appCallMethodCall(this.params.closeOut(params));
686
+ closeOut: async (params) => {
687
+ return this._algorand.createTransaction.appCallMethodCall(await this.params.closeOut(params));
609
688
  },
610
689
  /**
611
690
  * Return transactions for an ABI call (defaults to no-op)
612
691
  */
613
- call: (params) => {
614
- return this._algorand.transactions.appCallMethodCall(this.params.call(params));
692
+ call: async (params) => {
693
+ return this._algorand.createTransaction.appCallMethodCall(await this.params.call(params));
615
694
  },
616
695
  };
617
696
  }
618
- /**
619
- * Compiles the approval and clear state programs (if TEAL templates provided),
620
- * performing any provided deploy-time parameter replacement and stores
621
- * the source maps.
622
- *
623
- * If no TEAL templates provided it will use any byte code provided in the app spec.
624
- *
625
- * Will store any generated source maps for later use in debugging.
626
- */
627
- async compile(compilation) {
628
- const result = await AppClient.compile(this._appSpec, this._algorand.app, compilation);
629
- if (result.compiledApproval) {
630
- this._approvalSourceMap = result.compiledApproval.sourceMap;
631
- }
632
- if (result.compiledClear) {
633
- this._clearSourceMap = result.compiledClear.sourceMap;
634
- }
635
- return result;
636
- }
637
697
  /** Returns the sender for a call, using the `defaultSender`
638
698
  * if none provided and throws an error if neither provided */
639
699
  getSender(sender) {
@@ -650,13 +710,14 @@ class AppClient {
650
710
  onComplete,
651
711
  };
652
712
  }
653
- getABIParams(params, onComplete) {
713
+ async getABIParams(params, onComplete) {
714
+ const sender = this.getSender(params.sender);
654
715
  const method = getArc56Method(params.method, this._appSpec);
655
- const args = AppClient.getABIArgsWithDefaultValues(params.method, params.args, this._appSpec);
716
+ const args = await this.getABIArgsWithDefaultValues(params.method, params.args, sender);
656
717
  return {
657
718
  ...params,
658
719
  appId: this._appId,
659
- sender: this.getSender(params.sender),
720
+ sender: sender,
660
721
  method,
661
722
  onComplete,
662
723
  args,
@@ -1036,7 +1097,7 @@ class ApplicationClient {
1036
1097
  }
1037
1098
  }
1038
1099
  /**
1039
- * @deprecated Use `appClient.send.update` or `appClient.transactions.update` from an `AppClient` instance instead.
1100
+ * @deprecated Use `appClient.send.update` or `appClient.createTransaction.update` from an `AppClient` instance instead.
1040
1101
  *
1041
1102
  * Updates the smart contract app.
1042
1103
  * @param update The parameters to update the app with
@@ -1070,7 +1131,7 @@ class ApplicationClient {
1070
1131
  }
1071
1132
  }
1072
1133
  /**
1073
- * @deprecated Use `appClient.send.call` or `appClient.transactions.call` from an `AppClient` instance instead.
1134
+ * @deprecated Use `appClient.send.call` or `appClient.createTransaction.call` from an `AppClient` instance instead.
1074
1135
  *
1075
1136
  * Issues a no_op (normal) call to the app.
1076
1137
  * @param call The call details.
@@ -1105,7 +1166,7 @@ class ApplicationClient {
1105
1166
  return await this.callOfType(call, 'no_op');
1106
1167
  }
1107
1168
  /**
1108
- * @deprecated Use `appClient.send.optIn` or `appClient.transactions.optIn` from an `AppClient` instance instead.
1169
+ * @deprecated Use `appClient.send.optIn` or `appClient.createTransaction.optIn` from an `AppClient` instance instead.
1109
1170
  *
1110
1171
  * Issues a opt_in call to the app.
1111
1172
  * @param call The call details.
@@ -1115,7 +1176,7 @@ class ApplicationClient {
1115
1176
  return await this.callOfType(call, 'opt_in');
1116
1177
  }
1117
1178
  /**
1118
- * @deprecated Use `appClient.send.closeOut` or `appClient.transactions.closeOut` from an `AppClient` instance instead.
1179
+ * @deprecated Use `appClient.send.closeOut` or `appClient.createTransaction.closeOut` from an `AppClient` instance instead.
1119
1180
  *
1120
1181
  * Issues a close_out call to the app.
1121
1182
  * @param call The call details.
@@ -1125,7 +1186,7 @@ class ApplicationClient {
1125
1186
  return await this.callOfType(call, 'close_out');
1126
1187
  }
1127
1188
  /**
1128
- * @deprecated Use `appClient.send.clearState` or `appClient.transactions.clearState` from an `AppClient` instance instead.
1189
+ * @deprecated Use `appClient.send.clearState` or `appClient.createTransaction.clearState` from an `AppClient` instance instead.
1129
1190
  *
1130
1191
  * Issues a clear_state call to the app.
1131
1192
  * @param call The call details.
@@ -1135,7 +1196,7 @@ class ApplicationClient {
1135
1196
  return await this.callOfType(call, 'clear_state');
1136
1197
  }
1137
1198
  /**
1138
- * @deprecated Use `appClient.send.delete` or `appClient.transactions.delete` from an `AppClient` instance instead.
1199
+ * @deprecated Use `appClient.send.delete` or `appClient.createTransaction.delete` from an `AppClient` instance instead.
1139
1200
  *
1140
1201
  * Issues a delete_application call to the app.
1141
1202
  * @param call The call details.
@@ -1145,7 +1206,7 @@ class ApplicationClient {
1145
1206
  return await this.callOfType(call, 'delete_application');
1146
1207
  }
1147
1208
  /**
1148
- * @deprecated Use `appClient.send.call` or `appClient.transactions.call` from an `AppClient` instance instead.
1209
+ * @deprecated Use `appClient.send.call` or `appClient.createTransaction.call` from an `AppClient` instance instead.
1149
1210
  *
1150
1211
  * Issues a call to the app with the given call type.
1151
1212
  * @param call The call details.