@algorandfoundation/puya-ts 1.2.0-beta.35 → 1.2.0-beta.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/{analyser-service-B0DpIecU.js → analyser-service-Bk9GEtDA.js} +3 -3
  2. package/{analyser-service-B0DpIecU.js.map → analyser-service-Bk9GEtDA.js.map} +1 -1
  3. package/analyserService.mjs +3 -3
  4. package/{arc4-clientgen-Dd2qW-1d.js → arc4-clientgen-qBTlCOIm.js} +2 -2
  5. package/{arc4-clientgen-Dd2qW-1d.js.map → arc4-clientgen-qBTlCOIm.js.map} +1 -1
  6. package/awst_build/context/awst-build-context.d.ts +1 -1
  7. package/awst_build/ptypes/index.d.ts +64 -87
  8. package/bin/puyats-clientgen.mjs +5 -5
  9. package/bin/puyats-clientgen.mjs.map +1 -1
  10. package/bin/puyats-ls.mjs +13 -13
  11. package/bin/puyats-ls.mjs.map +1 -1
  12. package/bin/run-cli.mjs +12 -12
  13. package/{check-node-version-Df1hdewH.js → check-node-version-CLFFTDHN.js} +3 -3
  14. package/{check-node-version-Df1hdewH.js.map → check-node-version-CLFFTDHN.js.map} +1 -1
  15. package/cli-ls.d.ts +1 -1
  16. package/cli.d.ts +1 -1
  17. package/cli.mjs +15 -15
  18. package/cli.mjs.map +1 -1
  19. package/clientgen.d.ts +1 -1
  20. package/{compile-DGk1ftqu.js → compile-ycpMcgmJ.js} +6 -6
  21. package/{compile-DGk1ftqu.js.map → compile-ycpMcgmJ.js.map} +1 -1
  22. package/constants.d.ts +1 -1
  23. package/{contract-class-model-cK8F4WVM.js → contract-class-model-BZeEDGw0.js} +109 -243
  24. package/contract-class-model-BZeEDGw0.js.map +1 -0
  25. package/index.d.ts +0 -1
  26. package/index.mjs +8 -8
  27. package/index.mjs.map +1 -1
  28. package/language-server/analyser-service.d.ts +0 -1
  29. package/{options-sBHEIhey.js → options-DD9MApH4.js} +72 -78
  30. package/options-DD9MApH4.js.map +1 -0
  31. package/package.json +6 -3
  32. package/{resolve-puya-path-Bgh6DuRP.js → resolve-puya-path-Ba54kz9o.js} +4 -4
  33. package/{resolve-puya-path-Bgh6DuRP.js.map → resolve-puya-path-Ba54kz9o.js.map} +1 -1
  34. package/{semver-T4bO0VEo.js → semver-B0p_0XuH.js} +2 -2
  35. package/{semver-T4bO0VEo.js.map → semver-B0p_0XuH.js.map} +1 -1
  36. package/{util-CA3Q0W2C.js → util-Aa8RgOmt.js} +2 -2
  37. package/{util-CA3Q0W2C.js.map → util-Aa8RgOmt.js.map} +1 -1
  38. package/contract-class-model-cK8F4WVM.js.map +0 -1
  39. package/options-sBHEIhey.js.map +0 -1
  40. package/util/polyfills.d.ts +0 -1
@@ -78,7 +78,7 @@ const Constants = {
78
78
  supportedAvmVersions: [10n, 11n, 12n, 13n],
79
79
  targetedPuyaVersion: '5.9.0-rc.1',
80
80
  puyaGithubRepo: 'algorandfoundation/puya',
81
- minNodeVersion: '20.11.1',
81
+ minNodeVersion: '22.11.0',
82
82
  languageServerSource: 'puyats',
83
83
  };
84
84
 
@@ -476,74 +476,6 @@ function isIn(subject, items) {
476
476
  return items.some((i) => i === subject);
477
477
  }
478
478
 
