algosdk 2.5.0 → 2.7.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 (32) 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 +3 -4
  5. package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -1
  6. package/dist/cjs/client/v2/algod/algod.js +17 -0
  7. package/dist/cjs/client/v2/algod/algod.js.map +1 -1
  8. package/dist/cjs/client/v2/algod/getBlockTxids.js +19 -0
  9. package/dist/cjs/client/v2/algod/getBlockTxids.js.map +1 -0
  10. package/dist/cjs/client/v2/algod/models/types.js +484 -11
  11. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  12. package/dist/cjs/signer.js +6 -1
  13. package/dist/cjs/signer.js.map +1 -1
  14. package/dist/esm/client/urlTokenBaseHTTPClient.js +0 -1
  15. package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -1
  16. package/dist/esm/client/v2/algod/algod.js +17 -0
  17. package/dist/esm/client/v2/algod/algod.js.map +1 -1
  18. package/dist/esm/client/v2/algod/getBlockTxids.js +13 -0
  19. package/dist/esm/client/v2/algod/getBlockTxids.js.map +1 -0
  20. package/dist/esm/client/v2/algod/models/types.js +472 -9
  21. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  22. package/dist/esm/signer.js +6 -1
  23. package/dist/esm/signer.js.map +1 -1
  24. package/dist/types/client/v2/algod/algod.d.ts +15 -0
  25. package/dist/types/client/v2/algod/getBlockTxids.d.ts +8 -0
  26. package/dist/types/client/v2/algod/models/types.d.ts +418 -12
  27. package/package.json +2 -3
  28. package/src/client/urlTokenBaseHTTPClient.ts +0 -1
  29. package/src/client/v2/algod/algod.ts +18 -0
  30. package/src/client/v2/algod/getBlockTxids.ts +18 -0
  31. package/src/client/v2/algod/models/types.ts +831 -2
  32. package/src/signer.ts +5 -1
@@ -375,6 +375,88 @@ export declare class Application extends BaseModel {
375
375
  });
376
376
  static from_obj_for_encoding(data: Record<string, any>): Application;
377
377
  }
378
+ /**
379
+ * An application's initial global/local/box states that were accessed during
380
+ * simulation.
381
+ */
382
+ export declare class ApplicationInitialStates extends BaseModel {
383
+ /**
384
+ * Application index.
385
+ */
386
+ id: number | bigint;
387
+ /**
388
+ * An application's global/local/box state.
389
+ */
390
+ appBoxes?: ApplicationKVStorage;
391
+ /**
392
+ * An application's global/local/box state.
393
+ */
394
+ appGlobals?: ApplicationKVStorage;
395
+ /**
396
+ * An application's initial local states tied to different accounts.
397
+ */
398
+ appLocals?: ApplicationKVStorage[];
399
+ /**
400
+ * Creates a new `ApplicationInitialStates` object.
401
+ * @param id - Application index.
402
+ * @param appBoxes - An application's global/local/box state.
403
+ * @param appGlobals - An application's global/local/box state.
404
+ * @param appLocals - An application's initial local states tied to different accounts.
405
+ */
406
+ constructor({ id, appBoxes, appGlobals, appLocals, }: {
407
+ id: number | bigint;
408
+ appBoxes?: ApplicationKVStorage;
409
+ appGlobals?: ApplicationKVStorage;
410
+ appLocals?: ApplicationKVStorage[];
411
+ });
412
+ static from_obj_for_encoding(data: Record<string, any>): ApplicationInitialStates;
413
+ }
414
+ /**
415
+ * An application's global/local/box state.
416
+ */
417
+ export declare class ApplicationKVStorage extends BaseModel {
418
+ /**
419
+ * Key-Value pairs representing application states.
420
+ */
421
+ kvs: AvmKeyValue[];
422
+ /**
423
+ * The address of the account associated with the local state.
424
+ */
425
+ account?: string;
426
+ /**
427
+ * Creates a new `ApplicationKVStorage` object.
428
+ * @param kvs - Key-Value pairs representing application states.
429
+ * @param account - The address of the account associated with the local state.
430
+ */
431
+ constructor({ kvs, account }: {
432
+ kvs: AvmKeyValue[];
433
+ account?: string;
434
+ });
435
+ static from_obj_for_encoding(data: Record<string, any>): ApplicationKVStorage;
436
+ }
437
+ /**
438
+ * References an account's local state for an application.
439
+ */
440
+ export declare class ApplicationLocalReference extends BaseModel {
441
+ /**
442
+ * Address of the account with the local state.
443
+ */
444
+ account: string;
445
+ /**
446
+ * Application ID of the local state application.
447
+ */
448
+ app: number | bigint;
449
+ /**
450
+ * Creates a new `ApplicationLocalReference` object.
451
+ * @param account - Address of the account with the local state.
452
+ * @param app - Application ID of the local state application.
453
+ */
454
+ constructor({ account, app }: {
455
+ account: string;
456
+ app: number | bigint;
457
+ });
458
+ static from_obj_for_encoding(data: Record<string, any>): ApplicationLocalReference;
459
+ }
378
460
  /**
379
461
  * Stores local state associated with an application.
380
462
  */
