algosdk 2.4.0 → 2.5.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 (54) 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/client/urlTokenBaseHTTPClient.js +0 -3
  5. package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -1
  6. package/dist/cjs/client/v2/algod/models/types.js +240 -15
  7. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  8. package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js +2 -3
  9. package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
  10. package/dist/cjs/client/v2/indexer/lookupAssetBalances.js +2 -1
  11. package/dist/cjs/client/v2/indexer/lookupAssetBalances.js.map +1 -1
  12. package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js +2 -4
  13. package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
  14. package/dist/cjs/client/v2/indexer/searchAccounts.js +2 -1
  15. package/dist/cjs/client/v2/indexer/searchAccounts.js.map +1 -1
  16. package/dist/cjs/client/v2/indexer/searchForTransactions.js +61 -62
  17. package/dist/cjs/client/v2/indexer/searchForTransactions.js.map +1 -1
  18. package/dist/cjs/nacl/naclWrappers.js +4 -0
  19. package/dist/cjs/nacl/naclWrappers.js.map +1 -1
  20. package/dist/cjs/utils/utils.js +13 -1
  21. package/dist/cjs/utils/utils.js.map +1 -1
  22. package/dist/esm/client/urlTokenBaseHTTPClient.js +0 -3
  23. package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -1
  24. package/dist/esm/client/v2/algod/models/types.js +233 -13
  25. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  26. package/dist/esm/client/v2/indexer/lookupAccountTransactions.js +2 -3
  27. package/dist/esm/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
  28. package/dist/esm/client/v2/indexer/lookupAssetBalances.js +2 -1
  29. package/dist/esm/client/v2/indexer/lookupAssetBalances.js.map +1 -1
  30. package/dist/esm/client/v2/indexer/lookupAssetTransactions.js +2 -4
  31. package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
  32. package/dist/esm/client/v2/indexer/searchAccounts.js +2 -1
  33. package/dist/esm/client/v2/indexer/searchAccounts.js.map +1 -1
  34. package/dist/esm/client/v2/indexer/searchForTransactions.js +61 -62
  35. package/dist/esm/client/v2/indexer/searchForTransactions.js.map +1 -1
  36. package/dist/esm/nacl/naclWrappers.js +4 -0
  37. package/dist/esm/nacl/naclWrappers.js.map +1 -1
  38. package/dist/esm/utils/utils.js +11 -0
  39. package/dist/esm/utils/utils.js.map +1 -1
  40. package/dist/types/client/v2/algod/models/types.d.ts +194 -4
  41. package/dist/types/client/v2/indexer/lookupAccountTransactions.d.ts +0 -2
  42. package/dist/types/client/v2/indexer/lookupAssetTransactions.d.ts +0 -3
  43. package/dist/types/client/v2/indexer/searchForTransactions.d.ts +54 -56
  44. package/dist/types/utils/utils.d.ts +5 -0
  45. package/package.json +4 -4
  46. package/src/client/urlTokenBaseHTTPClient.ts +0 -3
  47. package/src/client/v2/algod/models/types.ts +430 -9
  48. package/src/client/v2/indexer/lookupAccountTransactions.ts +2 -3
  49. package/src/client/v2/indexer/lookupAssetBalances.ts +2 -1
  50. package/src/client/v2/indexer/lookupAssetTransactions.ts +2 -4
  51. package/src/client/v2/indexer/searchAccounts.ts +2 -1
  52. package/src/client/v2/indexer/searchForTransactions.ts +63 -64
  53. package/src/nacl/naclWrappers.ts +6 -0
  54. package/src/utils/utils.ts +12 -0
@@ -1397,6 +1397,69 @@ export class AssetParams extends BaseModel {
1397
1397
  }
1398
1398
  }
1399
1399
 