479
- /*
480
- Polyfills for Set methods that are not available on older versions of Node
481
-
482
- We only polyfill methods which are used in this codebase, polyfills should be removed as older
483
- versions of node are retired from LTS according to https://nodejs.org/en/about/previous-releases
484
- */
485
- // Node < 22.11
486
- if (!Set.prototype.union) {
487
- Set.prototype.union = function (other) {
488
- // Convert ReadonlySetLike to iterable by checking if it's a Set or has values method
489
- let otherIterable;
490
- if (other instanceof Set) {
491
- otherIterable = other;
492
- }
493
- else if ('values' in other && typeof other.values === 'function') {
494
- otherIterable = other.values();
495
- }
496
- else {
497
- throw new TypeError('Argument must be a ReadonlySetLike');
498
- }
499
- return new Set([...this, ...otherIterable]);
500
- };
501
- }
502
- // Node < 22.11
503
- if (!Set.prototype.intersection) {
504
- Set.prototype.intersection = function (other) {
505
- return new Set([...this].filter((e) => other.has(e)));
506
- };
507
- }
508
- // Node < 22.11
509
- if (!Set.prototype.difference) {
510
- Set.prototype.difference = function (other) {
511
- return new Set([...this].filter((e) => !other.has(e)));
512
- };
513
- }
514
- // Node < 22
515
- if (!Set.prototype.symmetricDifference) {
516
- Set.prototype.symmetricDifference = function (other) {
517
- const result = this.difference(other);
518
- for (let it = other.keys(), { value, done } = it.next(); !done; { value, done } = it.next()) {
519
- if (!this.has(value))
520
- result.add(value);
521
- }
522
- return result;
523
- };
524
- }
525
- // Node < 22.11
526
- if (!Promise.withResolvers) {
527
- Promise.withResolvers = function () {
528
- let resolve = undefined, reject = undefined;
529
- const promise = new Promise((res, rej) => {
530
- resolve = res;
531
- reject = rej;
532
- });
533
- return { promise, resolve, reject };
534
- };
535
- }
536
- // Node < 22.11
537
- const MapIteratorPrototype = Object.getPrototypeOf(new Map().entries());
538
- if (!MapIteratorPrototype.map) {
539
- MapIteratorPrototype.map = function* (callbackFn) {
540
- let i = 0;
541
- for (const item of this) {
542
- yield callbackFn(item, i++);
543
- }
544
- };
545
- }
546
-
547
479
  class AbsolutePath {
548
480
  value;
549
481
  constructor(value) {
@@ -1491,6 +1423,21 @@ class StorageProxyPType extends PType {
1491
1423
  this.contentType = props.content;
1492
1424
  }
1493
1425
  }
1426
+ class StateProxyPType extends StorageProxyPType {
1427
+ module;
1428
+ kind;
1429
+ constructor(props) {
1430
+ super({ content: props.content, keyWType: wtypes.stateKeyWType });
1431
+ this.module = Constants.moduleNames.algoTs.state;
1432
+ this.kind = props.kind;
1433
+ }
1434
+ get name() {
1435
+ return `${this.kind}<${this.contentType.name}>`;
1436
+ }
1437
+ get fullName() {
1438
+ return `${this.module}::${this.kind}<${this.contentType.fullName}>`;
1439
+ }
1440
+ }
1494
1441
  const GlobalStateGeneric = new GenericPType({
1495
1442
  name: 'GlobalState',
1496
1443
  module: Constants.moduleNames.algoTs.state,
@@ -1501,24 +1448,32 @@ const GlobalStateGeneric = new GenericPType({
1501
1448
  });
1502
1449
  },
1503
1450
  });
1504
- class GlobalStateType extends StorageProxyPType {
1451
+ class GlobalStateType extends StateProxyPType {
1505
1452
  [PType.IdSymbol] = 'GlobalStateType';
1506
- static baseName = 'GlobalState';
1507
- static baseFullName = `${Constants.moduleNames.algoTs.state}::${GlobalStateType.baseName}`;
1508
- module = Constants.moduleNames.algoTs.state;
1509
- get name() {
1510
- return `${GlobalStateType.baseName}<${this.contentType.name}>`;
1511
- }
1512
- get fullName() {
1513
- return `${GlobalStateType.baseFullName}<${this.contentType.fullName}>`;
1514
- }
1515
1453
  constructor(props) {
1516
- super({ ...props, keyWType: wtypes.stateKeyWType });
1454
+ super({ ...props, kind: 'GlobalState' });
1517
1455
  }
1518
1456
  accept(visitor) {
1519
1457
  return visitor.visitGlobalStateType(this);
1520
1458
  }
1521
1459
  }
1460
+ class StateMapProxyPType extends StorageProxyPType {
1461
+ module;
1462
+ kind;
1463
+ keyType;
1464
+ constructor(props) {
1465
+ super({ content: props.content, keyWType: wtypes.stateKeyWType });
1466
+ this.module = Constants.moduleNames.algoTs.state;
1467
+ this.kind = props.kind;
1468
+ this.keyType = props.keyType;
1469
+ }
1470
+ get name() {
1471
+ return `${this.kind}<${this.keyType.name}, ${this.contentType.name}>`;
1472
+ }
1473
+ get fullName() {
1474
+ return `${this.module}::${this.kind}<${this.keyType.name}, ${this.contentType.fullName}>`;
1475
+ }
1476
+ }
1522
1477
  const GlobalMapGeneric = new GenericPType({
1523
1478
  name: 'GlobalMap',
1524
1479
  module: Constants.moduleNames.algoTs.state,
@@ -1530,19 +1485,10 @@ const GlobalMapGeneric = new GenericPType({
1530
1485
  });
1531
1486
  },
1532
1487
  });