@@ -459,6 +541,51 @@ export declare class ApplicationParams extends BaseModel {
459
541
  });
460
542
  static from_obj_for_encoding(data: Record<string, any>): ApplicationParams;
461
543
  }
544
+ /**
545
+ * An operation against an application's global/local/box state.
546
+ */
547
+ export declare class ApplicationStateOperation extends BaseModel {
548
+ /**
549
+ * Type of application state. Value `g` is **global state**, `l` is **local
550
+ * state**, `b` is **boxes**.
551
+ */
552
+ appStateType: string;
553
+ /**
554
+ * The key (name) of the global/local/box state.
555
+ */
556
+ key: Uint8Array;
557
+ /**
558
+ * Operation type. Value `w` is **write**, `d` is **delete**.
559
+ */
560
+ operation: string;
561
+ /**
562
+ * For local state changes, the address of the account associated with the local
563
+ * state.
564
+ */
565
+ account?: string;
566
+ /**
567
+ * Represents an AVM value.
568
+ */
569
+ newValue?: AvmValue;
570
+ /**
571
+ * Creates a new `ApplicationStateOperation` object.
572
+ * @param appStateType - Type of application state. Value `g` is **global state**, `l` is **local
573
+ * state**, `b` is **boxes**.
574
+ * @param key - The key (name) of the global/local/box state.
575
+ * @param operation - Operation type. Value `w` is **write**, `d` is **delete**.
576
+ * @param account - For local state changes, the address of the account associated with the local
577
+ * state.
578
+ * @param newValue - Represents an AVM value.
579
+ */
580
+ constructor({ appStateType, key, operation, account, newValue, }: {
581
+ appStateType: string;
582
+ key: string | Uint8Array;
583
+ operation: string;
584
+ account?: string;
585
+ newValue?: AvmValue;
586
+ });
587
+ static from_obj_for_encoding(data: Record<string, any>): ApplicationStateOperation;
588
+ }
462
589
  /**
463
590
  * Specifies maximums on the number of each type that may be stored.
464
591
  */
@@ -542,6 +669,29 @@ export declare class AssetHolding extends BaseModel {
542
669
  });
543
670
  static from_obj_for_encoding(data: Record<string, any>): AssetHolding;
544
671
  }
672
+ /**
673
+ * References an asset held by an account.
674
+ */
675
+ export declare class AssetHoldingReference extends BaseModel {
676
+ /**
677
+ * Address of the account holding the asset.
678
+ */
679
+ account: string;
680
+ /**
681
+ * Asset ID of the holding.
682
+ */
683
+ asset: number | bigint;
684
+ /**
685
+ * Creates a new `AssetHoldingReference` object.
686
+ * @param account - Address of the account holding the asset.
687
+ * @param asset - Asset ID of the holding.
688
+ */
689
+ constructor({ account, asset }: {
690
+ account: string;
691
+ asset: number | bigint;
692
+ });
693
+ static from_obj_for_encoding(data: Record<string, any>): AssetHoldingReference;
694
+ }
545
695
  /**
546
696
  * AssetParams specifies the parameters for an asset.
547
697
  * (apar) when part of an AssetConfig transaction.
@@ -668,6 +818,26 @@ export declare class AssetParams extends BaseModel {
668
818
  });
669
819
  static from_obj_for_encoding(data: Record<string, any>): AssetParams;
670
820
  }
821
+ /**
822
+ * Represents an AVM key-value pair in an application store.
823
+ */
824
+ export declare class AvmKeyValue extends BaseModel {
825
+ key: Uint8Array;
826
+ /**
827
+ * Represents an AVM value.
828
+ */
829
+ value: AvmValue;
830
+ /**
831
+ * Creates a new `AvmKeyValue` object.
832
+ * @param key -
833
+ * @param value - Represents an AVM value.
834
+ */
835
+ constructor({ key, value }: {
836
+ key: string | Uint8Array;
837
+ value: AvmValue;
838
+ });
839
+ static from_obj_for_encoding(data: Record<string, any>): AvmKeyValue;
840
+ }
671
841
  /**
672
842
  * Represents an AVM value.
673
843
  */