1400
+ /**
1401
+ * Represents an AVM value.
1402
+ */
1403
+ export class AvmValue extends BaseModel {
1404
+ /**
1405
+ * value type. Value `1` refers to **bytes**, value `2` refers to **uint64**
1406
+ */
1407
+ public type: number | bigint;
1408
+
1409
+ /**
1410
+ * bytes value.
1411
+ */
1412
+ public bytes?: Uint8Array;
1413
+
1414
+ /**
1415
+ * uint value.
1416
+ */
1417
+ public uint?: number | bigint;
1418
+
1419
+ /**
1420
+ * Creates a new `AvmValue` object.
1421
+ * @param type - value type. Value `1` refers to **bytes**, value `2` refers to **uint64**
1422
+ * @param bytes - bytes value.
1423
+ * @param uint - uint value.
1424
+ */
1425
+ constructor({
1426
+ type,
1427
+ bytes,
1428
+ uint,
1429
+ }: {
1430
+ type: number | bigint;
1431
+ bytes?: string | Uint8Array;
1432
+ uint?: number | bigint;
1433
+ }) {
1434
+ super();
1435
+ this.type = type;
1436
+ this.bytes =
1437
+ typeof bytes === 'string'
1438
+ ? new Uint8Array(Buffer.from(bytes, 'base64'))
1439
+ : bytes;
1440
+ this.uint = uint;
1441
+
1442
+ this.attribute_map = {
1443
+ type: 'type',
1444
+ bytes: 'bytes',
1445
+ uint: 'uint',
1446
+ };
1447
+ }
1448
+
1449
+ // eslint-disable-next-line camelcase
1450
+ static from_obj_for_encoding(data: Record<string, any>): AvmValue {
1451
+ /* eslint-disable dot-notation */
1452
+ if (typeof data['type'] === 'undefined')
1453
+ throw new Error(`Response is missing required field 'type': ${data}`);
1454
+ return new AvmValue({
1455
+ type: data['type'],
1456
+ bytes: data['bytes'],
1457
+ uint: data['uint'],
1458
+ });
1459
+ /* eslint-enable dot-notation */
1460
+ }
1461
+ }
1462
+
1400
1463
  /**
1401
1464
  * Hash of a block header.
1402
1465
  */
