@algorandfoundation/puya-ts 1.2.0-beta.34 → 1.2.0-beta.36
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.
- package/{analyser-service-DjrWRS0-.js → analyser-service-C1sYEdlC.js} +3 -3
- package/{analyser-service-DjrWRS0-.js.map → analyser-service-C1sYEdlC.js.map} +1 -1
- package/analyserService.mjs +3 -3
- package/{arc4-clientgen-CZtNN1eT.js → arc4-clientgen-BBdFxRUs.js} +2 -2
- package/{arc4-clientgen-CZtNN1eT.js.map → arc4-clientgen-BBdFxRUs.js.map} +1 -1
- package/awst/wtypes.d.ts +2 -5
- package/awst_build/ast-visitors/base-visitor.d.ts +0 -1
- package/awst_build/ast-visitors/contract-method-visitor.d.ts +3 -3
- package/awst_build/context/awst-build-context.d.ts +1 -1
- package/awst_build/eb/index.d.ts +0 -1
- package/awst_build/ptypes/arc4-types.d.ts +1 -1
- package/awst_build/ptypes/index.d.ts +65 -90
- package/awst_build/type-resolver.d.ts +1 -1
- package/bin/puyats-clientgen.mjs +5 -5
- package/bin/puyats-ls.mjs +6 -6
- package/bin/run-cli.mjs +8 -8
- package/{check-node-version-BYGc-qxw.js → check-node-version-jdAtH-rx.js} +3 -3
- package/{check-node-version-BYGc-qxw.js.map → check-node-version-jdAtH-rx.js.map} +1 -1
- package/cli.mjs +8 -8
- package/{compile-BKk4hPli.js → compile-DbGGbErI.js} +6 -6
- package/{compile-BKk4hPli.js.map → compile-DbGGbErI.js.map} +1 -1
- package/{contract-class-model-Dpn9A-pJ.js → contract-class-model-CkfUf4wT.js} +112 -181
- package/contract-class-model-CkfUf4wT.js.map +1 -0
- package/index.mjs +8 -8
- package/{options-BCW57sPn.js → options-BMqysQHP.js} +106 -130
- package/options-BMqysQHP.js.map +1 -0
- package/package.json +2 -2
- package/{resolve-puya-path-CdZID0Yd.js → resolve-puya-path-C4sw8aVH.js} +4 -4
- package/{resolve-puya-path-CdZID0Yd.js.map → resolve-puya-path-C4sw8aVH.js.map} +1 -1
- package/{semver-a7hIj_hk.js → semver-BcvZGdLN.js} +2 -2
- package/{semver-a7hIj_hk.js.map → semver-BcvZGdLN.js.map} +1 -1
- package/{util-nZLj7LWS.js → util-DgN3iON1.js} +2 -2
- package/{util-nZLj7LWS.js.map → util-DgN3iON1.js.map} +1 -1
- package/contract-class-model-Dpn9A-pJ.js.map +0 -1
- package/options-BCW57sPn.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-node-version-
|
|
1
|
+
{"version":3,"file":"check-node-version-jdAtH-rx.js","sources":["../src/cli/check-node-version.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { Constants } from '../constants'\nimport { parseSemVer } from '../puya/semver'\n\nfunction writeError(text: string) {\n // eslint-disable-next-line no-console\n console.error(chalk.red(text))\n}\n\nexport function checkNodeVersion() {\n const min = parseSemVer(Constants.minNodeVersion)\n const actual = parseSemVer(process.versions.node)\n\n if (\n actual.major < min.major ||\n (actual.major === min.major && actual.minor < min.minor) ||\n (actual.major === min.major && actual.minor === min.minor && actual.rev < min.rev)\n ) {\n writeError(\n `Installed node version ${process.versions.node} is older than the minimum required version ${Constants.minNodeVersion}. You may experience compatibility issues.`,\n )\n }\n}\n"],"names":[],"mappings":";;;;AAIA,SAAS,UAAU,CAAC,IAAY,EAAA;;IAE9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAChC;SAEgB,gBAAgB,GAAA;IAC9B,MAAM,GAAG,GAAG,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC;IACjD,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;AAEjD,IAAA,IACE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK;AACxB,SAAC,MAAM,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;SACvD,MAAM,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,EAClF;AACA,QAAA,UAAU,CACR,CAAA,uBAAA,EAA0B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAA,4CAAA,EAA+C,SAAS,CAAC,cAAc,CAAA,0CAAA,CAA4C,CACnK;IACH;AACF;;;;"}
|
package/cli.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { l as logger, A as AbsolutePath, a as LoggingContext, L as LogLevel } from './contract-class-model-
|
|
1
|
+
import { l as logger, A as AbsolutePath, a as LoggingContext, L as LogLevel } from './contract-class-model-CkfUf4wT.js';
|
|
2
2
|
import { BooleanOptionalAction, ArgumentParser } from 'argparse';
|
|
3
|
-
import { a as appVersion } from './semver-
|
|
4
|
-
import { c as compile } from './compile-
|
|
5
|
-
import { _ as defaultPuyaOptions, X as processInputPaths, V as CompileOptions, $ as parseCliTemplateVar, a0 as LocalsCoalescingStrategy } from './options-
|
|
6
|
-
import { a as addEnumArg, C as ConsoleLogSink, c as convertInt } from './util-
|
|
7
|
-
import { c as checkNodeVersion } from './check-node-version-
|
|
3
|
+
import { a as appVersion } from './semver-BcvZGdLN.js';
|
|
4
|
+
import { c as compile } from './compile-DbGGbErI.js';
|
|
5
|
+
import { _ as defaultPuyaOptions, X as processInputPaths, V as CompileOptions, $ as parseCliTemplateVar, a0 as LocalsCoalescingStrategy } from './options-BMqysQHP.js';
|
|
6
|
+
import { a as addEnumArg, C as ConsoleLogSink, c as convertInt } from './util-DgN3iON1.js';
|
|
7
|
+
import { c as checkNodeVersion } from './check-node-version-jdAtH-rx.js';
|
|
8
8
|
import 'typescript';
|
|
9
9
|
import 'node:fs';
|
|
10
10
|
import 'node:util';
|
|
@@ -14,10 +14,10 @@ import 'polytype';
|
|
|
14
14
|
import 'node:async_hooks';
|
|
15
15
|
import 'fs';
|
|
16
16
|
import 'node:url';
|
|
17
|
-
import './arc4-clientgen-
|
|
17
|
+
import './arc4-clientgen-BBdFxRUs.js';
|
|
18
18
|
import '@algorandfoundation/algokit-utils/abi';
|
|
19
19
|
import 'fs/promises';
|
|
20
|
-
import './resolve-puya-path-
|
|
20
|
+
import './resolve-puya-path-C4sw8aVH.js';
|
|
21
21
|
import 'tslib';
|
|
22
22
|
import 'signal-exit';
|
|
23
23
|
import 'cross-spawn';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as writeARC4Clients } from './arc4-clientgen-
|
|
2
|
-
import { a1 as PuyaService, a2 as deserializeAndLog, Y as registerPTypes, a3 as createTsProgram, a4 as buildAwst, a5 as validateAwst, Z as typeRegistry } from './options-
|
|
3
|
-
import { a as appVersion } from './semver-
|
|
4
|
-
import { ck as mkDirIfNotExists, L as LogLevel, a as LoggingContext, l as logger } from './contract-class-model-
|
|
1
|
+
import { a as writeARC4Clients } from './arc4-clientgen-BBdFxRUs.js';
|
|
2
|
+
import { a1 as PuyaService, a2 as deserializeAndLog, Y as registerPTypes, a3 as createTsProgram, a4 as buildAwst, a5 as validateAwst, Z as typeRegistry } from './options-BMqysQHP.js';
|
|
3
|
+
import { a as appVersion } from './semver-BcvZGdLN.js';
|
|
4
|
+
import { ck as mkDirIfNotExists, L as LogLevel, a as LoggingContext, l as logger } from './contract-class-model-CkfUf4wT.js';
|
|
5
5
|
import ts from 'typescript';
|
|
6
|
-
import { r as resolvePuyaPath } from './resolve-puya-path-
|
|
6
|
+
import { r as resolvePuyaPath } from './resolve-puya-path-C4sw8aVH.js';
|
|
7
7
|
|
|
8
8
|
function buildCompilationSetMapping({ awst, inputPaths, compilationSet, }) {
|
|
9
9
|
const setIds = new Set(compilationSet.compilationOutputSet.map((s) => s.id));
|
|
@@ -110,4 +110,4 @@ async function compile(options, puyaService) {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
export { compile as c };
|
|
113
|
-
//# sourceMappingURL=compile-
|
|
113
|
+
//# sourceMappingURL=compile-DbGGbErI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-
|
|
1
|
+
{"version":3,"file":"compile-DbGGbErI.js","sources":["../src/puya/build-compilation-set-mapping.ts","../src/puya/index.ts","../src/compile.ts"],"sourcesContent":["import type { AWST } from '../awst/nodes'\nimport type { CompilationSet } from '../awst_build/models/contract-class-model'\nimport type { AlgoFile, CompilationSetMapping } from '../options'\nimport { mkDirIfNotExists } from '../util'\n\nexport function buildCompilationSetMapping({\n awst,\n inputPaths,\n compilationSet,\n}: {\n awst: AWST[]\n inputPaths: AlgoFile[]\n compilationSet: CompilationSet\n}): CompilationSetMapping {\n const setIds = new Set(compilationSet.compilationOutputSet.map((s) => s.id))\n\n return awst.reduce((acc, cur) => {\n if (setIds.has(cur.id.toString())) {\n const matchedPath = inputPaths.find((p) => cur.sourceLocation.file && p.sourceFile.equals(cur.sourceLocation.file))\n if (matchedPath) {\n mkDirIfNotExists(matchedPath.outDir.toString())\n acc[cur.id.toString()] = matchedPath.outDir.toString()\n }\n }\n return acc\n }, {} as CompilationSetMapping)\n}\n","import ts from 'typescript'\nimport type { AWST } from '../awst/nodes'\nimport type { CompilationSet } from '../awst_build/models/contract-class-model'\nimport { LogLevel } from '../logger'\nimport type { CompileOptions } from '../options'\nimport type { SourceFileMapping } from '../parser'\nimport type { AbsolutePath } from '../util/absolute-path'\nimport { buildCompilationSetMapping } from './build-compilation-set-mapping'\nimport { deserializeAndLog } from './log-deserializer'\nimport { PuyaService } from './puya-service'\nimport { resolvePuyaPath } from './resolve-puya-path'\n\nexport async function puyaCompile({\n moduleAwst,\n programDirectory,\n sourceFiles,\n options,\n compilationSet,\n puyaService,\n}: {\n moduleAwst: AWST[]\n programDirectory: AbsolutePath\n sourceFiles: SourceFileMapping\n options: CompileOptions\n compilationSet: CompilationSet\n puyaService?: PuyaService\n}) {\n const puyaPath = await resolvePuyaPath(options)\n const localPuyaService = puyaService ?? new PuyaService({ puyaPath })\n const puyaOptions = options.buildPuyaOptions(\n buildCompilationSetMapping({\n awst: moduleAwst,\n inputPaths: options.filePaths,\n compilationSet,\n }),\n )\n\n const response = await localPuyaService.compile({\n awst: moduleAwst,\n options: puyaOptions,\n base_path: programDirectory.toString(),\n log_level: getPuyaLogLevel(options.logLevel),\n source_annotations: getSourceFileContents(sourceFiles),\n })\n // Shutdown service if we created it locally\n if (puyaService === undefined) await localPuyaService.shutdown()\n for (const log of response.logs) {\n deserializeAndLog(log)\n }\n\n return response\n}\n\nfunction getPuyaLogLevel(logLevel: LogLevel): string {\n switch (logLevel) {\n case LogLevel.Debug:\n return 'debug'\n case LogLevel.Info:\n return 'info'\n case LogLevel.Warning:\n return 'warning'\n case LogLevel.Error:\n return 'error'\n case LogLevel.Critical:\n return 'critical'\n }\n}\nfunction getSourceFileContents(sourceFiles: SourceFileMapping) {\n return Object.fromEntries(\n Object.entries(sourceFiles).map(([key, value]) => {\n const source = ts.isSourceFile(value) ? value.getFullText().replace(/\\r\\n/g, '\\n').split(/\\n/g) : value\n return [key, source] as const\n }),\n )\n}\n","import type ts from 'typescript'\nimport { writeARC4Clients } from './arc4-clientgen'\nimport type { AWST } from './awst/nodes'\nimport { validateAwst } from './awst/validation'\nimport { buildAwst } from './awst_build'\nimport { type CompilationSet } from './awst_build/models/contract-class-model'\nimport { registerPTypes } from './awst_build/ptypes/register'\nimport { typeRegistry } from './awst_build/type-registry'\nimport { appVersion } from './cli/app-version'\nimport { logger, LoggingContext } from './logger'\nimport type { CompileOptions } from './options'\nimport { createTsProgram } from './parser'\nimport { puyaCompile } from './puya'\nimport type { PuyaService } from './puya/puya-service'\nimport type { AbsolutePath } from './util/absolute-path'\n\nexport type CompileResult = {\n programDirectory: AbsolutePath\n awst?: AWST[]\n ast?: Record<string, ts.SourceFile>\n compilationSet?: CompilationSet\n}\n\nexport async function compile(options: CompileOptions, puyaService?: PuyaService): Promise<CompileResult> {\n const loggerCtx = LoggingContext.current\n if (options.treatWarningsAsErrors) loggerCtx.treatWarningsAsErrors = true\n\n registerPTypes(typeRegistry)\n logger.info(undefined, appVersion({ withAVMVersion: false }))\n const programResult = createTsProgram(options)\n if (loggerCtx.hasErrors()) {\n logger.info(undefined, 'Compilation halted due to parse errors')\n return {\n programDirectory: programResult.programDirectory,\n ast: programResult.sourceFiles,\n }\n }\n const { moduleAwst, compilationSet } = buildAwst(programResult, options)\n validateAwst(moduleAwst)\n\n if (loggerCtx.hasErrors()) {\n logger.info(undefined, 'Compilation halted due to errors')\n return {\n programDirectory: programResult.programDirectory,\n awst: moduleAwst,\n ast: programResult.sourceFiles,\n compilationSet,\n }\n }\n if (!options.dryRun) {\n const compileResult = await puyaCompile({\n options,\n moduleAwst,\n programDirectory: programResult.programDirectory,\n compilationSet,\n sourceFiles: programResult.sourceFiles,\n puyaService,\n })\n\n if (options.outputClient) {\n await writeARC4Clients(compilationSet, options.filePaths, compileResult.arc56)\n }\n }\n\n return {\n programDirectory: programResult.programDirectory,\n awst: moduleAwst,\n ast: programResult.sourceFiles,\n compilationSet,\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -878,10 +878,10 @@ var wtypes;
|
|
|
878
878
|
class ReferenceArray extends WType {
|
|
879
879
|
elementType;
|
|
880
880
|
sourceLocation;
|
|
881
|
-
immutable = false;
|
|
882
881
|
constructor(props) {
|
|
883
882
|
super({
|
|
884
883
|
name: `ref_array<${props.itemType.name}>`,
|
|
884
|
+
immutable: false,
|
|
885
885
|
});
|
|
886
886
|
this.elementType = props.itemType;
|
|
887
887
|
this.sourceLocation = props.sourceLocation ?? null;
|
|
@@ -921,7 +921,7 @@ var wtypes;
|
|
|
921
921
|
wtypes.WInnerTransaction = WInnerTransaction;
|
|
922
922
|
class WInnerTransactionFields extends WType {
|
|
923
923
|
transactionType;
|
|
924
|
-
constructor({ transactionType
|
|
924
|
+
constructor({ transactionType }) {
|
|
925
925
|
super({
|
|
926
926
|
name: transactionType === undefined ? 'inner_transaction_fields' : `inner_transaction_fields_${TransactionKind[transactionType]}`,
|
|
927
927
|
});
|
|
@@ -934,7 +934,6 @@ var wtypes;
|
|
|
934
934
|
constructor({ returnType }) {
|
|
935
935
|
super({
|
|
936
936
|
transactionType: TransactionKind.appl,
|
|
937
|
-
name: 'abi_call_inner_transaction_fields',
|
|
938
937
|
});
|
|
939
938
|
this.resultType = returnType ?? wtypes.voidWType;
|
|
940
939
|
}
|
|
@@ -1492,6 +1491,21 @@ class StorageProxyPType extends PType {
|
|
|
1492
1491
|
this.contentType = props.content;
|
|
1493
1492
|
}
|
|
1494
1493
|
}
|
|
1494
|
+
class StateProxyPType extends StorageProxyPType {
|
|
1495
|
+
module;
|
|
1496
|
+
kind;
|
|
1497
|
+
constructor(props) {
|
|
1498
|
+
super({ content: props.content, keyWType: wtypes.stateKeyWType });
|
|
1499
|
+
this.module = Constants.moduleNames.algoTs.state;
|
|
1500
|
+
this.kind = props.kind;
|
|
1501
|
+
}
|
|
1502
|
+
get name() {
|
|
1503
|
+
return `${this.kind}<${this.contentType.name}>`;
|
|
1504
|
+
}
|
|
1505
|
+
get fullName() {
|
|
1506
|
+
return `${this.module}::${this.kind}<${this.contentType.fullName}>`;
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1495
1509
|
const GlobalStateGeneric = new GenericPType({
|
|
1496
1510
|
name: 'GlobalState',
|
|
1497
1511
|
module: Constants.moduleNames.algoTs.state,
|
|
@@ -1502,24 +1516,32 @@ const GlobalStateGeneric = new GenericPType({
|
|
|
1502
1516
|
});
|
|
1503
1517
|
},
|
|
1504
1518
|
});
|
|
1505
|
-
class GlobalStateType extends
|
|
1519
|
+
class GlobalStateType extends StateProxyPType {
|
|
1506
1520
|
[PType.IdSymbol] = 'GlobalStateType';
|
|
1507
|
-
static baseName = 'GlobalState';
|
|
1508
|
-
static baseFullName = `${Constants.moduleNames.algoTs.state}::${GlobalStateType.baseName}`;
|
|
1509
|
-
module = Constants.moduleNames.algoTs.state;
|
|
1510
|
-
get name() {
|
|
1511
|
-
return `${GlobalStateType.baseName}<${this.contentType.name}>`;
|
|
1512
|
-
}
|
|
1513
|
-
get fullName() {
|
|
1514
|
-
return `${GlobalStateType.baseFullName}<${this.contentType.fullName}>`;
|
|
1515
|
-
}
|
|
1516
1521
|
constructor(props) {
|
|
1517
|
-
super({ ...props,
|
|
1522
|
+
super({ ...props, kind: 'GlobalState' });
|
|
1518
1523
|
}
|
|
1519
1524
|
accept(visitor) {
|
|
1520
1525
|
return visitor.visitGlobalStateType(this);
|
|
1521
1526
|
}
|
|
1522
1527
|
}
|
|
1528
|
+
class StateMapProxyPType extends StorageProxyPType {
|
|
1529
|
+
module;
|
|
1530
|
+
kind;
|
|
1531
|
+
keyType;
|
|
1532
|
+
constructor(props) {
|
|
1533
|
+
super({ content: props.content, keyWType: wtypes.stateKeyWType });
|
|
1534
|
+
this.module = Constants.moduleNames.algoTs.state;
|
|
1535
|
+
this.kind = props.kind;
|
|
1536
|
+
this.keyType = props.keyType;
|
|
1537
|
+
}
|
|
1538
|
+
get name() {
|
|
1539
|
+
return `${this.kind}<${this.keyType.name}, ${this.contentType.name}>`;
|
|
1540
|
+
}
|
|
1541
|
+
get fullName() {
|
|
1542
|
+
return `${this.module}::${this.kind}<${this.keyType.name}, ${this.contentType.fullName}>`;
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1523
1545
|
const GlobalMapGeneric = new GenericPType({
|
|
1524
1546
|
name: 'GlobalMap',
|
|
1525
1547
|
module: Constants.moduleNames.algoTs.state,
|
|
@@ -1531,19 +1553,10 @@ const GlobalMapGeneric = new GenericPType({
|
|
|
1531
1553
|
});
|
|
1532
1554
|
},
|
|
1533
1555
|
});
|
|
1534
|
-
class GlobalMapType extends
|
|
1556
|
+
class GlobalMapType extends StateMapProxyPType {
|
|
1535
1557
|
[PType.IdSymbol] = 'GlobalMapType';
|
|
1536
|
-
module = Constants.moduleNames.algoTs.state;
|
|
1537
|
-
get name() {
|
|
1538
|
-
return `GlobalMap<${this.keyType.name}, ${this.contentType.name}>`;
|
|
1539
|
-
}
|
|
1540
|
-
get fullName() {
|
|
1541
|
-
return `${this.module}::${this.name}<${this.keyType.name}, ${this.contentType.fullName}>`;
|
|
1542
|
-
}
|
|
1543
|
-
keyType;
|
|
1544
1558
|
constructor(props) {
|
|
1545
|
-
super({ ...props,
|
|
1546
|
-
this.keyType = props.keyType;
|
|
1559
|
+
super({ ...props, kind: 'GlobalMap' });
|
|
1547
1560
|
}
|
|
1548
1561
|
accept(visitor) {
|
|
1549
1562
|
return visitor.visitGlobalMapType(this);
|
|
@@ -1559,25 +1572,10 @@ const LocalStateGeneric = new GenericPType({
|
|
|
1559
1572
|
});
|
|
1560
1573
|
},
|
|
1561
1574
|
});
|
|
1562
|
-
class LocalStateType extends
|
|
1575
|
+
class LocalStateType extends StateProxyPType {
|
|
1563
1576
|
[PType.IdSymbol] = 'LocalStateType';
|
|
1564
|
-
static baseName = 'LocalState';
|
|
1565
|
-
static baseFullName = `${Constants.moduleNames.algoTs.state}::${LocalStateType.baseName}`;
|
|
1566
|
-
module = Constants.moduleNames.algoTs.state;
|
|
1567
|
-
get name() {
|
|
1568
|
-
return `${LocalStateType.baseName}<${this.contentType.name}>`;
|
|
1569
|
-
}
|
|
1570
|
-
get fullName() {
|
|
1571
|
-
return `${LocalStateType.baseFullName}<${this.contentType.fullName}>`;
|
|
1572
|
-
}
|
|
1573
1577
|
constructor(props) {
|
|
1574
|
-
super({ ...props,
|
|
1575
|
-
}
|
|
1576
|
-
static parameterise(typeArgs) {
|
|
1577
|
-
codeInvariant(typeArgs.length === 1, 'LocalState type expects exactly one type parameter');
|
|
1578
|
-
return new LocalStateType({
|
|
1579
|
-
content: typeArgs[0],
|
|
1580
|
-
});
|
|
1578
|
+
super({ ...props, kind: 'LocalState' });
|
|
1581
1579
|
}
|
|
1582
1580
|
accept(visitor) {
|
|
1583
1581
|
return visitor.visitLocalStateType(this);
|
|
@@ -1594,19 +1592,10 @@ const LocalMapGeneric = new GenericPType({
|
|
|
1594
1592
|
});
|
|
1595
1593
|
},
|
|
1596
1594
|
});
|
|
1597
|
-
class LocalMapType extends
|
|
1595
|
+
class LocalMapType extends StateMapProxyPType {
|
|
1598
1596
|
[PType.IdSymbol] = 'LocalMapType';
|
|
1599
|
-
module = Constants.moduleNames.algoTs.state;
|
|
1600
|
-
get name() {
|
|
1601
|
-
return `LocalMap<${this.keyType.name}, ${this.contentType.name}>`;
|
|
1602
|
-
}
|
|
1603
|
-
get fullName() {
|
|
1604
|
-
return `${this.module}::${this.name}<${this.keyType.name}, ${this.contentType.fullName}>`;
|
|
1605
|
-
}
|
|
1606
|
-
keyType;
|
|
1607
1597
|
constructor(props) {
|
|
1608
|
-
super({ ...props,
|
|
1609
|
-
this.keyType = props.keyType;
|
|
1598
|
+
super({ ...props, kind: 'LocalMap' });
|
|
1610
1599
|
}
|
|
1611
1600
|
accept(visitor) {
|
|
1612
1601
|
return visitor.visitLocalMapType(this);
|
|
@@ -1656,7 +1645,7 @@ class BoxMapPType extends StorageProxyPType {
|
|
|
1656
1645
|
return `BoxMap<${this.keyType.name}, ${this.contentType.name}>`;
|
|
1657
1646
|
}
|
|
1658
1647
|
get fullName() {
|
|
1659
|
-
return `${this.module}::${this.name}
|
|
1648
|
+
return `${this.module}::${this.name}`;
|
|
1660
1649
|
}
|
|
1661
1650
|
keyType;
|
|
1662
1651
|
constructor(props) {
|
|
@@ -1743,8 +1732,7 @@ class ABICompatibleInstanceType extends InstanceType {
|
|
|
1743
1732
|
this.abiTypeSignature = abiTypeSignature;
|
|
1744
1733
|
}
|
|
1745
1734
|
}
|
|
1746
|
-
class
|
|
1747
|
-
[PType.IdSymbol] = 'LibFunctionType';
|
|
1735
|
+
class LibPType extends PType {
|
|
1748
1736
|
wtype;
|
|
1749
1737
|
name;
|
|
1750
1738
|
module;
|
|
@@ -1754,92 +1742,58 @@ class LibFunctionType extends PType {
|
|
|
1754
1742
|
this.name = name;
|
|
1755
1743
|
this.module = module;
|
|
1756
1744
|
}
|
|
1745
|
+
}
|
|
1746
|
+
class LibFunctionType extends LibPType {
|
|
1747
|
+
[PType.IdSymbol] = 'LibFunctionType';
|
|
1757
1748
|
accept(visitor) {
|
|
1758
1749
|
return visitor.visitLibFunctionType(this);
|
|
1759
1750
|
}
|
|
1760
1751
|
}
|
|
1761
|
-
class LibClassType extends
|
|
1752
|
+
class LibClassType extends LibPType {
|
|
1762
1753
|
[PType.IdSymbol] = 'LibClassType';
|
|
1763
|
-
wtype;
|
|
1764
|
-
name;
|
|
1765
|
-
module;
|
|
1766
|
-
singleton = true;
|
|
1767
|
-
constructor({ name, module }) {
|
|
1768
|
-
super();
|
|
1769
|
-
this.name = name;
|
|
1770
|
-
this.module = module;
|
|
1771
|
-
}
|
|
1772
1754
|
accept(visitor) {
|
|
1773
1755
|
return visitor.visitLibClassType(this);
|
|
1774
1756
|
}
|
|
1775
1757
|
}
|
|
1776
|
-
class LibObjType extends
|
|
1758
|
+
class LibObjType extends LibPType {
|
|
1777
1759
|
[PType.IdSymbol] = 'LibObjType';
|
|
1778
|
-
wtype;
|
|
1779
|
-
name;
|
|
1780
|
-
module;
|
|
1781
|
-
singleton = true;
|
|
1782
|
-
constructor({ name, module }) {
|
|
1783
|
-
super();
|
|
1784
|
-
this.name = name;
|
|
1785
|
-
this.module = module;
|
|
1786
|
-
}
|
|
1787
1760
|
accept(visitor) {
|
|
1788
1761
|
return visitor.visitLibObjType(this);
|
|
1789
1762
|
}
|
|
1790
1763
|
}
|
|
1791
|
-
class
|
|
1792
|
-
[PType.IdSymbol] = 'IntrinsicFunctionGroupType';
|
|
1764
|
+
class IntrinsicOpPType extends PType {
|
|
1793
1765
|
wtype;
|
|
1794
1766
|
name;
|
|
1795
1767
|
module = Constants.moduleNames.algoTs.op;
|
|
1796
|
-
singleton = true;
|
|
1797
1768
|
constructor({ name }) {
|
|
1798
1769
|
super();
|
|
1799
1770
|
this.name = name;
|
|
1800
1771
|
}
|
|
1772
|
+
}
|
|
1773
|
+
class IntrinsicFunctionGroupType extends IntrinsicOpPType {
|
|
1774
|
+
[PType.IdSymbol] = 'IntrinsicFunctionGroupType';
|
|
1775
|
+
singleton = true;
|
|
1801
1776
|
accept(visitor) {
|
|
1802
1777
|
return visitor.visitIntrinsicFunctionGroupType(this);
|
|
1803
1778
|
}
|
|
1804
1779
|
}
|
|
1805
|
-
class IntrinsicFunctionGroupTypeType extends
|
|
1780
|
+
class IntrinsicFunctionGroupTypeType extends IntrinsicOpPType {
|
|
1806
1781
|
[PType.IdSymbol] = 'IntrinsicFunctionGroupTypeType';
|
|
1807
|
-
wtype;
|
|
1808
|
-
name;
|
|
1809
|
-
module = Constants.moduleNames.algoTs.op;
|
|
1810
1782
|
singleton = false;
|
|
1811
|
-
constructor({ name }) {
|
|
1812
|
-
super();
|
|
1813
|
-
this.name = name;
|
|
1814
|
-
}
|
|
1815
1783
|
accept(visitor) {
|
|
1816
1784
|
return visitor.visitIntrinsicFunctionGroupTypeType(this);
|
|
1817
1785
|
}
|
|
1818
1786
|
}
|
|
1819
|
-
class IntrinsicFunctionType extends
|
|
1787
|
+
class IntrinsicFunctionType extends IntrinsicOpPType {
|
|
1820
1788
|
[PType.IdSymbol] = 'IntrinsicFunctionType';
|
|
1821
|
-
wtype;
|
|
1822
|
-
name;
|
|
1823
|
-
module = Constants.moduleNames.algoTs.op;
|
|
1824
1789
|
singleton = true;
|
|
1825
|
-
constructor({ name }) {
|
|
1826
|
-
super();
|
|
1827
|
-
this.name = name;
|
|
1828
|
-
}
|
|
1829
1790
|
accept(visitor) {
|
|
1830
1791
|
return visitor.visitIntrinsicFunctionType(this);
|
|
1831
1792
|
}
|
|
1832
1793
|
}
|
|
1833
|
-
class IntrinsicFunctionTypeType extends
|
|
1794
|
+
class IntrinsicFunctionTypeType extends IntrinsicOpPType {
|
|
1834
1795
|
[PType.IdSymbol] = 'IntrinsicFunctionTypeType';
|
|
1835
|
-
wtype;
|
|
1836
|
-
name;
|
|
1837
|
-
module = Constants.moduleNames.algoTs.op;
|
|
1838
1796
|
singleton = false;
|
|
1839
|
-
constructor({ name }) {
|
|
1840
|
-
super();
|
|
1841
|
-
this.name = name;
|
|
1842
|
-
}
|
|
1843
1797
|
accept(visitor) {
|
|
1844
1798
|
return visitor.visitIntrinsicFunctionTypeType(this);
|
|
1845
1799
|
}
|
|
@@ -1851,7 +1805,6 @@ class NamespacePType extends PType {
|
|
|
1851
1805
|
[PType.IdSymbol] = 'NamespacePType';
|
|
1852
1806
|
wtype;
|
|
1853
1807
|
name;
|
|
1854
|
-
factory;
|
|
1855
1808
|
module;
|
|
1856
1809
|
singleton = true;
|
|
1857
1810
|
constructor({ name, module }) {
|
|
@@ -1931,20 +1884,27 @@ class ArrayLiteralPType extends PType {
|
|
|
1931
1884
|
});
|
|
1932
1885
|
}
|
|
1933
1886
|
}
|
|
1934
|
-
class
|
|
1935
|
-
|
|
1887
|
+
class TupleBasePType extends PType {
|
|
1888
|
+
items;
|
|
1889
|
+
singleton = false;
|
|
1936
1890
|
module = Constants.moduleNames.tslib;
|
|
1891
|
+
namePrefix;
|
|
1892
|
+
constructor(props) {
|
|
1893
|
+
super();
|
|
1894
|
+
this.items = props.items;
|
|
1895
|
+
this.namePrefix = props.immutable ? 'readonly ' : '';
|
|
1896
|
+
}
|
|
1937
1897
|
get name() {
|
|
1938
|
-
return
|
|
1898
|
+
return `${this.namePrefix}[${this.items.map((i) => i.name).join(', ')}]`;
|
|
1939
1899
|
}
|
|
1940
1900
|
get fullName() {
|
|
1941
|
-
return `${this.module}
|
|
1901
|
+
return `${this.module}::${this.namePrefix}[${this.items.map((i) => i.fullName).join(', ')}]`;
|
|
1942
1902
|
}
|
|
1943
|
-
|
|
1944
|
-
|
|
1903
|
+
}
|
|
1904
|
+
class MutableTuplePType extends TupleBasePType {
|
|
1905
|
+
[PType.IdSymbol] = 'MutableTuplePType';
|
|
1945
1906
|
constructor(props) {
|
|
1946
|
-
super();
|
|
1947
|
-
this.items = props.items;
|
|
1907
|
+
super({ ...props });
|
|
1948
1908
|
}
|
|
1949
1909
|
get wtype() {
|
|
1950
1910
|
return new wtypes.ARC4Tuple({
|
|
@@ -1956,20 +1916,10 @@ class MutableTuplePType extends PType {
|
|
|
1956
1916
|
return visitor.visitMutableTuplePType(this);
|
|
1957
1917
|
}
|
|
1958
1918
|
}
|
|
1959
|
-
class ReadonlyTuplePType extends
|
|
1919
|
+
class ReadonlyTuplePType extends TupleBasePType {
|
|
1960
1920
|
[PType.IdSymbol] = 'ReadonlyTuplePType';
|
|
1961
|
-
module = Constants.moduleNames.tslib;
|
|
1962
|
-
get name() {
|
|
1963
|
-
return `readonly [${this.items.map((i) => i.name).join(', ')}]`;
|
|
1964
|
-
}
|
|
1965
|
-
get fullName() {
|
|
1966
|
-
return `${this.module}::readonly [${this.items.map((i) => i.fullName).join(', ')}]`;
|
|
1967
|
-
}
|
|
1968
|
-
items;
|
|
1969
|
-
singleton = false;
|
|
1970
1921
|
constructor(props) {
|
|
1971
|
-
super();
|
|
1972
|
-
this.items = props.items;
|
|
1922
|
+
super({ ...props, immutable: true });
|
|
1973
1923
|
}
|
|
1974
1924
|
get wtype() {
|
|
1975
1925
|
return new wtypes.WTuple({
|
|
@@ -1988,20 +1938,22 @@ const ArrayGeneric = new GenericPType({
|
|
|
1988
1938
|
return new ArrayPType({ elementType: typeArgs[0] });
|
|
1989
1939
|
},
|
|
1990
1940
|
});
|
|
1991
|
-
class
|
|
1992
|
-
[PType.IdSymbol] = 'ArrayPType';
|
|
1941
|
+
class DynamicArrayBasePType extends PType {
|
|
1993
1942
|
elementType;
|
|
1994
|
-
immutable
|
|
1943
|
+
immutable;
|
|
1995
1944
|
singleton = false;
|
|
1996
1945
|
name;
|
|
1997
1946
|
module = Constants.moduleNames.typescript.es5;
|
|
1998
|
-
|
|
1999
|
-
return `${this.module}::Array<${this.elementType.fullName}>`;
|
|
2000
|
-
}
|
|
1947
|
+
kind;
|
|
2001
1948
|
constructor(props) {
|
|
2002
1949
|
super();
|
|
2003
|
-
this.name = `Array<${props.elementType.name}>`;
|
|
2004
1950
|
this.elementType = props.elementType;
|
|
1951
|
+
this.immutable = props.immutable;
|
|
1952
|
+
this.kind = props.immutable ? 'ReadonlyArray' : 'Array';
|
|
1953
|
+
this.name = `${this.kind}<${props.elementType.name}>`;
|
|
1954
|
+
}
|
|
1955
|
+
get fullName() {
|
|
1956
|
+
return `${this.module}::${this.kind}<${this.elementType.fullName}>`;
|
|
2005
1957
|
}
|
|
2006
1958
|
get wtype() {
|
|
2007
1959
|
return new wtypes.ARC4DynamicArray({
|
|
@@ -2009,6 +1961,12 @@ class ArrayPType extends PType {
|
|
|
2009
1961
|
immutable: this.immutable,
|
|
2010
1962
|
});
|
|
2011
1963
|
}
|
|
1964
|
+
}
|
|
1965
|
+
class ArrayPType extends DynamicArrayBasePType {
|
|
1966
|
+
[PType.IdSymbol] = 'ArrayPType';
|
|
1967
|
+
constructor(props) {
|
|
1968
|
+
super({ ...props, immutable: false });
|
|
1969
|
+
}
|
|
2012
1970
|
accept(visitor) {
|
|
2013
1971
|
return visitor.visitArrayPType(this);
|
|
2014
1972
|
}
|
|
@@ -2021,26 +1979,10 @@ const ReadonlyArrayGeneric = new GenericPType({
|
|
|
2021
1979
|
return new ReadonlyArrayPType({ elementType: typeArgs[0] });
|
|
2022
1980
|
},
|
|
2023
1981
|
});
|
|
2024
|
-
class ReadonlyArrayPType extends
|
|
1982
|
+
class ReadonlyArrayPType extends DynamicArrayBasePType {
|
|
2025
1983
|
[PType.IdSymbol] = 'ReadonlyArrayPType';
|
|
2026
|
-
elementType;
|
|
2027
|
-
singleton = false;
|
|
2028
|
-
immutable = true;
|
|
2029
|
-
name;
|
|
2030
|
-
module = Constants.moduleNames.typescript.es5;
|
|
2031
|
-
get fullName() {
|
|
2032
|
-
return `${this.module}::ReadonlyArray<${this.elementType.fullName}>`;
|
|
2033
|
-
}
|
|
2034
1984
|
constructor(props) {
|
|
2035
|
-
super();
|
|
2036
|
-
this.elementType = props.elementType;
|
|
2037
|
-
this.name = `ReadonlyArray<${props.elementType.name}>`;
|
|
2038
|
-
}
|
|
2039
|
-
get wtype() {
|
|
2040
|
-
return new wtypes.ARC4DynamicArray({
|
|
2041
|
-
elementType: this.elementType.wtypeOrThrow,
|
|
2042
|
-
immutable: this.immutable,
|
|
2043
|
-
});
|
|
1985
|
+
super({ ...props, immutable: true });
|
|
2044
1986
|
}
|
|
2045
1987
|
accept(visitor) {
|
|
2046
1988
|
return visitor.visitReadonlyArrayPType(this);
|
|
@@ -2120,6 +2062,22 @@ class ObjectPType extends PType {
|
|
|
2120
2062
|
hasSameStructure(other) {
|
|
2121
2063
|
return zipStrict(this.properties, other.properties).every(([left, right]) => left.name === right.name && left.ptype.equals(right.ptype));
|
|
2122
2064
|
}
|
|
2065
|
+
toWTuple(fallbackName) {
|
|
2066
|
+
const tupleTypes = [];
|
|
2067
|
+
const tupleNames = [];
|
|
2068
|
+
for (const { name, ptype } of this.properties) {
|
|
2069
|
+
if (ptype instanceof TransientType) {
|
|
2070
|
+
throw new CodeError(`Property '${name}' of ${this.name} has an unsupported type: ${ptype.typeMessage}`);
|
|
2071
|
+
}
|
|
2072
|
+
tupleTypes.push(ptype.wtypeOrThrow);
|
|
2073
|
+
tupleNames.push(name);
|
|
2074
|
+
}
|
|
2075
|
+
return new wtypes.WTuple({
|
|
2076
|
+
name: this.alias?.fullName ?? fallbackName,
|
|
2077
|
+
names: tupleNames,
|
|
2078
|
+
types: tupleTypes,
|
|
2079
|
+
});
|
|
2080
|
+
}
|
|
2123
2081
|
}
|
|
2124
2082
|
class ObjectLiteralPType extends ObjectPType {
|
|
2125
2083
|
[PType.IdSymbol] = 'ObjectLiteralPType';
|
|
@@ -2148,20 +2106,7 @@ class ObjectLiteralPType extends ObjectPType {
|
|
|
2148
2106
|
});
|
|
2149
2107
|
}
|
|
2150
2108
|
get wtype() {
|
|
2151
|
-
|
|
2152
|
-
const tupleNames = [];
|
|
2153
|
-
for (const { name, ptype } of this.properties) {
|
|
2154
|
-
if (ptype instanceof TransientType) {
|
|
2155
|
-
throw new CodeError(`Property '${name}' of ${this.name} has an unsupported type: ${ptype.typeMessage}`);
|
|
2156
|
-
}
|
|
2157
|
-
tupleTypes.push(ptype.wtypeOrThrow);
|
|
2158
|
-
tupleNames.push(name);
|
|
2159
|
-
}
|
|
2160
|
-
return new wtypes.WTuple({
|
|
2161
|
-
name: this.alias?.fullName ?? this.toString(),
|
|
2162
|
-
names: tupleNames,
|
|
2163
|
-
types: tupleTypes,
|
|
2164
|
-
});
|
|
2109
|
+
return this.toWTuple(this.toString());
|
|
2165
2110
|
}
|
|
2166
2111
|
}
|
|
2167
2112
|
class ImmutableObjectPType extends ObjectPType {
|
|
@@ -2174,20 +2119,7 @@ class ImmutableObjectPType extends ObjectPType {
|
|
|
2174
2119
|
});
|
|
2175
2120
|
}
|
|
2176
2121
|
get wtype() {
|
|
2177
|
-
|
|
2178
|
-
const tupleNames = [];
|
|
2179
|
-
for (const { name, ptype } of this.properties) {
|
|
2180
|
-
if (ptype instanceof TransientType) {
|
|
2181
|
-
throw new CodeError(`Property '${name}' of ${this.name} has an unsupported type: ${ptype.typeMessage}`);
|
|
2182
|
-
}
|
|
2183
|
-
tupleTypes.push(ptype.wtypeOrThrow);
|
|
2184
|
-
tupleNames.push(name);
|
|
2185
|
-
}
|
|
2186
|
-
return new wtypes.WTuple({
|
|
2187
|
-
name: this.alias?.fullName ?? this.name,
|
|
2188
|
-
names: tupleNames,
|
|
2189
|
-
types: tupleTypes,
|
|
2190
|
-
});
|
|
2122
|
+
return this.toWTuple(this.name);
|
|
2191
2123
|
}
|
|
2192
2124
|
accept(visitor) {
|
|
2193
2125
|
return visitor.visitImmutableObjectPType(this);
|
|
@@ -3000,7 +2932,7 @@ class ReferenceArrayType extends PType {
|
|
|
3000
2932
|
singleton = false;
|
|
3001
2933
|
sourceLocation;
|
|
3002
2934
|
elementType;
|
|
3003
|
-
constructor({ elementType, sourceLocation, name
|
|
2935
|
+
constructor({ elementType, sourceLocation, name }) {
|
|
3004
2936
|
super();
|
|
3005
2937
|
this.name = name ?? `ReferenceArray<${elementType}>`;
|
|
3006
2938
|
this.sourceLocation = sourceLocation;
|
|
@@ -3010,7 +2942,6 @@ class ReferenceArrayType extends PType {
|
|
|
3010
2942
|
return new wtypes.ReferenceArray({
|
|
3011
2943
|
itemType: this.elementType.wtypeOrThrow,
|
|
3012
2944
|
sourceLocation: this.sourceLocation,
|
|
3013
|
-
immutable: false,
|
|
3014
2945
|
});
|
|
3015
2946
|
}
|
|
3016
2947
|
accept(visitor) {
|
|
@@ -5590,5 +5521,5 @@ class CompilationSet extends CustomKeyMap {
|
|
|
5590
5521
|
}
|
|
5591
5522
|
}
|
|
5592
5523
|
|
|
5593
|
-
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,
|
|
5594
|
-
//# sourceMappingURL=contract-class-model-
|
|
5524
|
+
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 };
|
|
5525
|
+
//# sourceMappingURL=contract-class-model-CkfUf4wT.js.map
|