@@ -739,6 +909,23 @@ export declare class BlockResponse extends BaseModel {
739
909
  });
740
910
  static from_obj_for_encoding(data: Record<string, any>): BlockResponse;
741
911
  }
912
+ /**
913
+ * Top level transaction IDs in a block.
914
+ */
915
+ export declare class BlockTxidsResponse extends BaseModel {
916
+ /**
917
+ * Block transaction IDs.
918
+ */
919
+ blocktxids: string[];
920
+ /**
921
+ * Creates a new `BlockTxidsResponse` object.
922
+ * @param blocktxids - Block transaction IDs.
923
+ */
924
+ constructor({ blocktxids }: {
925
+ blocktxids: string[];
926
+ });
927
+ static from_obj_for_encoding(data: Record<string, any>): BlockTxidsResponse;
928
+ }
742
929
  /**
743
930
  * Box name and its content.
744
931
  */
@@ -785,6 +972,29 @@ export declare class BoxDescriptor extends BaseModel {
785
972
  });
786
973
  static from_obj_for_encoding(data: Record<string, any>): BoxDescriptor;
787
974
  }
975
+ /**
976
+ * References a box of an application.
977
+ */
978
+ export declare class BoxReference extends BaseModel {
979
+ /**
980
+ * Application ID which this box belongs to
981
+ */
982
+ app: number | bigint;
983
+ /**
984
+ * Base64 encoded box name
985
+ */
986
+ name: Uint8Array;
987
+ /**
988
+ * Creates a new `BoxReference` object.
989
+ * @param app - Application ID which this box belongs to
990
+ * @param name - Base64 encoded box name
991
+ */
992
+ constructor({ app, name, }: {
993
+ app: number | bigint;
994
+ name: string | Uint8Array;
995
+ });
996
+ static from_obj_for_encoding(data: Record<string, any>): BoxReference;
997
+ }
788
998
  /**
789
999
  * Box names of an application
790
1000
  */
@@ -1597,6 +1807,25 @@ export declare class ScratchChange extends BaseModel {
1597
1807
  });
1598
1808
  static from_obj_for_encoding(data: Record<string, any>): ScratchChange;
1599
1809
  }
1810
+ /**
1811
+ * Initial states of resources that were accessed during simulation.
1812
+ */
1813
+ export declare class SimulateInitialStates extends BaseModel {
1814
+ /**
1815
+ * The initial states of accessed application before simulation. The order of this
1816
+ * array is arbitrary.
1817
+ */
1818
+ appInitialStates?: ApplicationInitialStates[];
1819
+ /**
1820
+ * Creates a new `SimulateInitialStates` object.
1821
+ * @param appInitialStates - The initial states of accessed application before simulation. The order of this
1822
+ * array is arbitrary.
1823
+ */
1824
+ constructor({ appInitialStates, }: {
1825
+ appInitialStates?: ApplicationInitialStates[];
1826
+ });
1827
+ static from_obj_for_encoding(data: Record<string, any>): SimulateInitialStates;
1828
+ }
1600
1829
  /**
1601
1830
  * Request type for simulation endpoint.
1602
1831
  */