@@ -1493,6 +1556,11 @@ export class Box extends BaseModel {
1493
1556
  */
1494
1557
  public name: Uint8Array;
1495
1558
 
1559
+ /**
1560
+ * The round for which this information is relevant
1561
+ */
1562
+ public round: number | bigint;
1563
+
1496
1564
  /**
1497
1565
  * (value) box value, base64 encoded.
1498
1566
  */
@@ -1501,13 +1569,16 @@ export class Box extends BaseModel {
1501
1569
  /**
1502
1570
  * Creates a new `Box` object.
1503
1571
  * @param name - (name) box name, base64 encoded
1572
+ * @param round - The round for which this information is relevant
1504
1573
  * @param value - (value) box value, base64 encoded.
1505
1574
  */
1506
1575
  constructor({
1507
1576
  name,
1577
+ round,
1508
1578
  value,
1509
1579
  }: {
1510
1580
  name: string | Uint8Array;
1581
+ round: number | bigint;
1511
1582
  value: string | Uint8Array;
1512
1583
  }) {
1513
1584
  super();
@@ -1515,6 +1586,7 @@ export class Box extends BaseModel {
1515
1586
  typeof name === 'string'
1516
1587
  ? new Uint8Array(Buffer.from(name, 'base64'))
1517
1588
  : name;
1589
+ this.round = round;
1518
1590
  this.value =
1519
1591
  typeof value === 'string'
1520
1592
  ? new Uint8Array(Buffer.from(value, 'base64'))
@@ -1522,6 +1594,7 @@ export class Box extends BaseModel {
1522
1594
 
1523
1595
  this.attribute_map = {
1524
1596
  name: 'name',
1597
+ round: 'round',
1525
1598
  value: 'value',
1526
1599
  };
1527
1600
  }
@@ -1531,10 +1604,13 @@ export class Box extends BaseModel {
1531
1604
  /* eslint-disable dot-notation */
1532
1605
  if (typeof data['name'] === 'undefined')
1533
1606
  throw new Error(`Response is missing required field 'name': ${data}`);
1607
+ if (typeof data['round'] === 'undefined')
1608
+ throw new Error(`Response is missing required field 'round': ${data}`);
1534
1609
  if (typeof data['value'] === 'undefined')
1535
1610
  throw new Error(`Response is missing required field 'value': ${data}`);
1536
1611
  return new Box({
1537
1612
  name: data['name'],
1613
+ round: data['round'],
1538
1614
  value: data['value'],
1539
1615
  });
1540
1616
  /* eslint-enable dot-notation */
@@ -2580,8 +2656,8 @@ export class LedgerStateDeltaForTransactionGroup extends BaseModel {
2580
2656
  this.ids = ids;
2581
2657
 
2582
2658
  this.attribute_map = {
2583
- delta: 'delta',
2584
- ids: 'ids',
2659
+ delta: 'Delta',
2660
+ ids: 'Ids',
2585
2661
  };
2586
2662
  }
2587
2663
 
@@ -2590,15 +2666,15 @@ export class LedgerStateDeltaForTransactionGroup extends BaseModel {
2590
2666
  data: Record<string, any>
2591
2667
  ): LedgerStateDeltaForTransactionGroup {
2592
2668
  /* eslint-disable dot-notation */
2593
- if (typeof data['delta'] === 'undefined')
2594
- throw new Error(`Response is missing required field 'delta': ${data}`);
2595
- if (!Array.isArray(data['ids']))
2669
+ if (typeof data['Delta'] === 'undefined')
2670
+ throw new Error(`Response is missing required field 'Delta': ${data}`);
2671
+ if (!Array.isArray(data['Ids']))
2596
2672
  throw new Error(
2597
- `Response is missing required array field 'ids': ${data}`
2673
+ `Response is missing required array field 'Ids': ${data}`
2598
2674
  );
2599
2675
  return new LedgerStateDeltaForTransactionGroup({
2600
- delta: data['delta'],
2601
- ids: data['ids'],
2676
+ delta: data['Delta'],
2677
+ ids: data['Ids'],
2602
2678
  });
2603
2679
  /* eslint-enable dot-notation */
2604
2680
  }
@@ -3344,6 +3420,59 @@ export class PostTransactionsResponse extends BaseModel {
3344
3420
  }
3345
3421
  }
3346
3422
 
3423
+ /**
3424
+ * A write operation into a scratch slot.
3425
+ */
3426
+ export class ScratchChange extends BaseModel {
3427
+ /**
3428
+ * Represents an AVM value.
3429
+ */
3430
+ public newValue: AvmValue;
3431
+
3432
+ /**
3433
+ * The scratch slot written.
3434
+ */
3435
+ public slot: number | bigint;
3436
+
3437
+ /**
3438
+ * Creates a new `ScratchChange` object.
3439
+ * @param newValue - Represents an AVM value.
3440
+ * @param slot - The scratch slot written.
3441
+ */
3442
+ constructor({
3443
+ newValue,
3444
+ slot,
3445
+ }: {
3446
+ newValue: AvmValue;
3447
+ slot: number | bigint;
3448
+ }) {
3449
+ super();
3450
+ this.newValue = newValue;
3451
+ this.slot = slot;
3452
+
3453
+ this.attribute_map = {
3454
+ newValue: 'new-value',
3455
+ slot: 'slot',
3456
+ };
3457
+ }
3458
+
3459
+ // eslint-disable-next-line camelcase
3460
+ static from_obj_for_encoding(data: Record<string, any>): ScratchChange {
3461
+ /* eslint-disable dot-notation */
3462
+ if (typeof data['new-value'] === 'undefined')
3463
+ throw new Error(
3464
+ `Response is missing required field 'new-value': ${data}`
3465
+ );
3466
+ if (typeof data['slot'] === 'undefined')
3467
+ throw new Error(`Response is missing required field 'slot': ${data}`);
3468
+ return new ScratchChange({
3469
+ newValue: AvmValue.from_obj_for_encoding(data['new-value']),
3470
+ slot: data['slot'],
3471
+ });
3472
+ /* eslint-enable dot-notation */
3473
+ }
3474
+ }
3475
+
3347
3476
  /**
3348
3477
  * Request type for simulation endpoint.
3349
3478
  */
@@ -3364,6 +3493,11 @@ export class SimulateRequest extends BaseModel {
3364
3493
  */
3365
3494
  public allowMoreLogging?: boolean;
3366
3495
 
3496
+ /**
3497
+ * An object that configures simulation execution trace.
3498
+ */
3499
+ public execTraceConfig?: SimulateTraceConfig;
3500
+
3367
3501
  /**
3368
3502
  * Applies extra opcode budget during simulation for each transaction group.
3369
3503
  */
@@ -3375,29 +3509,34 @@ export class SimulateRequest extends BaseModel {
3375
3509
  * @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
3376
3510
  * signatures.
3377
3511
  * @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
3512
+ * @param execTraceConfig - An object that configures simulation execution trace.
3378
3513
  * @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
3379
3514
  */
3380
3515
  constructor({
3381
3516
  txnGroups,
3382
3517
  allowEmptySignatures,
3383
3518
  allowMoreLogging,
3519
+ execTraceConfig,
3384
3520
  extraOpcodeBudget,
3385
3521
  }: {
3386
3522
  txnGroups: SimulateRequestTransactionGroup[];
3387
3523
  allowEmptySignatures?: boolean;
3388
3524
  allowMoreLogging?: boolean;
3525
+ execTraceConfig?: SimulateTraceConfig;
3389
3526
  extraOpcodeBudget?: number | bigint;
3390
3527
  }) {
3391
3528
  super();
3392
3529
  this.txnGroups = txnGroups;
3393
3530
  this.allowEmptySignatures = allowEmptySignatures;
3394
3531
  this.allowMoreLogging = allowMoreLogging;
3532
+ this.execTraceConfig = execTraceConfig;
3395
3533
  this.extraOpcodeBudget = extraOpcodeBudget;
3396
3534
 
3397
3535
  this.attribute_map = {
3398
3536
  txnGroups: 'txn-groups',
3399
3537
  allowEmptySignatures: 'allow-empty-signatures',
3400
3538
  allowMoreLogging: 'allow-more-logging',
3539
+ execTraceConfig: 'exec-trace-config',
3401
3540
  extraOpcodeBudget: 'extra-opcode-budget',
3402
3541
  };
3403
3542
  }
@@ -3415,6 +3554,10 @@ export class SimulateRequest extends BaseModel {
3415
3554
  ),
3416
3555
  allowEmptySignatures: data['allow-empty-signatures'],
3417
3556
  allowMoreLogging: data['allow-more-logging'],
3557
+ execTraceConfig:
3558
+ typeof data['exec-trace-config'] !== 'undefined'
3559
+ ? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
3560
+ : undefined,
3418
3561
  extraOpcodeBudget: data['extra-opcode-budget'],
3419
3562
  });
3420
3563
  /* eslint-enable dot-notation */
@@ -3486,6 +3629,11 @@ export class SimulateResponse extends BaseModel {
3486
3629
  */
3487
3630
  public evalOverrides?: SimulationEvalOverrides;
3488
3631
 
3632
+ /**
3633
+ * An object that configures simulation execution trace.
3634
+ */
3635
+ public execTraceConfig?: SimulateTraceConfig;
3636
+
3489
3637
  /**
3490
3638
  * Creates a new `SimulateResponse` object.
3491
3639
  * @param lastRound - The round immediately preceding this simulation. State changes through this
@@ -3495,29 +3643,34 @@ export class SimulateResponse extends BaseModel {
3495
3643
  * @param evalOverrides - The set of parameters and limits override during simulation. If this set of
3496
3644
  * parameters is present, then evaluation parameters may differ from standard
3497
3645
  * evaluation in certain ways.
3646
+ * @param execTraceConfig - An object that configures simulation execution trace.
3498
3647
  */
3499
3648
  constructor({
3500
3649
  lastRound,
3501
3650
  txnGroups,
3502
3651
  version,
3503
3652
  evalOverrides,
3653
+ execTraceConfig,
3504
3654
  }: {
3505
3655
  lastRound: number | bigint;
3506
3656
  txnGroups: SimulateTransactionGroupResult[];
3507
3657
  version: number | bigint;
3508
3658
  evalOverrides?: SimulationEvalOverrides;
3659
+ execTraceConfig?: SimulateTraceConfig;
3509
3660
  }) {
3510
3661
  super();
3511
3662
  this.lastRound = lastRound;
3512
3663
  this.txnGroups = txnGroups;
3513
3664
  this.version = version;
3514
3665
  this.evalOverrides = evalOverrides;
3666
+ this.execTraceConfig = execTraceConfig;
3515
3667
 
3516
3668
  this.attribute_map = {
3517
3669
  lastRound: 'last-round',
3518
3670
  txnGroups: 'txn-groups',
3519
3671
  version: 'version',
3520
3672
  evalOverrides: 'eval-overrides',
3673
+ execTraceConfig: 'exec-trace-config',
3521
3674
  };
3522
3675
  }
3523
3676
 
@@ -3546,6 +3699,72 @@ export class SimulateResponse extends BaseModel {
3546
3699
  data['eval-overrides']
3547
3700
  )
3548
3701
  : undefined,
3702
+ execTraceConfig:
3703
+ typeof data['exec-trace-config'] !== 'undefined'
3704
+ ? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
3705
+ : undefined,
3706
+ });
3707
+ /* eslint-enable dot-notation */
3708
+ }
3709
+ }
3710
+
3711
+ /**
3712
+ * An object that configures simulation execution trace.
3713
+ */
3714
+ export class SimulateTraceConfig extends BaseModel {
3715
+ /**
3716
+ * A boolean option for opting in execution trace features simulation endpoint.
3717
+ */
3718
+ public enable?: boolean;
3719
+
3720
+ /**
3721
+ * A boolean option enabling returning scratch slot changes together with execution
3722
+ * trace during simulation.
3723
+ */
3724
+ public scratchChange?: boolean;
3725
+
3726
+ /**
3727
+ * A boolean option enabling returning stack changes together with execution trace
3728
+ * during simulation.
3729
+ */
3730
+ public stackChange?: boolean;
3731
+
3732
+ /**
3733
+ * Creates a new `SimulateTraceConfig` object.
3734
+ * @param enable - A boolean option for opting in execution trace features simulation endpoint.
3735
+ * @param scratchChange - A boolean option enabling returning scratch slot changes together with execution
3736
+ * trace during simulation.
3737
+ * @param stackChange - A boolean option enabling returning stack changes together with execution trace
3738
+ * during simulation.
3739
+ */
3740
+ constructor({
3741
+ enable,
3742
+ scratchChange,
3743
+ stackChange,
3744
+ }: {
3745
+ enable?: boolean;
3746
+ scratchChange?: boolean;
3747
+ stackChange?: boolean;
3748
+ }) {
3749
+ super();
3750
+ this.enable = enable;
3751
+ this.scratchChange = scratchChange;
3752
+ this.stackChange = stackChange;
3753
+
3754
+ this.attribute_map = {
3755
+ enable: 'enable',
3756
+ scratchChange: 'scratch-change',
3757
+ stackChange: 'stack-change',
3758
+ };
3759
+ }
3760
+
3761
+ // eslint-disable-next-line camelcase
3762
+ static from_obj_for_encoding(data: Record<string, any>): SimulateTraceConfig {
3763
+ /* eslint-disable dot-notation */
3764
+ return new SimulateTraceConfig({
3765
+ enable: data['enable'],
3766
+ scratchChange: data['scratch-change'],
3767
+ stackChange: data['stack-change'],
3549
3768
  });
3550
3769
  /* eslint-enable dot-notation */
3551
3770
  }
@@ -3663,6 +3882,12 @@ export class SimulateTransactionResult extends BaseModel {
3663
3882
  */
3664
3883
  public appBudgetConsumed?: number | bigint;
3665
3884
 
3885
+ /**
3886
+ * The execution trace of calling an app or a logic sig, containing the inner app
3887
+ * call trace in a recursive way.
3888
+ */
3889
+ public execTrace?: SimulationTransactionExecTrace;
3890
+
3666
3891
  /**
3667
3892
  * Budget used during execution of a logic sig transaction.
3668
3893
  */
@@ -3674,25 +3899,31 @@ export class SimulateTransactionResult extends BaseModel {
3674
3899
  * includes confirmation details like the round and reward details.
3675
3900
  * @param appBudgetConsumed - Budget used during execution of an app call transaction. This value includes
3676
3901
  * budged used by inner app calls spawned by this transaction.
3902
+ * @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
3903
+ * call trace in a recursive way.
3677
3904
  * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
3678
3905
  */
3679
3906
  constructor({
3680
3907
  txnResult,
3681
3908
  appBudgetConsumed,
3909
+ execTrace,
3682
3910
  logicSigBudgetConsumed,
3683
3911
  }: {
3684
3912
  txnResult: PendingTransactionResponse;
3685
3913
  appBudgetConsumed?: number | bigint;
3914
+ execTrace?: SimulationTransactionExecTrace;
3686
3915
  logicSigBudgetConsumed?: number | bigint;
3687
3916
  }) {
3688
3917
  super();
3689
3918
  this.txnResult = txnResult;
3690
3919
  this.appBudgetConsumed = appBudgetConsumed;
3920
+ this.execTrace = execTrace;
3691
3921
  this.logicSigBudgetConsumed = logicSigBudgetConsumed;
3692
3922
 
3693
3923
  this.attribute_map = {
3694
3924
  txnResult: 'txn-result',
3695
3925
  appBudgetConsumed: 'app-budget-consumed',
3926
+ execTrace: 'exec-trace',
3696
3927
  logicSigBudgetConsumed: 'logic-sig-budget-consumed',
3697
3928
  };
3698
3929
  }
@@ -3711,6 +3942,12 @@ export class SimulateTransactionResult extends BaseModel {
3711
3942
  data['txn-result']
3712
3943
  ),
3713
3944
  appBudgetConsumed: data['app-budget-consumed'],
3945
+ execTrace:
3946
+ typeof data['exec-trace'] !== 'undefined'
3947
+ ? SimulationTransactionExecTrace.from_obj_for_encoding(
3948
+ data['exec-trace']
3949
+ )
3950
+ : undefined,
3714
3951
  logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
3715
3952
  });
3716
3953
  /* eslint-enable dot-notation */
@@ -3792,6 +4029,190 @@ export class SimulationEvalOverrides extends BaseModel {
3792
4029
  }
3793
4030
  }
3794
4031
 
4032
+ /**
4033
+ * The set of trace information and effect from evaluating a single opcode.
4034
+ */
4035
+ export class SimulationOpcodeTraceUnit extends BaseModel {
4036
+ /**
4037
+ * The program counter of the current opcode being evaluated.
4038
+ */
4039
+ public pc: number | bigint;
4040
+
4041
+ /**
4042
+ * The writes into scratch slots.
4043
+ */
4044
+ public scratchChanges?: ScratchChange[];
4045
+
4046
+ /**
4047
+ * The indexes of the traces for inner transactions spawned by this opcode, if any.
4048
+ */
4049
+ public spawnedInners?: (number | bigint)[];
4050
+
4051
+ /**
4052
+ * The values added by this opcode to the stack.
4053
+ */
4054
+ public stackAdditions?: AvmValue[];
4055
+
4056
+ /**
4057
+ * The number of deleted stack values by this opcode.
4058
+ */
4059
+ public stackPopCount?: number | bigint;
4060
+
4061
+ /**
4062
+ * Creates a new `SimulationOpcodeTraceUnit` object.
4063
+ * @param pc - The program counter of the current opcode being evaluated.
4064
+ * @param scratchChanges - The writes into scratch slots.
4065
+ * @param spawnedInners - The indexes of the traces for inner transactions spawned by this opcode, if any.
4066
+ * @param stackAdditions - The values added by this opcode to the stack.
4067
+ * @param stackPopCount - The number of deleted stack values by this opcode.
4068
+ */
4069
+ constructor({
4070
+ pc,
4071
+ scratchChanges,
4072
+ spawnedInners,
4073
+ stackAdditions,
4074
+ stackPopCount,
4075
+ }: {
4076
+ pc: number | bigint;
4077
+ scratchChanges?: ScratchChange[];
4078
+ spawnedInners?: (number | bigint)[];
4079
+ stackAdditions?: AvmValue[];
4080
+ stackPopCount?: number | bigint;
4081
+ }) {
4082
+ super();
4083
+ this.pc = pc;
4084
+ this.scratchChanges = scratchChanges;
4085
+ this.spawnedInners = spawnedInners;
4086
+ this.stackAdditions = stackAdditions;
4087
+ this.stackPopCount = stackPopCount;
4088
+
4089
+ this.attribute_map = {
4090
+ pc: 'pc',
4091
+ scratchChanges: 'scratch-changes',
4092
+ spawnedInners: 'spawned-inners',
4093
+ stackAdditions: 'stack-additions',
4094
+ stackPopCount: 'stack-pop-count',
4095
+ };
4096
+ }
4097
+
4098
+ // eslint-disable-next-line camelcase
4099
+ static from_obj_for_encoding(
4100
+ data: Record<string, any>
4101
+ ): SimulationOpcodeTraceUnit {
4102
+ /* eslint-disable dot-notation */
4103
+ if (typeof data['pc'] === 'undefined')
4104
+ throw new Error(`Response is missing required field 'pc': ${data}`);
4105
+ return new SimulationOpcodeTraceUnit({
4106
+ pc: data['pc'],
4107
+ scratchChanges:
4108
+ typeof data['scratch-changes'] !== 'undefined'
4109
+ ? data['scratch-changes'].map(ScratchChange.from_obj_for_encoding)
4110
+ : undefined,
4111
+ spawnedInners: data['spawned-inners'],
4112
+ stackAdditions:
4113
+ typeof data['stack-additions'] !== 'undefined'
4114
+ ? data['stack-additions'].map(AvmValue.from_obj_for_encoding)
4115
+ : undefined,
4116
+ stackPopCount: data['stack-pop-count'],
4117
+ });
4118
+ /* eslint-enable dot-notation */
4119
+ }
4120
+ }
4121
+
4122
+ /**
4123
+ * The execution trace of calling an app or a logic sig, containing the inner app
4124
+ * call trace in a recursive way.
4125
+ */
4126
+ export class SimulationTransactionExecTrace extends BaseModel {
4127
+ /**
4128
+ * Program trace that contains a trace of opcode effects in an approval program.
4129
+ */
4130
+ public approvalProgramTrace?: SimulationOpcodeTraceUnit[];
4131
+
4132
+ /**
4133
+ * Program trace that contains a trace of opcode effects in a clear state program.
4134
+ */
4135
+ public clearStateProgramTrace?: SimulationOpcodeTraceUnit[];
4136
+
4137
+ /**
4138
+ * An array of SimulationTransactionExecTrace representing the execution trace of
4139
+ * any inner transactions executed.
4140
+ */
4141
+ public innerTrace?: SimulationTransactionExecTrace[];
4142
+
4143
+ /**
4144
+ * Program trace that contains a trace of opcode effects in a logic sig.
4145
+ */
4146
+ public logicSigTrace?: SimulationOpcodeTraceUnit[];
4147
+
4148
+ /**
4149
+ * Creates a new `SimulationTransactionExecTrace` object.
4150
+ * @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program.
4151
+ * @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program.
4152
+ * @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of
4153
+ * any inner transactions executed.
4154
+ * @param logicSigTrace - Program trace that contains a trace of opcode effects in a logic sig.
4155
+ */
4156
+ constructor({
4157
+ approvalProgramTrace,
4158
+ clearStateProgramTrace,
4159
+ innerTrace,
4160
+ logicSigTrace,
4161
+ }: {
4162
+ approvalProgramTrace?: SimulationOpcodeTraceUnit[];
4163
+ clearStateProgramTrace?: SimulationOpcodeTraceUnit[];
4164
+ innerTrace?: SimulationTransactionExecTrace[];
4165
+ logicSigTrace?: SimulationOpcodeTraceUnit[];
4166
+ }) {
4167
+ super();
4168
+ this.approvalProgramTrace = approvalProgramTrace;
4169
+ this.clearStateProgramTrace = clearStateProgramTrace;
4170
+ this.innerTrace = innerTrace;
4171
+ this.logicSigTrace = logicSigTrace;
4172
+
4173
+ this.attribute_map = {
4174
+ approvalProgramTrace: 'approval-program-trace',
4175
+ clearStateProgramTrace: 'clear-state-program-trace',
4176
+ innerTrace: 'inner-trace',
4177
+ logicSigTrace: 'logic-sig-trace',
4178
+ };
4179
+ }
4180
+
4181
+ // eslint-disable-next-line camelcase
4182
+ static from_obj_for_encoding(
4183
+ data: Record<string, any>
4184
+ ): SimulationTransactionExecTrace {
4185
+ /* eslint-disable dot-notation */
4186
+ return new SimulationTransactionExecTrace({
4187
+ approvalProgramTrace:
4188
+ typeof data['approval-program-trace'] !== 'undefined'
4189
+ ? data['approval-program-trace'].map(
4190
+ SimulationOpcodeTraceUnit.from_obj_for_encoding
4191
+ )
4192
+ : undefined,
4193
+ clearStateProgramTrace:
4194
+ typeof data['clear-state-program-trace'] !== 'undefined'
4195
+ ? data['clear-state-program-trace'].map(
4196
+ SimulationOpcodeTraceUnit.from_obj_for_encoding
4197
+ )
4198
+ : undefined,
4199
+ innerTrace:
4200
+ typeof data['inner-trace'] !== 'undefined'
4201
+ ? data['inner-trace'].map(
4202
+ SimulationTransactionExecTrace.from_obj_for_encoding
4203
+ )
4204
+ : undefined,
4205
+ logicSigTrace:
4206
+ typeof data['logic-sig-trace'] !== 'undefined'
4207
+ ? data['logic-sig-trace'].map(
4208
+ SimulationOpcodeTraceUnit.from_obj_for_encoding
4209
+ )
4210
+ : undefined,
4211
+ });
4212
+ /* eslint-enable dot-notation */
4213
+ }
4214
+ }
4215
+
3795
4216
  /**
3796
4217
  * Represents a state proof and its corresponding message
3797
4218
  */
@@ -4150,7 +4571,7 @@ export class TransactionGroupLedgerStateDeltasForRoundResponse extends BaseModel
4150
4571
  this.deltas = deltas;
4151
4572
 
4152
4573
  this.attribute_map = {
4153
- deltas: 'deltas',
4574
+ deltas: 'Deltas',
4154
4575
  };
4155
4576
  }