1533
- class GlobalMapType extends StorageProxyPType {
1488
+ class GlobalMapType extends StateMapProxyPType {
1534
1489
  [PType.IdSymbol] = 'GlobalMapType';
1535
- module = Constants.moduleNames.algoTs.state;
1536
- get name() {
1537
- return `GlobalMap<${this.keyType.name}, ${this.contentType.name}>`;
1538
- }
1539
- get fullName() {
1540
- return `${this.module}::${this.name}<${this.keyType.name}, ${this.contentType.fullName}>`;
1541
- }
1542
- keyType;
1543
1490
  constructor(props) {
1544
- super({ ...props, keyWType: wtypes.stateKeyWType });
1545
- this.keyType = props.keyType;
1491
+ super({ ...props, kind: 'GlobalMap' });
1546
1492
  }
1547
1493
  accept(visitor) {
1548
1494
  return visitor.visitGlobalMapType(this);
@@ -1558,25 +1504,10 @@ const LocalStateGeneric = new GenericPType({
1558
1504
  });
1559
1505
  },
1560
1506
  });
1561
- class LocalStateType extends StorageProxyPType {
1507
+ class LocalStateType extends StateProxyPType {
1562
1508
  [PType.IdSymbol] = 'LocalStateType';
1563
- static baseName = 'LocalState';
1564
- static baseFullName = `${Constants.moduleNames.algoTs.state}::${LocalStateType.baseName}`;
1565
- module = Constants.moduleNames.algoTs.state;
1566
- get name() {
1567
- return `${LocalStateType.baseName}<${this.contentType.name}>`;
1568
- }
1569
- get fullName() {
1570
- return `${LocalStateType.baseFullName}<${this.contentType.fullName}>`;
1571
- }
1572
1509
  constructor(props) {
1573
- super({ ...props, keyWType: wtypes.stateKeyWType });
1574
- }
1575
- static parameterise(typeArgs) {
1576
- codeInvariant(typeArgs.length === 1, 'LocalState type expects exactly one type parameter');
1577
- return new LocalStateType({
1578
- content: typeArgs[0],
1579
- });
1510
+ super({ ...props, kind: 'LocalState' });
1580
1511
  }
1581
1512
  accept(visitor) {
1582
1513
  return visitor.visitLocalStateType(this);
@@ -1593,19 +1524,10 @@ const LocalMapGeneric = new GenericPType({
1593
1524
  });
1594
1525
  },
1595
1526
  });