@@ -1606,7 +1835,7 @@ export declare class SimulateRequest extends BaseModel {
1606
1835
  */
1607
1836
  txnGroups: SimulateRequestTransactionGroup[];
1608
1837
  /**
1609
- * Allow transactions without signatures to be simulated as if they had correct
1838
+ * Allows transactions without signatures to be simulated as if they had correct
1610
1839
  * signatures.
1611
1840
  */
1612
1841
  allowEmptySignatures?: boolean;
@@ -1614,6 +1843,10 @@ export declare class SimulateRequest extends BaseModel {
1614
1843
  * Lifts limits on log opcode usage during simulation.
1615
1844
  */
1616
1845
  allowMoreLogging?: boolean;
1846
+ /**
1847
+ * Allows access to unnamed resources during simulation.
1848
+ */
1849
+ allowUnnamedResources?: boolean;
1617
1850
  /**
1618
1851
  * An object that configures simulation execution trace.
1619
1852
  */
@@ -1622,21 +1855,35 @@ export declare class SimulateRequest extends BaseModel {
1622
1855
  * Applies extra opcode budget during simulation for each transaction group.
1623
1856
  */
1624
1857
  extraOpcodeBudget?: number | bigint;
1858
+ /**
1859
+ * If provided, specifies the round preceding the simulation. State changes through
1860
+ * this round will be used to run this simulation. Usually only the 4 most recent
1861
+ * rounds will be available (controlled by the node config value MaxAcctLookback).
1862
+ * If not specified, defaults to the latest available round.
1863
+ */
1864
+ round?: number | bigint;
1625
1865
  /**
1626
1866
  * Creates a new `SimulateRequest` object.
1627
1867
  * @param txnGroups - The transaction groups to simulate.
1628
- * @param allowEmptySignatures - Allow transactions without signatures to be simulated as if they had correct
1868
+ * @param allowEmptySignatures - Allows transactions without signatures to be simulated as if they had correct
1629
1869
  * signatures.
1630
1870
  * @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
1871
+ * @param allowUnnamedResources - Allows access to unnamed resources during simulation.
1631
1872
  * @param execTraceConfig - An object that configures simulation execution trace.
1632
1873
  * @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
1874
+ * @param round - If provided, specifies the round preceding the simulation. State changes through
1875
+ * this round will be used to run this simulation. Usually only the 4 most recent
1876
+ * rounds will be available (controlled by the node config value MaxAcctLookback).
1877
+ * If not specified, defaults to the latest available round.
1633
1878
  */
1634
- constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, execTraceConfig, extraOpcodeBudget, }: {
1879
+ constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, allowUnnamedResources, execTraceConfig, extraOpcodeBudget, round, }: {
1635
1880
  txnGroups: SimulateRequestTransactionGroup[];
1636
1881
  allowEmptySignatures?: boolean;
1637
1882
  allowMoreLogging?: boolean;
1883
+ allowUnnamedResources?: boolean;
1638
1884
  execTraceConfig?: SimulateTraceConfig;
1639
1885
  extraOpcodeBudget?: number | bigint;
1886
+ round?: number | bigint;
1640
1887
  });
1641
1888
  static from_obj_for_encoding(data: Record<string, any>): SimulateRequest;
1642
1889
  }