4156
4577
 
@@ -300,14 +300,13 @@ export default class LookupAccountTransactions extends JSONRequest {
300
300
  * .currencyGreaterThan(minBalance - 1)
301
301
  * .do();
302
302
  * ```
303
- * @remarks
304
- * If you are looking for transactions with the currency amount greater than 0, simply construct the query without `currencyGreaterThan` because it doesn't accept `-1`, and passing the `0` `currency-greater-than` value would exclude transactions with a 0 amount.
305
303
  *
306
304
  * @param greater
307
305
  * @category query
308
306
  */
309
307
  currencyGreaterThan(greater: number) {
310
- this.query['currency-greater-than'] = greater;
308
+ // We convert the following to a string for now to correctly include zero values in request parameters.
309
+ this.query['currency-greater-than'] = greater.toString();
311
310
  return this;
312
311
  }
313
312
 
@@ -64,7 +64,8 @@ export default class LookupAssetBalances extends JSONRequest {
64
64
  * @category query
65
65
  */
66
66
  currencyGreaterThan(greater: number) {
67
- this.query['currency-greater-than'] = greater;
67
+ // We convert the following to a string for now to correctly include zero values in request parameters.
68
+ this.query['currency-greater-than'] = greater.toString();
68
69
  return this;
69
70
  }
70
71
 
@@ -252,14 +252,12 @@ export default class LookupAssetTransactions extends JSONRequest {
252
252
  * .do();
253
253
  * ```
254
254
  *
255
- * @remarks
256
- * If you are looking for transactions with the currency amount greater than 0, simply construct the query without `currencyGreaterThan` because it doesn't accept `-1`, and passing the `0` `currency-greater-than` value would exclude transactions with a 0 amount.
257
- *
258
255
  * @param greater
259
256
  * @category query
260
257
  */
261
258
  currencyGreaterThan(greater: number) {
262
- this.query['currency-greater-than'] = greater;
259
+ // We convert the following to a string for now to correctly include zero values in request parameters.
260
+ this.query['currency-greater-than'] = greater.toString();
263
261
  return this;
264
262
  }
265
263