1596
- class LocalMapType extends StorageProxyPType {
1527
+ class LocalMapType extends StateMapProxyPType {
1597
1528
  [PType.IdSymbol] = 'LocalMapType';
1598
- module = Constants.moduleNames.algoTs.state;
1599
- get name() {
1600
- return `LocalMap<${this.keyType.name}, ${this.contentType.name}>`;
1601
- }
1602
- get fullName() {
1603
- return `${this.module}::${this.name}<${this.keyType.name}, ${this.contentType.fullName}>`;
1604
- }
1605
- keyType;
1606
1529
  constructor(props) {
1607
- super({ ...props, keyWType: wtypes.stateKeyWType });
1608
- this.keyType = props.keyType;
1530
+ super({ ...props, kind: 'LocalMap' });
1609
1531
  }
1610
1532
  accept(visitor) {
1611
1533
  return visitor.visitLocalMapType(this);
@@ -1655,7 +1577,7 @@ class BoxMapPType extends StorageProxyPType {
1655
1577
  return `BoxMap<${this.keyType.name}, ${this.contentType.name}>`;
1656
1578
  }
1657
1579
  get fullName() {
1658
- return `${this.module}::${this.name}<${this.keyType.name}, ${this.contentType.fullName}>`;
1580
+ return `${this.module}::${this.name}`;
1659
1581
  }
1660
1582
  keyType;
1661
1583
  constructor(props) {
@@ -1742,8 +1664,7 @@ class ABICompatibleInstanceType extends InstanceType {
1742
1664
  this.abiTypeSignature = abiTypeSignature;
1743
1665
  }
1744
1666
  }
1745
- class LibFunctionType extends PType {
1746
- [PType.IdSymbol] = 'LibFunctionType';
1667
+ class LibPType extends PType {
1747
1668
  wtype;
1748
1669
  name;
1749
1670
  module;
@@ -1753,92 +1674,58 @@ class LibFunctionType extends PType {
1753
1674
  this.name = name;
1754
1675
  this.module = module;
1755
1676
  }
1677
+ }
1678
+ class LibFunctionType extends LibPType {
1679
+ [PType.IdSymbol] = 'LibFunctionType';
1756
1680
  accept(visitor) {
1757
1681
  return visitor.visitLibFunctionType(this);
1758
1682
  }
1759
1683
  }
1760
- class LibClassType extends PType {
1684
+ class LibClassType extends LibPType {
1761
1685
  [PType.IdSymbol] = 'LibClassType';
1762
- wtype;
1763
- name;
1764
- module;
1765
- singleton = true;
1766
- constructor({ name, module }) {
1767
- super();
1768
- this.name = name;
1769
- this.module = module;
1770
- }
1771
1686
  accept(visitor) {
1772
1687
  return visitor.visitLibClassType(this);
1773
1688
  }
1774
1689
  }
1775
- class LibObjType extends PType {
1690
+ class LibObjType extends LibPType {
1776
1691
  [PType.IdSymbol] = 'LibObjType';
1777
- wtype;
1778
- name;
1779
- module;
1780
- singleton = true;
1781
- constructor({ name, module }) {
1782
- super();
1783
- this.name = name;
1784
- this.module = module;
1785
- }
1786
1692
  accept(visitor) {
1787
1693
  return visitor.visitLibObjType(this);
1788
1694
  }
1789
1695
  }
1790
- class IntrinsicFunctionGroupType extends PType {
1791
- [PType.IdSymbol] = 'IntrinsicFunctionGroupType';
1696
+ class IntrinsicOpPType extends PType {
1792
1697
  wtype;
1793
1698
  name;
1794
1699
  module = Constants.moduleNames.algoTs.op;
1795
- singleton = true;
1796
1700
  constructor({ name }) {
1797
1701
  super();
1798
1702
  this.name = name;
1799
1703
  }
1704
+ }
1705
+ class IntrinsicFunctionGroupType extends IntrinsicOpPType {
1706
+ [PType.IdSymbol] = 'IntrinsicFunctionGroupType';
1707
+ singleton = true;
1800
1708
  accept(visitor) {
1801
1709
  return visitor.visitIntrinsicFunctionGroupType(this);
1802
1710
  }
1803
1711
  }
1804
- class IntrinsicFunctionGroupTypeType extends PType {
1712
+ class IntrinsicFunctionGroupTypeType extends IntrinsicOpPType {
1805
1713
  [PType.IdSymbol] = 'IntrinsicFunctionGroupTypeType';
1806
- wtype;
1807
- name;
1808
- module = Constants.moduleNames.algoTs.op;
1809
1714
  singleton = false;
1810
- constructor({ name }) {
1811
- super();
1812
- this.name = name;
1813
- }
1814
1715
  accept(visitor) {
1815
1716
  return visitor.visitIntrinsicFunctionGroupTypeType(this);
1816
1717
  }
1817
1718
  }
1818
- class IntrinsicFunctionType extends PType {
1719
+ class IntrinsicFunctionType extends IntrinsicOpPType {
1819
1720
  [PType.IdSymbol] = 'IntrinsicFunctionType';
1820
- wtype;
1821
- name;
1822
- module = Constants.moduleNames.algoTs.op;
1823
1721
  singleton = true;
1824
- constructor({ name }) {
1825
- super();
1826
- this.name = name;
1827
- }
1828
1722
  accept(visitor) {
1829
1723
  return visitor.visitIntrinsicFunctionType(this);
1830
1724
  }
1831
1725
  }
1832
- class IntrinsicFunctionTypeType extends PType {
1726
+ class IntrinsicFunctionTypeType extends IntrinsicOpPType {
1833
1727
  [PType.IdSymbol] = 'IntrinsicFunctionTypeType';
1834
- wtype;
1835
- name;
1836
- module = Constants.moduleNames.algoTs.op;
1837
1728
  singleton = false;
1838
- constructor({ name }) {
1839
- super();
1840
- this.name = name;
1841
- }
1842
1729
  accept(visitor) {
1843
1730
  return visitor.visitIntrinsicFunctionTypeType(this);
1844
1731
  }
@@ -1929,20 +1816,27 @@ class ArrayLiteralPType extends PType {
1929
1816
  });
1930
1817
  }
1931
1818
  }
1932
- class MutableTuplePType extends PType {
1933
- [PType.IdSymbol] = 'MutableTuplePType';
1819
+ class TupleBasePType extends PType {
1820
+ items;
1821
+ singleton = false;
1934
1822
  module = Constants.moduleNames.tslib;
1823
+ namePrefix;
1824
+ constructor(props) {
1825
+ super();
1826
+ this.items = props.items;
1827
+ this.namePrefix = props.immutable ? 'readonly ' : '';
1828
+ }
1935
1829
  get name() {
1936
- return `[${this.items.map((i) => i.name).join(', ')}]`;
1830
+ return `${this.namePrefix}[${this.items.map((i) => i.name).join(', ')}]`;
1937
1831
  }
1938
1832
  get fullName() {
1939
- return `${this.module}::[${this.items.map((i) => i.fullName).join(', ')}]`;
1833
+ return `${this.module}::${this.namePrefix}[${this.items.map((i) => i.fullName).join(', ')}]`;
1940
1834
  }
1941
- items;
1942
- singleton = false;
1835
+ }
1836
+ class MutableTuplePType extends TupleBasePType {
1837
+ [PType.IdSymbol] = 'MutableTuplePType';
1943
1838
  constructor(props) {
1944
- super();
1945
- this.items = props.items;
1839
+ super({ ...props });
1946
1840
  }
1947
1841
  get wtype() {
1948
1842
  return new wtypes.ARC4Tuple({
@@ -1954,20 +1848,10 @@ class MutableTuplePType extends PType {
1954
1848
  return visitor.visitMutableTuplePType(this);
1955
1849
  }
1956
1850
  }
1957
- class ReadonlyTuplePType extends PType {
1851
+ class ReadonlyTuplePType extends TupleBasePType {
1958
1852
  [PType.IdSymbol] = 'ReadonlyTuplePType';
1959
- module = Constants.moduleNames.tslib;
1960
- get name() {
1961
- return `readonly [${this.items.map((i) => i.name).join(', ')}]`;
1962
- }
1963
- get fullName() {
1964
- return `${this.module}::readonly [${this.items.map((i) => i.fullName).join(', ')}]`;
1965
- }
1966
- items;
1967
- singleton = false;
1968
1853
  constructor(props) {
1969
- super();
1970
- this.items = props.items;
1854
+ super({ ...props, immutable: true });
1971
1855
  }
1972
1856
  get wtype() {
1973
1857
  return new wtypes.WTuple({
@@ -1986,20 +1870,22 @@ const ArrayGeneric = new GenericPType({
1986
1870
  return new ArrayPType({ elementType: typeArgs[0] });
1987
1871
  },
1988
1872
  });
1989
- class ArrayPType extends PType {
1990
- [PType.IdSymbol] = 'ArrayPType';
1873
+ class DynamicArrayBasePType extends PType {
1991
1874
  elementType;
1992
- immutable = false;
1875
+ immutable;
1993
1876
  singleton = false;
1994
1877
  name;
1995
1878
  module = Constants.moduleNames.typescript.es5;
1996
- get fullName() {
1997
- return `${this.module}::Array<${this.elementType.fullName}>`;
1998
- }
1879
+ kind;
1999
1880
  constructor(props) {
2000
1881
  super();
2001
- this.name = `Array<${props.elementType.name}>`;
2002
1882
  this.elementType = props.elementType;
1883
+ this.immutable = props.immutable;
1884
+ this.kind = props.immutable ? 'ReadonlyArray' : 'Array';
1885
+ this.name = `${this.kind}<${props.elementType.name}>`;
1886
+ }
1887
+ get fullName() {
1888
+ return `${this.module}::${this.kind}<${this.elementType.fullName}>`;
2003
1889
  }
2004
1890
  get wtype() {
2005
1891
  return new wtypes.ARC4DynamicArray({
@@ -2007,6 +1893,12 @@ class ArrayPType extends PType {
2007
1893
  immutable: this.immutable,
2008
1894
  });
2009
1895
  }
1896
+ }
1897
+ class ArrayPType extends DynamicArrayBasePType {
1898
+ [PType.IdSymbol] = 'ArrayPType';
1899
+ constructor(props) {
1900
+ super({ ...props, immutable: false });
1901
+ }
2010
1902
  accept(visitor) {
2011
1903
  return visitor.visitArrayPType(this);
2012
1904
  }
@@ -2019,26 +1911,10 @@ const ReadonlyArrayGeneric = new GenericPType({
2019
1911
  return new ReadonlyArrayPType({ elementType: typeArgs[0] });
2020
1912
  },
2021
1913
  });
2022
- class ReadonlyArrayPType extends PType {
1914
+ class ReadonlyArrayPType extends DynamicArrayBasePType {
2023
1915
  [PType.IdSymbol] = 'ReadonlyArrayPType';
2024
- elementType;
2025
- singleton = false;
2026
- immutable = true;
2027
- name;
2028
- module = Constants.moduleNames.typescript.es5;
2029
- get fullName() {
2030
- return `${this.module}::ReadonlyArray<${this.elementType.fullName}>`;
2031
- }
2032
1916
  constructor(props) {
2033
- super();
2034
- this.elementType = props.elementType;
2035
- this.name = `ReadonlyArray<${props.elementType.name}>`;
2036
- }
2037
- get wtype() {
2038
- return new wtypes.ARC4DynamicArray({
2039
- elementType: this.elementType.wtypeOrThrow,
2040
- immutable: this.immutable,
2041
- });
1917
+ super({ ...props, immutable: true });
2042
1918
  }
2043
1919
  accept(visitor) {
2044
1920
  return visitor.visitReadonlyArrayPType(this);
@@ -2118,6 +1994,22 @@ class ObjectPType extends PType {
2118
1994
  hasSameStructure(other) {
2119
1995
  return zipStrict(this.properties, other.properties).every(([left, right]) => left.name === right.name && left.ptype.equals(right.ptype));
2120
1996
  }
1997
+ toWTuple(fallbackName) {
1998
+ const tupleTypes = [];
1999
+ const tupleNames = [];
2000
+ for (const { name, ptype } of this.properties) {
2001
+ if (ptype instanceof TransientType) {
2002
+ throw new CodeError(`Property '${name}' of ${this.name} has an unsupported type: ${ptype.typeMessage}`);
2003
+ }
2004
+ tupleTypes.push(ptype.wtypeOrThrow);
2005
+ tupleNames.push(name);
2006
+ }
2007
+ return new wtypes.WTuple({
2008
+ name: this.alias?.fullName ?? fallbackName,
2009
+ names: tupleNames,
2010
+ types: tupleTypes,
2011
+ });
2012
+ }
2121
2013
  }
2122
2014
  class ObjectLiteralPType extends ObjectPType {
2123
2015
  [PType.IdSymbol] = 'ObjectLiteralPType';
@@ -2146,20 +2038,7 @@ class ObjectLiteralPType extends ObjectPType {
2146
2038
  });
2147
2039
  }
2148
2040
  get wtype() {
2149
- const tupleTypes = [];
2150
- const tupleNames = [];
2151
- for (const { name, ptype } of this.properties) {
2152
- if (ptype instanceof TransientType) {
2153
- throw new CodeError(`Property '${name}' of ${this.name} has an unsupported type: ${ptype.typeMessage}`);
2154
- }
2155
- tupleTypes.push(ptype.wtypeOrThrow);
2156
- tupleNames.push(name);
2157
- }
2158
- return new wtypes.WTuple({
2159
- name: this.alias?.fullName ?? this.toString(),
2160
- names: tupleNames,
2161
- types: tupleTypes,
2162
- });
2041
+ return this.toWTuple(this.toString());
2163
2042
  }
2164
2043
  }
2165
2044
  class ImmutableObjectPType extends ObjectPType {
@@ -2172,20 +2051,7 @@ class ImmutableObjectPType extends ObjectPType {
2172
2051
  });
2173
2052
  }
2174
2053
  get wtype() {
2175
- const tupleTypes = [];
2176
- const tupleNames = [];
2177
- for (const { name, ptype } of this.properties) {
2178
- if (ptype instanceof TransientType) {
2179
- throw new CodeError(`Property '${name}' of ${this.name} has an unsupported type: ${ptype.typeMessage}`);
2180
- }
2181
- tupleTypes.push(ptype.wtypeOrThrow);
2182
- tupleNames.push(name);
2183
- }
2184
- return new wtypes.WTuple({
2185
- name: this.alias?.fullName ?? this.name,
2186
- names: tupleNames,
2187
- types: tupleTypes,
2188
- });
2054
+ return this.toWTuple(this.name);
2189
2055
  }
2190
2056
  accept(visitor) {
2191
2057
  return visitor.visitImmutableObjectPType(this);
@@ -5588,4 +5454,4 @@ class CompilationSet extends CustomKeyMap {
5588
5454
  }
5589
5455
 
5590
5456
  export { FixedArrayGeneric as $, AbsolutePath as A, AssetConfigTxnFunction as B, ContractReference as C, AssetFreezeTxnFunction as D, AssetFunction as E, AssetTransferTxnFunction as F, BaseContractClassType as G, BigIntLiteralPType as H, InternalError as I, BigIntPType as J, BigUintFunction as K, LogLevel as L, BooleanFunction as M, BoxGeneric as N, OnCompletionAction as O, PuyaError as P, BoxMapGeneric as Q, BoxMapPType as R, BoxPType as S, BytesFunction as T, BytesGeneric as U, BytesPType as V, ClassMethodDecoratorContext as W, ClearStateProgram as X, ClusteredContractClassType as Y, ClusteredPrototype as Z, ContractClassPType as _, LoggingContext as a, UnsupportedType as a$, FixedArrayPType as a0, FunctionPType as a1, GeneratorGeneric as a2, GeneratorType as a3, GenericPType as a4, GlobalMapGeneric as a5, GlobalMapType as a6, GlobalStateGeneric as a7, GlobalStateType as a8, GroupTransactionPType as a9, NumericLiteralPType as aA, ObjectLiteralPType as aB, ObjectWithOptionalFieldsType as aC, PType as aD, PaymentTxnFunction as aE, PolytypeClassMethodHelper as aF, PromiseGeneric as aG, PromiseType as aH, ReadonlyArrayGeneric as aI, ReadonlyArrayPType as aJ, ReadonlyGeneric as aK, ReadonlyTuplePType as aL, ReferenceArrayGeneric as aM, ReferenceArrayType as aN, StringFunction as aO, SuperPrototypeSelector as aP, SuperPrototypeSelectorGeneric as aQ, TemplateVarFunction as aR, TransactionFunction as aS, TransactionFunctionType as aT, TransientType as aU, TypeParameterType as aV, Uint64EnumMemberLiteralType as aW, Uint64EnumMemberType as aX, Uint64EnumType as aY, Uint64Function as aZ, UnionPType as a_, ImmutableObjectPType as aa, InnerTransactionPType as ab, InstanceType as ac, InternalType as ad, IntersectionPType as ae, IntrinsicEnumType as af, IntrinsicFunctionGroupType as ag, IntrinsicFunctionGroupTypeType as ah, IntrinsicFunctionType as ai, IntrinsicFunctionTypeType as aj, IterableIteratorGeneric as ak, IterableIteratorType as al, ItxnParamsPType as am, KeyRegistrationTxnFunction as an, LibClassType as ao, LibFunctionType as ap, LibObjType as aq, LocalMapGeneric as ar, LocalMapType as as, LocalStateGeneric as at, LocalStateType as au, LogicSigPType as av, MutableObjectPType as aw, MutableTuplePType as ax, NamespacePType as ay, NumberPType as az, ContractClassModel as b, stringPType as b$, anyItxnParamsType as b0, anyItxnType as b1, anyPType as b2, applicationCallItxnFn as b3, applicationCallItxnParamsType as b4, applicationItxnType as b5, arc28EmitFunction as b6, arc4AbiMethodDecorator as b7, arc4BareMethodDecorator as b8, arc4BaseContractType as b9, errFunction as bA, esSymbol as bB, inputOnlyObjects as bC, isArrayType as bD, isObjectType as bE, isTupleLike as bF, itoaMethod as bG, itxnComposePType as bH, keyRegistrationItxnFn as bI, keyRegistrationItxnParamsType as bJ, keyRegistrationItxnType as bK, logFunction as bL, loggedAssertFunction as bM, loggedErrFunction as bN, logicSigBaseType as bO, logicSigOptionsDecorator as bP, matchFunction as bQ, mimcConfigurationsPType as bR, neverPType as bS, nullPType as bT, numberPType as bU, onCompleteActionType as bV, opUpFeeSourceType as bW, paymentItxnFn as bX, paymentItxnParamsType as bY, paymentItxnType as bZ, readonlyDecorator as b_, assertFunction as ba, assertMatchFunction as bb, assetConfigItxnFn as bc, assetConfigItxnParamsType as bd, assetConfigItxnType as be, assetFreezeItxnFn as bf, assetFreezeItxnParamsType as bg, assetFreezeItxnType as bh, assetTransferItxnFn as bi, assetTransferItxnParamsType as bj, assetTransferItxnType as bk, base64PType as bl, baseContractType as bm, bigIntPType as bn, biguintPType as bo, boolPType as bp, bytesPType as bq, bzeroFunction as br, cloneFunctionPType as bs, compileFunctionType as bt, compiledContractType as bu, compiledLogicSigType as bv, contractOptionsDecorator as bw, ecPType as bx, ecdsaPType as by, ensureBudgetFunction as bz, CodeError as c, UInt64BinaryOperator as c$, submitGroupItxnFunction as c0, transactionTypeType as c1, uint64PType as c2, undefinedPType as c3, unknownPType as c4, urangeFunction as c5, validateEncodingFunctionPType as c6, vrfVerifyPType as c7, uint8ArrayToBigInt as c8, uint8ArrayToBase64 as c9, instanceOfAny as cA, SingleEvaluation as cB, VarExpression as cC, nodeFactory as cD, NotSupported as cE, TupleItemExpression as cF, FieldExpression as cG, IndexExpression as cH, TupleExpression as cI, AppStateExpression as cJ, AppAccountStateExpression as cK, BoxValueExpression as cL, StateGetEx as cM, StateGet as cN, hasFlags as cO, BinaryBooleanOperator as cP, SymbolName as cQ, intersectsFlags as cR, extractModuleName as cS, toSubScript as cT, CompilationSet as cU, ARC4ABIMethodConfig as cV, EqualityComparison as cW, ARC4CreateOption as cX, NewArray as cY, BytesEncoding as cZ, FixableCodeError as c_, uint8ArrayToBase32 as ca, uint8ArrayToUtf8 as cb, base64ToUint8Array as cc, base32ToUint8Array as cd, bigIntToUint8Array as ce, utf8ToUint8Array as cf, LogSource as cg, SourceLocation as ch, isMinLevel as ci, enumFromValue as cj, mkDirIfNotExists as ck, distinct as cl, zipStrict as cm, isIn as cn, wtypes as co, codeInvariant as cp, invariant as cq, throwError as cr, StringConstant as cs, BytesConstant as ct, IntegerConstant as cu, BoolConstant as cv, AddressConstant as cw, MethodConstant as cx, DecimalConstant as cy, TemplateVar as cz, Constants as d, ReturnStatement as d$, tryConvertEnum as d0, NumericComparison as d1, UInt64UnaryOperator as d2, UInt64PostfixUnaryOperator as d3, wrapInCodeError as d4, TransactionKind as d5, LogicSigReference as d6, getInnerTransactionType as d7, getItxnParamsType as d8, CompiledContract as d9, StageInnerTransactions as dA, SubmitInnerTransaction as dB, AssignmentExpression as dC, CommaExpression as dD, NumericComparisonExpression as dE, BytesComparisonExpression as dF, PuyaLibCall as dG, UInt64UnaryOperation as dH, UInt64PostfixUnaryOperation as dI, BigUIntPostfixUnaryOperation as dJ, BytesUnaryOperation as dK, UInt64BinaryOperation as dL, BigUIntBinaryOperation as dM, BooleanBinaryOperation as dN, Not as dO, Emit as dP, Range as dQ, Enumeration as dR, Reversed as dS, StateExists as dT, ARC4Router as dU, MethodSignatureString as dV, SubroutineID as dW, ContractMethodTarget as dX, InstanceMethodTarget as dY, patchErrorLocation as dZ, Goto as d_, ARC4BareMethodConfig as da, MethodSignature as db, BigUIntBinaryOperator as dc, BigUIntPostfixUnaryOperator as dd, BytesBinaryOperator as de, IntrinsicCall as df, enumKeyFromValue as dg, BytesUnaryOperator as dh, PuyaLibFunction as di, Expression as dj, AppStorageKind as dk, transientTypeErrors as dl, getGroupTransactionType as dm, Contract as dn, InstanceSuperMethodTarget as dp, ExpressionStatement as dq, AssertExpression as dr, VoidConstant as ds, ArrayConcat as dt, ArrayPop as du, ArrayReplace as dv, ArrayLength as dw, SizeOf as dx, UpdateInnerTransaction as dy, CheckedMaybe as dz, accountPType as e, ContractMethod as e0, sameSets as e1, Subroutine as e2, LogicSigClassModel as e3, ptypeIn as e4, expandMaybeArray as e5, applicationPType as f, assetPType as g, anyGtxnType as h, assetConfigGtxnType as i, assetTransferGtxnType as j, keyRegistrationGtxnType as k, logger as l, assetFreezeGtxnType as m, applicationCallGtxnType as n, ABICompatibleInstanceType as o, paymentGtxnType as p, ALL_OP_ENUMS as q, AccountFunction as r, AnyPType as s, ApplicationFunctionType as t, ApplicationTxnFunction as u, voidPType as v, ApprovalProgram as w, ArrayGeneric as x, ArrayLiteralPType as y, ArrayPType as z };
5591
- //# sourceMappingURL=contract-class-model-cK8F4WVM.js.map
5457
+ //# sourceMappingURL=contract-class-model-BZeEDGw0.js.map