@@ -1684,6 +1931,10 @@ export declare class SimulateResponse extends BaseModel {
1684
1931
  * An object that configures simulation execution trace.
1685
1932
  */
1686
1933
  execTraceConfig?: SimulateTraceConfig;
1934
+ /**
1935
+ * Initial states of resources that were accessed during simulation.
1936
+ */
1937
+ initialStates?: SimulateInitialStates;
1687
1938
  /**
1688
1939
  * Creates a new `SimulateResponse` object.
1689
1940
  * @param lastRound - The round immediately preceding this simulation. State changes through this
@@ -1694,13 +1945,15 @@ export declare class SimulateResponse extends BaseModel {
1694
1945
  * parameters is present, then evaluation parameters may differ from standard
1695
1946
  * evaluation in certain ways.
1696
1947
  * @param execTraceConfig - An object that configures simulation execution trace.
1948
+ * @param initialStates - Initial states of resources that were accessed during simulation.
1697
1949
  */
1698
- constructor({ lastRound, txnGroups, version, evalOverrides, execTraceConfig, }: {
1950
+ constructor({ lastRound, txnGroups, version, evalOverrides, execTraceConfig, initialStates, }: {
1699
1951
  lastRound: number | bigint;
1700
1952
  txnGroups: SimulateTransactionGroupResult[];
1701
1953
  version: number | bigint;
1702
1954
  evalOverrides?: SimulationEvalOverrides;
1703
1955
  execTraceConfig?: SimulateTraceConfig;
1956
+ initialStates?: SimulateInitialStates;
1704
1957
  });
1705
1958
  static from_obj_for_encoding(data: Record<string, any>): SimulateResponse;
1706
1959
  }
@@ -1722,6 +1975,11 @@ export declare class SimulateTraceConfig extends BaseModel {
1722
1975
  * during simulation.
1723
1976
  */
1724
1977
  stackChange?: boolean;
1978
+ /**
1979
+ * A boolean option enabling returning application state changes (global, local,
1980
+ * and box changes) with the execution trace during simulation.
1981
+ */
1982
+ stateChange?: boolean;
1725
1983
  /**
1726
1984
  * Creates a new `SimulateTraceConfig` object.
1727
1985
  * @param enable - A boolean option for opting in execution trace features simulation endpoint.
@@ -1729,11 +1987,14 @@ export declare class SimulateTraceConfig extends BaseModel {
1729
1987
  * trace during simulation.
1730
1988
  * @param stackChange - A boolean option enabling returning stack changes together with execution trace
1731
1989
  * during simulation.
1990
+ * @param stateChange - A boolean option enabling returning application state changes (global, local,
1991
+ * and box changes) with the execution trace during simulation.
1732
1992
  */
1733
- constructor({ enable, scratchChange, stackChange, }: {
1993
+ constructor({ enable, scratchChange, stackChange, stateChange, }: {
1734
1994
  enable?: boolean;
1735
1995
  scratchChange?: boolean;
1736
1996
  stackChange?: boolean;
1997
+ stateChange?: boolean;
1737
1998
  });
1738
1999
  static from_obj_for_encoding(data: Record<string, any>): SimulateTraceConfig;
1739
2000
  }
@@ -1765,6 +2026,18 @@ export declare class SimulateTransactionGroupResult extends BaseModel {
1765
2026
  * happened
1766
2027
  */
1767
2028
  failureMessage?: string;
2029
+ /**
2030
+ * These are resources that were accessed by this group that would normally have
2031
+ * caused failure, but were allowed in simulation. Depending on where this object
2032
+ * is in the response, the unnamed resources it contains may or may not qualify for
2033
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
2034
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
2035
+ * they do not qualify. In order to make this group valid for actual submission,
2036
+ * resources that qualify for group sharing can be made available by any
2037
+ * transaction of the group; otherwise, resources must be placed in the same
2038
+ * transaction which accessed them.
2039
+ */
2040
+ unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
1768
2041
  /**
1769
2042
  * Creates a new `SimulateTransactionGroupResult` object.
1770
2043
  * @param txnResults - Simulation result for individual transactions
@@ -1776,13 +2049,23 @@ export declare class SimulateTransactionGroupResult extends BaseModel {
1776
2049
  * indicate deeper inner transactions.
1777
2050
  * @param failureMessage - If present, indicates that the transaction group failed and specifies why that
1778
2051
  * happened
1779
- */
1780
- constructor({ txnResults, appBudgetAdded, appBudgetConsumed, failedAt, failureMessage, }: {
2052
+ * @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
2053
+ * caused failure, but were allowed in simulation. Depending on where this object
2054
+ * is in the response, the unnamed resources it contains may or may not qualify for
2055
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
2056
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
2057
+ * they do not qualify. In order to make this group valid for actual submission,
2058
+ * resources that qualify for group sharing can be made available by any
2059
+ * transaction of the group; otherwise, resources must be placed in the same
2060
+ * transaction which accessed them.
2061
+ */
2062
+ constructor({ txnResults, appBudgetAdded, appBudgetConsumed, failedAt, failureMessage, unnamedResourcesAccessed, }: {
1781
2063
  txnResults: SimulateTransactionResult[];
1782
2064
  appBudgetAdded?: number | bigint;
1783
2065
  appBudgetConsumed?: number | bigint;
1784
2066
  failedAt?: (number | bigint)[];
1785
2067
  failureMessage?: string;
2068
+ unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
1786
2069
  });
1787
2070
  static from_obj_for_encoding(data: Record<string, any>): SimulateTransactionGroupResult;
1788
2071
  }
@@ -1809,6 +2092,18 @@ export declare class SimulateTransactionResult extends BaseModel {
1809
2092
  * Budget used during execution of a logic sig transaction.
1810
2093
  */
1811
2094
  logicSigBudgetConsumed?: number | bigint;
2095
+ /**
2096
+ * These are resources that were accessed by this group that would normally have
2097
+ * caused failure, but were allowed in simulation. Depending on where this object
2098
+ * is in the response, the unnamed resources it contains may or may not qualify for
2099
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
2100
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
2101
+ * they do not qualify. In order to make this group valid for actual submission,
2102
+ * resources that qualify for group sharing can be made available by any
2103
+ * transaction of the group; otherwise, resources must be placed in the same
2104
+ * transaction which accessed them.
2105
+ */
2106
+ unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
1812
2107
  /**
1813
2108
  * Creates a new `SimulateTransactionResult` object.
1814
2109
  * @param txnResult - Details about a pending transaction. If the transaction was recently confirmed,
@@ -1818,15 +2113,96 @@ export declare class SimulateTransactionResult extends BaseModel {
1818
2113
  * @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
1819
2114
  * call trace in a recursive way.
1820
2115
  * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
1821
- */
1822
- constructor({ txnResult, appBudgetConsumed, execTrace, logicSigBudgetConsumed, }: {
2116
+ * @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
2117
+ * caused failure, but were allowed in simulation. Depending on where this object
2118
+ * is in the response, the unnamed resources it contains may or may not qualify for
2119
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
2120
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
2121
+ * they do not qualify. In order to make this group valid for actual submission,
2122
+ * resources that qualify for group sharing can be made available by any
2123
+ * transaction of the group; otherwise, resources must be placed in the same
2124
+ * transaction which accessed them.
2125
+ */
2126
+ constructor({ txnResult, appBudgetConsumed, execTrace, logicSigBudgetConsumed, unnamedResourcesAccessed, }: {
1823
2127
  txnResult: PendingTransactionResponse;
1824
2128
  appBudgetConsumed?: number | bigint;
1825
2129
  execTrace?: SimulationTransactionExecTrace;
1826
2130
  logicSigBudgetConsumed?: number | bigint;
2131
+ unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
1827
2132
  });
1828
2133
  static from_obj_for_encoding(data: Record<string, any>): SimulateTransactionResult;
1829
2134
  }
2135
+ /**
2136
+ * These are resources that were accessed by this group that would normally have
2137
+ * caused failure, but were allowed in simulation. Depending on where this object
2138
+ * is in the response, the unnamed resources it contains may or may not qualify for
2139
+ * group resource sharing. If this is a field in SimulateTransactionGroupResult,
2140
+ * the resources do qualify, but if this is a field in SimulateTransactionResult,
2141
+ * they do not qualify. In order to make this group valid for actual submission,
2142
+ * resources that qualify for group sharing can be made available by any
2143
+ * transaction of the group; otherwise, resources must be placed in the same
2144
+ * transaction which accessed them.
2145
+ */
2146
+ export declare class SimulateUnnamedResourcesAccessed extends BaseModel {
2147
+ /**
2148
+ * The unnamed accounts that were referenced. The order of this array is arbitrary.
2149
+ */
2150
+ accounts?: string[];
2151
+ /**
2152
+ * The unnamed application local states that were referenced. The order of this
2153
+ * array is arbitrary.
2154
+ */
2155
+ appLocals?: ApplicationLocalReference[];
2156
+ /**
2157
+ * The unnamed applications that were referenced. The order of this array is
2158
+ * arbitrary.
2159
+ */
2160
+ apps?: (number | bigint)[];
2161
+ /**
2162
+ * The unnamed asset holdings that were referenced. The order of this array is
2163
+ * arbitrary.
2164
+ */
2165
+ assetHoldings?: AssetHoldingReference[];
2166
+ /**
2167
+ * The unnamed assets that were referenced. The order of this array is arbitrary.
2168
+ */
2169
+ assets?: (number | bigint)[];
2170
+ /**
2171
+ * The unnamed boxes that were referenced. The order of this array is arbitrary.
2172
+ */
2173
+ boxes?: BoxReference[];
2174
+ /**
2175
+ * The number of extra box references used to increase the IO budget. This is in
2176
+ * addition to the references defined in the input transaction group and any
2177
+ * referenced to unnamed boxes.
2178
+ */
2179
+ extraBoxRefs?: number | bigint;
2180
+ /**
2181
+ * Creates a new `SimulateUnnamedResourcesAccessed` object.
2182
+ * @param accounts - The unnamed accounts that were referenced. The order of this array is arbitrary.
2183
+ * @param appLocals - The unnamed application local states that were referenced. The order of this
2184
+ * array is arbitrary.
2185
+ * @param apps - The unnamed applications that were referenced. The order of this array is
2186
+ * arbitrary.
2187
+ * @param assetHoldings - The unnamed asset holdings that were referenced. The order of this array is
2188
+ * arbitrary.
2189
+ * @param assets - The unnamed assets that were referenced. The order of this array is arbitrary.
2190
+ * @param boxes - The unnamed boxes that were referenced. The order of this array is arbitrary.
2191
+ * @param extraBoxRefs - The number of extra box references used to increase the IO budget. This is in
2192
+ * addition to the references defined in the input transaction group and any
2193
+ * referenced to unnamed boxes.
2194
+ */
2195
+ constructor({ accounts, appLocals, apps, assetHoldings, assets, boxes, extraBoxRefs, }: {
2196
+ accounts?: string[];
2197
+ appLocals?: ApplicationLocalReference[];
2198
+ apps?: (number | bigint)[];
2199
+ assetHoldings?: AssetHoldingReference[];
2200
+ assets?: (number | bigint)[];
2201
+ boxes?: BoxReference[];
2202
+ extraBoxRefs?: number | bigint;
2203
+ });
2204
+ static from_obj_for_encoding(data: Record<string, any>): SimulateUnnamedResourcesAccessed;
2205
+ }
1830
2206
  /**
1831
2207
  * The set of parameters and limits override during simulation. If this set of
1832
2208
  * parameters is present, then evaluation parameters may differ from standard
@@ -1838,6 +2214,10 @@ export declare class SimulationEvalOverrides extends BaseModel {
1838
2214
  * were properly signed.
1839
2215
  */
1840
2216
  allowEmptySignatures?: boolean;
2217
+ /**
2218
+ * If true, allows access to unnamed resources during simulation.
2219
+ */
2220
+ allowUnnamedResources?: boolean;
1841
2221
  /**
1842
2222
  * The extra opcode budget added to each transaction group during simulation
1843
2223
  */
@@ -1854,12 +2234,14 @@ export declare class SimulationEvalOverrides extends BaseModel {
1854
2234
  * Creates a new `SimulationEvalOverrides` object.
1855
2235
  * @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
1856
2236
  * were properly signed.
2237
+ * @param allowUnnamedResources - If true, allows access to unnamed resources during simulation.
1857
2238
  * @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
1858
2239
  * @param maxLogCalls - The maximum log calls one can make during simulation
1859
2240
  * @param maxLogSize - The maximum byte number to log during simulation
1860
2241
  */
1861
- constructor({ allowEmptySignatures, extraOpcodeBudget, maxLogCalls, maxLogSize, }: {
2242
+ constructor({ allowEmptySignatures, allowUnnamedResources, extraOpcodeBudget, maxLogCalls, maxLogSize, }: {
1862
2243
  allowEmptySignatures?: boolean;
2244
+ allowUnnamedResources?: boolean;
1863
2245
  extraOpcodeBudget?: number | bigint;
1864
2246
  maxLogCalls?: number | bigint;
1865
2247
  maxLogSize?: number | bigint;
@@ -1890,6 +2272,10 @@ export declare class SimulationOpcodeTraceUnit extends BaseModel {
1890
2272
  * The number of deleted stack values by this opcode.
1891
2273
  */
1892
2274
  stackPopCount?: number | bigint;
2275
+ /**
2276
+ * The operations against the current application's states.
2277
+ */
2278
+ stateChanges?: ApplicationStateOperation[];
1893
2279
  /**
1894
2280
  * Creates a new `SimulationOpcodeTraceUnit` object.
1895
2281
  * @param pc - The program counter of the current opcode being evaluated.
@@ -1897,13 +2283,15 @@ export declare class SimulationOpcodeTraceUnit extends BaseModel {
1897
2283
  * @param spawnedInners - The indexes of the traces for inner transactions spawned by this opcode, if any.
1898
2284
  * @param stackAdditions - The values added by this opcode to the stack.
1899
2285
  * @param stackPopCount - The number of deleted stack values by this opcode.
2286
+ * @param stateChanges - The operations against the current application's states.
1900
2287
  */
1901
- constructor({ pc, scratchChanges, spawnedInners, stackAdditions, stackPopCount, }: {
2288
+ constructor({ pc, scratchChanges, spawnedInners, stackAdditions, stackPopCount, stateChanges, }: {
1902
2289
  pc: number | bigint;
1903
2290
  scratchChanges?: ScratchChange[];
1904
2291
  spawnedInners?: (number | bigint)[];
1905
2292
  stackAdditions?: AvmValue[];
1906
2293
  stackPopCount?: number | bigint;
2294
+ stateChanges?: ApplicationStateOperation[];
1907
2295
  });
1908
2296
  static from_obj_for_encoding(data: Record<string, any>): SimulationOpcodeTraceUnit;
1909
2297
  }
@@ -1912,10 +2300,18 @@ export declare class SimulationOpcodeTraceUnit extends BaseModel {
1912
2300
  * call trace in a recursive way.
1913
2301
  */
1914
2302
  export declare class SimulationTransactionExecTrace extends BaseModel {
2303
+ /**
2304
+ * SHA512_256 hash digest of the approval program executed in transaction.
2305
+ */
2306
+ approvalProgramHash?: Uint8Array;
1915
2307
  /**
1916
2308
  * Program trace that contains a trace of opcode effects in an approval program.
1917
2309
  */
1918
2310
  approvalProgramTrace?: SimulationOpcodeTraceUnit[];
2311
+ /**
2312
+ * SHA512_256 hash digest of the clear state program executed in transaction.
2313
+ */
2314
+ clearStateProgramHash?: Uint8Array;
1919
2315
  /**
1920
2316
  * Program trace that contains a trace of opcode effects in a clear state program.
1921
2317
  */
@@ -1925,22 +2321,32 @@ export declare class SimulationTransactionExecTrace extends BaseModel {
1925
2321
  * any inner transactions executed.
1926
2322
  */
1927
2323
  innerTrace?: SimulationTransactionExecTrace[];
2324
+ /**
2325
+ * SHA512_256 hash digest of the logic sig executed in transaction.
2326
+ */
2327
+ logicSigHash?: Uint8Array;
1928
2328
  /**
1929
2329
  * Program trace that contains a trace of opcode effects in a logic sig.
1930
2330
  */
1931
2331
  logicSigTrace?: SimulationOpcodeTraceUnit[];
1932
2332
  /**
1933
2333
  * Creates a new `SimulationTransactionExecTrace` object.
2334
+ * @param approvalProgramHash - SHA512_256 hash digest of the approval program executed in transaction.
1934
2335
  * @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program.
2336
+ * @param clearStateProgramHash - SHA512_256 hash digest of the clear state program executed in transaction.
1935
2337
  * @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program.
1936
2338
  * @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of
1937
2339
  * any inner transactions executed.
2340
+ * @param logicSigHash - SHA512_256 hash digest of the logic sig executed in transaction.
1938
2341
  * @param logicSigTrace - Program trace that contains a trace of opcode effects in a logic sig.
1939
2342
  */
1940
- constructor({ approvalProgramTrace, clearStateProgramTrace, innerTrace, logicSigTrace, }: {
2343
+ constructor({ approvalProgramHash, approvalProgramTrace, clearStateProgramHash, clearStateProgramTrace, innerTrace, logicSigHash, logicSigTrace, }: {
2344
+ approvalProgramHash?: string | Uint8Array;
1941
2345
  approvalProgramTrace?: SimulationOpcodeTraceUnit[];
2346
+ clearStateProgramHash?: string | Uint8Array;
1942
2347
  clearStateProgramTrace?: SimulationOpcodeTraceUnit[];
1943
2348
  innerTrace?: SimulationTransactionExecTrace[];
2349
+ logicSigHash?: string | Uint8Array;
1944
2350
  logicSigTrace?: SimulationOpcodeTraceUnit[];
1945
2351
  });
1946
2352
  static from_obj_for_encoding(data: Record<string, any>): SimulationTransactionExecTrace;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "algosdk",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "description": "The official JavaScript SDK for Algorand",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -23,7 +23,6 @@
23
23
  "dependencies": {
24
24
  "algo-msgpack-with-bigint": "^2.1.1",
25
25
  "buffer": "^6.0.3",
26
- "cross-fetch": "^4.0.0",
27
26
  "hi-base32": "^0.5.1",
28
27
  "js-sha256": "^0.9.0",
29
28
  "js-sha3": "^0.8.0",
@@ -80,6 +79,6 @@
80
79
  "author": "Algorand, llc",
81
80
  "license": "MIT",
82
81
  "engines": {
83
- "node": ">=16.0.0"
82
+ "node": ">=18.0.0"
84
83
  }
85
84
  }
@@ -1,5 +1,4 @@
1
1
  import { Buffer } from 'buffer';
2
- import { fetch, Response, Headers } from 'cross-fetch';
3
2
  import {
4
3
  BaseHTTPClient,
5
4
  BaseHTTPClientResponse,